From ddc2343842dc02a9d1d5b800956f2014150cad2f Mon Sep 17 00:00:00 2001 From: yanyang Date: Mon, 6 Mar 2023 21:02:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E8=A3=85=E7=AE=B1=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=20=E9=BB=98=E8=AE=A4=E6=98=BE=E7=A4=BA=E5=BD=93?= =?UTF-8?q?=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChangePackagingBoxHistoryController.java | 3 ++- .../controller/WoPackagingBoxController.java | 9 +++++++ .../WoPackagingBoxSubstrateController.java | 10 +++++++ .../ChangePackagingBoxHistoryServiceBiz.java | 2 ++ .../service/WoPackagingBoxServiceBiz.java | 2 ++ .../WoPackagingBoxSubstrateServiceBiz.java | 2 ++ ...angePackagingBoxHistoryServiceBizImpl.java | 15 +++++++++-- .../impl/WoPackagingBoxServiceBizImpl.java | 26 ++++++++++++++++++- ...WoPackagingBoxSubstrateServiceBizImpl.java | 19 ++++++++++++-- .../ChangePackagingBoxHistoryMapper.xml | 2 +- 10 files changed, 83 insertions(+), 7 deletions(-) diff --git a/ym-packing/src/main/java/com/cnbm/packing/controller/ChangePackagingBoxHistoryController.java b/ym-packing/src/main/java/com/cnbm/packing/controller/ChangePackagingBoxHistoryController.java index 2c07411..1ad04f4 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/controller/ChangePackagingBoxHistoryController.java +++ b/ym-packing/src/main/java/com/cnbm/packing/controller/ChangePackagingBoxHistoryController.java @@ -11,6 +11,7 @@ import com.cnbm.common.validator.group.AddGroup; import com.cnbm.common.validator.group.DefaultGroup; import com.cnbm.common.validator.group.UpdateGroup; import com.cnbm.packing.dto.ChangePackagingBoxHistoryDTO; +import com.cnbm.packing.entity.ChangePackagingBoxHistory; import com.cnbm.packing.excel.ChangePackagingBoxHistoryExcel; import com.cnbm.packing.service.ChangePackagingBoxHistoryServiceBiz; import io.swagger.annotations.Api; @@ -117,7 +118,7 @@ public class ChangePackagingBoxHistoryController { }) @PreAuthorize("@ex.hasAuthority('packing:changePackagingBoxHistory:export')") public void export(@ApiIgnore @RequestParam Map params, HttpServletResponse response) throws Exception { - List list = changePackagingBoxHistoryService.list(params); + List list = changePackagingBoxHistoryService.historyList(params); if(list.size()>0) { ExcelUtils.exportExcelToTarget(response, "包装箱模组操作记录", list, ChangePackagingBoxHistoryExcel.class); } diff --git a/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxController.java b/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxController.java index b1fb726..43e9a48 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxController.java +++ b/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxController.java @@ -159,4 +159,13 @@ public class WoPackagingBoxController { return woPackagingBoxService.boxList(woSubstrateId); } + @PostMapping("insertSubstrateManual") + @ApiOperation("手动新增包装箱") + @LogOperation("手动新增包装箱") + public IdVo insertSubstrateManual(@RequestBody WoPackagingBoxDTO dto){ + + return woPackagingBoxService.insertSubstrateManual(dto); + + } + } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxSubstrateController.java b/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxSubstrateController.java index 50be926..ac18e27 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxSubstrateController.java +++ b/ym-packing/src/main/java/com/cnbm/packing/controller/WoPackagingBoxSubstrateController.java @@ -277,4 +277,14 @@ public class WoPackagingBoxSubstrateController { return new Result(); } + @PostMapping("updateSubstrateManual") + @ApiOperation("手动装箱编辑") + @LogOperation("手动装箱编辑") + public Result updateSubstrateManual(@RequestBody ChangePackingBoxDTO[] dtos){ + + woPackagingBoxSubstrateService.updateSubstrateManual(dtos); + + return new Result(); + } + } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/service/ChangePackagingBoxHistoryServiceBiz.java b/ym-packing/src/main/java/com/cnbm/packing/service/ChangePackagingBoxHistoryServiceBiz.java index 6d4ba60..eb058bd 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/service/ChangePackagingBoxHistoryServiceBiz.java +++ b/ym-packing/src/main/java/com/cnbm/packing/service/ChangePackagingBoxHistoryServiceBiz.java @@ -28,4 +28,6 @@ public interface ChangePackagingBoxHistoryServiceBiz extends CrudService list(Map params); + List historyList(Map params); + } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxServiceBiz.java b/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxServiceBiz.java index a779e5b..3d43e33 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxServiceBiz.java +++ b/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxServiceBiz.java @@ -40,6 +40,8 @@ public interface WoPackagingBoxServiceBiz extends CrudService boxList (String woSubstrateId); + IdVo insertSubstrateManual(WoPackagingBoxDTO dto); + int updateIsArrivedByBoxNo(Integer isArrived, String boxNo); diff --git a/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxSubstrateServiceBiz.java b/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxSubstrateServiceBiz.java index bea2ab2..a51a80a 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxSubstrateServiceBiz.java +++ b/ym-packing/src/main/java/com/cnbm/packing/service/WoPackagingBoxSubstrateServiceBiz.java @@ -34,6 +34,8 @@ public interface WoPackagingBoxSubstrateServiceBiz extends CrudService page (Map params){ IPage page = baseDao.selectPage( - getPage(params, ChangePackagingBoxHistory.CREATE_TIME, true), - getWrapper(params) + getPage(params, ChangePackagingBoxHistory.CREATE_TIME, true), + getWrapper(params) ); return getPageData(page, ChangePackagingBoxHistoryDTO.class); } @@ -97,4 +100,12 @@ public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl historyList(Map params) { + QueryWrapper wrapper = getWrapper(params); + List historyList = mapper.selectList(wrapper); + return historyList; + } + } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingBoxServiceBizImpl.java b/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingBoxServiceBizImpl.java index 8c614c2..6ec63b2 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingBoxServiceBizImpl.java +++ b/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingBoxServiceBizImpl.java @@ -16,6 +16,7 @@ import com.cnbm.packing.mapper.WoPackagingBoxMapper; import com.cnbm.packing.mapper.WoPackagingBoxSubstrateMapper; import com.cnbm.packing.param.PowerReportQueryParam; import com.cnbm.packing.service.WoPackagingBoxServiceBiz; +import com.cnbm.packing.service.WoPackagingBoxSubstrateServiceBiz; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -41,6 +42,8 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl boxList = new ArrayList<>(); for(WoPackagingBoxSubstrate substrate: substrateList){ QueryWrapper boxQueryWrapper = new QueryWrapper<>(); - boxQueryWrapper.eq(StringUtils.isNotBlank(substrate.getPackagingBoxId()), WoPackagingBox.BOX_NO, substrate.getPackagingBoxId()); + boxQueryWrapper.like(StringUtils.isNotBlank(substrate.getPackagingBoxId()), WoPackagingBox.BOX_NO, substrate.getPackagingBoxId()); List woPackagingBoxList = mapper.selectList(boxQueryWrapper); boxList.addAll(woPackagingBoxList); } return boxList; } + @Override + @Transactional(rollbackFor = Exception.class) + public IdVo insertSubstrateManual(WoPackagingBoxDTO dto) { + //新增包装箱 + WoPackagingBox box = ConvertUtils.sourceToTarget(dto, WoPackagingBox.class); + BaseSupportUtils.setCommonField(box); + insert(box); + //新增模组 + List substrateList = dto.getSubstrateList(); + for(WoPackagingBoxSubstrate substrate : substrateList){ + substrate.setPackagingBoxId(box.getBoxNo()); + substrate.setPowerLevel(box.getPowerLevel()); + BaseSupportUtils.setCommonField(substrate); + woPackagingBoxSubstrateServiceBiz.insert(substrate); + } + return IdVo.builder().id(box.getId()).build(); + } + @Override public int updateIsArrivedByBoxNo(Integer isArrived, String boxNo) { return mapper.updateIsArrivedByBoxNo(isArrived,boxNo); diff --git a/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingBoxSubstrateServiceBizImpl.java b/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingBoxSubstrateServiceBizImpl.java index 20330e9..6a3a569 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingBoxSubstrateServiceBizImpl.java +++ b/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingBoxSubstrateServiceBizImpl.java @@ -163,8 +163,12 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(dto.getWoSubstrateId()), WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, dto.getWoSubstrateId()); +// QueryWrapper wrapper = new QueryWrapper<>(); +// wrapper.eq(StringUtils.isNotBlank(dto.getWoSubstrateId()), WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, dto.getWoSubstrateId()); + WoPackagingBoxSubstrate entity = ConvertUtils.sourceToTarget(dto, WoPackagingBoxSubstrate.class); + BaseSupportUtils.setCommonField(entity); + insert(entity); + /* if (mapper.selectCount(wrapper) > 0 && StringUtils.isNotBlank(dto.getWoSubstrateId())) { WoPackagingBoxSubstrate substrate = mapper.selectList(wrapper).get(0); substrate.setPackagingBoxId(dto.getPackagingBoxId()); @@ -181,6 +185,17 @@ public class WoPackagingBoxSubstrateServiceBizImpl extends CrudServiceImpl - order by id asc + order by CREATE_TIME desc