Kaynağa Gözat

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

Tiroble 3 yıl önce
ebeveyn
işleme
5d33ccfb6a

+ 0 - 1
src/main/java/com/steerinfo/dil/controller/WmsInboundResultController.java

@@ -196,7 +196,6 @@ public class WmsInboundResultController extends BaseRESTfulController {
                 //如果是线材直接结束
                 //将下面的订单都录入这个批次里面
                 for (int i=0;i<mapList.size();i++) {
-
                     Map<String, Object> item = mapList.get(i);
                     //获得高线库
                     HashMap<String, Object> map3 = new HashMap<>();

+ 16 - 0
src/main/java/com/steerinfo/dil/controller/WmspGridMaterialController.java

@@ -222,6 +222,22 @@ public class WmspGridMaterialController extends BaseRESTfulController {
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId,columnList,mapList);
         return success(pageList);
     }
+
+//    根据仓库id查询对应库的物资id,没有传库的id直接查询所有钢材的物资
+    @ApiOperation(value = "查询所有钢材的物资信息",notes = "查询所有钢材的物资信息")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "apiId", value = "443", required = false, dataType = "BigDecimal"),
+    })
+    @PostMapping("/getSteelMaterialList")
+    public  RESTfulResult getSteelMaterialList(Integer pageNum,
+                                               Integer pageSize,
+                                               Integer apiId){
+        List<Map<String,Object>> columnList=wmspGridMaterialService.getSteelMaterialList();
+        PageHelper.startPage(pageNum,pageSize);
+        List<Map<String,Object>> mapList=wmspGridMaterialService.getSteelMaterialList();
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId,columnList,mapList);
+        return success(pageList);
+    }
 }
 
 

+ 6 - 3
src/main/java/com/steerinfo/dil/controller/WmspOutboundResultController.java

@@ -14,7 +14,6 @@ import com.steerinfo.dil.util.PageListAdd;
 import com.steerinfo.dil.vo.OutBoundDetailed;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageHelper;
-import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
@@ -23,8 +22,6 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
-import java.util.*;
-import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -472,6 +469,12 @@ public class WmspOutboundResultController extends BaseRESTfulController {
     @PostMapping("/deleteGridMaterial")
     public RESTfulResult deleteGridMaterial(@RequestParam String materialOnlyCode){
         int result = wmspOutboundResultService.deleteGridMaterial(materialOnlyCode);
+        if(result == -1){
+            return failed("请勿重复扫码");
+        }
+        if(result == -2){
+            return  failed("该钢材还未入库");
+        }
         return success(result);
     }
 }

+ 25 - 24
src/main/java/com/steerinfo/dil/controller/WmspSendReceiveController.java

@@ -4,6 +4,7 @@ import com.steerinfo.dil.feign.ESFeign;
 import com.steerinfo.dil.service.impl.WmspSendReceiveServiceImpl;
 import com.steerinfo.dil.util.BaseRESTfulController;
 import com.steerinfo.dil.util.ColumnDataUtil;
+import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.util.PageListAdd;
 import com.steerinfo.framework.controller.RESTfulResult;
 import com.steerinfo.framework.service.pagehelper.PageHelper;
@@ -11,11 +12,13 @@ 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;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.text.SimpleDateFormat;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -38,6 +41,10 @@ public class WmspSendReceiveController extends BaseRESTfulController {
     @Autowired
     WmspSendReceiveServiceImpl iWmspSendReceiveService;
 
+    private final SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
+
+    private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
     @PostMapping("/getSendReceive")
     @ApiOperation(value = "展示收发存报表信息")
     @ApiImplicitParams({
@@ -47,32 +54,19 @@ public class WmspSendReceiveController extends BaseRESTfulController {
                                            Integer apiId,
                                            Integer pageNum,
                                            Integer pageSize,
-                                           String  con
+                                           String  con,
+                                           String startTime,
+                                           String endTime
                                         ){
-        if(con != null){
-            if(!"undefined".equals(con)){
-                String index = "get_wms_SendReceive";
-                return success(esFeign.getConResult(mapValue,index,apiId,pageNum,pageSize,con));
-            }
-        }
-        List<Map<String,Object>>sendReceiveList = null;
-        if(mapValue.size() == 0){
-            //将查询结果存入索引中
-            sendReceiveList = iWmspSendReceiveService.getWmspSendReceiveService(mapValue);
-            Map<String, Object> sendReceiveMap = new HashMap<>();
-            //添加索引
-            sendReceiveMap.put("index","get_wms_SendReceive");
-            //添加ID
-            sendReceiveMap.put("indexId","sendReceivetId");
-            sendReceiveList.add(sendReceiveMap);
-            //新建索引
-            esFeign.insertIndex(sendReceiveList);
-            //删除
-            sendReceiveList.remove(sendReceiveList.size() -1);
+        if (con!=null&&!con.equals("undefined")){
+            mapValue.put("con","%"+con+"%");
         }
-        if(sendReceiveList == null) {
-            sendReceiveList =iWmspSendReceiveService.getWmspSendReceiveService(mapValue);
+        if(mapValue == null){
+            mapValue =new HashMap<>();
         }
+        DataChange.queryDataByDateTime(startTime, endTime, mapValue, sdfDateTime);//根据时间段查询数据
+        List<Map<String,Object>> sendReceiveList = iWmspSendReceiveService.getWmspSendReceiveService(mapValue);
+
         /*分页*/
         PageHelper.startPage(pageNum, pageSize);
         List<Map<String,Object>> columnList = iWmspSendReceiveService.getWmspSendReceiveService(mapValue);
@@ -80,8 +74,15 @@ public class WmspSendReceiveController extends BaseRESTfulController {
         return success(pageList);
     }
 
-    //初始化收发层
+   /* //初始化收发层
+    @PostMapping("addSendReceive")
+    public RESTfulResult addSendReceive(){
+        int result = iWmspSendReceiveService.addSendReceive();
+        return success(result);
+    }*/
+
     @PostMapping("addSendReceive")
+    @Scheduled(cron =  "0 0 0 * * ? ")
     public RESTfulResult addSendReceive(){
         int result = iWmspSendReceiveService.addSendReceive();
         return success(result);

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/WmspCheckWarehouseMapper.java

@@ -14,4 +14,6 @@ public interface WmspCheckWarehouseMapper extends IBaseMapper<WmspCheckWarehouse
     List<Map<String, Object>> getStockTakingList();
 
     BigDecimal getMaxId();
+//    查找钢材物资信息
+    List<Map<String, Object>> getSteelMaterialList();
 }

+ 1 - 1
src/main/java/com/steerinfo/dil/mapper/WmspOutboundScanResultMapper.java

@@ -21,6 +21,6 @@ public interface WmspOutboundScanResultMapper extends IBaseMapper<WmspOutboundSc
 
     List<String> getResultStrs(BigDecimal resultId);
     //通过物资唯一编码查询钢材物资唯一id
-    List<Map<String, Object>> getMaterialSteelId(String materialOnlyCode);
+    Map<String, Object> getMaterialSteelId(String materialOnlyCode);
 
 }

+ 4 - 0
src/main/java/com/steerinfo/dil/mapper/WmspSendReceiveMapper.java

@@ -34,4 +34,8 @@ public interface WmspSendReceiveMapper extends IBaseMapper<WmspSendReceive, BigD
     BigDecimal getMaterialId(BigDecimal materialSteelId);
     //实时更改库存
     int updateSendReceiveThisdayInventory(Map<String,Object> map);
+    //统计前一天的入库总数
+    BigDecimal countSndReceiveThisdayInbound(Map<String, Object> map2);
+    //统计前一天的出库总数
+    BigDecimal countSendReceiveThisdayOutbound(Map<String, Object> map2);
 }

+ 2 - 0
src/main/java/com/steerinfo/dil/service/IWmspGridMaterialService.java

@@ -53,4 +53,6 @@ public interface IWmspGridMaterialService  {
    int insertStockTaking(String warehouseid, String materialCode, Integer quantity);
 //   查询盘库实绩
     List<Map<String, Object>> getStockTakingList();
+//    获得钢材物资信息
+    List<Map<String, Object>> getSteelMaterialList();
 }

+ 5 - 5
src/main/java/com/steerinfo/dil/service/impl/WmspGridMaterialServiceImpl.java

@@ -272,11 +272,6 @@ public class WmspGridMaterialServiceImpl  implements IWmspGridMaterialService {
         wmspCheckWarehouse.setInsertUsername("admin");
 //        查找当前盘点库存实绩表的最大Id
         BigDecimal checkId = wmspCheckWarehouseMapper.getMaxId();
-        if (checkId==null){
-            checkId=new BigDecimal(1);
-        }else{
-            checkId.add(new BigDecimal(1));
-        }
         wmspCheckWarehouse.setCheckId(checkId);
         int result = wmspCheckWarehouseMapper.insertSelective(wmspCheckWarehouse);
 
@@ -288,4 +283,9 @@ public class WmspGridMaterialServiceImpl  implements IWmspGridMaterialService {
 
         return wmspCheckWarehouseMapper.getStockTakingList();
     }
+
+    @Override
+    public List<Map<String, Object>> getSteelMaterialList() {
+        return wmspCheckWarehouseMapper.getSteelMaterialList();
+    }
 }

+ 14 - 31
src/main/java/com/steerinfo/dil/service/impl/WmspOutboundResultServiceImpl.java

@@ -1,26 +1,20 @@
 package com.steerinfo.dil.service.impl;
 
 import com.steerinfo.dil.feign.TmstruckFeign;
-import com.steerinfo.dil.mapper.CommonSeq;
-import com.steerinfo.dil.mapper.WmspInboundScanResultMapper;
-import com.steerinfo.dil.mapper.WmspGridMaterialMapper;
-import com.steerinfo.dil.mapper.WmspOutboundResultMapper;
-import com.steerinfo.dil.mapper.WmspOutboundScanResultMapper;
+import com.steerinfo.dil.mapper.*;
 import com.steerinfo.dil.model.WmspOutboundResult;
-import com.steerinfo.dil.model.WmspOutboundResultMaterial;
 import com.steerinfo.dil.model.WmspOutboundScanResult;
 import com.steerinfo.dil.service.IWmspOutboundResultService;
+import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.dil.vo.OutBoundDetailed;
 import com.steerinfo.dil.vo.OutBoundMaterialDetailedInfo;
 import com.steerinfo.dil.vo.OutBoundTypeDetailedInfo;
-import com.steerinfo.dil.util.DataChange;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -385,34 +379,23 @@ public class WmspOutboundResultServiceImpl  implements IWmspOutboundResultServic
         return scanResultInsert(wmspOutboundScanResult);
     }
     public int deleteGridMaterial(String materialOnlyCode) {
-        //获取扫描的物资
-       // List<Map<String,Object>> scanList = wmspOutboundScanResultMapper.getResultMaterial(resultId);
-        //根据扫描的吊牌数据查询钢材物资id
-      /*  List<Map<String,Object>> listMap = null;
         int i=0;
-        for(Map<String,Object> scanMaterial:scanList){
-            String materialOnlyCode = scanMaterial.get("RESULT_MATERIAL").toString();*/
-
-            int i=0;
             String[] tag1 = materialOnlyCode.split("\\-");
-            List<Map<String,Object>> listMap  = wmspOutboundScanResultMapper.getMaterialSteelId(tag1[7]);
-
-            for(Map<String,Object> map:listMap) {
-
+           Map<String,Object> map  = wmspOutboundScanResultMapper.getMaterialSteelId(tag1[7]);
+            if(map == null){
+                return -2;
+            }
                 BigDecimal materialSteelId = DataChange.dataToBigDecimal(map.get("materialId"));
-                if(materialSteelId == null){
+                Date date = (Date) map.get("updateTime");
+                //如果修改时间为空,就表示该钢材还未出库
+                if(date==null){
+                    //将这些物资钢材id进行逻辑删除
+                    i += wmspGridMaterialMapper.updateByMaterialId(materialSteelId,new Date());
+                }
+                //表示该钢材已出库
+                else{
                     return -1;
                 }
-                //根据物资钢材id查询仓库id和物资大类id
-//                BigDecimal materialId = wmspSendReceiveService.getMaterialId(materialSteelId);
-//                Map<String,Object> map1 = new HashMap<>();
-//                map1.put("materialId",materialId);
-//                map1.put("warehouseId",3);
-//                wmspSendReceiveService.addOutBoundSendReceive(map1);
-//                wmspSendReceiveService.addThisdayInventorySendReceive(map1);
-                //将这些物资钢材id进行逻辑删除
-                i += wmspGridMaterialMapper.updateByMaterialId(materialSteelId,new Date());
-            }
 
         return i;
     }

+ 63 - 2
src/main/java/com/steerinfo/dil/service/impl/WmspSendReceiveServiceImpl.java

@@ -8,7 +8,6 @@ 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;
@@ -52,7 +51,7 @@ public class WmspSendReceiveServiceImpl implements IWmspSendReceiveService {
         return wmspSendReceiveMapper.getMaterialId(materialSteelId);
     }
 
-    @Override
+   /* @Override
     //针对每一个仓库中的每一个物资类型新增一个收发层(初始化收发层)
     @Scheduled(cron =  "0 0 0 * * ? ")
     public int addSendReceive() {
@@ -131,8 +130,14 @@ public class WmspSendReceiveServiceImpl implements IWmspSendReceiveService {
         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){
@@ -148,4 +153,60 @@ public class WmspSendReceiveServiceImpl implements IWmspSendReceiveService {
         return wmspSendReceiveMapper.updateSendReceiveThisdayInventory(map1);
 
     }
+*/
+    //零点生成前一天的入库、出库、库存
+    @Override
+    public int addSendReceive(){
+        WmspSendReceive wmspSendReceive = new WmspSendReceive();
+        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) {
+                //收发层主键自增
+                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);
+                wmspSendReceive.setSendReceiveThisdayInbound(sendReceiveThisdayInbound);
+                //统计前一天的出库总数
+                BigDecimal sendReceiveThisdayOutbound = wmspSendReceiveMapper.countSendReceiveThisdayOutbound(map2);
+                wmspSendReceive.setSendReceiveThisdayOutbound(sendReceiveThisdayOutbound);
+                //昨天库存
+                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()
+                                +sendReceiveThisdayInbound.intValue()-sendReceiveThisdayOutbound.intValue());
+
+                wmspSendReceive.setSendReceiveThisdayInventory(sendReceiveThisdayInventory);
+                wmspSendReceive.setInsertUsername("admin");
+                wmspSendReceive.setInsertTime(new Date());
+                wmspSendReceive.setDeleted(new BigDecimal(1));
+                i+=wmspSendReceiveMapper.insertSelective(wmspSendReceive);
+            }
+        }
+        return i;
+    }
+
 }

+ 96 - 19
src/main/java/com/steerinfo/dil/util/DataChange.java

@@ -40,23 +40,22 @@ public class DataChange {
      * @param data
      * @return
      */
-    public static BigDecimal
-    dataToBigDecimal(Object data){
+    public static BigDecimal dataToBigDecimal(Object data){
         if (data != null){
-            if(data instanceof String){
-                String data1 = (String) data;
-                return new BigDecimal(data1);
-            }
-            if(data instanceof Integer){
-                Integer data2 = (Integer) data;
-                return new BigDecimal(data2);
-            }
-            if(data instanceof Double){
-                Double data3 = (Double) data;
-                return new BigDecimal(data3);
-            }
             if(data instanceof BigDecimal){
                 return (BigDecimal) data;
+            }else{
+                String str = String.valueOf(data);
+                BigDecimal decimal = null;
+                if(!"".equals(str)){
+                    try {
+                        decimal = new BigDecimal(str);
+                    } catch (Exception e) {
+                        System.out.println(data + ":数据解析失败!返回0");
+                        return new BigDecimal(0);
+                    }
+                }
+                return decimal;
             }
         }
         return new BigDecimal(0);
@@ -70,8 +69,10 @@ public class DataChange {
     public static String dateToDayDate(Object date){
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Date changeDate = null;
+        if(date == null)
+            return null;
         try{
-            changeDate = (Date) date;
+             changeDate = (Date) date;
         }catch (Exception e){
             e.printStackTrace();
         }
@@ -109,10 +110,15 @@ public class DataChange {
         for (Map<String, Object> map : list) {
             for (String s : key) {
                 //修改数据为带两位小数
-                BigDecimal oldDate = (BigDecimal) map.get(s);
-                DecimalFormat df =  new DecimalFormat("0.00");
-                String resultDeduction = df.format(oldDate.doubleValue());
-                map.put(s, resultDeduction);
+                try {
+                    BigDecimal oldDate = (BigDecimal) map.get(s);
+                    DecimalFormat df =  new DecimalFormat("0.00");
+                    String resultDeduction = df.format(oldDate.doubleValue());
+                    map.put(s, resultDeduction);
+                } catch (Exception e) {
+                    System.out.println("原料扣减量数据有误");
+                }
+
             }
         }
     }
@@ -159,4 +165,75 @@ public class DataChange {
         );
         return sb.toString();
     }
+
+    /**
+     * 根据时间段查询数据 支持只选择单个时间
+     * @Author TXF
+     * @Date 2022/1/10 23:21
+     * @param startTime
+     * @param endTime
+     * @param map
+     * @param sdf
+     * @return
+     **/
+    public static void queryDataByDate(String startTime, String endTime, Map<String, Object> map, SimpleDateFormat sdf){
+        if (startTime != null && !"null".equals(startTime) && endTime != null && !"null".equals(endTime)) {
+            map.put("startDate", sdf.format(new Date(Long.parseLong(startTime))));
+            map.put("endDate", sdf.format(new Date(Long.parseLong(endTime) + 86400000)));
+        } else if (startTime != null && !"null".equals(startTime)) {
+            map.put("oneDate", sdf.format(new Date(Long.parseLong(startTime))));
+        } else if (endTime != null && !"null".equals(endTime)) {
+            map.put("oneDate", sdf.format(new Date(Long.parseLong(endTime))));
+        } else {
+            map.put("oneDate", sdf.format(new Date()));
+        }
+    }
+
+    /**
+     * 只支持两个时间查询
+     * @Author TXF
+     * @Date 2022/1/15 9:08
+     * @param startTime
+     * @param endTime
+     * @param sdf
+     * @return
+     **/
+    public static void queryDataByDateTime(String startTime, String endTime, Map<String, Object> map,SimpleDateFormat sdf){
+        SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
+        if (startTime != null && !"null".equals(startTime) && endTime != null && !"null".equals(endTime)) {
+            map.put("startDate", sdf.format(new Date(Long.parseLong(startTime))));
+            map.put("endDate", sdf.format(new Date(Long.parseLong(endTime))));
+        }
+        //如果开始时间和结束时间有且只有一个为空 则只查那天的数据
+        else if((startTime != null && !"null".equals(startTime)) || (endTime != null && !"null".equals(endTime))){
+            if(startTime != null && !"null".equals(startTime)){
+                queryDataByTwoDateSon(map, startTime, sdfDate);
+            }
+            if(endTime != null && !"null".equals(endTime)){
+                queryDataByTwoDateSon(map, endTime, sdfDate);
+            }
+        }else {
+            //如果两者时间都为空,则查询当天数据
+            String nowDate = sdfDate.format(new Date());
+            map.put("oneDate", nowDate + " 00:00:00");
+        }
+    }
+
+    /**
+     * 上面方法的儿子方法 如果只传入了一个时间 则查询那天的数据
+     * @Author TXF
+     * @Date 2022/1/17 16:17
+     * @param map
+     * @param time
+     * @param sdfDate
+     * @return
+     **/
+    private static void queryDataByTwoDateSon(Map<String, Object> map, String time, SimpleDateFormat sdfDate){
+        Date date1 = new Date(Long.parseLong(time));
+        Date date2 = new Date(Long.parseLong(time) + 86400000);
+        String dayStartTime = sdfDate.format(date1);
+        String dayEndTime = sdfDate.format(date2);
+        map.put("startDate", dayStartTime + " 00:00:00");
+        map.put("endDate", dayEndTime + " 00:00:00");
+    }
 }

+ 17 - 1
src/main/resources/com/steerinfo/dil/mapper/WmspCheckWarehouseMapper.xml

@@ -386,7 +386,23 @@
     ORDER BY WCW.INSERT_TIME DESC
   </select>
   <select id="getMaxId" resultType="java.math.BigDecimal">
-    SELECT MAX(WCM.CHECK_ID)
+    SELECT MAX(WCM.CHECK_ID)+1 "checkId"
     FROM WMSP_CHECK_WAREHOUSE WCM
   </select>
+    <select id="getSteelMaterialList" resultType="java.util.Map">
+        SELECT DISTINCT
+--             物资名称
+            RM.MATERIAL_NAME "materialName",
+--                物资编码
+               RM.MATERIAL_CODE "materialCode",
+--                物资规格
+               RM.MATERIAL_SPECIFICATION "materialSpecification",
+--                物资型号
+               RM.MATERIAL_MODEL "materialModel",
+--                物资长度
+                RM.MATERIAL_LENGTH "materialLength"
+        FROM RMS_MATERIAL_STEEL RMS
+        LEFT JOIN RMS_MATERIAL RM
+        ON RMS.MATERIAL_ID = RM.MATERIAL_ID
+    </select>
 </mapper>

+ 3 - 2
src/main/resources/com/steerinfo/dil/mapper/WmspOutboundScanResultMapper.xml

@@ -466,9 +466,10 @@
      select RESULT_MATERIAL "resultMaterial" from  WMSP_OUTBOUND_SCAN_RESULT where OUTBOUND_RESULT_ID=#{resultId}
   </select>
 
-  <select id="getMaterialSteelId" resultType="java.util.LinkedHashMap" parameterType="String">
+  <select id="getMaterialSteelId" resultType="java.util.Map" parameterType="String">
     SELECT
-       gcwz.MATERIAL_STEEL_ID "materialId"
+       wgm.MATERIAL_ID "materialId",
+       wgm.UPDATE_TIME "updateTime"
     FROM RMS_MATERIAL_STEEL gcwz
     LEFT JOIN WMSP_GRID_MATERIAL wgm
     ON gcwz.MATERIAL_STEEL_ID = wgm.MATERIAL_ID

+ 64 - 3
src/main/resources/com/steerinfo/dil/mapper/WmspSendReceiveMapper.xml

@@ -450,13 +450,17 @@
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
 
   <select id="selectWmspSendReceive" resultType="java.util.LinkedHashMap">
+    select * from (
     select
     rw.warehouse_name "warehouse_name",
     rm.material_name "material_name",
+    rm.material_specification "material_specification",
+    rm.material_model "material_model",
     wsr.send_receive_lastday_inventory "send_receive_lastday_inventory" ,
     wsr.send_receive_thisday_inbound "send_receive_thisday_inbound",
     wsr.send_receive_thisday_outbound "send_receive_thisday_outbound",
-    wsr.send_receive_thisday_inventory "send_receive_thisday_inventory"
+    wsr.send_receive_thisday_inventory "send_receive_thisday_inventory",
+    wsr.send_receive_date "send_receive_date"
     from wmsp_send_receive wsr
     join RMS_MATERIAL rm
     on rm.material_id=wsr.material_id
@@ -464,6 +468,17 @@
     on rmt.material_type_id=rm.material_type_id
     join rms_warehouse rw
     on rw.warehouse_id=wsr.warehouse_id
+
+   <where>
+    <if test="oneDate != null">
+      and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= wsr.INSERT_TIME
+    </if>
+    <if test="startDate != null">
+      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">
         and "warehouse_name" in
@@ -477,6 +492,18 @@
           #{item}
         </foreach>
       </if>
+      <if test="material_specification != null">
+        and "material_specification" in
+        <foreach collection="material_specification" item="item" open="(" separator="," close=")">
+          #{item}
+        </foreach>
+      </if>
+      <if test="material_model != null">
+        and "material_model" in
+        <foreach collection="material_model" item="item" open="(" separator="," close=")">
+          #{item}
+        </foreach>
+      </if>
       <if test="send_receive_lastday_inventory != null">
         and "send_receive_lastday_inventory" in
         <foreach collection="send_receive_lastday_inventory" item="item" open="(" separator="," close=")">
@@ -501,6 +528,12 @@
           #{item}
         </foreach>
       </if>
+      <if test="send_receive_date != null">
+        and "send_receive_date" in
+        <foreach collection="send_receive_date" item="item" open="(" separator="," close=")">
+          #{item}
+        </foreach>
+      </if>
     </where>
     <include refid="orderBy"></include>
   </select>
@@ -533,15 +566,17 @@
   </update>
 
   <select id="selectSendReceiveThisdayInbound" parameterType="java.util.Map" resultType="java.math.BigDecimal">
-    select wsr.SEND_RECEIVE_THISDAY_INBOUND
+    select DISTINCT wsr.SEND_RECEIVE_THISDAY_INBOUND
     from WMSP_SEND_RECEIVE wsr
     where wsr.MATERIAL_ID = #{materialId} and wsr.WAREHOUSE_ID = #{warehouseId}
+     and trunc(wsr.INSERT_TIME) = trunc(sysdate-1)
   </select>
 
   <select id="selectSendReceiveThisdayOutbound" parameterType="java.util.Map" resultType="java.math.BigDecimal">
-    select wsr.SEND_RECEIVE_THISDAY_OUTBOUND
+    select DISTINCT wsr.SEND_RECEIVE_THISDAY_OUTBOUND
     from WMSP_SEND_RECEIVE wsr
     where wsr.MATERIAL_ID = #{materialId} and wsr.WAREHOUSE_ID = #{warehouseId}
+    and trunc(wsr.INSERT_TIME) = trunc(sysdate-1)
   </select>
 
   <select id="getMaterialId" parameterType="java.math.BigDecimal" resultType="java.math.BigDecimal">
@@ -557,4 +592,30 @@
     set wsr.SEND_RECEIVE_THISDAY_INVENTORY = #{sendReceiveThisdayInventory}
     where wsr.MATERIAL_ID = #{materialId} and wsr.WAREHOUSE_ID = #{warehouseId}
   </update>
+
+  <select id="countSndReceiveThisdayInbound" parameterType="java.util.Map" resultType="java.math.BigDecimal">
+    select count(*) from WMSP_INBOUND_RESULT wir
+    left join RMS_MATERIAL_STEEL rms
+    on rms.MATERIAL_STEEL_ID = wir.MATERIAL_ID
+    left join RMS_MATERIAL rm
+    on rm.MATERIAL_ID =rms.MATERIAL_ID
+    left join RMS_PWAREHOUSE_GRID rpg
+    on rpg.GRID_ID = wir.GRID_ID
+    where rm.MATERIAL_ID = #{materialId} and
+    rpg.WAREHOUSE_ID = #{warehouseId} and
+    trunc(wir.INSERT_TIME) = trunc(sysdate-1)
+  </select>
+
+  <select id="countSendReceiveThisdayOutbound" parameterType="java.util.Map" resultType="java.math.BigDecimal">
+    select count(*) from WMSP_GRID_MATERIAL wgm
+     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
+    where  rm.MATERIAL_ID = #{materialId} and
+    rpg.WAREHOUSE_ID = #{warehouseId} and
+    trunc(wgm.UPDATE_TIME) = trunc(sysdate-1)
+  </select>
 </mapper>