diff --git a/ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue b/ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue index f1a5308f..34c84d1d 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue @@ -48,21 +48,25 @@ > + + + diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java index e32e0e46..ff0c3aa8 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java @@ -19,6 +19,8 @@ import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.modules.productplan.entity.ZyPlanProcess; import org.jeecg.modules.productplan.entity.vo.ProcessDataVo; import org.jeecg.modules.productplan.service.IZyPlanProcessService; +import org.jeecg.modules.system.entity.SysUser; +import org.jeecg.modules.system.service.ISysUserService; import org.jeecg.modules.team.entity.Station; import org.jeecg.modules.team.entity.StationMachine; import org.jeecg.modules.team.service.IStationMachineService; @@ -32,10 +34,7 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @Description: 生产计划工序 @@ -50,7 +49,8 @@ import java.util.Map; public class ZyPlanProcessController extends JeecgController { @Autowired private IZyPlanProcessService zyPlanProcessService; - + @Autowired + private ISysUserService iSysUserService; @Autowired private IStationService iStationService; @Autowired @@ -81,39 +81,39 @@ public class ZyPlanProcessController extends JeecgController queryPageList2(ZyPlanProcess zyPlanProcess, - @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = zyPlanProcessService.page(page, queryWrapper); - if (!ObjectUtils.isEmpty(pageList)) { - String processIdList = ""; - String stationIdList = ""; - String machineIdList = ""; - String toolsIdList = ""; - String userIdList = ""; - List records = pageList.getRecords(); - for (ZyPlanProcess e : records) { - processIdList += e.getProcessId(); - stationIdList += e.getStationId(); - machineIdList += e.getMachineIds(); - toolsIdList += e.getToolsIds(); - userIdList += e.getUserIds(); - } - for (ZyPlanProcess e : records) { - e.setProcessId(processIdList); - e.setStationId(stationIdList); - e.setMachineIds(machineIdList); - e.setToolsIds(toolsIdList); - e.setUserIds(userIdList); - } - } - return Result.OK(pageList); - } +// @ApiOperation(value = "生产计划工序-分页列表查询", notes = "生产计划工序-分页列表查询") +// @GetMapping(value = "/list2") +// public Result queryPageList2(ZyPlanProcess zyPlanProcess, +// @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, +// @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, +// HttpServletRequest req) { +// QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap()); +// Page page = new Page(pageNo, pageSize); +// IPage pageList = zyPlanProcessService.page(page, queryWrapper); +// if (!ObjectUtils.isEmpty(pageList)) { +// String processIdList = ""; +// String stationIdList = ""; +// String machineIdList = ""; +// String toolsIdList = ""; +// String userIdList = ""; +// List records = pageList.getRecords(); +// for (ZyPlanProcess e : records) { +// processIdList += e.getProcessId(); +// stationIdList += e.getStationId(); +// machineIdList += e.getMachineIds(); +// toolsIdList += e.getToolsIds(); +// userIdList += e.getUserIds(); +// } +// for (ZyPlanProcess e : records) { +// e.setProcessId(processIdList); +// e.setStationId(stationIdList); +// e.setMachineIds(machineIdList); +// e.setToolsIds(toolsIdList); +// e.setUserIds(userIdList); +// } +// } +// return Result.OK(pageList); +// } @ApiOperation(value = "生产计划工序-查询产品工序&计划", notes = "生产计划工序-查询产品工序&计划") @GetMapping(value = "/getProcessDatalist") @@ -121,11 +121,9 @@ public class ZyPlanProcessController extends JeecgController queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); -// List processDatalist = zyPlanProcessService.getProcessDatalist(zyPlanProcess); +// QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap()); +// Page page = new Page(pageNo, pageSize); List processDatalist = zyPlanProcessService.getProcessDatalist(zyPlanProcess); -// PageList processDataVos = new PageList<>(processDatalist, processDatalist.size()); return Result.OK(processDatalist); } @@ -195,6 +193,7 @@ public class ZyPlanProcessController extends JeecgController userIds = Arrays.asList(e.getUserIds().split(",")); + List userList = iSysUserService.list(new LambdaQueryWrapper().in(SysUser::getId, userIds)); + Optional.ofNullable(userList).orElse(new ArrayList<>()).forEach(e2 -> { + stringBuffer.append(e2.getRealname()).append(","); + }); + userNames = stringBuffer.toString(); + userNames = userNames.substring(0, userNames.length() - 1); + e.setUserNames(userNames); + } }); zyPlanProcessService.saveOrUpdateBatch(zyPlanProcessList); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java index d8f38ce1..9cad80b6 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java @@ -13,6 +13,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.jeecg.common.aspect.annotation.Dict; +import org.jeecg.modules.team.vo.GroupxMemeberVo; import org.jeecg.modules.team.vo.StationVo; import org.jeecgframework.poi.excel.annotation.Excel; import org.springframework.format.annotation.DateTimeFormat; @@ -92,6 +93,9 @@ public class ZyPlanProcess implements Serializable { @TableField(exist = false) private List stationIdList; + + @TableField(exist = false) + private List userIdList; /** * 设备id列表 */ @@ -115,6 +119,7 @@ public class ZyPlanProcess implements Serializable { @ApiModelProperty(value = "成员id列表") @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") private String userIds; + private String userNames; /** * 前导工序 @@ -155,4 +160,6 @@ public class ZyPlanProcess implements Serializable { @Excel(name = "机器时长", width = 15) @ApiModelProperty(value = "机器时长") private Integer totalMachine; + + private Integer stationNum; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java index 8fb4001d..b9fd87ad 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java @@ -159,11 +159,27 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl { - e.setStationIdList(stationVoList); + Groupx groupx = iGroupxService.getOne(new LambdaQueryWrapper().eq(Groupx::getDepartId, departId).eq(Groupx::getId,zyProductPlan.getTeamId())); + List groupMembers = iGroupxMemberService.list(new LambdaQueryWrapper().eq(GroupxMember::getGroupxId, groupx.getId())); + List groupxMemeberVoList = new LinkedList<>(); + + if (!ObjectUtils.isEmpty(groupMembers)) { + groupMembers.forEach(en -> { + GroupxMemeberVo memberVo = new GroupxMemeberVo(); + memberVo.setId(en.getUserId()); + memberVo.setValue(en.getUserId()); + SysUser sysUser = iSysUserService.getById(en.getUserId()); + memberVo.setText(StringUtils.isNotBlank(sysUser.getRealname()) ? sysUser.getRealname() : ""); + memberVo.setTitle(StringUtils.isNotBlank(sysUser.getRealname()) ? sysUser.getRealname() : ""); + groupxMemeberVoList.add(memberVo); }); } + planProcessList.forEach(e -> { + //设备工位列表 + e.setStationIdList(stationVoList); + // 设置部门工人列表 + e.setUserIdList(groupxMemeberVoList); + }); } return planProcessList; } @@ -172,7 +188,6 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl syncProductBaseProcess(ZyPlanProcess zyPlanProcess) { - //重新同步数据,先删除之前已同步数据 this.delSyncData(zyPlanProcess); @@ -192,7 +207,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper() - .eq(ZyProductProcess::getProductId, zyProduct.getId())); + .eq(ZyProductProcess::getProductId, zyProduct.getId()).orderByAsc(ZyProductProcess::getNumber)); if (!ObjectUtils.isEmpty(productProcessesList)) { List saveList = new LinkedList<>(); productProcessesList.forEach(o -> {