Commit 2ce85e44 LN

增加Completed Thaw 和Ongoint Thaw  报表功能。

1 个父辈 f9997444
...@@ -204,7 +204,7 @@ public class BarcodeDto implements Serializable { ...@@ -204,7 +204,7 @@ public class BarcodeDto implements Serializable {
@ApiModelProperty("原始条码") @ApiModelProperty("原始条码")
private String fullCode; private String fullCode;
@ApiModelProperty("开包时间") @ApiModelProperty("开包时间,开始回温时间")
private Date openTime; private Date openTime;
...@@ -253,4 +253,8 @@ public class BarcodeDto implements Serializable { ...@@ -253,4 +253,8 @@ public class BarcodeDto implements Serializable {
@ApiModelProperty("制造商物料编号") @ApiModelProperty("制造商物料编号")
private String mpn; private String mpn;
@ApiModelProperty("冷却结束时间 ready for use time")
private Date stabilizationEndDate;
} }
...@@ -210,7 +210,7 @@ public class Barcode extends BasePo implements Serializable { ...@@ -210,7 +210,7 @@ public class Barcode extends BasePo implements Serializable {
*/ */
private String fullCode; private String fullCode;
/** /**
* 开包时间 * 开包时间,Start Thaw Date
*/ */
private Date openTime; private Date openTime;
...@@ -232,6 +232,9 @@ public class Barcode extends BasePo implements Serializable { ...@@ -232,6 +232,9 @@ public class Barcode extends BasePo implements Serializable {
private Date sluggishTime; private Date sluggishTime;
/**
* 冷却结束时间 ready for use time
*/
private Date stabilizationEndDate; private Date stabilizationEndDate;
/** /**
......
...@@ -323,7 +323,9 @@ public class BaseDeviceHandler implements IDeviceHandler { ...@@ -323,7 +323,9 @@ public class BaseDeviceHandler implements IDeviceHandler {
statusBean.addPosInfo(barcodeSave.getBarcode(), posId, plateW, plateH, false,false,barcodeSave.getUsedCount()); statusBean.addPosInfo(barcodeSave.getBarcode(), posId, plateW, plateH, false,false,barcodeSave.getUsedCount());
statusBean.addData("inOutType",putInTask.getInOutType()); statusBean.addData("inOutType",putInTask.getInOutType());
statusBean.addData("expiredDate",barcodeSave.getExpireDateStr()); statusBean.addData("expiredDate",barcodeSave.getExpireDateStr());
//ready for use Time
statusBean.addData("stabilizationEndDate",barcodeSave.getStabilizationEndDateStr()); statusBean.addData("stabilizationEndDate",barcodeSave.getStabilizationEndDateStr());
//start thaw Date
statusBean.addData("exposureStartDate",barcodeSave.getOpenTimeStr()); statusBean.addData("exposureStartDate",barcodeSave.getOpenTimeStr());
log.info(barcodeSave.getBarcode() + "[" + plateW + "x" + plateH + "]开始入库到" + storage.getCid() + "[" + posId + "]"); log.info(barcodeSave.getBarcode() + "[" + plateW + "x" + plateH + "]开始入库到" + storage.getCid() + "[" + posId + "]");
......
...@@ -54,6 +54,10 @@ public class Micron20031Menu { ...@@ -54,6 +54,10 @@ public class Micron20031Menu {
// MenuInit.addMenu(menuLabel,null, -7, "Return", "returnPage", "system/returnPage/index","returnPage"); // MenuInit.addMenu(menuLabel,null, -7, "Return", "returnPage", "system/returnPage/index","returnPage");
// MenuInit.addMenu(menuLabel,null, -6, "Removal", "removal", "system/removal/index","removal"); // MenuInit.addMenu(menuLabel,null, -6, "Removal", "removal", "system/removal/index","removal");
//Thaw Summary
MenuInit.addMenu(menuLabel,report, 220, "Ongoint Thaw", "ongointThaw", "micron/ongointThaw/index","ongointThaw");
MenuInit.addMenu(menuLabel,report, 221, "Completed Thaw", "completedThaw", "micron/completedThaw/index","completedThaw");
String apiName = smfApi.getApiName(); String apiName = smfApi.getApiName();
if(Strings.isNotBlank(apiName) && apiName.equals(menuLabel)){ if(Strings.isNotBlank(apiName) && apiName.equals(menuLabel)){
menuInit.showMenu(apiName); menuInit.showMenu(apiName);
......
...@@ -2,7 +2,13 @@ package com.neotel.smfcore.custom.micron20031; ...@@ -2,7 +2,13 @@ package com.neotel.smfcore.custom.micron20031;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.google.common.base.Strings;
import com.neotel.smfcore.common.bean.PageData;
import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
import com.neotel.smfcore.core.storage.rest.dto.StoragePosDto;
import com.neotel.smfcore.core.storage.rest.mapstruct.StoragePosMapper;
import com.neotel.smfcore.core.storage.rest.query.StoragePosFindCriteria;
import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager; import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import com.neotel.smfcore.core.storage.service.po.StoragePos; import com.neotel.smfcore.core.storage.service.po.StoragePos;
import com.neotel.smfcore.custom.micron20031.bean.dto.PosInfoDto; import com.neotel.smfcore.custom.micron20031.bean.dto.PosInfoDto;
...@@ -10,25 +16,30 @@ import com.neotel.smfcore.custom.micron20031.bean.dto.PosRowDto; ...@@ -10,25 +16,30 @@ import com.neotel.smfcore.custom.micron20031.bean.dto.PosRowDto;
import com.neotel.smfcore.custom.micron20031.bean.dto.PosValueInfo; import com.neotel.smfcore.custom.micron20031.bean.dto.PosValueInfo;
import com.neotel.smfcore.security.annotation.AnonymousAccess; import com.neotel.smfcore.security.annotation.AnonymousAccess;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query; import org.springframework.data.mongodb.core.query.Query;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.*; import java.util.*;
@Slf4j @Slf4j
@RestController @RestController
@RequiredArgsConstructor
@RequestMapping("/rest/micron") @RequestMapping("/rest/micron")
public class MicronSpController { public class MicronSpController {
@Autowired @Autowired
private IStoragePosManager storagePosManager; private IStoragePosManager storagePosManager;
@Autowired
private final StoragePosMapper storagePosMapper;
@ApiOperation("获取库位使用列表") @ApiOperation("获取库位使用列表")
@GetMapping("/posUsedData") @GetMapping("/posUsedData")
@AnonymousAccess @AnonymousAccess
...@@ -51,10 +62,19 @@ public class MicronSpController { ...@@ -51,10 +62,19 @@ public class MicronSpController {
String posN = posName.substring(0, 2); String posN = posName.substring(0, 2);
Integer num = Convert.toInt(posName.substring(2, posName.length())); Integer num = Convert.toInt(posName.substring(2, posName.length()));
//0=灰色未使用,1=使用中,2=AuthoriseNg,3=已过期,4=解冻中
Integer used = 0; Integer used = 0;
Barcode barcode = pos.getBarcode(); Barcode barcode = pos.getBarcode();
if (pos.isUsed()&&barcode!=null) { if (pos.isUsed()&&barcode!=null) {
used = 1; used = 1;
Date stabilizationEndDate = barcode.getStabilizationEndDate();
if (stabilizationEndDate != null){
if (System.currentTimeMillis() - stabilizationEndDate.getTime() < 0){
used = 4;
}
}
Boolean AuthoriseNg= pos.getBarcode().getAppendData("AuthoriseNg") ; Boolean AuthoriseNg= pos.getBarcode().getAppendData("AuthoriseNg") ;
if(AuthoriseNg!=null && AuthoriseNg){ if(AuthoriseNg!=null && AuthoriseNg){
used=2; used=2;
...@@ -66,7 +86,6 @@ public class MicronSpController { ...@@ -66,7 +86,6 @@ public class MicronSpController {
} }
} }
} }
// used=1;
String labelName = pos.getLabelName(); String labelName = pos.getLabelName();
...@@ -135,4 +154,52 @@ public class MicronSpController { ...@@ -135,4 +154,52 @@ public class MicronSpController {
return dto; return dto;
} }
private Query getPosFindCriteria(StoragePosFindCriteria criteria){
if (ObjectUtil.isNotEmpty(criteria.getStorageId()) && criteria.getStorageId().equals("0")) {
criteria.setStorageId(null);
}
Query query = QueryHelp.getQuery(criteria);
Criteria baseCriteria = Criteria.where("used").is(true);
int componentType = criteria.getComponentType();
if (componentType != -1) {
baseCriteria.and("barcode.type").is(componentType);
}
String expire = criteria.getExpire();
if (!Strings.isNullOrEmpty(expire)) {
if ("solder".equalsIgnoreCase(expire)) {
baseCriteria.and("barcode.expTime").lte(new Date());
} else if ("pcb".equalsIgnoreCase(expire)) {
baseCriteria.and("barcode.expireDate").lte(new Date());
}
}
query.addCriteria(baseCriteria);
return query;
}
@ApiOperation("Ongoint Thaw 回温中的物料列表")
@GetMapping("/ongointThaw")
public PageData<StoragePosDto> ongointThaw(StoragePosFindCriteria criteria, Pageable pageable ) {
Query query=getPosFindCriteria(criteria);
query.addCriteria(Criteria.where("barcode.stabilizationEndDate").lt(new Date()));
PageData<StoragePos> pages = storagePosManager.findByPage(query, pageable);
List<StoragePosDto> StoragePosDtos = storagePosMapper.toDto(pages.getContent());
return new PageData(StoragePosDtos, pages.getTotalElements());
}
@ApiOperation("Completed Thaw 回温完成的物料列表")
@GetMapping("/completedThaw")
public PageData<StoragePosDto> completedThaw(StoragePosFindCriteria criteria, Pageable pageable ) {
Query query=getPosFindCriteria(criteria);
query.addCriteria(Criteria.where("barcode.stabilizationEndDate").gte(new Date()));
PageData<StoragePos> pages = storagePosManager.findByPage(query, pageable);
List<StoragePosDto> StoragePosDtos = storagePosMapper.toDto(pages.getContent());
return new PageData(StoragePosDtos, pages.getTotalElements());
}
} }
...@@ -30,3 +30,9 @@ ...@@ -30,3 +30,9 @@
20220318: 20220318:
安全库存和 呆滞物料功能 安全库存和 呆滞物料功能
20241119
//增加回温中的物料表,和回温完成的物料表
http://localhost:8800/api/menus/show?menuPath=ongointThaw
http://localhost:8800/api/menus/show?menuPath=completedThaw
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!