Explorar o código

Merge remote-tracking branch 'origin/master'

hejiahui %!s(int64=2) %!d(string=hai) anos
pai
achega
6ae3e9821d

+ 1 - 2
src/main/java/com/steerinfo/dil/feign/OmsFeign.java

@@ -18,7 +18,6 @@ import java.util.Map;
 public interface OmsFeign {
 
     @PostMapping("api/v1/oms/omstruckorderseparates/closeInwardOrder")
-    Map<String,Object> closeInwardOrder(@RequestParam("orderId") Integer orderId,
-                                        @RequestParam(value = "status") Integer status);
+    Map<String,Object> closeInwardOrder(@RequestParam("orderId") Integer orderId);
 
 }

+ 4 - 3
src/main/java/com/steerinfo/dil/service/impl/BmstruckDetailsOrderServiceImpl.java

@@ -770,11 +770,12 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
             if(orderType.intValue() == 11){
                 List<BigDecimal> detailsIds = bmstruckDetailsOrderMapper.getDetailsIdByOrderId(orderId);
                 if(detailsIds.size() == 0){
-                    omsFeign.closeInwardOrder(orderId,1);
+                    omsFeign.closeInwardOrder(orderId);
                     count++;
                 }else{
-                    for(int i=0;i<detailsIds.size()-1;i++){
+                    for(int i=0;i<detailsIds.size();i++){
                         bmstruckDetailsOrderMapper.deleteByPrimaryKey(detailsIds.get(i));
+                        omsFeign.closeInwardOrder(orderId);
                         count++;
                     }
                 }
@@ -790,7 +791,7 @@ public class BmstruckDetailsOrderServiceImpl implements IBmstruckDetailsOrderSer
                 }
                 inserInwardOrder(orderIdMap);
             }
-            if(orderType.intValue() == 23){
+            if(orderType.intValue() == 23 || orderType.intValue() == 24){
                 List<BigDecimal> detailsIds = bmstruckDetailsOrderMapper.getDetailsIdByOrderId(orderId);
                 for(BigDecimal detailsId:detailsIds){
                     //根据详单ID物理删除详单

+ 4 - 1
src/main/resources/com/steerinfo/dil/mapper/BmstruckDetailsOrderMapper.xml

@@ -1666,10 +1666,12 @@
     </select>
     <select id="getPurInwardPrice" resultType="java.util.Map" parameterType="java.util.Map">
         SELECT * FROM (
-        select distinct actp.price_id "priceId", actp.price_value "priceValue" ,actp.PRICE_DATE "priceDate"
+        select distinct actp.price_id "priceId", actp.price_value "priceValue" ,rop.PRICE_DATE "priceDate"
         from ams_contract_transport_price actp
         left join ams_contaact_price_material acpm
         on acpm.price_id = actp.price_id
+        left join RMS_OIL_PRICE ROP
+        on rop.PRICE_OIL_TYPE_ID = actp.OIL_TYPE_ID
         left join rms_trans_range rtr
         on rtr.trans_range_id = actp.line_id
         where actp.DELETED = 0
@@ -1686,6 +1688,7 @@
         <if test="materialTypeId == null">
             and acpm.MATERIAL_ID = 0
         </if>
+        ORDER BY rop.PRICE_DATE DESC
         )
         WHERE ROWNUM = 1
     </select>