|
@@ -51,113 +51,118 @@ public class WmspSendReceiveServiceImpl implements IWmspSendReceiveService {
|
|
|
return wmspSendReceiveMapper.getMaterialId(materialSteelId);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- @Scheduled(cron = "0 0 0 * * ? ")
|
|
|
- public int addSendReceive() {
|
|
|
- int i=0;
|
|
|
- WmspSendReceive wmspSendReceive = new WmspSendReceive();
|
|
|
-
|
|
|
- List<Map<String, Object>> mapList = rmsWarehouseMapper.getWarehouseName();
|
|
|
-
|
|
|
- for(Map<String,Object> map:mapList){
|
|
|
- BigDecimal warehouseId = DataChange.dataToBigDecimal(map.get("id"));
|
|
|
-
|
|
|
- List<Map<String,Object>> materialIdList = wmspGridMaterialMapper.getMaterialId(warehouseId);
|
|
|
- for(Map<String,Object> map1:materialIdList){
|
|
|
-
|
|
|
- BigDecimal sendReceiveId = wmspSendReceiveMapper.getSendReceiveId();
|
|
|
- wmspSendReceive.setSendReceiveId(sendReceiveId);
|
|
|
-
|
|
|
- wmspSendReceive.setWarehouseId(warehouseId);
|
|
|
-
|
|
|
- wmspSendReceive.setSendReceiveDate(new Date());
|
|
|
-
|
|
|
- BigDecimal materialId = DataChange.dataToBigDecimal(map1.get("materialId"));
|
|
|
- wmspSendReceive.setMaterialId(materialId);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- wmspSendReceive.setSendReceiveThisdayInbound(new BigDecimal(0));
|
|
|
-
|
|
|
-
|
|
|
- wmspSendReceive.setSendReceiveThisdayOutbound(new BigDecimal(0));
|
|
|
-
|
|
|
-
|
|
|
- Map<String,Object> map2 = new HashMap<>();
|
|
|
- map2.put("warehouseId",warehouseId);
|
|
|
- map2.put("materialId",materialId);
|
|
|
- BigDecimal sendReceiveLastdayInventory = wmspSendReceiveMapper.getSendReceiveLastdayInventory(map2);
|
|
|
- if(sendReceiveLastdayInventory == null){
|
|
|
- wmspSendReceive.setSendReceiveLastdayInventory(new BigDecimal(0));
|
|
|
- }else{
|
|
|
- wmspSendReceive.setSendReceiveLastdayInventory(sendReceiveLastdayInventory);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- wmspSendReceive.setSendReceiveThisdayInventory(wmspSendReceive.getSendReceiveLastdayInventory());
|
|
|
- wmspSendReceive.setInsertUsername("admin");
|
|
|
- wmspSendReceive.setInsertTime(new Date());
|
|
|
- wmspSendReceive.setDeleted(new BigDecimal(1));
|
|
|
- i+=wmspSendReceiveMapper.insertSelective(wmspSendReceive);
|
|
|
- }
|
|
|
- }
|
|
|
- return i;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- public int addInBoundSendReceive(Map<String,Object> map){
|
|
|
-
|
|
|
- return wmspSendReceiveMapper.updateSendReceiveThisdayInbound(map);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- public int addOutBoundSendReceive(Map<String,Object> map){
|
|
|
-
|
|
|
- return wmspSendReceiveMapper.updateSendReceiveThisdayOutbound(map);
|
|
|
+ @Override
|
|
|
+ public int getTodaySendReceiveCount() {
|
|
|
+ return wmspSendReceiveMapper.getTodaySendReceiveCount();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public int addThisdayInventorySendReceive(Map<String,Object> map){
|
|
|
- BigDecimal materialId = DataChange.dataToBigDecimal(map.get("materialId"));
|
|
|
- BigDecimal warehouseId = DataChange.dataToBigDecimal(map.get("warehouseId"));
|
|
|
-
|
|
|
- BigDecimal sendReceiveThisdayInbound = wmspSendReceiveMapper.selectSendReceiveThisdayInbound(map);
|
|
|
- if(sendReceiveThisdayInbound == null){
|
|
|
- sendReceiveThisdayInbound = new BigDecimal(0);
|
|
|
- }
|
|
|
-
|
|
|
- BigDecimal sendReceiveThisdayOutbound = wmspSendReceiveMapper.selectSendReceiveThisdayOutbound(map);
|
|
|
- if(sendReceiveThisdayOutbound == null){
|
|
|
- sendReceiveThisdayOutbound = new BigDecimal(0);
|
|
|
- }
|
|
|
-
|
|
|
- BigDecimal sendReceiveLastdayInventory = wmspSendReceiveMapper.getSendReceiveLastdayInventory(map);
|
|
|
- if(sendReceiveLastdayInventory == null){
|
|
|
- sendReceiveLastdayInventory=new BigDecimal(0);
|
|
|
+
|
|
|
+
|
|
|
+ @Scheduled(cron = "0 0 0 * * ? ")
|
|
|
+ public int addSendReceive() {
|
|
|
+ int i=0;
|
|
|
+ WmspSendReceive wmspSendReceive = new WmspSendReceive();
|
|
|
+
|
|
|
+ List<Map<String, Object>> mapList = rmsWarehouseMapper.getWarehouseName();
|
|
|
+
|
|
|
+ for(Map<String,Object> map:mapList){
|
|
|
+ BigDecimal warehouseId = DataChange.dataToBigDecimal(map.get("id"));
|
|
|
+
|
|
|
+ List<Map<String,Object>> materialIdList = wmspGridMaterialMapper.getMaterialId(warehouseId);
|
|
|
+ for(Map<String,Object> map1:materialIdList){
|
|
|
+
|
|
|
+ BigDecimal sendReceiveId = wmspSendReceiveMapper.getSendReceiveId();
|
|
|
+ wmspSendReceive.setSendReceiveId(sendReceiveId);
|
|
|
+
|
|
|
+ wmspSendReceive.setWarehouseId(warehouseId);
|
|
|
+
|
|
|
+ wmspSendReceive.setSendReceiveDate(new Date());
|
|
|
+
|
|
|
+ BigDecimal materialId = DataChange.dataToBigDecimal(map1.get("materialId"));
|
|
|
+ wmspSendReceive.setMaterialId(materialId);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ wmspSendReceive.setSendReceiveThisdayInbound(new BigDecimal(0));
|
|
|
+
|
|
|
+
|
|
|
+ wmspSendReceive.setSendReceiveThisdayOutbound(new BigDecimal(0));
|
|
|
+
|
|
|
+
|
|
|
+ Map<String,Object> map2 = new HashMap<>();
|
|
|
+ map2.put("warehouseId",warehouseId);
|
|
|
+ map2.put("materialId",materialId);
|
|
|
+ BigDecimal sendReceiveLastdayInventory = wmspSendReceiveMapper.getSendReceiveLastdayInventory(map2);
|
|
|
+ if(sendReceiveLastdayInventory == null){
|
|
|
+ wmspSendReceive.setSendReceiveLastdayInventory(new BigDecimal(0));
|
|
|
+ }else{
|
|
|
+ wmspSendReceive.setSendReceiveLastdayInventory(sendReceiveLastdayInventory);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ wmspSendReceive.setSendReceiveThisdayInventory(wmspSendReceive.getSendReceiveLastdayInventory());
|
|
|
+ wmspSendReceive.setInsertUsername("admin");
|
|
|
+ wmspSendReceive.setInsertTime(new Date());
|
|
|
+ wmspSendReceive.setDeleted(new BigDecimal(1));
|
|
|
+ i+=wmspSendReceiveMapper.insertSelective(wmspSendReceive);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return i;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ public int addInBoundSendReceive(Map<String,Object> map){
|
|
|
+
|
|
|
+ return wmspSendReceiveMapper.updateSendReceiveThisdayInbound(map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public int addOutBoundSendReceive(Map<String,Object> map){
|
|
|
+
|
|
|
+ return wmspSendReceiveMapper.updateSendReceiveThisdayOutbound(map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public int addThisdayInventorySendReceive(Map<String,Object> map){
|
|
|
+ BigDecimal materialId = DataChange.dataToBigDecimal(map.get("materialId"));
|
|
|
+ BigDecimal warehouseId = DataChange.dataToBigDecimal(map.get("warehouseId"));
|
|
|
+
|
|
|
+ BigDecimal sendReceiveThisdayInbound = wmspSendReceiveMapper.selectSendReceiveThisdayInbound(map);
|
|
|
+ if(sendReceiveThisdayInbound == null){
|
|
|
+ sendReceiveThisdayInbound = new BigDecimal(0);
|
|
|
}
|
|
|
-
|
|
|
- BigDecimal sendReceiveThisdayInventory = new BigDecimal(sendReceiveLastdayInventory.intValue()
|
|
|
- +sendReceiveThisdayInbound.intValue()-sendReceiveThisdayOutbound.intValue());
|
|
|
- Map<String,Object> map1 = new HashMap<>();
|
|
|
- map1.put("materialId",materialId);
|
|
|
- map1.put("warehouseId",warehouseId);
|
|
|
- map1.put("sendReceiveThisdayInventory",sendReceiveThisdayInventory);
|
|
|
- return wmspSendReceiveMapper.updateSendReceiveThisdayInventory(map1);
|
|
|
-
|
|
|
- }
|
|
|
-*/
|
|
|
+
|
|
|
+ BigDecimal sendReceiveThisdayOutbound = wmspSendReceiveMapper.selectSendReceiveThisdayOutbound(map);
|
|
|
+ if(sendReceiveThisdayOutbound == null){
|
|
|
+ sendReceiveThisdayOutbound = new BigDecimal(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ BigDecimal sendReceiveLastdayInventory = wmspSendReceiveMapper.getSendReceiveLastdayInventory(map);
|
|
|
+ if(sendReceiveLastdayInventory == null){
|
|
|
+ sendReceiveLastdayInventory=new BigDecimal(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ BigDecimal sendReceiveThisdayInventory = new BigDecimal(sendReceiveLastdayInventory.intValue()
|
|
|
+ +sendReceiveThisdayInbound.intValue()-sendReceiveThisdayOutbound.intValue());
|
|
|
+ Map<String,Object> map1 = new HashMap<>();
|
|
|
+ map1.put("materialId",materialId);
|
|
|
+ map1.put("warehouseId",warehouseId);
|
|
|
+ map1.put("sendReceiveThisdayInventory",sendReceiveThisdayInventory);
|
|
|
+ return wmspSendReceiveMapper.updateSendReceiveThisdayInventory(map1);
|
|
|
+
|
|
|
+ }
|
|
|
+ */
|
|
|
|
|
|
@Override
|
|
|
public int addSendReceive(){
|
|
|
- WmspSendReceive wmspSendReceive = new WmspSendReceive();
|
|
|
+
|
|
|
int i = 0;
|
|
|
|
|
|
List<Map<String, Object>> mapList = rmsWarehouseMapper.getWarehouseName();
|
|
@@ -167,6 +172,7 @@ public class WmspSendReceiveServiceImpl implements IWmspSendReceiveService {
|
|
|
|
|
|
List<Map<String,Object>> materialIdList = wmspGridMaterialMapper.getMaterialId(warehouseId);
|
|
|
for(Map<String,Object> map1:materialIdList) {
|
|
|
+ WmspSendReceive wmspSendReceive = new WmspSendReceive();
|
|
|
|
|
|
BigDecimal sendReceiveId = wmspSendReceiveMapper.getSendReceiveId();
|
|
|
wmspSendReceive.setSendReceiveId(sendReceiveId);
|