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 5be0225..b1fb726 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 @@ -12,6 +12,7 @@ import com.cnbm.common.validator.group.DefaultGroup; import com.cnbm.common.validator.group.UpdateGroup; import com.cnbm.packing.dto.IdVo; import com.cnbm.packing.dto.WoPackagingBoxDTO; +import com.cnbm.packing.entity.WoPackagingBox; import com.cnbm.packing.entity.WoPackagingBoxSubstrate; import com.cnbm.packing.excel.WoPackagingBoxExcel; import com.cnbm.packing.excel.WoPackagingBoxSubstrateExcel; @@ -152,4 +153,10 @@ public class WoPackagingBoxController { } } + @GetMapping("boxList/{woSubstrateId}") + @ApiOperation("查询模组id所在包装箱") + public List get(@PathVariable("woSubstrateId") String woSubstrateId){ + return woPackagingBoxService.boxList(woSubstrateId); + } + } \ No newline at end of file diff --git a/ym-packing/src/main/java/com/cnbm/packing/excel/WoPackagingBoxSubstrateExcel.java b/ym-packing/src/main/java/com/cnbm/packing/excel/WoPackagingBoxSubstrateExcel.java index 0e8dcb4..f00db57 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/excel/WoPackagingBoxSubstrateExcel.java +++ b/ym-packing/src/main/java/com/cnbm/packing/excel/WoPackagingBoxSubstrateExcel.java @@ -17,21 +17,25 @@ import java.util.Date; @Data public class WoPackagingBoxSubstrateExcel { - @Excel(name = "产出时间") + @Excel(name = "创建时间") private LocalDateTime createTime; - @Excel(name = "substrate ID") + @Excel(name = "模组ID") private String woSubstrateId; @Excel(name = "Box_ID") private String packagingBoxId; - @Excel(name = "Pmpp") - private Float pmpp; @Excel(name = "BOX_SLOT") private Integer slot; - @Excel(name = "线体") - private Integer lineBody; - @Excel(name = "实际功率") + @Excel(name = "档位功率") + private String powerLevel; + @Excel(name = "补偿功率") + private Float pmpp; + @Excel(name = "实测功率") private Float actualPmpp; @Excel(name = "订单") private String orderName; + @Excel(name = "线体") + private Integer lineBody; + @Excel(name = "SAP物料号") + private String sapMaterial; } \ 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 09c46d7..a779e5b 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 @@ -38,6 +38,8 @@ public interface WoPackagingBoxServiceBiz extends CrudService substrateList (Map params); + List boxList (String woSubstrateId); + int updateIsArrivedByBoxNo(Integer isArrived, String boxNo); diff --git a/ym-packing/src/main/java/com/cnbm/packing/service/impl/ChangePackagingBoxHistoryServiceBizImpl.java b/ym-packing/src/main/java/com/cnbm/packing/service/impl/ChangePackagingBoxHistoryServiceBizImpl.java index b5c7f0c..94aaa4e 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/service/impl/ChangePackagingBoxHistoryServiceBizImpl.java +++ b/ym-packing/src/main/java/com/cnbm/packing/service/impl/ChangePackagingBoxHistoryServiceBizImpl.java @@ -8,7 +8,6 @@ import com.cnbm.common.page.PageData; import com.cnbm.common.service.impl.CrudServiceImpl; import com.cnbm.common.utils.ConvertUtils; import com.cnbm.packing.dto.ChangePackagingBoxHistoryDTO; -import com.cnbm.packing.dto.ChangePackagingBoxHistoryDTO; import com.cnbm.packing.entity.ChangePackagingBoxHistory; import com.cnbm.packing.mapper.ChangePackagingBoxHistoryMapper; import com.cnbm.packing.service.ChangePackagingBoxHistoryServiceBiz; @@ -17,6 +16,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -35,12 +35,15 @@ public class ChangePackagingBoxHistoryServiceBizImpl extends CrudServiceImpl getWrapper(Map params){ - LocalDateTime startTime = (LocalDateTime) params.get("startTime"); - LocalDateTime endTime = (LocalDateTime) params.get("endTime"); QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.between(startTime!=null && endTime!=null,ChangePackagingBoxHistory.CREATE_TIME, startTime, endTime); - wrapper.between(startTime!=null && endTime!=null,ChangePackagingBoxHistory.CREATE_TIME, startTime, endTime); + + DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + if(params.get("startTime")!=null && params.get("endTime")!=null){ + LocalDateTime startTime = LocalDateTime.parse(params.get("startTime").toString(),df); + LocalDateTime endTime = LocalDateTime.parse(params.get("endTime").toString(),df); + wrapper.between(startTime!=null && endTime!=null,ChangePackagingBoxHistory.CREATE_TIME, startTime, endTime); + } if(params.get("type")!=null) { Integer type = Integer.parseInt( params.get("type").toString()); wrapper.eq(ObjectUtils.isNotNull(type), ChangePackagingBoxHistory.TYPE, type); 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 4bb2215..8c614c2 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 @@ -22,6 +22,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -45,12 +46,15 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl getWrapper(Map params){ - LocalDateTime startTime = (LocalDateTime) params.get("startTime"); - LocalDateTime endTime = (LocalDateTime) params.get("endTime"); - String boxNo = (String) params.get("boxNo"); - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.between(startTime!=null && endTime!=null,WoPackagingBox.CREATE_TIME, startTime, endTime); + + DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + if(params.get("startTime")!=null && params.get("endTime")!=null){ + LocalDateTime startTime = LocalDateTime.parse(params.get("startTime").toString(),df); + LocalDateTime endTime = LocalDateTime.parse(params.get("endTime").toString(),df); + wrapper.between(startTime!=null && endTime!=null, WoPackagingBox.CREATE_TIME, startTime, endTime); + } + String boxNo = (String) params.get("boxNo"); wrapper.like(StringUtils.isNotBlank(boxNo), WoPackagingBox.BOX_NO, boxNo); if(params.get("lineBody")!=null) { Integer lineBody = Integer.parseInt(params.get("lineBody").toString()); @@ -141,6 +145,21 @@ public class WoPackagingBoxServiceBizImpl extends CrudServiceImpl boxList(String woSubstrateId) { + QueryWrapper substrateQueryWrapper = new QueryWrapper<>(); + substrateQueryWrapper.eq(StringUtils.isNotBlank(woSubstrateId), WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, woSubstrateId); + List substrateList = substrateMapper.selectList(substrateQueryWrapper); + List boxList = new ArrayList<>(); + for(WoPackagingBoxSubstrate substrate: substrateList){ + QueryWrapper boxQueryWrapper = new QueryWrapper<>(); + boxQueryWrapper.eq(StringUtils.isNotBlank(substrate.getPackagingBoxId()), WoPackagingBox.BOX_NO, substrate.getPackagingBoxId()); + List woPackagingBoxList = mapper.selectList(boxQueryWrapper); + boxList.addAll(woPackagingBoxList); + } + return boxList; + } + @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/WoPackagingPrintHistoryServiceBizImpl.java b/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingPrintHistoryServiceBizImpl.java index 6aecb00..99096cb 100644 --- a/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingPrintHistoryServiceBizImpl.java +++ b/ym-packing/src/main/java/com/cnbm/packing/service/impl/WoPackagingPrintHistoryServiceBizImpl.java @@ -19,6 +19,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -40,12 +41,16 @@ public class WoPackagingPrintHistoryServiceBizImpl extends CrudServiceImpl getWrapper(Map params){ - LocalDateTime startTime = (LocalDateTime) params.get("startTime"); - LocalDateTime endTime = (LocalDateTime) params.get("endTime"); - String boxNo = (String) params.get("boxNo"); QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.between(startTime!=null && endTime!=null, WoPackagingPrintHistory.PRINT_TIME, startTime, endTime); + + DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + if(params.get("startTime")!=null && params.get("endTime")!=null){ + LocalDateTime startTime = LocalDateTime.parse(params.get("startTime").toString(),df); + LocalDateTime endTime = LocalDateTime.parse(params.get("endTime").toString(),df); + wrapper.between(startTime!=null && endTime!=null, WoPackagingPrintHistory.PRINT_TIME, startTime, endTime); + } + String boxNo = (String) params.get("boxNo"); wrapper.like(StringUtils.isNotBlank(boxNo), WoPackagingPrintHistory.BOX_NO, boxNo); return wrapper;