浏览代码

修改入库实绩

Tiroble 3 年之前
父节点
当前提交
fe5fa0611c

+ 8 - 26
src/main/java/com/steerinfo/dil/controller/WmspOutboundResultController.java

@@ -10,6 +10,7 @@ import com.steerinfo.dil.service.impl.WmspOutboundResultServiceImpl;
 import com.steerinfo.dil.service.impl.WmspOutboundScanResultServiceImpl;
 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.dil.vo.OutBoundDetailed;
 import com.steerinfo.framework.controller.RESTfulResult;
@@ -22,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -57,6 +59,7 @@ public class WmspOutboundResultController extends BaseRESTfulController {
     @Autowired
     private  ESFeign esFeign;
 
+    private SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
     /**
      * 编写人:hukui
@@ -80,34 +83,13 @@ public class WmspOutboundResultController extends BaseRESTfulController {
                                                Integer pageNum,
                                                Integer pageSize,
                                                Integer apiId,
-                                               String con)
+                                               String con,
+                                               String startTime,
+                                               String endTime)
     {
 
-        if (con != null) {
-            if (!"undefined".equals(con)) {
-                String index = "get_wms_outResult";//设置要查询的索引名称
-                return success(esFeign.getConResult(mapval, index, apiId, pageNum, pageSize, con));//获取查询结果
-            }
-        }
-
-        List<Map<String, Object>> libaryOutBoundList = null;
-        if (mapval.size() == 0) {
-            //将查询结果存入索引中
-            libaryOutBoundList = wmspOutboundResultService.selectResultNumber(mapval);
-            Map<String, Object> map1 = new HashMap<>();
-            //添加索引
-            map1.put("index", "get_wms_outresult");
-            //添加id
-            map1.put("indexId", "outBoundResultId");
-            libaryOutBoundList.add(map1);
-            //新建索引
-            esFeign.insertIndex(libaryOutBoundList);
-            //删除
-            libaryOutBoundList.remove(libaryOutBoundList.size() - 1);
-        }
-        if (libaryOutBoundList == null) {
-            libaryOutBoundList = wmspOutboundResultService.selectResultNumber(mapval);
-        }
+        DataChange.queryDataByDateTime(startTime,endTime,mapval,simpleDateFormat);
+        List<Map<String, Object>> libaryOutBoundList  = wmspOutboundResultService.selectResultNumber(mapval);
         PageHelper.startPage(pageNum, pageSize);
         List<Map<String, Object>> columnList =wmspOutboundResultService.selectResultNumber(mapval);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, libaryOutBoundList, columnList);

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

@@ -157,7 +157,7 @@ public class WmspOutboundResultServiceImpl  implements IWmspOutboundResultServic
 
     @Override
     public int scanResultInsert(WmspOutboundScanResult wmspOutboundScanResult) {
-        return wmspOutboundScanResultMapper.insert(wmspOutboundScanResult);
+        return wmspOutboundScanResultMapper.insertSelective(wmspOutboundScanResult);
     }
 
     @Override
@@ -361,7 +361,7 @@ public class WmspOutboundResultServiceImpl  implements IWmspOutboundResultServic
         //插入主键id
         wmspOutboundScanResult.setResultId(new BigDecimal(seq_wmspOutboundScanResult));
         //入库实绩
-        wmspOutboundScanResult.setInboundResultId(inboundResultId);
+        wmspOutboundScanResult.setInboundResultId(inboundResultId==null?new BigDecimal(1):inboundResultId);
         //插入出库实绩ID
         wmspOutboundScanResult.setOutboundResultId(resultId);
         //插入装卸工Id

+ 6 - 0
src/main/resources/com/steerinfo/dil/mapper/WmspOutboundResultMapper.xml

@@ -734,6 +734,12 @@
           "resultOutboundType" like '%${item}%'
         </foreach>
       </if>
+      <if test="startTime != null and endTime !=null">
+        and ckd.insert_time between to_date(#{startTime}, 'yyyy-mm-dd hh24:mi:ss') and  to_date(#{endTime}, 'yyyy-mm-dd hh24:mi:ss')
+      </if>
+      <if test="oneDate != null">
+        and to_date(#{oneDate}, 'yyyy-mm-dd hh24:mi:ss') &lt;= ckd.insert_time
+      </if>
     </where>
    
   </select>