diff --git a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue index 02a75a6b..d5812940 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue @@ -104,7 +104,7 @@ 删除 - 制定计划详情 + 制定计划工序 @@ -187,8 +187,8 @@ export default { } ], url: { - // list: "/org.jeecg.modules.productplan/zyPlanProcess/list", - list: "/org.jeecg.modules.productplan/zyPlanProcess/list2", + list: "/org.jeecg.modules.productplan/zyPlanProcess/list", + // list: "/org.jeecg.modules.productplan/zyPlanProcess/list2", productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list", delete: "/org.jeecg.modules.productplan/zyPlanProcess/delete", deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch", diff --git a/ant-design-vue-jeecg/src/views/productplan/ZyPlanTeamDataList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyPlanTeamDataList.vue new file mode 100644 index 00000000..530bb524 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/productplan/ZyPlanTeamDataList.vue @@ -0,0 +1,331 @@ + + + + \ No newline at end of file diff --git a/ant-design-vue-jeecg/src/views/productplan/ZyPlanTeamList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyPlanTeamList.vue new file mode 100644 index 00000000..414e22b2 --- /dev/null +++ b/ant-design-vue-jeecg/src/views/productplan/ZyPlanTeamList.vue @@ -0,0 +1,257 @@ + + + + \ No newline at end of file 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 b26835f3..89a695e8 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 @@ -1,7 +1,10 @@ package org.jeecg.modules.productplan.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.PageList; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -10,11 +13,14 @@ import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.system.base.controller.JeecgController; 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.team.entity.GroupxMember; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.ObjectUtils; import org.springframework.web.bind.annotation.*; @@ -22,9 +28,7 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; /** * @Description: 生产计划工序 @@ -111,6 +115,33 @@ public class ZyPlanProcessController extends JeecgController getTeamDatalist(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); + List processDatalist = zyPlanProcessService.getTeamDatalist(zyPlanProcess); +// PageList processDataVos = new PageList<>(processDatalist, processDatalist.size()); + + return Result.OK(processDatalist); + } + + @ApiOperation(value = "计划班组管理-查询产品工序&班组", notes = "计划班组管理-查询产品工序&班组") + @GetMapping(value = "/getTeamDatalistByPlanId") + public Result getTeamDatalistByPlanId(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()); + queryWrapper.eq("plan_id", zyPlanProcess.getPlanId()); + Page page = new Page(pageNo, pageSize); + IPage pageList = zyPlanProcessService.page(page, queryWrapper); + return Result.OK(pageList); + } + /** * 添加 * @@ -125,6 +156,29 @@ public class ZyPlanProcessController extends JeecgController addProcessBatch(@RequestBody List zyPlanProcessList) { + + zyPlanProcessService.saveBatch(zyPlanProcessList); + return Result.OK("添加成功!"); + } + + // @AutoLog(value = "计划班组管理-批量添加成员") + @ApiOperation(value = "计划班组管理-批量添zyPlanProcessList = {ArrayList@21228} size = 7加工序-班组成员", notes = "批量添加工序-班组成员") + @PostMapping(value = "/addTeamBatch") + public Result addTeamBatch(@RequestBody List zyPlanProcessList) { + if (!ObjectUtils.isEmpty(zyPlanProcessList)) { + zyPlanProcessList.forEach(e -> { + zyPlanProcessService.update(new LambdaUpdateWrapper() + .set(ZyPlanProcess::getUserIds, e.getUserIds()) + .eq(ZyPlanProcess::getProcessId, e.getProcessId())); + }); + } + return Result.OK("添加成功!"); + } + /** * 编辑 * @@ -145,7 +199,6 @@ public class ZyPlanProcessController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { @@ -159,11 +212,19 @@ public class ZyPlanProcessController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { - this.zyPlanProcessService.removeByIds(Arrays.asList(ids.split(","))); + List zyPlanProcessList = zyPlanProcessService.list(new LambdaQueryWrapper().in(ZyPlanProcess::getId, Arrays.asList(ids.split(",")))); + if (ObjectUtils.isEmpty(zyPlanProcessList)) throw new JeecgBootException("计划工序数据异常"); + List updateList = new LinkedList<>(); + zyPlanProcessList.forEach(e -> { + ZyPlanProcess en = new ZyPlanProcess(); + BeanUtils.copyProperties(e, en); + en.setUserIds(""); + updateList.add(en); + }); + zyPlanProcessService.updateBatchById(updateList); return Result.OK("批量删除成功!"); } 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 ae3b5c27..b286ca1d 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 @@ -100,6 +100,6 @@ public class ZyPlanProcess implements Serializable { */ @Excel(name = "成员id列表", width = 15) @ApiModelProperty(value = "成员id列表") -// @Dict(dictTable = "sys_user", dicText = "name", dicCode = "id") + @Dict(dictTable = "groupx_member", dicText = "user_id", dicCode = "id") private String userIds; } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java index 596a69f1..84475544 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java @@ -4,6 +4,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.jeecg.common.aspect.annotation.Dict; +import org.jeecg.modules.team.entity.GroupxMember; import org.jeecg.modules.team.entity.Station; import java.io.Serializable; @@ -16,6 +17,7 @@ public class ProcessDataVo implements Serializable { private static final long serialVersionUID = 1009888L; + private String id; //工单id private String workOrderId; @@ -31,6 +33,9 @@ public class ProcessDataVo implements Serializable { //工位 private List stationList; + //班组成员列表 + private List groupMemberList; + //产品工序id // @Dict(dictTable ="zy_process",dicText = "process_name",dicCode = "id") private String productProcessId; diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java index 804cca26..7a20f520 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java @@ -16,4 +16,6 @@ import java.util.List; public interface IZyPlanProcessService extends IService { List getProcessDatalist(ZyPlanProcess zyPlanProcess); + + List getTeamDatalist(ZyPlanProcess zyPlanProcess); } 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 ee9ddff8..d6a579da 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 @@ -16,7 +16,9 @@ import org.jeecg.modules.productplan.service.IZyPlanProcessService; import org.jeecg.modules.productplan.service.IZyProductPlanService; import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.service.ISysDepartService; +import org.jeecg.modules.team.entity.GroupxMember; import org.jeecg.modules.team.entity.Station; +import org.jeecg.modules.team.service.IGroupxMemberService; import org.jeecg.modules.team.service.IStationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -48,6 +50,8 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl getProcessDatalist(ZyPlanProcess zyPlanProcess) { @@ -83,4 +87,41 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl getTeamDatalist(ZyPlanProcess zyPlanProcess) { + //生产计划id + String planId = zyPlanProcess.getPlanId(); + ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId); + if (ObjectUtils.isEmpty(zyPlanProcess)) { + throw new JeecgBootException("生产计划不存在!"); + } + //工单id + String productCode = zyProductPlan.getProductCode(); + String departId = zyProductPlan.getWorkshopId(); + // TODO zy_product产品表,根据工单id获取产品id, + List result = new LinkedList<>(); + //根据产品id获取产品工序列表 +// List productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper().eq(ZyProductProcess::getProductId, "产品id")); + List productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper().eq(ZyProductProcess::getProductId, "1")); + if (!ObjectUtils.isEmpty(productProcessesList)) { + SysDepart depart = iSysDepartService.getById(departId); + List groupxMemberList = iGroupxMemberService.list(new LambdaQueryWrapper().eq(GroupxMember::getGroupxId, zyProductPlan.getTeamId())); + productProcessesList.forEach(e -> { + ProcessDataVo vo = new ProcessDataVo(); +// vo.setId() + vo.setProductProcessId(e.getProcessId()); + vo.setProcessName(iZyProcessService.getById(e.getProcessId()).getProcessName()); + vo.setProductId(e.getProductId()); +// vo.setProductName("产品名称") + vo.setWorkOrderId(productCode); + vo.setDepartId(departId); + vo.setDepartName(depart.getDepartName()); +// vo.setStationList(stationList); + vo.setGroupMemberList(groupxMemberList); + result.add(vo); + }); + } + return result; + } }