模组查询包装箱 时间

This commit is contained in:
闫阳 2023-03-06 17:03:01 +08:00
parent 5b3f6f6f5d
commit 4fd5498f1e
6 changed files with 61 additions and 21 deletions

View File

@ -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<WoPackagingBox> get(@PathVariable("woSubstrateId") String woSubstrateId){
return woPackagingBoxService.boxList(woSubstrateId);
}
}

View File

@ -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;
}

View File

@ -38,6 +38,8 @@ public interface WoPackagingBoxServiceBiz extends CrudService<WoPackagingBox, Wo
List<WoPackagingBoxSubstrate> substrateList (Map<String, Object> params);
List<WoPackagingBox> boxList (String woSubstrateId);
int updateIsArrivedByBoxNo(Integer isArrived, String boxNo);

View File

@ -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<Cha
@Override
public QueryWrapper<ChangePackagingBoxHistory> getWrapper(Map<String, Object> params){
LocalDateTime startTime = (LocalDateTime) params.get("startTime");
LocalDateTime endTime = (LocalDateTime) params.get("endTime");
QueryWrapper<ChangePackagingBoxHistory> wrapper = new QueryWrapper<>();
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);
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);

View File

@ -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<WoPackagingBox
@Override
public QueryWrapper<WoPackagingBox> getWrapper(Map<String, Object> params){
LocalDateTime startTime = (LocalDateTime) params.get("startTime");
LocalDateTime endTime = (LocalDateTime) params.get("endTime");
String boxNo = (String) params.get("boxNo");
QueryWrapper<WoPackagingBox> wrapper = new QueryWrapper<>();
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<WoPackagingBox
return substrateList;
}
@Override
public List<WoPackagingBox> boxList(String woSubstrateId) {
QueryWrapper<WoPackagingBoxSubstrate> substrateQueryWrapper = new QueryWrapper<>();
substrateQueryWrapper.eq(StringUtils.isNotBlank(woSubstrateId), WoPackagingBoxSubstrate.WO_SUBSTRATE_ID, woSubstrateId);
List<WoPackagingBoxSubstrate> substrateList = substrateMapper.selectList(substrateQueryWrapper);
List<WoPackagingBox> boxList = new ArrayList<>();
for(WoPackagingBoxSubstrate substrate: substrateList){
QueryWrapper<WoPackagingBox> boxQueryWrapper = new QueryWrapper<>();
boxQueryWrapper.eq(StringUtils.isNotBlank(substrate.getPackagingBoxId()), WoPackagingBox.BOX_NO, substrate.getPackagingBoxId());
List<WoPackagingBox> woPackagingBoxList = mapper.selectList(boxQueryWrapper);
boxList.addAll(woPackagingBoxList);
}
return boxList;
}
@Override
public int updateIsArrivedByBoxNo(Integer isArrived, String boxNo) {
return mapper.updateIsArrivedByBoxNo(isArrived,boxNo);

View File

@ -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<WoPac
@Override
public QueryWrapper<WoPackagingPrintHistory> getWrapper(Map<String, Object> params){
LocalDateTime startTime = (LocalDateTime) params.get("startTime");
LocalDateTime endTime = (LocalDateTime) params.get("endTime");
String boxNo = (String) params.get("boxNo");
QueryWrapper<WoPackagingPrintHistory> wrapper = new QueryWrapper<>();
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;