Commit 743d3c98 LN

1.呆滞天数问题修改。2.库存接口realId改为uid.3.料仓显示名称修改。

1 个父辈 1686abbd
...@@ -13,10 +13,14 @@ public class MessageCriteria { ...@@ -13,10 +13,14 @@ public class MessageCriteria {
@QueryCondition(blurry = "deviceName,module,msg") @QueryCondition(blurry = "deviceName,module,msg")
private String blurry; private String blurry;
@QueryCondition(type = QueryCondition.Type.BETWEEN, propName = "updateDate") @QueryCondition(type = QueryCondition.Type.BETWEEN, propName = "createDate")
@DateTimeFormat(pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd")
private BetweenData<Date> createDate; private BetweenData<Date> createDate;
@QueryCondition(type = QueryCondition.Type.BETWEEN, propName = "updateDate")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private BetweenData<Date> updateDate;
@QueryCondition @QueryCondition
@ApiModelProperty("设备") @ApiModelProperty("设备")
......
...@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil; ...@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.neotel.smfcore.common.base.IExcelDownLoad; import com.neotel.smfcore.common.base.IExcelDownLoad;
import com.neotel.smfcore.common.bean.PageData; import com.neotel.smfcore.common.bean.PageData;
import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.FileUtil; import com.neotel.smfcore.common.utils.FileUtil;
import com.neotel.smfcore.common.utils.QueryHelp; import com.neotel.smfcore.common.utils.QueryHelp;
import com.neotel.smfcore.core.barcode.service.manager.IComponentManager; import com.neotel.smfcore.core.barcode.service.manager.IComponentManager;
...@@ -183,10 +184,36 @@ public class MaterialStockController { ...@@ -183,10 +184,36 @@ public class MaterialStockController {
} }
}); });
} }
@ApiOperation("获取呆滞物料列表") @ApiOperation("获取呆滞物料列表")
@GetMapping(value = "/sluggishMaterials") @GetMapping(value = "/sluggishMaterials")
@PreAuthorize("@el.check('sluggishMaterials')") @PreAuthorize("@el.check('sluggishMaterials')")
public PageData<StoragePosDto> sluggishMaterials(StoragePosFindCriteria criteria, Pageable pageable, HttpServletRequest request) { public Map<String,Object> sluggishMaterials(StoragePosFindCriteria criteria, Pageable pageable, HttpServletRequest request) {
Integer sluggishDay=getSluggishDay(criteria);
Query query=getSluggishQuery(criteria,sluggishDay);
PageData<StoragePos> pages = storagePosManager.findByPage(query, pageable);
List<StoragePosDto> StoragePosDtos = storagePosMapper.toDto(pages.getContent());
Map<String,Object> resultMap=new HashMap<>();
resultMap.put("content",StoragePosDtos);
resultMap.put("totalElements",pages.getTotalElements());
resultMap.put("sluggishDay",sluggishDay);
return resultMap;
// return new PageData(StoragePosDtos, pages.getTotalElements());
}
private Integer getSluggishDay(StoragePosFindCriteria criteria){
Integer sluggishDay = criteria.getSluggishDay();
if (sluggishDay == null) {
sluggishDay = dataCache.getCache(Constants.CACHE_SluggishDay);
}
if (sluggishDay == null || sluggishDay <= 0) {
sluggishDay = 30;
}
return sluggishDay;
}
private Query getSluggishQuery(StoragePosFindCriteria criteria,Integer sluggishDay) {
if (criteria.getStorageId() != null && criteria.getStorageId().equals("0")) { if (criteria.getStorageId() != null && criteria.getStorageId().equals("0")) {
criteria.setStorageId(null); criteria.setStorageId(null);
...@@ -194,37 +221,47 @@ public class MaterialStockController { ...@@ -194,37 +221,47 @@ public class MaterialStockController {
Query query = QueryHelp.getQuery(criteria); Query query = QueryHelp.getQuery(criteria);
Criteria baseCriteria = Criteria.where("used").is(true); Criteria baseCriteria = Criteria.where("used").is(true);
if (criteria.getSluggishTime() != null && criteria.getSluggishTime().getFrom() != null && criteria.getSluggishTime().getTo() != null) { // if (criteria.getSluggishTime() != null && criteria.getSluggishTime().getFrom() != null && criteria.getSluggishTime().getTo() != null) {
//根据过滤时间查询 // //根据过滤时间查询
} else { // } else {
//需要查询已经过呆滞日期的物料 // //需要查询已经过呆滞日期的物料
baseCriteria.and("barcode.sluggishTime").exists(true).lte(new Date()); // baseCriteria.and("barcode.sluggishTime").exists(true).lte(new Date());
} // }
// baseCriteria.and("barcode.sluggishTime").gte(new Date()); // baseCriteria.and("barcode.sluggishTime").gte(new Date());
if(sluggishDay==null){
sluggishDay=getSluggishDay(criteria);
}
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.DATE, -sluggishDay);
Date tenDaysAgo = calendar.getTime();
baseCriteria.and("barcode.putInDate").lt(tenDaysAgo);
query.addCriteria(baseCriteria); query.addCriteria(baseCriteria);
PageData<StoragePos> pages = storagePosManager.findByPage(query, pageable); return query;
List<StoragePosDto> StoragePosDtos = storagePosMapper.toDto(pages.getContent());
return new PageData(StoragePosDtos, pages.getTotalElements());
} }
@ApiOperation("导出呆滞物料报表") @ApiOperation("导出呆滞物料报表")
@GetMapping(value = "/sluggishMaterials/download") @GetMapping(value = "/sluggishMaterials/download")
@PreAuthorize("@el.check('sluggishMaterials')") @PreAuthorize("@el.check('sluggishMaterials')")
public void sluggishMaterialsDownload(StoragePosFindCriteria criteria, HttpServletResponse response, Pageable pageable,HttpServletRequest request)throws IOException { public void sluggishMaterialsDownload(StoragePosFindCriteria criteria, HttpServletResponse response, Pageable pageable,HttpServletRequest request)throws IOException {
if (criteria.getStorageId() != null && criteria.getStorageId().equals("0")) { // if (criteria.getStorageId() != null && criteria.getStorageId().equals("0")) {
criteria.setStorageId(null); // criteria.setStorageId(null);
} // }
Query query = QueryHelp.getQuery(criteria); // Query query = QueryHelp.getQuery(criteria);
Criteria baseCriteria = Criteria.where("used").is(true); // Criteria baseCriteria = Criteria.where("used").is(true);
//
if (criteria.getSluggishTime() != null && criteria.getSluggishTime().getFrom() != null && criteria.getSluggishTime().getTo() != null) { // if (criteria.getSluggishTime() != null && criteria.getSluggishTime().getFrom() != null && criteria.getSluggishTime().getTo() != null) {
//根据过滤时间查询 // //根据过滤时间查询
} else { // } else {
//需要查询已经过呆滞日期的物料 // //需要查询已经过呆滞日期的物料
baseCriteria.and("barcode.sluggishTime").exists(true).lte(new Date()); // baseCriteria.and("barcode.sluggishTime").exists(true).lte(new Date());
} // }
//
query.addCriteria(baseCriteria); // query.addCriteria(baseCriteria);
Query query=getSluggishQuery(criteria,null);
FileUtil.downloadExcel(query, pageable, response, new IExcelDownLoad() { FileUtil.downloadExcel(query, pageable, response, new IExcelDownLoad() {
@Override @Override
...@@ -280,7 +317,6 @@ public class MaterialStockController { ...@@ -280,7 +317,6 @@ public class MaterialStockController {
} }
@ApiOperation("导出安全库存列表") @ApiOperation("导出安全库存列表")
@GetMapping(value = "/safetyInventory/download") @GetMapping(value = "/safetyInventory/download")
@PreAuthorize("@el.check('safetyInventory')") @PreAuthorize("@el.check('safetyInventory')")
......
...@@ -400,6 +400,12 @@ public class StoragePosController { ...@@ -400,6 +400,12 @@ public class StoragePosController {
// barcode.setSubCodeList(subCodes); // barcode.setSubCodeList(subCodes);
// storagePosDto.setBarcode(barcode); // storagePosDto.setBarcode(barcode);
// } // }
for (int i=0;i<StoragePosDtos.size();i++){
Storage storage=dataCache.getStorageById(StoragePosDtos.get(i).getStorageId());
if(storage!=null){
StoragePosDtos.get(i).setStorageName(storage.getName());
}
}
return new PageData(StoragePosDtos, pages.getTotalElements()); return new PageData(StoragePosDtos, pages.getTotalElements());
} }
......
...@@ -29,9 +29,9 @@ public class StoragePosFindCriteria { ...@@ -29,9 +29,9 @@ public class StoragePosFindCriteria {
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private BetweenData<Date> expireDate; private BetweenData<Date> expireDate;
@QueryCondition(type = QueryCondition.Type.BETWEEN, propName = "barcode.sluggishTime") // @QueryCondition(type = QueryCondition.Type.BETWEEN, propName = "barcode.sluggishTime")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private BetweenData<Date> sluggishTime; // private BetweenData<Date> sluggishTime;
...@@ -91,6 +91,9 @@ public class StoragePosFindCriteria { ...@@ -91,6 +91,9 @@ public class StoragePosFindCriteria {
@ApiModelProperty("物料类型: pcb,tray,shoeBox,pizzaBox") @ApiModelProperty("物料类型: pcb,tray,shoeBox,pizzaBox")
private String reelType; private String reelType;
@ApiModelProperty("呆滞天数")
private Integer sluggishDay;
public int getComponentType(){ public int getComponentType(){
int componentType = getType(); int componentType = getType();
if (componentType != -1) { if (componentType != -1) {
......
...@@ -245,6 +245,7 @@ public class MicronStatusController { ...@@ -245,6 +245,7 @@ public class MicronStatusController {
for (String cid : for (String cid :
cids) { cids) {
Storage storage = dataCache.getStorage(cid); Storage storage = dataCache.getStorage(cid);
String name=storage.getName();
for (UsageItem item : storage.getUsageMap().values() for (UsageItem item : storage.getUsageMap().values()
) { ) {
useCount += item.getUsedCount(); useCount += item.getUsedCount();
...@@ -259,14 +260,14 @@ public class MicronStatusController { ...@@ -259,14 +260,14 @@ public class MicronStatusController {
dto.setHumidity(humidity); dto.setHumidity(humidity);
dto.setTemperature(temperature); dto.setTemperature(temperature);
} }
dto.getStatuMap().put(cid, boxStatus.getStatus()); dto.getStatuMap().put(name, boxStatus.getStatus());
dto.getMsgMap().put(cid, statusBean.getErrorMsg(servletRequest.getLocale())); dto.getMsgMap().put(name, statusBean.getErrorMsg(servletRequest.getLocale()));
} }
}else{ }else{
dto.getStatuMap().put(cid,0); dto.getStatuMap().put(name,0);
dto.getMsgMap().put(cid,""); dto.getMsgMap().put(name,"");
} }
//出入库报表 默认过去一周到现在的 //出入库报表 默认过去一周到现在的
......
...@@ -163,7 +163,7 @@ public class NeotelController { ...@@ -163,7 +163,7 @@ public class NeotelController {
if (barcode.getSubCodeList() != null && !barcode.getSubCodeList().isEmpty()) { if (barcode.getSubCodeList() != null && !barcode.getSubCodeList().isEmpty()) {
for (Barcode subBarcode : barcode.getSubCodeList()) { for (Barcode subBarcode : barcode.getSubCodeList()) {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
resultMap.put("reelId", subBarcode.getBarcode()); resultMap.put("uid", subBarcode.getBarcode());
resultMap.put("qty", subBarcode.getAmount()); resultMap.put("qty", subBarcode.getAmount());
resultMap.put("towerId", storagePos.getStorageId()); resultMap.put("towerId", storagePos.getStorageId());
resultMap.put("location", storagePos.getPosName()); resultMap.put("location", storagePos.getPosName());
...@@ -172,7 +172,7 @@ public class NeotelController { ...@@ -172,7 +172,7 @@ public class NeotelController {
} }
} else { } else {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
resultMap.put("reelId", barcode.getBarcode()); resultMap.put("uid", barcode.getBarcode());
resultMap.put("qty", barcode.getAmount()); resultMap.put("qty", barcode.getAmount());
resultMap.put("towerId", storagePos.getStorageId()); resultMap.put("towerId", storagePos.getStorageId());
resultMap.put("location", storagePos.getPosName()); resultMap.put("location", storagePos.getPosName());
......
...@@ -290,11 +290,11 @@ smfcore.statePage=Equipment Status ...@@ -290,11 +290,11 @@ smfcore.statePage=Equipment Status
smfcore.palletStatus=Pallet Status smfcore.palletStatus=Pallet Status
smfcore.tempLog=Temperature Log smfcore.tempLog=Temperature Log
smfcore.humidityLog=Humidity Log smfcore.humidityLog=Humidity Log
smfcore.SBSH1=SBSH1 smfcore.SBSH1=KTS-B004
smfcore.SBSH2=SBSH2 smfcore.SBSH2=KTS-B003
smfcore.SBDH1=SBDH1 smfcore.SBDH1=KTS-B001
smfcore.SBDH2=SBDH2 smfcore.SBDH2=KTS-B002
smfcore.SBDH3=SBDH3 smfcore.SBDH3=KTS-B005
smfcore.cl=CI smfcore.cl=CI
smfcore.mt=MT smfcore.mt=MT
smfcore.ml=MI1 smfcore.ml=MI1
......
...@@ -290,11 +290,11 @@ smfcore.statePage=Equipment Status ...@@ -290,11 +290,11 @@ smfcore.statePage=Equipment Status
smfcore.palletStatus=Pallet Status smfcore.palletStatus=Pallet Status
smfcore.tempLog=Temperature Log smfcore.tempLog=Temperature Log
smfcore.humidityLog=Humidity Log smfcore.humidityLog=Humidity Log
smfcore.SBSH1=SBSH1 smfcore.SBSH1=KTS-B004
smfcore.SBSH2=SBSH2 smfcore.SBSH2=KTS-B003
smfcore.SBDH1=SBDH1 smfcore.SBDH1=KTS-B001
smfcore.SBDH2=SBDH2 smfcore.SBDH2=KTS-B002
smfcore.SBDH3=SBDH3 smfcore.SBDH3=KTS-B005
smfcore.cl=CI smfcore.cl=CI
smfcore.mt=MT smfcore.mt=MT
smfcore.ml=MI1 smfcore.ml=MI1
......
...@@ -287,11 +287,11 @@ smfcore.statePage=Equipment Status ...@@ -287,11 +287,11 @@ smfcore.statePage=Equipment Status
smfcore.palletStatus=Pallet Status smfcore.palletStatus=Pallet Status
smfcore.tempLog=Temperature Log smfcore.tempLog=Temperature Log
smfcore.humidityLog=Humidity Log smfcore.humidityLog=Humidity Log
smfcore.SBSH1=SBSH1 smfcore.SBSH1=KTS-B004
smfcore.SBSH2=SBSH2 smfcore.SBSH2=KTS-B003
smfcore.SBDH1=SBDH1 smfcore.SBDH1=KTS-B001
smfcore.SBDH2=SBDH2 smfcore.SBDH2=KTS-B002
smfcore.SBDH3=SBDH3 smfcore.SBDH3=KTS-B005
smfcore.cl=CI smfcore.cl=CI
smfcore.mt=MT smfcore.mt=MT
smfcore.ml=MI1 smfcore.ml=MI1
......
...@@ -287,11 +287,11 @@ smfcore.statePage=Equipment Status ...@@ -287,11 +287,11 @@ smfcore.statePage=Equipment Status
smfcore.palletStatus=Pallet Status smfcore.palletStatus=Pallet Status
smfcore.tempLog=Temperature Log smfcore.tempLog=Temperature Log
smfcore.humidityLog=Humidity Log smfcore.humidityLog=Humidity Log
smfcore.SBSH1=SBSH1 smfcore.SBSH1=KTS-B004
smfcore.SBSH2=SBSH2 smfcore.SBSH2=KTS-B003
smfcore.SBDH1=SBDH1 smfcore.SBDH1=KTS-B001
smfcore.SBDH2=SBDH2 smfcore.SBDH2=KTS-B002
smfcore.SBDH3=SBDH3 smfcore.SBDH3=KTS-B005
smfcore.cl=CI smfcore.cl=CI
smfcore.mt=MT smfcore.mt=MT
smfcore.ml=MI1 smfcore.ml=MI1
......
...@@ -288,11 +288,11 @@ smfcore.statePage=Equipment Status ...@@ -288,11 +288,11 @@ smfcore.statePage=Equipment Status
smfcore.palletStatus=Pallet Status smfcore.palletStatus=Pallet Status
smfcore.tempLog=Temperature Log smfcore.tempLog=Temperature Log
smfcore.humidityLog=Humidity Log smfcore.humidityLog=Humidity Log
smfcore.SBSH1=SBSH1 smfcore.SBSH1=KTS-B004
smfcore.SBSH2=SBSH2 smfcore.SBSH2=KTS-B003
smfcore.SBDH1=SBDH1 smfcore.SBDH1=KTS-B001
smfcore.SBDH2=SBDH2 smfcore.SBDH2=KTS-B002
smfcore.SBDH3=SBDH3 smfcore.SBDH3=KTS-B005
smfcore.cl=CI smfcore.cl=CI
smfcore.mt=MT smfcore.mt=MT
smfcore.ml=MI1 smfcore.ml=MI1
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!