Bladeren bron

提交代码(钢材长度)

zyf 2 jaren geleden
bovenliggende
commit
e58da1a67f

+ 23 - 2
src/main/java/com/steerinfo/dil/controller/QmsQueueResultController.java

@@ -1,6 +1,7 @@
 package com.steerinfo.dil.controller;
 
 
+import com.steerinfo.dil.mapper.QmsQueueResultMapper;
 import com.steerinfo.dil.mapper.QueueInterfaceMapper;
 import com.steerinfo.dil.model.QmsQueueResult;
 import com.steerinfo.dil.service.impl.QmsQueueResultServiceImpl;
@@ -17,6 +18,7 @@ import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.*;
 
@@ -46,6 +48,9 @@ public class QmsQueueResultController extends BaseRESTfulController {
     @Autowired
     QueueInterfaceServiceImpl queueInterfaceService;
 
+    @Autowired
+    private QmsQueueResultMapper qmsQueueResultMapper;
+
 
     private final SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
@@ -127,8 +132,24 @@ public class QmsQueueResultController extends BaseRESTfulController {
             mapValue.put("capacityNumber", capacityNumber);
         PageHelper.startPage(pageNum,pageSize);
         if(isSpelling == 1){
-            //多拼
-            return success(qmsQueueResultService.getQueueListByQueueUpSpelling(mapValue));
+            //原多拼
+            List<Map<String, Object>> queueListByQueueUpSpelling = qmsQueueResultService.getQueueListByQueueUpSpelling(mapValue);
+            //现多拼数据
+            for (Map<String, Object> stringObjectMap : queueListByQueueUpSpelling) {
+                BigDecimal orderId = (BigDecimal) stringObjectMap.get("orderId");
+                //米数
+                List<Map<String, Object>> materialId = qmsQueueResultMapper.getMaterialId(orderId);
+                for (Map<String, Object> objectMap : materialId) {
+                    BigDecimal materialId2 = DataChange.dataToBigDecimal(stringObjectMap.get("materialId"));
+                    BigDecimal materialId1 = (BigDecimal) objectMap.get("materialId");
+                    if (materialId2.compareTo(materialId1)==0){
+                        //钢材长度
+                        BigDecimal steelmeter = (BigDecimal) objectMap.get("steelmeter");
+                        stringObjectMap.put("steelMeter",steelmeter);
+                    }
+                }
+            }
+            return success(queueListByQueueUpSpelling);
         }else {
             //单拼
             return success(qmsQueueResultService.getQueueListByQueueUp(mapValue));

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

@@ -149,4 +149,6 @@ public interface QmsQueueResultMapper extends IBaseMapper<QmsQueueResult, BigDec
     Map<String, Object> getResultMesByTotalId(BigDecimal resultTotalId);
 
     List<Map<String, Object>> getQueueListByQueueUpSpelling(Map<String, Object> map);
+
+    List<Map<String,Object>> getMaterialId(BigDecimal orderId);
 }

+ 19 - 1
src/main/resources/com/steerinfo/dil/mapper/QmsQueueResultMapper.xml

@@ -865,6 +865,7 @@
                OO.DRIVER_TEL                "driverTel",
                OO.ORDER_ID                  "orderId",
                RG.GATEPOST_NAME             "gatepostName",
+               ASM.STEEL_METER              "steelMeter",
                (
                    select COUNT(QQL2.LIST_ID)
                    from QMS_QUEUE_LIST QQL2
@@ -882,6 +883,10 @@
             LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM ON ASOM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
             LEFT JOIN AMS_SALE_ORDER ASO ON ASO.SALE_ORDER_ID = ASOM.SALE_ORDER_ID
             LEFT JOIN RMS_CONSIGNEE RCE ON RCE.CONSIGNEE_ID = ASO.RECEIVE_ID
+            LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
+            ON ASTM.SALE_ORDER_MATERIAL_ID=OO.ORDER_PLAN_ID
+            LEFT JOIN AMS_SALE_MATERIAL ASM
+            ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
             where oo.ORDER_STATUS = 5
             <if test="capacityNumber != null">
                 and instr(RC.CAPACITY_NUMBER, #{capacityNumber}) > 0
@@ -935,7 +940,6 @@
                    and QQSL.SPELLING_SURE_TIME &lt;= QQSL2.SPELLING_SURE_TIME
 
               )     "listNodeOrder"
-
         from QMS_QUEUE_SPELLING_LIST QQSL
             left join QMS_QUEUE_RESULT  QQR ON QQSL.QUEUE_RESULT_ID = QQR.RESULT_ID
             left join RMS_CAPACITY RC ON QQR.CAPACITY_ID = RC.CAPACITY_ID
@@ -971,6 +975,20 @@
             </if>
     </select>
 
+    <select id="getMaterialId" resultType="java.util.Map">
+        select
+        distinct
+        AMS.MATERIAL_ID "materialId",
+        AMS.STEEL_METER "steelmeter"
+        from OMSTRUCK_ORDER_MATERIAL OOM
+        LEFT JOIN OMSTRUCK_ORDER OO
+        ON OO.ORDER_ID = OOM.ORDER_ID
+        LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
+        ON ASTM.SALE_ORDER_MATERIAL_ID = OO.ORDER_PLAN_ID
+        LEFT JOIN AMS_SALE_MATERIAL AMS
+        ON AMS.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
+        WHERE OOM.ORDER_ID=#{orderId}
+    </select>
 
     <!--  查看进厂排队详情  -->
 <!--    <select id="getQueueMes" resultType="java.util.Map" parameterType="java.util.Map">-->