|
@@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -64,8 +65,31 @@ public class WmspGridMaterialServiceImpl implements IWmspGridMaterialService {
|
|
}
|
|
}
|
|
//查询实时库存数据
|
|
//查询实时库存数据
|
|
@Override
|
|
@Override
|
|
- public List<Map<String, Object>> selectGridMaterial(Map<String, Object> mapval) {
|
|
|
|
- return wmspGridMaterialMapper.selectGridMaterial(mapval);
|
|
|
|
|
|
+ public List<Map<String, Object>> selectGridMaterial(Map<String, Object> mapval,Integer warehouseId) {
|
|
|
|
+ // 通过当前时间获得前一个月的时间
|
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ Calendar cal= Calendar.getInstance();
|
|
|
|
+ cal.add(Calendar.MONTH, -1);
|
|
|
|
+ long date2 = cal.getTimeInMillis();
|
|
|
|
+ String newDate=simpleDateFormat.format(new Date(date2));
|
|
|
|
+ mapval.put("warehouseId",warehouseId);
|
|
|
|
+ List<Map<String ,Object>> list1 = wmspGridMaterialMapper.selectGridMaterial(mapval);
|
|
|
|
+ mapval.put("newDate",newDate);
|
|
|
|
+ List<Map<String ,Object>> list2 = wmspGridMaterialMapper.getGridMaterialAgeList(mapval);
|
|
|
|
+ for (Map<String,Object> map1:list1){
|
|
|
|
+ Integer status = 0;
|
|
|
|
+ for (Map<String,Object> map2:list2){
|
|
|
|
+ String onlyCode1 = (String) map1.get("materialOnlyCode");
|
|
|
|
+ String onlyCode2 = (String) map2.get("onlyCode");
|
|
|
|
+// 当两个onlyeCode相等时,设置状态
|
|
|
|
+ if (onlyCode1.equals(onlyCode2)){
|
|
|
|
+// 设置状态为入库预警超过界限
|
|
|
|
+ status = 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ map1.put("status",status);
|
|
|
|
+ }
|
|
|
|
+ return list1;
|
|
}
|
|
}
|
|
//根据仓储网格统计数据
|
|
//根据仓储网格统计数据
|
|
@Override
|
|
@Override
|
|
@@ -221,7 +245,8 @@ public class WmspGridMaterialServiceImpl implements IWmspGridMaterialService {
|
|
|
|
|
|
// 4、改变当前订单中已经稽核的吊牌的状态,改为已倒垛
|
|
// 4、改变当前订单中已经稽核的吊牌的状态,改为已倒垛
|
|
// 根据吊牌扫描结果查找对应的吊牌扫描实绩Id
|
|
// 根据吊牌扫描结果查找对应的吊牌扫描实绩Id
|
|
- BigDecimal resultId=wmspRestackScanResultMapper.getResultId(content);
|
|
|
|
|
|
+ List<Map<String,Object>> list1=wmspRestackScanResultMapper.getResultId(new BigDecimal(content));
|
|
|
|
+ BigDecimal resultId =(BigDecimal) list1.get(0).get("resultId");
|
|
WmspRestackScanResult wmspRestackScanResult = new WmspRestackScanResult();
|
|
WmspRestackScanResult wmspRestackScanResult = new WmspRestackScanResult();
|
|
wmspRestackScanResult.setResultId(resultId);
|
|
wmspRestackScanResult.setResultId(resultId);
|
|
wmspRestackScanResult.setStatus(new BigDecimal(1));
|
|
wmspRestackScanResult.setStatus(new BigDecimal(1));
|
|
@@ -406,17 +431,53 @@ public class WmspGridMaterialServiceImpl implements IWmspGridMaterialService {
|
|
rmsPwarehouseGrid.setGridId((BigDecimal) map.get("gridId"));
|
|
rmsPwarehouseGrid.setGridId((BigDecimal) map.get("gridId"));
|
|
rmsPwarehouseGrid.setGridGradationNumber(new BigDecimal(CC));
|
|
rmsPwarehouseGrid.setGridGradationNumber(new BigDecimal(CC));
|
|
rmsPwarehouseGrid.setGridSequenceNumber(new BigDecimal(CX));
|
|
rmsPwarehouseGrid.setGridSequenceNumber(new BigDecimal(CX));
|
|
- rmsPwarehouseGridMapper.updateByPrimaryKeySelective(rmsPwarehouseGrid);
|
|
|
|
|
|
+ i+= rmsPwarehouseGridMapper.updateByPrimaryKeySelective(rmsPwarehouseGrid);
|
|
|
|
|
|
// 3.修改倒垛单的数量
|
|
// 3.修改倒垛单的数量
|
|
// 创建倒垛实绩表
|
|
// 创建倒垛实绩表
|
|
|
|
+ WmspRestackMakeResult wmspRestackMakeResult = new WmspRestackMakeResult();
|
|
|
|
+ BigDecimal quantitys = (BigDecimal) map.get("quantity");
|
|
|
|
+ BigDecimal quantity = quantitys.subtract(new BigDecimal(1));
|
|
|
|
+ wmspRestackMakeResult.setQuantity(quantity);
|
|
|
|
+ wmspRestackMakeResult.setResultId((BigDecimal) map.get("restackId"));
|
|
|
|
+ i+= wmspRestackMakeResultMapper.updateByPrimaryKeySelective(wmspRestackMakeResult);
|
|
// 4.判断当前倒垛单剩余数量是否小于等于0(小于则修改所有的符合条件的倒垛单状态),并且逻辑删除当前倒垛单
|
|
// 4.判断当前倒垛单剩余数量是否小于等于0(小于则修改所有的符合条件的倒垛单状态),并且逻辑删除当前倒垛单
|
|
- BigDecimal quantity =(BigDecimal) map.get("quantity");
|
|
|
|
- if (quantity.compareTo(new BigDecimal(0))==-1){
|
|
|
|
|
|
+
|
|
|
|
+ if (quantity.compareTo(new BigDecimal(0))==-1){
|
|
// 当数量小于零的时候,将所有的入库扫描的实绩状态都变成已倒垛
|
|
// 当数量小于零的时候,将所有的入库扫描的实绩状态都变成已倒垛
|
|
- }
|
|
|
|
|
|
+// 查询该订单下的所有未倒垛的的订单
|
|
|
|
+ List<Map<String,Object>> list1 = wmspRestackScanResultMapper.getResultId((BigDecimal) map.get("restackId"));
|
|
|
|
+// 创建入库扫描实体类
|
|
|
|
+ for (Map<String,Object> map2:list1){
|
|
|
|
+ BigDecimal resultId = (BigDecimal) map2.get("resultId");
|
|
|
|
+ WmspRestackScanResult wmspRestackScanResult = new WmspRestackScanResult();
|
|
|
|
+ wmspRestackScanResult.setResultId(resultId);
|
|
|
|
+ wmspRestackMakeResult.setResultStatus(new BigDecimal(1));
|
|
|
|
+ i+=wmspRestackScanResultMapper.updateByPrimaryKeySelective(wmspRestackScanResult);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+// 将该订单的状态变为已完成
|
|
|
|
+ WmspRestackMakeResult wmspRestackMakeResult1 = new WmspRestackMakeResult();
|
|
|
|
+ wmspRestackMakeResult1.setResultId((BigDecimal) map.get("restackId"));
|
|
|
|
+ wmspRestackMakeResult1.setResultStatus(new BigDecimal(1));
|
|
|
|
+ i+= wmspRestackMakeResultMapper.updateByPrimaryKeySelective(wmspRestackMakeResult1);
|
|
|
|
+ }
|
|
|
|
+ return i;
|
|
}
|
|
}
|
|
- return 0;
|
|
|
|
|
|
+ return i;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<Map<String, Object>> getGridMaterialAgeList(Map<String,Object> mapVal,Integer warehouseId) {
|
|
|
|
+// 通过当前时间获得前一个月的时间
|
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ Calendar cal= Calendar.getInstance();
|
|
|
|
+ cal.add(Calendar.MONTH, -1);
|
|
|
|
+ long date2 = cal.getTimeInMillis();
|
|
|
|
+ String newDate=simpleDateFormat.format(new Date(date2));
|
|
|
|
+ mapVal.put("warehouseId",warehouseId);
|
|
|
|
+ mapVal.put("newDate",newDate);
|
|
|
|
+ List<Map<String, Object>> list =wmspGridMaterialMapper.getGridMaterialAgeList(mapVal);
|
|
|
|
+ return list;
|
|
}
|
|
}
|
|
}
|
|
}
|