liyg 2 лет назад
Родитель
Сommit
6e8ca1396d

+ 39 - 1
src/main/java/com/steerinfo/dil/controller/WmspOutboundScanResultController.java

@@ -5,6 +5,7 @@ import com.steerinfo.dil.model.WmspOutboundScanResult;
 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.DataChange;
 import com.steerinfo.framework.controller.RESTfulResult;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.math.BigDecimal;
+import java.text.ParseException;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -40,7 +42,8 @@ public class WmspOutboundScanResultController extends BaseRESTfulController {
     CommonSeq commonSeq;
     @Autowired
     WmspOutboundResultServiceImpl wmspOutboundResultService;
-
+    @Autowired
+    WmspOutboundResultController wmspOutboundResultController;
     /**
      * 编写人:hukui
      * 新增出单实绩并返回出库单详情
@@ -104,6 +107,41 @@ public class WmspOutboundScanResultController extends BaseRESTfulController {
         }
         return failed();
     }
+
+    /**
+     * 复制吊牌出库
+     * @param mapval
+     * @return
+     */
+    @PostMapping(value = "/copyWmspOutboundScanResult")
+    public RESTfulResult copyWmspOutboundScanResult(@RequestBody(required = false) Map<String, Object> mapval) throws ParseException {
+        String resultMaterial=mapval.get("resultMaterial")+"";
+        System.out.println("In:"+resultMaterial);
+        String[] items=resultMaterial.split("-");
+        if(items==null || items.length<8){
+            return failed("复制失败!");
+        }else{
+            items[7]="ManualCopy"+System.currentTimeMillis();
+            resultMaterial="";
+            for(String temp:items){
+                resultMaterial+=temp+"-";
+            }
+            resultMaterial=resultMaterial.substring(0,resultMaterial.length()-1)+" ";
+            System.out.println("Copy:"+resultMaterial);
+            mapval.put("resultMaterial",resultMaterial);
+            return wmspOutboundResultController.insertwmspOutboundScanResult(mapval);
+        }
+    }
+
+    /**
+     * 删除出库扫描实绩
+     * @param mapval
+     * @return
+     */
+    @PostMapping(value = "/deleteWmspOutboundScanResult")
+    public RESTfulResult deleteWmspOutboundScanResult(@RequestBody(required = false) Map<String, Object> mapval){
+        return success(wmspOutboundScanResultService.deleteById(DataChange.dataToBigDecimal(mapval.get("resultId"))));
+    }
 /*
  *倒垛单新增扫描吊牌实绩
  */

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

@@ -1,6 +1,7 @@
 package com.steerinfo.dil.mapper;
 
 import com.steerinfo.dil.model.WmspOutboundResult;
+import com.steerinfo.dil.vo.OutBoundMaterialDetailedInfo;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import org.apache.ibatis.annotations.MapKey;
 import org.apache.ibatis.annotations.Mapper;
@@ -100,6 +101,9 @@ public interface WmspOutboundResultMapper extends IBaseMapper<WmspOutboundResult
 
     BigDecimal getSteelOrderType(BigDecimal orderId);
 
+    //根据出库实绩id查询出库扫码实绩信息
+    List<OutBoundMaterialDetailedInfo>  getOutBoundMaterialDetailedInfo(@Param("resultId") BigDecimal resultId);
+
     /**
      * @author:zyf
      * @version:1.0

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

@@ -33,4 +33,6 @@ public interface IWmspOutboundScanResultService {
     List<String> getOutBoundScanResultOnlyCodes(BigDecimal resultId);
 
     int getScanCount(String s, BigDecimal resultId);
+
+    int deleteById(BigDecimal resultId);
 }

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

@@ -323,26 +323,22 @@ public class WmspOutboundResultServiceImpl  implements IWmspOutboundResultServic
 
         //查询待出库物资类型详情
         List<OutBoundTypeDetailedInfo> outBoundTypeDetailedInfos= wmspOutboundResultMaterialService.getOutBoundTypeDetailedInfo(resultId,null);
-        //查询扫码实绩的扫码结构
-        List<String> onlycodes= wmspOutboundScanResultService.getOutBoundScanResultOnlyCodes(resultId);
         //出库信息展示
         OutBoundDetailed outBoundDetailed=new OutBoundDetailed();
-        if (onlycodes.size()>0){
-            //查询出已经扫码的物资信息
-            List<OutBoundMaterialDetailedInfo> outBoundMaterialDetailedInfos= wmspOutboundScanResultService.getOutBoundMaterialDetailedInfos(onlycodes,null);
-            //统计出已经扫码的物资数量
-            for (OutBoundTypeDetailedInfo typeDetailedInfo :outBoundTypeDetailedInfos){
-                int count=0;
-                for (OutBoundMaterialDetailedInfo outBoundMaterialDetailedInfo: outBoundMaterialDetailedInfos){
-                    if (typeDetailedInfo.getMaterialId().equals(outBoundMaterialDetailedInfo.getMaterialId())){
-                        count++;
-                    }
+        //查询出已经扫码的物资信息
+        List<OutBoundMaterialDetailedInfo> outBoundMaterialDetailedInfos= wmspOutboundResultMapper.getOutBoundMaterialDetailedInfo(resultId);
+        //统计出已经扫码的物资数量
+        for (OutBoundTypeDetailedInfo typeDetailedInfo :outBoundTypeDetailedInfos){
+            int count=0;
+            for (OutBoundMaterialDetailedInfo outBoundMaterialDetailedInfo: outBoundMaterialDetailedInfos){
+                if (typeDetailedInfo.getMaterialId().equals(outBoundMaterialDetailedInfo.getMaterialId())){
+                    count++;
                 }
-                //统计完数量赋值
-                typeDetailedInfo.setScanCodeNumber(count);
             }
-            outBoundDetailed.setOutBoundMaterialDetailedInfos(outBoundMaterialDetailedInfos);
+            //统计完数量赋值
+            typeDetailedInfo.setScanCodeNumber(count);
         }
+        outBoundDetailed.setOutBoundMaterialDetailedInfos(outBoundMaterialDetailedInfos);
         outBoundDetailed.setOutBoundTypeDetailedInfos(outBoundTypeDetailedInfos);
         return outBoundDetailed;
     }

+ 4 - 1
src/main/java/com/steerinfo/dil/service/impl/WmspOutboundScanResultServiceImpl.java

@@ -80,5 +80,8 @@ public class WmspOutboundScanResultServiceImpl implements IWmspOutboundScanResul
         return scanCount;
     }
 
-
+    @Override
+    public int deleteById(BigDecimal resultId) {
+        return wmspOutboundScanResultMapper.deleteByPrimaryKey(resultId);
+    }
 }

+ 2 - 1
src/main/java/com/steerinfo/dil/vo/OutBoundMaterialDetailedInfo.java

@@ -5,7 +5,8 @@ import lombok.Data;
 import java.math.BigDecimal;
 @Data
 public class OutBoundMaterialDetailedInfo {
-
+    private BigDecimal resultId;
+    private String resultMaterial;
     private String materialSteelId;
     private String onlyCode;
     private String furnaceNumber;

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

@@ -1226,4 +1226,26 @@
     from TMSTRUCK_TOTAL_RESULT t
     where t.order_id=#{orderId}
   </select>
+  <select id="getOutBoundMaterialDetailedInfo" resultType="com.steerinfo.dil.vo.OutBoundMaterialDetailedInfo">
+    select DISTINCT
+      wosr.RESULT_ID "resultId",
+      wosr.RESULT_MATERIAL "resultMaterial",
+      rms.MATERIAL_STEEL_ID "materialSteelId",
+      rms.MATERIAL_ONLY_CODE "onlyCode",
+      rms.MATERIAL_FURNACE_NUMBER "furnaceNumber",
+      RM.material_Id "materialId",
+      RM.MATERIAL_CODE "materialCode",
+      RM.MATERIAL_NAME "materialName",
+      RM.MATERIAL_SPECIFICATION "materialSpecification",
+      RM.MATERIAL_MODEL "materialModel"
+    from  WMSP_OUTBOUND_SCAN_RESULT wosr
+            left join WMSP_OUTBOUND_RESULT_MATERIAL worm
+                      on wosr.RESULT_MATERIAL_ID=worm.RESULT_MATERIAL_ID
+            left join RMS_MATERIAL_STEEL rms
+                      on  wosr.RESULT_MATERIAL  like '%'||rms.MATERIAL_ONLY_CODE ||'%'
+            left join RMS_MATERIAL RM on rms.material_id = RM.MATERIAL_ID
+            LEFT JOIN WMSP_GRID_MATERIAL wgm
+                      ON rms.MATERIAL_STEEL_ID = wgm.MATERIAL_ID
+    where wosr.OUTBOUND_RESULT_ID=#{resultId}  and worm.STATUS=1
+  </select>
 </mapper>