盘点测试优化

main
judy 1 year ago
parent bdfe3567eb
commit 0ee63a1947
  1. 5
      shkj-wms/src/main/java/com/shkj/wms/bo/BusinStockInvQueryBo.java
  2. 3
      shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java
  3. 2
      shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java
  4. 4
      shkj-wms/src/main/java/com/shkj/wms/utils/IntIdUtil.java
  5. 2
      shkj-wms/src/main/java/com/shkj/wms/vo/StockLocationInvVo.java
  6. 4
      shkj-wms/src/main/resources/mapper/wms/BusinStockInvMapper.xml

@ -66,5 +66,10 @@ public class BusinStockInvQueryBo extends BaseEntity {
*/
private String invStatus;
/**
* 货位ID
*/
private Long locationId;
}

@ -523,6 +523,9 @@ public class PlcEventTask {
Object temp = redisTemplate.opsForValue().get(RedisConstant.redisSTKWare + taskId);
redisTaskId = ObjectUtils.isNotEmpty(temp) ? Long.valueOf(temp.toString()) : 0L;
}
log.info("堆垛机的数据:taskId="+taskId+" redisTaskId="+redisTaskId);
String tunnel = "";
//判断redis中是否已有此任务号,如果有则不再执行;
if (taskId != 0 && !redisTaskId.equals(taskId) && readValue == 1) {

@ -1722,7 +1722,7 @@ public class ScheduledTasks {
plcToLayerMap.put("SHORT", baseLocation.getLayer());
allMap.put(plcToLayer, plcToLayerMap);
Map<String, Object> plcMLMap = new HashMap<>(1);
plcMLMap.put("Short", 4);
plcMLMap.put("Short", 7);
allMap.put(plcml, plcMLMap);
PLCReadAndWrite plcReadAndWrite = new PLCReadAndWrite();

@ -26,7 +26,7 @@ public class IntIdUtil {
if (seq > ROTATION) {
seq = 0;
}
String str = String.format("%1$01d", seq++);
String str = String.format("%1$02d", seq++);
SpringUtils.getBean(RedisCache.class).setCacheObject("seq", seq);
System.out.println("redis的值为"+seq);
return str;
@ -38,7 +38,7 @@ public class IntIdUtil {
// 因为int的最大数是2147483647 所以前2位=当前年-10
String yearStr = now.getYear() - 10 + "";
yearStr = yearStr.substring(2);
StringBuilder id = new StringBuilder(yearStr + String.format("%1$01d", now.getDayOfYear() )+ next());
StringBuilder id = new StringBuilder(yearStr + String.format("%1$02d", now.getDayOfYear() )+ next());
return Long.parseLong(id.toString());
}

@ -44,5 +44,5 @@ public class StockLocationInvVo implements Serializable {
/**
* 保险杠数量
*/
private String goodQty;
private Integer goodQty;
}

@ -39,7 +39,7 @@
<select id="queryList" resultType="com.shkj.wms.vo.BusinStockInvVo"
parameterType="com.shkj.wms.bo.BusinStockInvQueryBo">
SELECT
si.id as invId, loc.id as locationId,loc.location_code,goods.vehiche_model,goods.color,loc.location_status,count(stock.id) goodQty
si.id as invId, loc.id as locationId,loc.location_code,goods.vehiche_model,goods.color,loc.location_status, sum(case when stock.goods_no is null then 0 else 1 end ) as goodQty
FROM
busin_stock_inv si
JOIN base_location loc ON si.location_id = loc.id
@ -202,7 +202,7 @@
<select id="queryLocatonStocklist" resultType="com.shkj.wms.vo.StockLocationInvVo"
parameterType="com.shkj.wms.bo.BusinStockInvLocQueryBo">
select loc.id as locationId, loc.location_code,goods.vehiche_model,goods.color,loc.location_status,count(stock.id) goodQty
select loc.id as locationId, loc.location_code,goods.vehiche_model,goods.color,loc.location_status, sum(case when stock.goods_no is null then 0 else 1 end ) as goodQty
from base_location loc
left join sys_stock_detail stock on loc.id =stock.location_id
left join base_goods_data goods on stock.goods_no=goods.goods_no

Loading…
Cancel
Save