forked from sfms3.0/sfms3.0
7 changed files with 598 additions and 0 deletions
@ -0,0 +1,72 @@ |
|||
package com.win.module.system.api.permission.dto; |
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import lombok.Builder; |
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.util.List; |
|||
import java.util.Set; |
|||
|
|||
@Data |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
@Builder |
|||
public class PermissionIdentificationRespVO { |
|||
|
|||
private UserVO user; |
|||
|
|||
private Set<String> roles; |
|||
|
|||
private Set<String> permissions; |
|||
|
|||
private List<MenuVO> menus; |
|||
|
|||
@Data |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
@Builder |
|||
public static class UserVO { |
|||
|
|||
private Long id; |
|||
|
|||
private String nickname; |
|||
|
|||
private String avatar; |
|||
|
|||
} |
|||
|
|||
@Data |
|||
@NoArgsConstructor |
|||
@AllArgsConstructor |
|||
@Builder |
|||
public static class MenuVO { |
|||
|
|||
private Long id; |
|||
|
|||
private Long parentId; |
|||
|
|||
private String name; |
|||
|
|||
private String path; |
|||
|
|||
private String component; |
|||
|
|||
private String componentName; |
|||
|
|||
private String icon; |
|||
|
|||
private Boolean visible; |
|||
|
|||
private Boolean keepAlive; |
|||
|
|||
private Boolean alwaysShow; |
|||
|
|||
/** |
|||
* 子路由 |
|||
*/ |
|||
private List<MenuVO> children; |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.win.module.wms.controller.allJob; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.module.wms.controller.allJob.vo.AllJobRespVO; |
|||
import com.win.module.wms.service.allJob.AllJobService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.Parameter; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
import javax.annotation.Resource; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
@Tag(name = "管理后台 - PDA根据用户权限操作所有任务模块") |
|||
@RestController |
|||
@RequestMapping("/wms/all-job") |
|||
@Validated |
|||
public class AllJobController { |
|||
|
|||
@Resource |
|||
private AllJobService allJobService; |
|||
|
|||
|
|||
@PostMapping("/list") |
|||
@Operation(summary = "PDA根据用户权限操作所有任务模块数量") |
|||
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|||
@PreAuthorize("@ss.hasPermission('wms:inspect-job-main:query')") |
|||
public CommonResult<List<Map<String,Integer>>> getAllJobCountList(@RequestBody AllJobRespVO allJobRespVO) { |
|||
List<Map<String, Integer>> list = allJobService.getAllJobCountList(allJobRespVO); |
|||
return success(list); |
|||
} |
|||
} |
@ -0,0 +1,17 @@ |
|||
package com.win.module.wms.controller.allJob.vo; |
|||
|
|||
|
|||
import io.swagger.v3.oas.annotations.media.Schema; |
|||
import lombok.Data; |
|||
import lombok.ToString; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Schema(description = "管理后台 - 查询全部任务 Response VO") |
|||
@Data |
|||
@ToString(callSuper = true) |
|||
public class AllJobRespVO{ |
|||
@Schema(description = "任务状态数组") |
|||
private List<String> types; |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.win.module.wms.service.allJob; |
|||
|
|||
import com.win.module.wms.controller.allJob.vo.AllJobRespVO; |
|||
import com.win.module.wms.dal.dataobject.inspectJob.InspectJobMainDO; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 检验任务主 Service 接口 |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
public interface AllJobService { |
|||
|
|||
|
|||
List<Map<String, Integer>> getAllJobCountList(AllJobRespVO allJobRespVO); |
|||
|
|||
|
|||
} |
@ -0,0 +1,400 @@ |
|||
package com.win.module.wms.service.allJob; |
|||
|
|||
import cn.hutool.json.JSONArray; |
|||
import cn.hutool.json.JSONObject; |
|||
import cn.hutool.json.JSONUtil; |
|||
import com.win.module.system.api.permission.PermissionApi; |
|||
import com.win.module.system.api.user.AdminUserApi; |
|||
import com.win.module.wms.controller.allJob.vo.AllJobRespVO; |
|||
import com.win.module.wms.dal.dataobject.inspectJob.InspectJobMainDO; |
|||
import com.win.module.wms.dal.mysql.inspectJob.InspectJobMainMapper; |
|||
import com.win.module.wms.service.countJob.CountJobMainService; |
|||
import com.win.module.wms.service.customerreturnJob.CustomerreturnJobMainService; |
|||
import com.win.module.wms.service.deliverJob.DeliverJobMainService; |
|||
import com.win.module.wms.service.inspectJob.InspectJobDetailService; |
|||
import com.win.module.wms.service.inspectJob.InspectJobMainService; |
|||
import com.win.module.wms.service.inventorymoveJob.InventorymoveJobMainService; |
|||
import com.win.module.wms.service.issueJob.IssueJobMainService; |
|||
import com.win.module.wms.service.pickJob.PickJobMainService; |
|||
import com.win.module.wms.service.productdismantleJob.ProductdismantleJobMainService; |
|||
import com.win.module.wms.service.productionreceiptJob.ProductionreceiptJobMainService; |
|||
import com.win.module.wms.service.productionreturnJob.ProductionreturnJobMainService; |
|||
import com.win.module.wms.service.productputawayJob.ProductputawayJobMainService; |
|||
import com.win.module.wms.service.productreceiptJob.ProductreceiptJobMainService; |
|||
import com.win.module.wms.service.purchasereceiptJob.PurchasereceiptJobMainService; |
|||
import com.win.module.wms.service.purchasereturnJob.PurchasereturnJobMainService; |
|||
import com.win.module.wms.service.putawayJob.PutawayJobMainService; |
|||
import com.win.module.wms.service.repleinshJob.RepleinshJobMainService; |
|||
import com.win.module.wms.service.scrapJob.ScrapJobMainService; |
|||
import com.win.module.wms.service.transferissueJob.TransferissueJobMainService; |
|||
import com.win.module.wms.service.transferreceiptJob.TransferreceiptJobMainService; |
|||
import com.win.module.wms.service.unplannedissueJob.UnplannedissueJobMainService; |
|||
import com.win.module.wms.service.unplannedreceiptJob.UnplannedreceiptJobMainService; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.validation.annotation.Validated; |
|||
|
|||
import javax.annotation.Resource; |
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 检验任务主 Service 实现类 |
|||
* |
|||
* @author 超级管理员 |
|||
*/ |
|||
@Service |
|||
@Validated |
|||
public class AllJobServiceImpl implements AllJobService { |
|||
|
|||
@Resource |
|||
private InspectJobMainMapper inspectJobMainMapper; |
|||
|
|||
@Resource |
|||
private AdminUserApi userApi; |
|||
|
|||
@Resource |
|||
private PermissionApi permissionApi; |
|||
|
|||
@Resource |
|||
private PurchasereceiptJobMainService purchasereceiptJobMainService; |
|||
|
|||
@Resource |
|||
private PurchasereturnJobMainService purchasereturnJobMainService; |
|||
|
|||
@Resource |
|||
private PutawayJobMainService putawayJobMainService; |
|||
|
|||
@Resource |
|||
private ProductputawayJobMainService productputawayJobMainService; |
|||
|
|||
@Resource |
|||
private RepleinshJobMainService repleinshJobMainService; |
|||
|
|||
@Resource |
|||
private PickJobMainService pickJobMainService; |
|||
|
|||
@Resource |
|||
private IssueJobMainService issueJobMainService; |
|||
|
|||
@Resource |
|||
private ProductionreceiptJobMainService productionreceiptJobMainService; |
|||
|
|||
@Resource |
|||
private ProductionreturnJobMainService productionreturnJobMainService; |
|||
|
|||
@Resource |
|||
private ProductreceiptJobMainService productreceiptJobMainService; |
|||
|
|||
@Resource |
|||
private ProductdismantleJobMainService productdismantleJobMainService; |
|||
|
|||
@Resource |
|||
private DeliverJobMainService deliverJobMainService; |
|||
|
|||
@Resource |
|||
private CustomerreturnJobMainService customerreturnJobMainService; |
|||
|
|||
@Resource |
|||
private InventorymoveJobMainService inventorymoveJobMainService; |
|||
|
|||
@Resource |
|||
private TransferissueJobMainService transferissueJobMainService; |
|||
|
|||
@Resource |
|||
private TransferreceiptJobMainService transferreceiptJobMainService; |
|||
|
|||
@Resource |
|||
private UnplannedissueJobMainService unplannedissueJobMainService; |
|||
|
|||
@Resource |
|||
private UnplannedreceiptJobMainService unplannedreceiptJobMainService; |
|||
|
|||
@Resource |
|||
private ScrapJobMainService scrapJobMainService; |
|||
|
|||
@Resource |
|||
private CountJobMainService countJobMainService; |
|||
|
|||
@Resource |
|||
private InspectJobMainService inspectJobMainService; |
|||
|
|||
@Override |
|||
public List<Map<String, Integer>> getAllJobCountList(AllJobRespVO allJobRespVO) { |
|||
List<Map<String, Integer>> list = new ArrayList<>(); |
|||
Object permissionIdentifications = permissionApi.getPermissionIdentifications(); |
|||
if (permissionIdentifications != null) { |
|||
JSONObject entries = JSONUtil.parseObj(permissionIdentifications); |
|||
JSONArray permissions = JSONUtil.parseArray(entries.get("permissions")); |
|||
String val = permissions.toString(); |
|||
if (val.contains("wms:purchasereceipt-job-main:query")) {//采购收货权限标识1
|
|||
Map<String, Integer> type1 = purchasereceiptJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type1); |
|||
} else { |
|||
HashMap<String, Integer> type1 = new HashMap<>(); |
|||
type1.put("type1", 0); |
|||
list.add(type1); |
|||
|
|||
} |
|||
|
|||
if (val.contains("wms:purchasereturn-job-main:query")) {//采购退货任务权限标识2
|
|||
Map<String, Integer> type2 = purchasereturnJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type2); |
|||
} else { |
|||
HashMap<String, Integer> type2 = new HashMap<>(); |
|||
type2.put("type2", 0); |
|||
list.add(type2); |
|||
} |
|||
|
|||
if (val.contains("wms:putaway-job-main:query")) {//原料上架任务3
|
|||
Map<String, Integer> type3 = putawayJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type3); |
|||
} else { |
|||
HashMap<String, Integer> type3 = new HashMap<>(); |
|||
type3.put("type3", 0); |
|||
list.add(type3); |
|||
} |
|||
|
|||
|
|||
if (val.contains("wms:productputaway-job-main:query")) {//制品上架任务4
|
|||
Map<String, Integer> type4 = productputawayJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type4); |
|||
} else { |
|||
HashMap<String, Integer> type4 = new HashMap<>(); |
|||
type4.put("type4", 0); |
|||
list.add(type4); |
|||
} |
|||
|
|||
|
|||
if (val.contains("wms:repleinsh-job-main:query")) {//补料任务5
|
|||
Map<String, Integer> type5 = repleinshJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type5); |
|||
} else { |
|||
HashMap<String, Integer> type5 = new HashMap<>(); |
|||
type5.put("type5", 0); |
|||
list.add(type5); |
|||
} |
|||
|
|||
|
|||
if (val.contains("wms:pick-job-main:query")) {//拣料任务6
|
|||
Map<String, Integer> type6 = pickJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type6); |
|||
} else { |
|||
HashMap<String, Integer> type6 = new HashMap<>(); |
|||
type6.put("type6", 0); |
|||
list.add(type6); |
|||
} |
|||
|
|||
if (val.contains("wms:issue-job-main:query")) {//发料任务7
|
|||
Map<String, Integer> type7 = issueJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type7); |
|||
} else { |
|||
HashMap<String, Integer> type7 = new HashMap<>(); |
|||
type7.put("type7", 0); |
|||
list.add(type7); |
|||
} |
|||
|
|||
|
|||
if (val.contains("wms:productionreceipt-job-main:query")) {//生产收料任务8
|
|||
Map<String, Integer> type8 = productionreceiptJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type8); |
|||
} else { |
|||
HashMap<String, Integer> type8 = new HashMap<>(); |
|||
type8.put("type8", 0); |
|||
list.add(type8); |
|||
} |
|||
|
|||
if (val.contains("wms:productionreturn-job-main:query")) {//生产退料任务9
|
|||
Map<String, Integer> type9 = productionreturnJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type9); |
|||
} else { |
|||
HashMap<String, Integer> type9 = new HashMap<>(); |
|||
type9.put("type9", 0); |
|||
list.add(type9); |
|||
} |
|||
|
|||
if (val.contains("wms:productreceipt-job-main:query")) {//制品收货任务10
|
|||
Map<String, Integer> type10 = productreceiptJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type10); |
|||
} else { |
|||
HashMap<String, Integer> type10 = new HashMap<>(); |
|||
type10.put("type10", 0); |
|||
list.add(type10); |
|||
} |
|||
|
|||
if (val.contains("wms:productdismantle-job-main:query")) {//制品拆解任务11
|
|||
Map<String, Integer> type11 = productdismantleJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type11); |
|||
} else { |
|||
HashMap<String, Integer> type11 = new HashMap<>(); |
|||
type11.put("type11", 0); |
|||
list.add(type11); |
|||
} |
|||
|
|||
|
|||
if (val.contains("wms:deliver-job-main:query")) {//发货任务12
|
|||
Map<String, Integer> type12 = deliverJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type12); |
|||
} else { |
|||
HashMap<String, Integer> type12 = new HashMap<>(); |
|||
type12.put("type12", 0); |
|||
list.add(type12); |
|||
} |
|||
|
|||
if (val.contains("wms:customerreturn-job-main:query")) {//客户退货任务13
|
|||
Map<String, Integer> type13 = customerreturnJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type13); |
|||
} else { |
|||
HashMap<String, Integer> type13 = new HashMap<>(); |
|||
type13.put("type13", 0); |
|||
list.add(type13); |
|||
} |
|||
|
|||
|
|||
if (val.contains("wms:inventorymove-job-main:query")) {//库存转移任务14
|
|||
Map<String, Integer> type14 = inventorymoveJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type14); |
|||
} else { |
|||
HashMap<String, Integer> type14 = new HashMap<>(); |
|||
type14.put("type14", 0); |
|||
list.add(type14); |
|||
} |
|||
|
|||
if (val.contains("wms:transferissue-job-main:query")) {//调拨出库任务15
|
|||
Map<String, Integer> type15 = transferissueJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type15); |
|||
} else { |
|||
HashMap<String, Integer> type15 = new HashMap<>(); |
|||
type15.put("type15", 0); |
|||
list.add(type15); |
|||
|
|||
} |
|||
|
|||
|
|||
if (val.contains("wms:transferreceipt-job-main:query")) {//调拨入库任务16
|
|||
Map<String, Integer> type16 = transferreceiptJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type16); |
|||
} else { |
|||
HashMap<String, Integer> type16 = new HashMap<>(); |
|||
type16.put("type16", 0); |
|||
list.add(type16); |
|||
} |
|||
|
|||
if (val.contains("wms:unplannedissue-job-main:query")) {//计划出库任务17
|
|||
Map<String, Integer> type17 = unplannedissueJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type17); |
|||
} else { |
|||
HashMap<String, Integer> type17 = new HashMap<>(); |
|||
type17.put("type17", 0); |
|||
list.add(type17); |
|||
} |
|||
|
|||
|
|||
if (val.contains("wms:unplannedreceipt-job-main:query")) {//计划入库任务18
|
|||
Map<String, Integer> type18 = unplannedreceiptJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type18); |
|||
} else { |
|||
HashMap<String, Integer> type18 = new HashMap<>(); |
|||
type18.put("type18", 0); |
|||
list.add(type18); |
|||
} |
|||
|
|||
|
|||
if (val.contains("wms:scrap-job-main:query")) {//报废出库任务19
|
|||
Map<String, Integer> type19 = scrapJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type19); |
|||
} else { |
|||
HashMap<String, Integer> type19 = new HashMap<>(); |
|||
type19.put("type19", 0); |
|||
list.add(type19); |
|||
} |
|||
|
|||
|
|||
if (val.contains("wms:count-job-main:query")) {//盘点任务20
|
|||
Map<String, Integer> type20 = countJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type20); |
|||
} else { |
|||
HashMap<String, Integer> type20 = new HashMap<>(); |
|||
type20.put("type20", 0); |
|||
list.add(type20); |
|||
} |
|||
|
|||
if (val.contains("wms:inspect-job-main:query")) {//检验任务21
|
|||
Map<String, Integer> type21 = inspectJobMainService.getCountByStatus(allJobRespVO.getTypes()); |
|||
list.add(type21); |
|||
} else { |
|||
HashMap<String, Integer> type21 = new HashMap<>(); |
|||
type21.put("type21", 0); |
|||
list.add(type21); |
|||
} |
|||
|
|||
}else { |
|||
HashMap<String, Integer> type1 = new HashMap<>(); |
|||
type1.put("type1", 0); |
|||
list.add(type1); |
|||
HashMap<String, Integer> type2 = new HashMap<>(); |
|||
type2.put("type2", 0); |
|||
list.add(type2); |
|||
HashMap<String, Integer> type3 = new HashMap<>(); |
|||
type3.put("type3", 0); |
|||
list.add(type3); |
|||
HashMap<String, Integer> type4 = new HashMap<>(); |
|||
type4.put("type4", 0); |
|||
list.add(type4); |
|||
HashMap<String, Integer> type5 = new HashMap<>(); |
|||
type5.put("type5", 0); |
|||
list.add(type5); |
|||
HashMap<String, Integer> type6 = new HashMap<>(); |
|||
type6.put("type6", 0); |
|||
list.add(type6); |
|||
HashMap<String, Integer> type7 = new HashMap<>(); |
|||
type7.put("type7", 0); |
|||
list.add(type7); |
|||
HashMap<String, Integer> type8 = new HashMap<>(); |
|||
type8.put("type8", 0); |
|||
list.add(type8); |
|||
HashMap<String, Integer> type9 = new HashMap<>(); |
|||
type9.put("type9", 0); |
|||
list.add(type9); |
|||
HashMap<String, Integer> type10 = new HashMap<>(); |
|||
type10.put("type10", 0); |
|||
list.add(type10); |
|||
HashMap<String, Integer> type11 = new HashMap<>(); |
|||
type11.put("type11", 0); |
|||
list.add(type11); |
|||
HashMap<String, Integer> type12 = new HashMap<>(); |
|||
type12.put("type12", 0); |
|||
list.add(type12); |
|||
HashMap<String, Integer> type13 = new HashMap<>(); |
|||
type13.put("type13", 0); |
|||
list.add(type13); |
|||
HashMap<String, Integer> type14 = new HashMap<>(); |
|||
type14.put("type14", 0); |
|||
list.add(type14); |
|||
HashMap<String, Integer> type15 = new HashMap<>(); |
|||
type15.put("type15", 0); |
|||
list.add(type15); |
|||
HashMap<String, Integer> type16 = new HashMap<>(); |
|||
type16.put("type16", 0); |
|||
list.add(type16); |
|||
HashMap<String, Integer> type17 = new HashMap<>(); |
|||
type17.put("type17", 0); |
|||
list.add(type17); |
|||
HashMap<String, Integer> type18 = new HashMap<>(); |
|||
type18.put("type18", 0); |
|||
list.add(type18); |
|||
HashMap<String, Integer> type19 = new HashMap<>(); |
|||
type19.put("type19", 0); |
|||
list.add(type19); |
|||
HashMap<String, Integer> type20 = new HashMap<>(); |
|||
type20.put("type20", 0); |
|||
list.add(type20); |
|||
HashMap<String, Integer> type21 = new HashMap<>(); |
|||
type21.put("type21", 0); |
|||
list.add(type21); |
|||
} |
|||
return list; |
|||
} |
|||
} |
Loading…
Reference in new issue