Переглянути джерело

Merge branch 'master' of https://git.steerinfo.com/luobang/DIL-DAZHOU-WMS2

胡半仙 3 роки тому
батько
коміт
15472574e0

+ 0 - 15
src/main/java/com/steerinfo/dil/controller/WmspInventoryCloseController.java

@@ -11,7 +11,6 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -48,14 +47,12 @@ public class WmspInventoryCloseController extends BaseRESTfulController {
                                                Integer apiId,
                                                Integer pageNum,
                                                Integer pageSize,
-                                               Integer warehouseId,
                                                String  value){
             if(mapValue == null){
                 mapValue = new HashMap<>();
             }
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
             String sd = sdf.format(new Date(Long.parseLong(value))); // 时间戳转换日期
-            mapValue.put("warehouseId",warehouseId);
             mapValue.put("value",sd);
             List<Map<String,Object>>inventoryCloseList = wmspInventoryCloseServiceImpl.getWmspInventoryClose(mapValue);
             /*分页*/
@@ -65,16 +62,4 @@ public class WmspInventoryCloseController extends BaseRESTfulController {
             return success(pageList);
     }
 
-    //库存结转(在每个月的25号11点45时结算一个月的数据)
-    @PostMapping("/addInventoryClose")
-    @Scheduled(cron =  "3 45 23 25 * ? ")
-    @ApiOperation(value = "库存结转")
-    public RESTfulResult addInventoryClose(){
-            int result = 0;
-            int count = wmspInventoryCloseServiceImpl.getClose();
-            if(count == 0) {
-                result = wmspInventoryCloseServiceImpl.addInventoryClose();
-            }
-            return success(result);
-    }
 }

+ 0 - 19
src/main/java/com/steerinfo/dil/controller/WmspSendReceiveController.java

@@ -12,7 +12,6 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -55,7 +54,6 @@ public class WmspSendReceiveController extends BaseRESTfulController {
                                            Integer pageNum,
                                            Integer pageSize,
                                            String  con,
-                                           Integer warehouseId,
                                            String startTime,
                                            String endTime
                                         ){
@@ -65,7 +63,6 @@ public class WmspSendReceiveController extends BaseRESTfulController {
         if(mapValue == null){
             mapValue =new HashMap<>();
         }
-        mapValue.put("warehouseId",warehouseId);
         DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
         List<Map<String,Object>> sendReceiveList = iWmspSendReceiveService.getWmspSendReceiveService(mapValue);
 
@@ -83,21 +80,5 @@ public class WmspSendReceiveController extends BaseRESTfulController {
         return success(result);
     }*/
 
-    /**
-     * 这整各模块会在linux系统中的tomcat加载两次,所有定时器可能会执行两次,或者是由于定时器的方法执行太快,一秒内执行了
-     * @return
-     * @throws InterruptedException
-     */
-    @PostMapping("addSendReceive")
-    @Scheduled(cron =  "1 45 23 * * ? ")
-    public synchronized RESTfulResult addSendReceive() throws InterruptedException {
-        int result=0;
-        int count =iWmspSendReceiveService.getTodaySendReceiveCount();
-        if (count==0)
-        {
-            result = iWmspSendReceiveService.addSendReceive();
-        }
 
-        return success(result);
-    }
 }

+ 53 - 48
src/main/java/com/steerinfo/dil/service/impl/WmspInventoryCloseServiceImpl.java

@@ -6,6 +6,7 @@ import com.steerinfo.dil.model.WmspInventoryClose;
 import com.steerinfo.dil.service.IWmspInventoryCloseService;
 import com.steerinfo.dil.util.DataChange;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
@@ -29,67 +30,71 @@ public class WmspInventoryCloseServiceImpl implements IWmspInventoryCloseService
     @Override
     public List<Map<String, Object>> getWmspInventoryClose(Map<String, Object> mapValue) {
         List<Map<String, Object>> maps = wmspInventoryCloseMapper.selectWmspInventoryClose(mapValue);
-
         return maps;
     }
 
     @Override
+    @Scheduled(cron =  "3 45 23 25 * ? ")
     public int addInventoryClose() {
         int i = 0;
-        //高线库,一棒库,二棒库,配送库
-        List<Map<String, Object>> mapList = rmsWarehouseMapper.getWarehouseName();
-        //遍历四个仓库
-        for(Map<String,Object> map:mapList) {
-            BigDecimal warehouseId = DataChange.dataToBigDecimal(map.get("id"));
-            //先获取收发存中的物资
-            List<Map<String,Object>> materialList = wmspInventoryCloseMapper.selectSendReceive(warehouseId);
-            for(Map<String,Object> map1:materialList){
-                WmspInventoryClose wmspInventoryClose = new WmspInventoryClose();
-                //主键自增
-                BigDecimal inventoryCloseId = wmspInventoryCloseMapper.addInventoryCloseId();
-                wmspInventoryClose.setCloseId(inventoryCloseId);
-                //增加仓库id
-                wmspInventoryClose.setWarehouseId(warehouseId);
-                //增加物资id
-                BigDecimal materialId = DataChange.dataToBigDecimal(map1.get("materialId"));
-                wmspInventoryClose.setMaterialId(materialId);
-                //获取一个仓库中的一种物资一个月之内的入库数据
-                BigDecimal closeThismonthInbound = wmspInventoryCloseMapper.selectCloseThismonthInbound(warehouseId,materialId);
-                if(closeThismonthInbound == null){
-                    wmspInventoryClose.setCloseThismonthInbound(new BigDecimal(0));
-                }else {
-                    wmspInventoryClose.setCloseThismonthInbound(closeThismonthInbound);
-                }
-                BigDecimal closeThismonthInbound1 = wmspInventoryClose.getCloseThismonthInbound();
-                //获取一个仓库的一种物资一个月之内的出库数据
-                BigDecimal closeThismonthOutbound = wmspInventoryCloseMapper.selectCloseThismonthOutbound(warehouseId,materialId);
-                if(closeThismonthOutbound == null){
-                    wmspInventoryClose.setCloseThismonthOutbound(new BigDecimal(0));
-                }else {
-                    wmspInventoryClose.setCloseThismonthOutbound(closeThismonthOutbound);
-                }
-                BigDecimal closeThismonthOutbound1 = wmspInventoryClose.getCloseThismonthOutbound();
-                //获取上一个月的一种物资的库存数据
-                BigDecimal closeLastmonthInventory = wmspInventoryCloseMapper.selectCloseLastmonthInventory(warehouseId,materialId);
-                if(closeLastmonthInventory==null){
-                    wmspInventoryClose.setCloseLastmonthInventory(new BigDecimal(0));
-                }else {
-                    wmspInventoryClose.setCloseLastmonthInventory(closeLastmonthInventory);
-                }
-                //获取一个仓库的一种物资一个月之内的总库存数据
-                BigDecimal closeLastmonthInventory1 = wmspInventoryClose.getCloseLastmonthInventory();
+        int count = wmspInventoryCloseMapper.getClose();
+        if(count == 0){
+            //高线库,一棒库,二棒库,配送库
+            List<Map<String, Object>> mapList = rmsWarehouseMapper.getWarehouseName();
+            //遍历四个仓库
+            for(Map<String,Object> map:mapList) {
+                BigDecimal warehouseId = DataChange.dataToBigDecimal(map.get("id"));
+                //先获取收发存中的物资
+                List<Map<String,Object>> materialList = wmspInventoryCloseMapper.selectSendReceive(warehouseId);
+                for(Map<String,Object> map1:materialList){
+                    WmspInventoryClose wmspInventoryClose = new WmspInventoryClose();
+                    //主键自增
+                    BigDecimal inventoryCloseId = wmspInventoryCloseMapper.addInventoryCloseId();
+                    wmspInventoryClose.setCloseId(inventoryCloseId);
+                    //增加仓库id
+                    wmspInventoryClose.setWarehouseId(warehouseId);
+                    //增加物资id
+                    BigDecimal materialId = DataChange.dataToBigDecimal(map1.get("materialId"));
+                    wmspInventoryClose.setMaterialId(materialId);
+                    //获取一个仓库中的一种物资一个月之内的入库数据
+                    BigDecimal closeThismonthInbound = wmspInventoryCloseMapper.selectCloseThismonthInbound(warehouseId,materialId);
+                    if(closeThismonthInbound == null){
+                        wmspInventoryClose.setCloseThismonthInbound(new BigDecimal(0));
+                    }else {
+                        wmspInventoryClose.setCloseThismonthInbound(closeThismonthInbound);
+                    }
+                    BigDecimal closeThismonthInbound1 = wmspInventoryClose.getCloseThismonthInbound();
+                    //获取一个仓库的一种物资一个月之内的出库数据
+                    BigDecimal closeThismonthOutbound = wmspInventoryCloseMapper.selectCloseThismonthOutbound(warehouseId,materialId);
+                    if(closeThismonthOutbound == null){
+                        wmspInventoryClose.setCloseThismonthOutbound(new BigDecimal(0));
+                    }else {
+                        wmspInventoryClose.setCloseThismonthOutbound(closeThismonthOutbound);
+                    }
+                    BigDecimal closeThismonthOutbound1 = wmspInventoryClose.getCloseThismonthOutbound();
+                    //获取上一个月的一种物资的库存数据
+                    BigDecimal closeLastmonthInventory = wmspInventoryCloseMapper.selectCloseLastmonthInventory(warehouseId,materialId);
+                    if(closeLastmonthInventory==null){
+                        wmspInventoryClose.setCloseLastmonthInventory(new BigDecimal(0));
+                    }else {
+                        wmspInventoryClose.setCloseLastmonthInventory(closeLastmonthInventory);
+                    }
+                    //获取一个仓库的一种物资一个月之内的总库存数据
+                    BigDecimal closeLastmonthInventory1 = wmspInventoryClose.getCloseLastmonthInventory();
                     BigDecimal closeThismonthInventory =
                             new BigDecimal(closeThismonthInbound1.intValue() - closeThismonthOutbound1.intValue() + closeLastmonthInventory1.intValue());
 
                     wmspInventoryClose.setCloseThismonthInventory(closeThismonthInventory);
 
-                wmspInventoryClose.setInsertTime(new Date());
-                wmspInventoryClose.setInsertUsername("admin");
-                wmspInventoryClose.setDeleted(new BigDecimal(1));
-                i+=wmspInventoryCloseMapper.insertSelective(wmspInventoryClose);
-            }
+                    wmspInventoryClose.setInsertTime(new Date());
+                    wmspInventoryClose.setInsertUsername("admin");
+                    wmspInventoryClose.setDeleted(new BigDecimal(1));
+                    i+=wmspInventoryCloseMapper.insertSelective(wmspInventoryClose);
+                }
 
+            }
         }
+
         return i;
     }
 

+ 60 - 55
src/main/java/com/steerinfo/dil/service/impl/WmspSendReceiveServiceImpl.java

@@ -8,6 +8,7 @@ import com.steerinfo.dil.model.WmspSendReceive;
 import com.steerinfo.dil.service.IWmspSendReceiveService;
 import com.steerinfo.dil.util.DataChange;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
@@ -161,70 +162,74 @@ public class WmspSendReceiveServiceImpl implements IWmspSendReceiveService {
  */
     //零点生成前一天的入库、出库、库存
     @Override
+    @Scheduled(cron =  "1 45 23 * * ? ")
     public int addSendReceive(){
-
         int i = 0;
-        //高线库,一棒库,二棒库,配送库
-        List<Map<String, Object>> mapList = rmsWarehouseMapper.getWarehouseName();
-        //遍历四个仓库
-        for(Map<String,Object> map:mapList){
-            BigDecimal warehouseId = DataChange.dataToBigDecimal(map.get("id"));
-            //查询去重实时库存中的物资id
-            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);
-                //仓库id
-                wmspSendReceive.setWarehouseId(warehouseId);
-                //收发层日期
-                wmspSendReceive.setSendReceiveDate(new Date());
-                //物资id
-                BigDecimal materialId = DataChange.dataToBigDecimal(map1.get("materialId"));
-                wmspSendReceive.setMaterialId(materialId);
-
-                Map<String,Object> map2 = new HashMap<>();
-                map2.put("warehouseId",warehouseId);
-                map2.put("materialId",materialId);
-                //统计今天的入库总数(只统计当前仓库没有预留的数量,不统计预留库的数量)
-                BigDecimal sendReceiveThisdayInbound = wmspSendReceiveMapper.countSndReceiveThisdayInbound(map2);
-                if(sendReceiveThisdayInbound == null){
-                    wmspSendReceive.setSendReceiveThisdayInbound(new BigDecimal(0));
-                }else{
-                    wmspSendReceive.setSendReceiveThisdayInbound(sendReceiveThisdayInbound);
-                }
-                BigDecimal sendReceiveThisdayInbound1 = wmspSendReceive.getSendReceiveThisdayInbound();
-                //统计今天天的出库总数
-                BigDecimal sendReceiveThisdayOutbound = wmspSendReceiveMapper.countSendReceiveThisdayOutbound(map2);
-                if(sendReceiveThisdayOutbound == null){
-                    wmspSendReceive.setSendReceiveThisdayOutbound(new BigDecimal(0));
-                }else {
-                    wmspSendReceive.setSendReceiveThisdayOutbound(sendReceiveThisdayOutbound);
-                }
-                BigDecimal sendReceiveThisdayOutbound1 = wmspSendReceive.getSendReceiveThisdayOutbound();
-                //昨天库存
-                BigDecimal sendReceiveLastdayInventory = wmspSendReceiveMapper.getSendReceiveLastdayInventory(map2);
-                if(sendReceiveLastdayInventory == null){
-                    wmspSendReceive.setSendReceiveLastdayInventory(new BigDecimal(0));
-                }else{
-                    wmspSendReceive.setSendReceiveLastdayInventory(sendReceiveLastdayInventory);
-                }
-
-                BigDecimal sendReceiveLastdayInventory1 = wmspSendReceive.getSendReceiveLastdayInventory();
+        int count = wmspSendReceiveMapper.getTodaySendReceiveCount();
+        if(count == 0){
+            //高线库,一棒库,二棒库,配送库
+            List<Map<String, Object>> mapList = rmsWarehouseMapper.getWarehouseName();
+            //遍历四个仓库
+            for(Map<String,Object> map:mapList){
+                BigDecimal warehouseId = DataChange.dataToBigDecimal(map.get("id"));
+                //查询去重实时库存中的物资id
+                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);
+                    //仓库id
+                    wmspSendReceive.setWarehouseId(warehouseId);
+                    //收发层日期
+                    wmspSendReceive.setSendReceiveDate(new Date());
+                    //物资id
+                    BigDecimal materialId = DataChange.dataToBigDecimal(map1.get("materialId"));
+                    wmspSendReceive.setMaterialId(materialId);
+
+                    Map<String,Object> map2 = new HashMap<>();
+                    map2.put("warehouseId",warehouseId);
+                    map2.put("materialId",materialId);
+                    //统计今天的入库总数(只统计当前仓库没有预留的数量,不统计预留库的数量)
+                    BigDecimal sendReceiveThisdayInbound = wmspSendReceiveMapper.countSndReceiveThisdayInbound(map2);
+                    if(sendReceiveThisdayInbound == null){
+                        wmspSendReceive.setSendReceiveThisdayInbound(new BigDecimal(0));
+                    }else{
+                        wmspSendReceive.setSendReceiveThisdayInbound(sendReceiveThisdayInbound);
+                    }
+                    BigDecimal sendReceiveThisdayInbound1 = wmspSendReceive.getSendReceiveThisdayInbound();
+                    //统计今天天的出库总数
+                    BigDecimal sendReceiveThisdayOutbound = wmspSendReceiveMapper.countSendReceiveThisdayOutbound(map2);
+                    if(sendReceiveThisdayOutbound == null){
+                        wmspSendReceive.setSendReceiveThisdayOutbound(new BigDecimal(0));
+                    }else {
+                        wmspSendReceive.setSendReceiveThisdayOutbound(sendReceiveThisdayOutbound);
+                    }
+                    BigDecimal sendReceiveThisdayOutbound1 = wmspSendReceive.getSendReceiveThisdayOutbound();
+                    //昨天库存
+                    BigDecimal sendReceiveLastdayInventory = wmspSendReceiveMapper.getSendReceiveLastdayInventory(map2);
+                    if(sendReceiveLastdayInventory == null){
+                        wmspSendReceive.setSendReceiveLastdayInventory(new BigDecimal(0));
+                    }else{
+                        wmspSendReceive.setSendReceiveLastdayInventory(sendReceiveLastdayInventory);
+                    }
+
+                    BigDecimal sendReceiveLastdayInventory1 = wmspSendReceive.getSendReceiveLastdayInventory();
 
                     //今天库存
-                BigDecimal sendReceiveThisdayInventory = new BigDecimal(sendReceiveLastdayInventory1.intValue()
-                                +sendReceiveThisdayInbound1.intValue()-sendReceiveThisdayOutbound1.intValue());
+                    BigDecimal sendReceiveThisdayInventory = new BigDecimal(sendReceiveLastdayInventory1.intValue()
+                            +sendReceiveThisdayInbound1.intValue()-sendReceiveThisdayOutbound1.intValue());
 
                     wmspSendReceive.setSendReceiveThisdayInventory(sendReceiveThisdayInventory);
 
-                wmspSendReceive.setInsertUsername("admin");
-                wmspSendReceive.setInsertTime(new Date());
-                wmspSendReceive.setDeleted(new BigDecimal(1));
-                i+=wmspSendReceiveMapper.insertSelective(wmspSendReceive);
+                    wmspSendReceive.setInsertUsername("admin");
+                    wmspSendReceive.setInsertTime(new Date());
+                    wmspSendReceive.setDeleted(new BigDecimal(1));
+                    i+=wmspSendReceiveMapper.insertSelective(wmspSendReceive);
+                }
             }
         }
+
         return i;
     }
 

+ 44 - 57
src/main/resources/com/steerinfo/dil/mapper/WmspIntransitInventoryMapper.xml

@@ -367,63 +367,50 @@
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
   <select id="selectTransitInventory" resultType="java.util.LinkedHashMap" parameterType="java.util.Map">
-    select
---            运力编号
-            RC.CAPACITY_NUMBER "number",
---             车皮号
-            OOT.ORDER_WAGON_NO "No",
---            发运计划号
-            ARD.DAYPLAN_NO "dayplanNo",
---            运输订单号
-            OO.ORDER_NUMBER "orderNumber",
---            物资编码
-            RM.MATERIAL_CODE "materialCode",
---            物资名称
-            RM.MATERIAL_NAME "materialName",
---            物资规格加型号
-            RM.MATERIAL_SPECIFICATION || '(' || RM.MATERIAL_MODEL || ')' "specification",
---            物资生产下线重量
-            RMS.MATERIAL_SINGLE_BUNDLE_WEIGHT  "bundleWeight",
---            物资理重
-            RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
---            物资件数
-            OOM.ORDER_MATERIAL_NUMBER "materialNumber",
---            磅单号
-            TWR.RESULT_POUND_NO "poundNo",
---            仓库名称
-            RW.WAREHOUSE_NAME "warehouseName",
---            物资入库时间
-            WII.INSERT_TIME "insertTime"
-
-           from WMSP_INTRANSIT_INVENTORY WII
-           left join  AMSTRUCK_RAIL_DAYPLAN ARD
-           on ARD.DAYPLAN_ID=WII.RAIL_DAYPLAY_ID
-           left  join OMSTRUCK_ORDER OO
-           on OO.ORDER_ID=WII.ORDER_ID
-           left join OMSTRUCK_ORDER_MATERIAL OOM
-           on OOM.ORDER_ID=OO.ORDER_ID
-           left join RMS_CAPACITY RC
-           on RC.CAPACITY_ID=OO.CAPACITY_ID
-           left join  OMSTRAIN_ORDER OOT
-           on  WII.ORDER_ID=OO.ORDER_ID
-           left join  WMSP_GRID_MATERIAL WGM
-           on WGM.MATERIAL_ID=OOM.MATERIAL_ID
-           left join RMS_MATERIAL_STEEL RMS
-           on RMS.MATERIAL_STEEL_ID=WGM.MATERIAL_ID
-           left join RMS_MATERIAL RM
-           on RM.MATERIAL_ID=RMS.MATERIAL_ID
-           left join RMS_PWAREHOUSE_GRID RPG
-           on RPG.GRID_ID=WGM.GRID_ID
-           left join RMS_WAREHOUSE RW
-           on RW.WAREHOUSE_ID=RPG.WAREHOUSE_ID
-           left join RMS_WAREHOUSE_TYPE RWT
-           on RWT.WAREHOUSE_TYPE_ID=RW.WAREHOUSE_TYPE_ID
-           left join TMSTRUCK_TOTAL_RESULT TTR
-           on OO.ORDER_ID=TTR.ORDER_ID
-           left join TMSTRUCK_WEIGHT_RESULT TWR
-           on TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
-           where RW.WAREHOUSE_TYPE_ID=2
-<where>
+    select * from (
+    select RC.CAPACITY_NUMBER "number",
+    OOT.ORDER_WAGON_NO "No",
+    ARD.DAYPLAN_NO "dayplanNo",
+    OO.ORDER_NUMBER "orderNumber",
+    RM.MATERIAL_CODE "materialCode",
+    RM.MATERIAL_NAME "materialName",
+    RM.MATERIAL_SPECIFICATION || '(' || RM.MATERIAL_MODEL || ')' "specification",
+    RMS.MATERIAL_SINGLE_BUNDLE_WEIGHT "bundleWeight",
+    RMS.MATERIAL_THEORETICAL_WEIGHT "theoreticalWeight",
+    OOM.ORDER_MATERIAL_NUMBER "materialNumber",
+    TWR.RESULT_POUND_NO "poundNo",
+    RW.WAREHOUSE_NAME "warehouseName",
+    WII.INSERT_TIME "insertTime"
+    from WMSP_INTRANSIT_INVENTORY WII
+    left join AMSTRUCK_RAIL_DAYPLAN ARD
+    on ARD.DAYPLAN_ID=WII.RAIL_DAYPLAY_ID
+    left join OMSTRUCK_ORDER OO
+    on OO.ORDER_ID=WII.ORDER_ID
+    left join OMSTRUCK_ORDER_MATERIAL OOM
+    on OOM.ORDER_ID=OO.ORDER_ID
+    left join RMS_CAPACITY RC
+    on RC.CAPACITY_ID=OO.CAPACITY_ID
+    left join OMSTRAIN_ORDER OOT
+    on WII.ORDER_ID=OO.ORDER_ID
+    left join RMS_MATERIAL RM
+    on RM.MATERIAL_ID = OOM.MATERIAL_ID
+    left join RMS_MATERIAL_STEEL RMS
+    on RMS.MATERIAL_ID =RM.MATERIAL_ID
+    left join WMSP_GRID_MATERIAL WGM
+    on WGM.MATERIAL_ID = RMS.MATERIAL_STEEL_ID
+    left join RMS_PWAREHOUSE_GRID RPG
+    on RPG.GRID_ID=WGM.GRID_ID
+    left join RMS_WAREHOUSE RW
+    on RW.WAREHOUSE_ID=RPG.WAREHOUSE_ID
+    left join RMS_WAREHOUSE_TYPE RWT
+    on RWT.WAREHOUSE_TYPE_ID=RW.WAREHOUSE_TYPE_ID
+    left join TMSTRUCK_TOTAL_RESULT TTR
+    on OO.ORDER_ID=TTR.ORDER_ID
+    left join TMSTRUCK_WEIGHT_RESULT TWR
+    on TWR.RESULT_TOTAL_ID=TTR.RESULT_TOTAL_ID
+    where RW.WAREHOUSE_TYPE_ID=2 and OO.ORDER_STATUS = 5 and TWR.RESULT_GROSS_WEIGHT is not null
+    )
+    <where>
   <if test="number!= null">
     and
     <foreach collection="number" item="item" open="(" separator="or" close=")">

+ 16 - 17
src/main/resources/com/steerinfo/dil/mapper/WmspInventoryCloseMapper.xml

@@ -446,24 +446,23 @@
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
   <select id="selectWmspInventoryClose" resultType="java.util.LinkedHashMap">
+    select * from (
     select
-          rw.warehouse_name "warehouse_name",
-          rm.material_name "material_name",
-          wpic.close_lastmonth_inventory "close_lastmonth_inventory",
-          wpic.close_thismonth_inbound "close_thismonth_inbound",
-          wpic.close_thismonth_outbound "close_thismonth_outbound",
-          wpic.close_thismonth_inventory "close_thismonth_inventory"
-   from
-          wmsp_inventory_close wpic
-  join rms_material rm
-  on rm.material_id=wpic.material_id
-  join rms_warehouse rw
-  on rw.warehouse_id=wpic.warehouse_id
-  where wpic.WAREHOUSE_ID = #{warehouseId}
-    <if test="value!=null">
-      and #{value}= to_char(wpic.INSERT_TIME,'yyyy-mm')
-    </if>
-
+    rw.warehouse_name "warehouse_name",
+    rm.MATERIAL_NAME || rm.MATERIAL_SPECIFICATION || '(' ||
+    rm.MATERIAL_MODEL || ')' "material_name",
+    wpic.close_lastmonth_inventory "close_lastmonth_inventory",
+    wpic.close_thismonth_inbound "close_thismonth_inbound",
+    wpic.close_thismonth_outbound "close_thismonth_outbound",
+    wpic.close_thismonth_inventory "close_thismonth_inventory"
+    from
+    wmsp_inventory_close wpic
+    join rms_material rm
+    on rm.material_id=wpic.material_id
+    join rms_warehouse rw
+    on rw.warehouse_id=wpic.warehouse_id
+    where  #{value}= to_char(wpic.INSERT_TIME,'yyyy-mm')
+    )
     <where>
       <if test="warehouse_name != null">
         and "warehouse_name" in

+ 2 - 1
src/main/resources/com/steerinfo/dil/mapper/WmspSendReceiveMapper.xml

@@ -467,7 +467,7 @@
     on rmt.material_type_id=rm.material_type_id
     join rms_warehouse rw
     on rw.warehouse_id=wsr.warehouse_id
-    where wsr.WAREHOUSE_ID = #{warehouseId}
+   <where>
     <if test="oneDate != null">
       and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= wsr.INSERT_TIME
     </if>
@@ -475,6 +475,7 @@
       and to_date(#{startDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= wsr.INSERT_TIME
       and to_date(#{endDate}, 'yyyy-mm-dd hh24:mi:ss') >= wsr.INSERT_TIME
     </if>
+  </where>
     )
     <where>
       <if test="warehouse_name != null">