فهرست منبع

修改销售汽运

luobang 2 سال پیش
والد
کامیت
37a4ed14f9
18فایلهای تغییر یافته به همراه522 افزوده شده و 83 حذف شده
  1. 44 44
      pom.xml
  2. 7 0
      src/main/java/com/steerinfo/dil/controller/AmsContractTransportPriceController.java
  3. 14 0
      src/main/java/com/steerinfo/dil/controller/AmstruckInwardRequirementController.java
  4. 7 4
      src/main/java/com/steerinfo/dil/mapper/AmsContractTransportPriceMapper.java
  5. 3 0
      src/main/java/com/steerinfo/dil/mapper/AmstruckInwardRequirementMapper.java
  6. 6 4
      src/main/java/com/steerinfo/dil/mapper/AmstruckRequirementMaterialMapper.java
  7. 79 4
      src/main/java/com/steerinfo/dil/model/AmsContractTransportPrice.java
  8. 2 0
      src/main/java/com/steerinfo/dil/service/IAmsContractTransportPriceService.java
  9. 6 1
      src/main/java/com/steerinfo/dil/service/IAmstruckInwardRequirementService.java
  10. 16 0
      src/main/java/com/steerinfo/dil/service/impl/AmsContractTransportPriceServiceImpl.java
  11. 1 2
      src/main/java/com/steerinfo/dil/service/impl/AmsSaleOrderServiceImpl.java
  12. 69 3
      src/main/java/com/steerinfo/dil/service/impl/AmstruckInwardPlanServiceImpl.java
  13. 91 6
      src/main/java/com/steerinfo/dil/service/impl/AmstruckInwardRequirementServiceImpl.java
  14. 150 13
      src/main/resources/com/steerinfo/dil/mapper/AmsContractTransportPriceMapper.xml
  15. 3 0
      src/main/resources/com/steerinfo/dil/mapper/AmsContractTruckPriceMapper.xml
  16. 1 1
      src/main/resources/com/steerinfo/dil/mapper/AmsSaleOrderMapper.xml
  17. 14 0
      src/main/resources/com/steerinfo/dil/mapper/AmstruckInwardRequirementMapper.xml
  18. 9 1
      src/main/resources/com/steerinfo/dil/mapper/AmstruckRequirementMaterialMapper.xml

+ 44 - 44
pom.xml

@@ -105,13 +105,13 @@
                 <artifactId>generator-maven-plugin</artifactId>
                 <version>3.0</version>
                 <configuration>
-                    <connUrl>jdbc:oracle:thin:@172.16.33.63:1521:ORCL</connUrl>
-                    <user>dzgt</user>
-                    <password>bigdata</password>
+                    <connUrl>jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri</connUrl>
+                    <user>dil</user>
+                    <password>Dil123789</password>
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-                        <param>TB_PRODUCT_SUMMARY_DG</param>
+                        <param>AMS_CONTRACT_TRANSPORT_PRICE</param>
                     </tables>
                 </configuration>
                 <executions>
@@ -135,46 +135,46 @@
                     </execution>
                 </executions>
             </plugin>
-<!--            <plugin>-->
-<!--                <groupId>com.steerinfo</groupId>-->
-<!--                <artifactId>generator-maven-plugin</artifactId>-->
-<!--                <version>3.0</version>-->
-<!--                <configuration>-->
-<!--                    <connUrl>jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri</connUrl>-->
-<!--                    <user>dagang</user>-->
-<!--                    <password>root123</password>-->
-<!--                    &lt;!&ndash;包名&ndash;&gt;-->
-<!--                    <targetPackage>com.steerinfo.dil</targetPackage>-->
-<!--                    <tables>-->
-<!--                        <table>OMSTRUCK_ORDER_MATERIAL</table>&lt;!&ndash;销售计划&ndash;&gt;-->
-<!--                        &lt;!&ndash;                        <param>AMSTRUCK_INWARD_REQUIREMENT</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;&ndash;&gt;-->
-<!--                        &lt;!&ndash;                        <param>AMSTRUCK_RAIL_DAYPLAN</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;&ndash;&gt;-->
-<!--                        &lt;!&ndash;                        <param>AMS_CONTRACT_TRANSPORT_PRICE</param>&lt;!&ndash;销售订单&ndash;&gt;&ndash;&gt;-->
-<!--                        &lt;!&ndash;                        <param>AMS_SALE_ORDER_MATERIAL</param>&lt;!&ndash;销售订单车序号表&ndash;&gt;&ndash;&gt;-->
-<!--                        &lt;!&ndash;                        <param>AMS_SALE_TRUCKNO_MATERIAL</param>&lt;!&ndash;车序号物资中间表&ndash;&gt;&ndash;&gt;-->
-<!--                    </tables>-->
-<!--                </configuration>-->
-<!--                <executions>-->
-<!--                    <execution>-->
-<!--                        <phase>compile</phase>-->
-<!--                        <goals>-->
-<!--                            <goal></goal>-->
-<!--                        </goals>-->
-<!--                    </execution>-->
-<!--                </executions>-->
-<!--            </plugin>-->
-                        <plugin>
-                            <groupId>org.springframework.boot</groupId>
-                            <artifactId>spring-boot-maven-plugin</artifactId>
-                            <version>2.2.6.RELEASE</version>
-                            <executions>
-                                <execution>
-                                    <goals>
-                                        <goal>repackage</goal>
-                                    </goals>
-                                </execution>
-                            </executions>
-                        </plugin>
+            <!--            <plugin>-->
+            <!--                <groupId>com.steerinfo</groupId>-->
+            <!--                <artifactId>generator-maven-plugin</artifactId>-->
+            <!--                <version>3.0</version>-->
+            <!--                <configuration>-->
+            <!--                    <connUrl>jdbc:oracle:thin:@172.16.33.163:1521:ilsdbpri</connUrl>-->
+            <!--                    <user>dagang</user>-->
+            <!--                    <password>root123</password>-->
+            <!--                    &lt;!&ndash;包名&ndash;&gt;-->
+            <!--                    <targetPackage>com.steerinfo.dil</targetPackage>-->
+            <!--                    <tables>-->
+            <!--                        <table>OMSTRUCK_ORDER_MATERIAL</table>&lt;!&ndash;销售计划&ndash;&gt;-->
+            <!--                        &lt;!&ndash;                        <param>AMSTRUCK_INWARD_REQUIREMENT</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;&ndash;&gt;-->
+            <!--                        &lt;!&ndash;                        <param>AMSTRUCK_RAIL_DAYPLAN</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;&ndash;&gt;-->
+            <!--                        &lt;!&ndash;                        <param>AMS_CONTRACT_TRANSPORT_PRICE</param>&lt;!&ndash;销售订单&ndash;&gt;&ndash;&gt;-->
+            <!--                        &lt;!&ndash;                        <param>AMS_SALE_ORDER_MATERIAL</param>&lt;!&ndash;销售订单车序号表&ndash;&gt;&ndash;&gt;-->
+            <!--                        &lt;!&ndash;                        <param>AMS_SALE_TRUCKNO_MATERIAL</param>&lt;!&ndash;车序号物资中间表&ndash;&gt;&ndash;&gt;-->
+            <!--                    </tables>-->
+            <!--                </configuration>-->
+            <!--                <executions>-->
+            <!--                    <execution>-->
+            <!--                        <phase>compile</phase>-->
+            <!--                        <goals>-->
+            <!--                            <goal></goal>-->
+            <!--                        </goals>-->
+            <!--                    </execution>-->
+            <!--                </executions>-->
+            <!--            </plugin>-->
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+                <version>2.2.6.RELEASE</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>repackage</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
         <resources>
             <resource>

+ 7 - 0
src/main/java/com/steerinfo/dil/controller/AmsContractTransportPriceController.java

@@ -302,4 +302,11 @@ public class AmsContractTransportPriceController extends BaseRESTfulController {
         List<Map<String,Object>> result = amsContractTransportPriceService.getLineId();
         return success(result);
     }
+
+    @ApiOperation(value = "复制增加一个单价")
+    @PostMapping("copySteelPrice")
+    public RESTfulResult copySteelPrice(@RequestBody(required = false) Map<String,Object>map){
+        int i = amsContractTransportPriceService.copySteelPrice(map);
+        return success(i);
+    }
 }

+ 14 - 0
src/main/java/com/steerinfo/dil/controller/AmstruckInwardRequirementController.java

@@ -12,6 +12,7 @@ import com.steerinfo.framework.service.pagehelper.PageHelper;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -56,6 +57,13 @@ public class AmstruckInwardRequirementController extends BaseRESTfulController {
         return success(result);
     }
 
+    @ApiOperation("新增钢坯车辆用车需求")
+    @PostMapping("/addBilletRequirement")
+    public RESTfulResult addBilletRequirement(@RequestBody Map<String,Object> mapValue) {
+        int result = amstruckInwardRequirementService.addBilletRequirement(mapValue);
+        return success(result);
+    }
+
     /*
     新增采购内转需求
      */
@@ -289,6 +297,12 @@ public class AmstruckInwardRequirementController extends BaseRESTfulController {
         return success(mapList);
     }
 
+    @ApiOperation("关闭截止日期以及需求下的订单")
+    @PostMapping("closeDueDate")
+    public RESTfulResult closeDueDate(BigDecimal requirementId){
+        int i = amstruckInwardRequirementService.closeDueDate(requirementId);
+        return success();
+    }
 
 
 }

+ 7 - 4
src/main/java/com/steerinfo/dil/mapper/AmsContractTransportPriceMapper.java

@@ -2,13 +2,13 @@ package com.steerinfo.dil.mapper;
 
 import com.steerinfo.dil.model.AmsContractTransportPrice;
 import com.steerinfo.framework.mapper.IBaseMapper;
-import java.math.*;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Select;
 
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
 @Mapper
 public interface AmsContractTransportPriceMapper extends IBaseMapper<AmsContractTransportPrice, BigDecimal> {
 
@@ -112,4 +112,7 @@ public interface AmsContractTransportPriceMapper extends IBaseMapper<AmsContract
     BigDecimal selectTransportId();
     // 得到销售汽运单价
     List<Map<String, Object>> getSaleTruckPriceList(Map<String, Object> mapValue);
+
+    BigDecimal getPlaceId(BigDecimal orderId);
+
 }

+ 3 - 0
src/main/java/com/steerinfo/dil/mapper/AmstruckInwardRequirementMapper.java

@@ -43,4 +43,7 @@ public interface AmstruckInwardRequirementMapper extends IBaseMapper<AmstruckInw
     List<Map<String, Object>> getPurRequirementList(Map<String, Object> mapValue);
 
     BigDecimal selectPurOrderId(Integer requirementId);
+
+    int closeOrderByRequirementId(BigDecimal requirementId);
+
 }

+ 6 - 4
src/main/java/com/steerinfo/dil/mapper/AmstruckRequirementMaterialMapper.java

@@ -2,13 +2,13 @@ package com.steerinfo.dil.mapper;
 
 import com.steerinfo.dil.model.AmstruckRequirementMaterial;
 import com.steerinfo.framework.mapper.IBaseMapper;
-import java.math.*;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Select;
 
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+
 @Mapper
 public interface AmstruckRequirementMaterialMapper extends IBaseMapper<AmstruckRequirementMaterial, BigDecimal> {
 
@@ -20,4 +20,6 @@ public interface AmstruckRequirementMaterialMapper extends IBaseMapper<AmstruckR
 
     List<Map<String,Object>> getRequirementMaterial(Integer requirementId);
 
+    BigDecimal getMaterialId(Map<String, Object> mapValue);
+
 }

+ 79 - 4
src/main/java/com/steerinfo/dil/model/AmsContractTransportPrice.java

@@ -40,7 +40,7 @@ public class AmsContractTransportPrice implements IBasePO<BigDecimal> {
     private BigDecimal capacityTypeId;
 
     /**
-     * 货物类型ID(CARGONAME_ID,CHAR,10)
+     * 货物类型ID(CARGONAME_ID,CHAR,20)
      */
     @ApiModelProperty(value="货物类型ID",required=false)
     private BigDecimal cargonameId;
@@ -100,15 +100,15 @@ public class AmsContractTransportPrice implements IBasePO<BigDecimal> {
     private BigDecimal deleted;
 
     /**
-     * 收货地址ID(ADDRESS_ID,DECIMAL,0)
+     * 收货地址ID(PLACE_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="收货地址ID",required=false)
     private BigDecimal placeId;
 
     /**
-     * 类型:1为销售 2为内转 3为采购水运 4为采购汽运(TYPE,DECIMAL,0)
+     * 类型:1为销售钢材 2为内转计重 3为采购水运 4为采购汽运5内转计时 6内转计数7采购内转8销售非钢材(TYPE,DECIMAL,0)
      */
-    @ApiModelProperty(value="类型:1为销售 2为内转 3为采购水运 4为采购汽运",required=false)
+    @ApiModelProperty(value="类型:1为销售钢材 2为内转计重 3为采购水运 4为采购汽运5内转计时 6内转计数7采购内转8销售非钢材",required=false)
     private BigDecimal type;
 
     /**
@@ -135,6 +135,36 @@ public class AmsContractTransportPrice implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="油价变化率阈值",required=false)
     private BigDecimal oilpriceChangeThreshold;
 
+    /**
+     * 历史时间(OLD_DATE,TIMESTAMP,7)
+     */
+    @ApiModelProperty(value="历史时间",required=false)
+    private Date oldDate;
+
+    /**
+     * 运输距离(HAUL_DISTANCE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="运输距离",required=false)
+    private BigDecimal haulDistance;
+
+    /**
+     * 中标合同作为参考依据:1参考(REFERENCE_HT,DECIMAL,0)
+     */
+    @ApiModelProperty(value="中标合同作为参考依据:1参考",required=false)
+    private BigDecimal referenceHt;
+
+    /**
+     * 地址为库存(INVENTORY,DECIMAL,0)
+     */
+    @ApiModelProperty(value="地址为库存",required=false)
+    private BigDecimal inventory;
+
+    /**
+     * 1:非标准单价(ISSTANDARD,DECIMAL,0)
+     */
+    @ApiModelProperty(value="1:非标准单价",required=false)
+    private BigDecimal isstandard;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -315,6 +345,46 @@ public class AmsContractTransportPrice implements IBasePO<BigDecimal> {
         this.oilpriceChangeThreshold = oilpriceChangeThreshold;
     }
 
+    public Date getOldDate() {
+        return oldDate;
+    }
+
+    public void setOldDate(Date oldDate) {
+        this.oldDate = oldDate;
+    }
+
+    public BigDecimal getHaulDistance() {
+        return haulDistance;
+    }
+
+    public void setHaulDistance(BigDecimal haulDistance) {
+        this.haulDistance = haulDistance;
+    }
+
+    public BigDecimal getReferenceHt() {
+        return referenceHt;
+    }
+
+    public void setReferenceHt(BigDecimal referenceHt) {
+        this.referenceHt = referenceHt;
+    }
+
+    public BigDecimal getInventory() {
+        return inventory;
+    }
+
+    public void setInventory(BigDecimal inventory) {
+        this.inventory = inventory;
+    }
+
+    public BigDecimal getIsstandard() {
+        return isstandard;
+    }
+
+    public void setIsstandard(BigDecimal isstandard) {
+        this.isstandard = isstandard;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -342,6 +412,11 @@ public class AmsContractTransportPrice implements IBasePO<BigDecimal> {
         sb.append(", oilpriceBase=").append(oilpriceBase);
         sb.append(", oilTypeId=").append(oilTypeId);
         sb.append(", oilpriceChangeThreshold=").append(oilpriceChangeThreshold);
+        sb.append(", oldDate=").append(oldDate);
+        sb.append(", haulDistance=").append(haulDistance);
+        sb.append(", referenceHt=").append(referenceHt);
+        sb.append(", inventory=").append(inventory);
+        sb.append(", isstandard=").append(isstandard);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

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

@@ -116,4 +116,6 @@ public interface IAmsContractTransportPriceService {
     List<Map<String, Object>> getPriceValueAndPriceTonKilometer();
     // 销售汽运单价
     List<Map<String, Object>> getSaleTruckPriceList(Map<String, Object> mapValue);
+
+    int copySteelPrice(Map<String, Object> map);
 }

+ 6 - 1
src/main/java/com/steerinfo/dil/service/IAmstruckInwardRequirementService.java

@@ -2,7 +2,6 @@ package com.steerinfo.dil.service;
 
 import com.steerinfo.dil.model.AmstruckInwardRequirement;
 import com.steerinfo.framework.service.IBaseService;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.List;
@@ -57,5 +56,11 @@ public interface IAmstruckInwardRequirementService extends IBaseService<Amstruck
     //查询纯内转需求
     List<Map<String,Object>> getRequirementMaterial(Integer requirementId);
 
+    int closeDueDate(BigDecimal requirementId);
+
+    int addBilletRequirement(Map<String, Object> mapvalue);
+
+
+
 //    int insertInwardRequirementPlan(Map<String, Object> mapValue);
 }

+ 16 - 0
src/main/java/com/steerinfo/dil/service/impl/AmsContractTransportPriceServiceImpl.java

@@ -367,4 +367,20 @@ public class AmsContractTransportPriceServiceImpl implements IAmsContractTranspo
     public List<Map<String, Object>> selectPriceToUpdate(BigDecimal priceId) {
         return amsContractTransportPriceMapper.selectPriceToUpdate(priceId);
     }
+
+    @Override
+    public int copySteelPrice(Map<String, Object> map) {
+        int i ;
+        BigDecimal priceId = DataChange.dataToBigDecimal(map.get("priceId"));
+        BigDecimal orderId = DataChange.dataToBigDecimal(map.get("orderId"));
+        //获取地址id
+        BigDecimal placeId = amsContractTransportPriceMapper.getPlaceId(orderId);
+        AmsContractTransportPrice amsContractTransportPrice = amsContractTransportPriceMapper.selectByPrimaryKey(priceId);
+        amsContractTransportPrice.setPriceId(amsContractTruckPriceMapper.selectMaxId());
+        amsContractTransportPrice.setPlaceId(placeId);
+        amsContractTransportPrice.setIsstandard(new BigDecimal(1));
+        amsContractTransportPrice.setInsertTime(new Date());
+        i = amsContractTransportPriceMapper.insertSelective(amsContractTransportPrice);
+        return i;
+    }
 }

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

@@ -10,7 +10,6 @@ import com.steerinfo.dil.mapper.*;
 import com.steerinfo.dil.model.*;
 import com.steerinfo.dil.service.IAmsSaleOrderService;
 import com.steerinfo.dil.util.*;
-import com.steerinfo.framework.controller.RESTfulResult;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -663,7 +662,7 @@ public class AmsSaleOrderServiceImpl implements IAmsSaleOrderService {
                     List<Map<String, Object>> carrierList = getCarrierByAddress(amsSaleOrderMaterial.getSaleShippingAddressId());
                     BigDecimal carrierCount = null;
                     if(place != null && !"null".equals(place)){
-                        carrierCount = amsSaleOrderMapper.getMoreCarrier("%" + place + "%");
+                        carrierCount = amsSaleOrderMapper.getMoreCarrier(place);
                     }
                     // 单一承运商才进行匹配
                     if (carrierList != null && carrierList.size() == 1 && carrierList.get(0) != null  && carrierCount.intValue() == 0) {

+ 69 - 3
src/main/java/com/steerinfo/dil/service/impl/AmstruckInwardPlanServiceImpl.java

@@ -1,17 +1,19 @@
 package com.steerinfo.dil.service.impl;
 
+import com.steerinfo.dil.feign.TmsTruckFeign;
 import com.steerinfo.dil.mapper.AmstruckInwardPlanMapper;
 import com.steerinfo.dil.mapper.AmstruckRequirementPlanMapper;
+import com.steerinfo.dil.mapper.OmstruckOrderMapper;
+import com.steerinfo.dil.mapper.OmstruckOrderMaterialMapper;
 import com.steerinfo.dil.model.AmstruckInwardPlan;
-import com.steerinfo.dil.model.AmstruckInwardRequirement;
 import com.steerinfo.dil.model.AmstruckRequirementPlan;
+import com.steerinfo.dil.model.OmstruckOrder;
+import com.steerinfo.dil.model.OmstruckOrderMaterial;
 import com.steerinfo.dil.service.IAmstruckInwardPlanService;
 import com.steerinfo.dil.service.IAmstruckInwardRequirementService;
-import com.steerinfo.dil.service.IAmstruckRequirementPlanService;
 import com.steerinfo.dil.util.DataChange;
 import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
-import io.swagger.models.auth.In;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -19,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -49,6 +52,15 @@ public class AmstruckInwardPlanServiceImpl extends BaseServiceImpl<AmstruckInwar
         return amstruckInwardPlanMapper;
     }
 
+    @Autowired
+    TmsTruckFeign tmsTruckFeign;
+
+    @Autowired
+    OmstruckOrderMapper omstruckOrderMapper;
+
+    @Autowired
+    OmstruckOrderMaterialMapper omstruckOrderMaterialMapper;
+
     @Transactional
     @Override
     public int insert(Map<String,Object> mapValue) {
@@ -66,6 +78,10 @@ public class AmstruckInwardPlanServiceImpl extends BaseServiceImpl<AmstruckInwar
         amstruckInwardPlan.setPlanNumber(DataChange.generateEightDigitsNumber("YSJH",planId.intValue()));
         //设置计划状态为未下发
         amstruckInwardPlan.setPlanStatus(new BigDecimal(0));
+        //if(mapValue.get("addBilletRequirement") != null) {
+        //    addBilletOrder(mapValue);
+        //}
+        // 设置常规字段
         // 设置常规字段
         amstruckInwardPlan.setInsertTime(new Date());
         amstruckInwardPlan.setInsertUsername("admin");
@@ -88,6 +104,56 @@ public class AmstruckInwardPlanServiceImpl extends BaseServiceImpl<AmstruckInwar
         return i;
     }
 
+    public int addBilletOrder(Map<String,Object> mapValue) {
+        int result = 0;
+        List<Map<String,Object>> mapList = (List<Map<String, Object>>) mapValue.get("mapList");
+        BigDecimal planId = DataChange.dataToBigDecimal(mapValue.get("planId")) ;
+        String orgCode =(String) mapValue.get("orgCode");
+        Integer carrierId = (Integer) mapValue.get("carrierId");
+        AmstruckInwardPlan amstruckInwardPlan = amstruckInwardPlanMapper.selectByPrimaryKey(planId);
+        amstruckInwardPlan.setPlanStatus(new BigDecimal(3));
+        result += amstruckInwardPlanMapper.updateByPrimaryKeySelective(amstruckInwardPlan);
+        for (Map<String,Object> orderMap : mapList) {
+            OmstruckOrder omstruckOrder = new OmstruckOrder();
+            BigDecimal capacityId = DataChange.dataToBigDecimal(orderMap.get("capacityNumber"));
+            List<Map<String,Object>>orderMaterialList = (List<Map<String,Object>>)orderMap.get("orderMaterialList");
+            BigDecimal orderId = omstruckOrderMapper.selectMaxId();
+            // 添加总实绩
+            Map<String,Object> orderIdMap = new HashMap<>();
+            orderIdMap.put("orderId",orderId);
+            tmsTruckFeign.addTotalResult(orderIdMap);
+            omstruckOrder.setOrderId(orderId);
+            omstruckOrder.setOrderPlanId(planId);
+            String orderNumber = DataChange.generateEightDigitsNumber("WYSDD", orderId.intValue());
+            omstruckOrder.setOrderNumber(orderNumber);
+            omstruckOrder.setOrderIssueTime(new Date());
+            omstruckOrder.setOrderStatus(new BigDecimal(4));
+            omstruckOrder.setOptionerCode(orgCode);
+            omstruckOrder.setCapacityId(capacityId);
+            omstruckOrder.setInsertTime(new Date());
+            omstruckOrder.setUpdateTime(new Date());
+            omstruckOrder.setInsertUpdateRemark("无");
+            omstruckOrder.setDeleted(new BigDecimal(0));
+            omstruckOrder.setOrderType(new BigDecimal(11));
+            omstruckOrder.setCarrierId(new BigDecimal(carrierId));
+            result +=omstruckOrderMapper.insertSelective(omstruckOrder);
+            for (Map<String,Object>orderMaterial:orderMaterialList
+            ) {
+                OmstruckOrderMaterial omstruckOrderMaterial = new OmstruckOrderMaterial();
+                BigDecimal orderMaterialId = omstruckOrderMaterialMapper.selectMaxId();
+                BigDecimal materialId = DataChange.dataToBigDecimal(orderMaterial.get("materialId"));
+                omstruckOrderMaterial.setOrderMaterialId(orderMaterialId);
+                omstruckOrderMaterial.setOrderId(orderId);
+                omstruckOrderMaterial.setMaterialId(materialId);
+                omstruckOrderMaterial.setInsertTime(new Date());
+                omstruckOrderMaterial.setUpdateTime(new Date());
+                result +=omstruckOrderMaterialMapper.insertSelective(omstruckOrderMaterial);
+            }
+        }
+
+        return result;
+    }
+
 
     @Override
     public List<Map<String, Object>> getTruckPlanList(Map<String, Object> mapValue) {

+ 91 - 6
src/main/java/com/steerinfo/dil/service/impl/AmstruckInwardRequirementServiceImpl.java

@@ -50,6 +50,9 @@ public class AmstruckInwardRequirementServiceImpl extends BaseServiceImpl<Amstru
     @Autowired
     AmsContractTruckPriceServiceImpl amsContractTruckPriceService;
 
+    @Autowired
+    AmstruckInwardPlanServiceImpl amstruckInwardPlanService;
+
     @Override
     protected IBaseMapper<AmstruckInwardRequirement, BigDecimal> getMapper() {
         return amstruckInwardRequirementMapper;
@@ -75,7 +78,6 @@ public class AmstruckInwardRequirementServiceImpl extends BaseServiceImpl<Amstru
        //取出装机需求
         String loadingRemark = (String) mapValue.get("installremark");
         Long dueTime =(Long) mapValue.get("DueTime");
-
         AmstruckInwardRequirement amstruckInwardRequirement = new AmstruckInwardRequirement();
         //设置主键
         BigDecimal requirementId = amstruckInwardRequirementMapper.selectOtherId();
@@ -156,15 +158,83 @@ public class AmstruckInwardRequirementServiceImpl extends BaseServiceImpl<Amstru
             amstruckRequirementMaterial.setInsertUsername("admin");
             amstruckRequirementMaterial.setInsertUpdateRemark(InsertUpdateRemark);
             result += amstruckRequirementMaterialMapper.insertSelective(amstruckRequirementMaterial);
-            //if(mapValue.get("rangeId") != null){
-            //    //承运起止范围
-            //    requireMaterialMap.put("rangeId",mapValue.get("rangeId"));
-            //    amsContractTruckPriceService.insertLineNodePoint(requireMaterialMap);
-            //}
         }
         return result;
     }
 
+    //新增钢坯车辆用车需求
+    @Override
+    public int addBilletRequirement(Map<String, Object> mapValue) {
+        String requirementType = (String) mapValue.get("requirementType");
+        Integer requirementShipperId = (Integer) mapValue.get("requirementShipperId");
+        //提取车型
+        String InsertUpdateRemark = (String) mapValue.get("remark");
+        //取出装机需求
+        AmstruckInwardRequirement amstruckInwardRequirement = new AmstruckInwardRequirement();
+        //设置主键
+        BigDecimal requirementId = amstruckInwardRequirementMapper.selectOtherId();
+        amstruckInwardRequirement.setRequirementId(requirementId);
+        amstruckInwardRequirement.setRequirementNumber(DataChange.generateEightDigitsNumber("YSXQ",amstruckInwardRequirementMapper.selectOtherId().intValue()));
+        amstruckInwardRequirement.setRequirementStatus(new BigDecimal(2));
+        amstruckInwardRequirement.setRequirementType(requirementType);
+        //设置截止日期为2099年
+        amstruckInwardRequirement.setDueDate(new Date(4095805350L));
+        //用车单位
+        amstruckInwardRequirement.setRequirementShipperId(new BigDecimal(requirementShipperId));
+        //判断截止日期是否为空
+        // 设置常规字段
+        amstruckInwardRequirement.setInsertTime(new Date());
+        amstruckInwardRequirement.setInsertUsername((String) mapValue.get("orgCode"));
+        amstruckInwardRequirement.setInsertUpdateRemark(InsertUpdateRemark);
+        amstruckInwardRequirement.setDeleted(new BigDecimal(0));
+        int result = 0;
+        result += amstruckInwardRequirementMapper.insertSelective(amstruckInwardRequirement);
+        // 物资中间表
+        BigDecimal materialId = amstruckRequirementMaterialMapper.getMaterialId(mapValue);
+        //for (Map<String,Object> requireMaterialMap:mapList
+        //) {
+        //    BigDecimal materialId = DataChange.dataToBigDecimal(requireMaterialMap.get("materialId"));
+        //    if(materialId.intValue() == 0)
+        //        if(purchaseOrderId != null)
+        //            materialId = amstruckInwardRequirementMapper.getMaterialId(new BigDecimal(purchaseOrderId));
+        //    AmstruckRequirementMaterial amstruckRequirementMaterial = new AmstruckRequirementMaterial();
+        //    requireMaterialMap.get("requirementPlatformId");
+        //    requireMaterialMap.get("requirementUnloadUnitId");
+        //    BigDecimal materialNumber = DataChange.dataToBigDecimal(requireMaterialMap.get("orderMaterialNumber"));
+        //    BigDecimal materialWeight = DataChange.dataToBigDecimal(requireMaterialMap.get("orderMaterialWeight"));
+        //    BigDecimal materialPriority = DataChange.dataToBigDecimal(requireMaterialMap.get("materialPriority"));
+        //    BigDecimal requirementPlatformId = DataChange.dataToBigDecimal(requireMaterialMap.get("requirementPlatformId"));
+        //    BigDecimal requirementUnloadUnitId = DataChange.dataToBigDecimal(requireMaterialMap.get("requirementUnloadUnitId"));
+        //    amstruckRequirementMaterial.setRequirementMaterialId(amstruckRequirementMaterialMapper.selectRequirementMaterialId());
+        //    amstruckRequirementMaterial.setRequirementId(requirementId);
+        //    amstruckRequirementMaterial.setLoadUnloadSequence(materialPriority);
+        //    if(materialNumber.intValue() != 0)
+        //        amstruckRequirementMaterial.setMaterialCount(materialNumber);
+        //    if(materialWeight.intValue() != 0)
+        //        amstruckRequirementMaterial.setMaterialWeight(materialWeight);
+        //    if(requirementPlatformId.intValue() !=0){
+        //        amstruckRequirementMaterial.setRequirementPlatformId(requirementPlatformId);
+        //    }
+        //    if(requirementUnloadUnitId.intValue() !=0){
+        //        amstruckRequirementMaterial.setRequirementUnloadUnitId(requirementUnloadUnitId);
+        //    }
+        //    amstruckRequirementMaterial.setMaterialId(materialId);
+        //    amstruckRequirementMaterial.setInsertTime(new Date());
+        //    amstruckRequirementMaterial.setInsertUsername("admin");
+        //    amstruckRequirementMaterial.setInsertUpdateRemark(InsertUpdateRemark);
+        //    result += amstruckRequirementMaterialMapper.insertSelective(amstruckRequirementMaterial);
+        //}
+        //制定计划
+        Map<String, Object> planMap = new HashMap<>();
+        planMap.put("carrierId",5848);
+        planMap.put("requirementId",requirementId);
+        planMap.put("addBilletRequirement",1);
+        result =+ amstruckInwardPlanService.insert(planMap);
+        //分解计划-车牌号,物资
+
+        return result;
+    }
+
     /**
      * 查询用车需求
      * @param mapValue
@@ -385,6 +455,21 @@ public class AmstruckInwardRequirementServiceImpl extends BaseServiceImpl<Amstru
         return amstruckRequirementMaterialMapper.getRequirementMaterial(requirementId);
     }
 
+    @Override
+    public int closeDueDate(BigDecimal requirementId) {
+        int i = 0 ;
+        //根据需求id将截止日期定位现在
+        AmstruckInwardRequirement amstruckInwardRequirement = new AmstruckInwardRequirement();
+        amstruckInwardRequirement.setRequirementId(requirementId);
+        amstruckInwardRequirement.setDueDate(new Date());
+        i += amstruckInwardRequirementMapper.updateByPrimaryKeySelective(amstruckInwardRequirement);
+        //关闭需求下待接收的运单
+        i += amstruckInwardRequirementMapper.closeOrderByRequirementId(requirementId);
+        return i;
+    }
+
+
+
     public int insertInwardRequirementPlan(Map<String, Object> mapValue) {
         AmstruckInwardPlan amstruckInwardPlan = new AmstruckInwardPlan();
         BigDecimal planId = amstruckInwardPlanMapper.selectOtherId();

+ 150 - 13
src/main/resources/com/steerinfo/dil/mapper/AmsContractTransportPriceMapper.xml

@@ -23,18 +23,24 @@
         <result column="OILPRICE_BASE" jdbcType="DECIMAL" property="oilpriceBase" />
         <result column="OIL_TYPE_ID" jdbcType="DECIMAL" property="oilTypeId" />
         <result column="OILPRICE_CHANGE_THRESHOLD" jdbcType="DECIMAL" property="oilpriceChangeThreshold" />
+        <result column="OLD_DATE" jdbcType="TIMESTAMP" property="oldDate" />
+        <result column="HAUL_DISTANCE" jdbcType="DECIMAL" property="haulDistance" />
+        <result column="REFERENCE_HT" jdbcType="DECIMAL" property="referenceHt" />
+        <result column="INVENTORY" jdbcType="DECIMAL" property="inventory" />
+        <result column="ISSTANDARD" jdbcType="DECIMAL" property="isstandard" />
     </resultMap>
     <sql id="columns">
         PRICE_ID, SHIPPER_ID, CARRIER_ID, LINE_ID, CAPACITY_TYPE_ID, CARGONAME_ID, PRICE_TON_KILOMETER, 
     PRICE_VALUE, PRICE_DATE, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, 
-    INSERT_UPDATE_REMARK, DELETED, PLACE_ID, TYPE, DEPARTMENT, OILPRICE_BASE, OIL_TYPE_ID,
-    OILPRICE_CHANGE_THRESHOLD
+    INSERT_UPDATE_REMARK, DELETED, PLACE_ID, TYPE, DEPARTMENT, OILPRICE_BASE, OIL_TYPE_ID, 
+    OILPRICE_CHANGE_THRESHOLD, OLD_DATE, HAUL_DISTANCE, REFERENCE_HT, INVENTORY, ISSTANDARD
     </sql>
     <sql id="columns_alias">
         t.PRICE_ID, t.SHIPPER_ID, t.CARRIER_ID, t.LINE_ID, t.CAPACITY_TYPE_ID, t.CARGONAME_ID, 
     t.PRICE_TON_KILOMETER, t.PRICE_VALUE, t.PRICE_DATE, t.INSERT_USERNAME, t.INSERT_TIME, 
-    t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.PLACE_ID,
-    t.TYPE, t.DEPARTMENT, t.OILPRICE_BASE, t.OIL_TYPE_ID, t.OILPRICE_CHANGE_THRESHOLD
+    t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED, t.PLACE_ID, 
+    t.TYPE, t.DEPARTMENT, t.OILPRICE_BASE, t.OIL_TYPE_ID, t.OILPRICE_CHANGE_THRESHOLD, 
+    t.OLD_DATE, t.HAUL_DISTANCE, t.REFERENCE_HT, t.INVENTORY, t.ISSTANDARD
     </sql>
     <sql id="select">
         SELECT <include refid="columns" /> FROM AMS_CONTRACT_TRANSPORT_PRICE
@@ -107,6 +113,21 @@
             <if test="oilpriceChangeThreshold != null">
                 and OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
             </if>
+            <if test="oldDate != null">
+                and TO_CHAR(OLD_DATE,'yyyy-MM-dd') = #{oldDate}
+            </if>
+            <if test="haulDistance != null">
+                and HAUL_DISTANCE = #{haulDistance}
+            </if>
+            <if test="referenceHt != null">
+                and REFERENCE_HT = #{referenceHt}
+            </if>
+            <if test="inventory != null">
+                and INVENTORY = #{inventory}
+            </if>
+            <if test="isstandard != null">
+                and ISSTANDARD = #{isstandard}
+            </if>
         </where>
     </sql>
     <sql id="whereLike">
@@ -174,9 +195,24 @@
             <if test="oilpriceChangeThreshold != null">
                 and OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
             </if>
+            <if test="oldDate != null">
+                and TO_CHAR(OLD_DATE,'yyyy-MM-dd') = #{oldDate}
+            </if>
+            <if test="haulDistance != null">
+                and HAUL_DISTANCE = #{haulDistance}
+            </if>
+            <if test="referenceHt != null">
+                and REFERENCE_HT = #{referenceHt}
+            </if>
+            <if test="inventory != null">
+                and INVENTORY = #{inventory}
+            </if>
+            <if test="isstandard != null">
+                and ISSTANDARD = #{isstandard}
+            </if>
         </where>
     </sql>
-    <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
+    <delete id="deleteByPrimaryKey" parameterType="DECIMAL">
         delete from AMS_CONTRACT_TRANSPORT_PRICE
         where PRICE_ID = #{priceId,jdbcType=DECIMAL}
     </delete>
@@ -243,6 +279,21 @@
         <if test="oilpriceChangeThreshold != null">
             or OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
         </if>
+        <if test="oldDate != null">
+            or TO_CHAR(OLD_DATE,'yyyy-MM-dd') = '#{oldDate}'
+        </if>
+        <if test="haulDistance != null">
+            or HAUL_DISTANCE = #{haulDistance}
+        </if>
+        <if test="referenceHt != null">
+            or REFERENCE_HT = #{referenceHt}
+        </if>
+        <if test="inventory != null">
+            or INVENTORY = #{inventory}
+        </if>
+        <if test="isstandard != null">
+            or ISSTANDARD = #{isstandard}
+        </if>
     </delete>
     <insert id="insert" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
         insert into AMS_CONTRACT_TRANSPORT_PRICE (PRICE_ID, SHIPPER_ID, CARRIER_ID,
@@ -251,16 +302,18 @@
                                                   INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME,
                                                   UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED,
                                                   PLACE_ID, TYPE, DEPARTMENT,
-                                                  OILPRICE_BASE, OIL_TYPE_ID, OILPRICE_CHANGE_THRESHOLD
-        )
+                                                  OILPRICE_BASE, OIL_TYPE_ID, OILPRICE_CHANGE_THRESHOLD,
+                                                  OLD_DATE, HAUL_DISTANCE, REFERENCE_HT,
+                                                  INVENTORY, ISSTANDARD)
         values (#{priceId,jdbcType=DECIMAL}, #{shipperId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL},
                 #{lineId,jdbcType=DECIMAL}, #{capacityTypeId,jdbcType=DECIMAL}, #{cargonameId,jdbcType=CHAR},
                 #{priceTonKilometer,jdbcType=DECIMAL}, #{priceValue,jdbcType=DECIMAL}, #{priceDate,jdbcType=TIMESTAMP},
                 #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR},
                 #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL},
                 #{placeId,jdbcType=DECIMAL}, #{type,jdbcType=DECIMAL}, #{department,jdbcType=DECIMAL},
-                #{oilpriceBase,jdbcType=DECIMAL}, #{oilTypeId,jdbcType=DECIMAL}, #{oilpriceChangeThreshold,jdbcType=DECIMAL}
-               )
+                #{oilpriceBase,jdbcType=DECIMAL}, #{oilTypeId,jdbcType=DECIMAL}, #{oilpriceChangeThreshold,jdbcType=DECIMAL},
+                #{oldDate,jdbcType=TIMESTAMP}, #{haulDistance,jdbcType=DECIMAL}, #{referenceHt,jdbcType=DECIMAL},
+                #{inventory,jdbcType=DECIMAL}, #{isstandard,jdbcType=DECIMAL})
     </insert>
     <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
         insert into AMS_CONTRACT_TRANSPORT_PRICE
@@ -328,6 +381,21 @@
             <if test="oilpriceChangeThreshold != null">
                 OILPRICE_CHANGE_THRESHOLD,
             </if>
+            <if test="oldDate != null">
+                OLD_DATE,
+            </if>
+            <if test="haulDistance != null">
+                HAUL_DISTANCE,
+            </if>
+            <if test="referenceHt != null">
+                REFERENCE_HT,
+            </if>
+            <if test="inventory != null">
+                INVENTORY,
+            </if>
+            <if test="isstandard != null">
+                ISSTANDARD,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="priceId != null">
@@ -393,6 +461,21 @@
             <if test="oilpriceChangeThreshold != null">
                 #{oilpriceChangeThreshold,jdbcType=DECIMAL},
             </if>
+            <if test="oldDate != null">
+                #{oldDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="haulDistance != null">
+                #{haulDistance,jdbcType=DECIMAL},
+            </if>
+            <if test="referenceHt != null">
+                #{referenceHt,jdbcType=DECIMAL},
+            </if>
+            <if test="inventory != null">
+                #{inventory,jdbcType=DECIMAL},
+            </if>
+            <if test="isstandard != null">
+                #{isstandard,jdbcType=DECIMAL},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
@@ -416,7 +499,12 @@
             DEPARTMENT = #{department,jdbcType=DECIMAL},
             OILPRICE_BASE = #{oilpriceBase,jdbcType=DECIMAL},
             OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL},
-            OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold,jdbcType=DECIMAL}
+            OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold,jdbcType=DECIMAL},
+            OLD_DATE = #{oldDate,jdbcType=TIMESTAMP},
+            HAUL_DISTANCE = #{haulDistance,jdbcType=DECIMAL},
+            REFERENCE_HT = #{referenceHt,jdbcType=DECIMAL},
+            INVENTORY = #{inventory,jdbcType=DECIMAL},
+            ISSTANDARD = #{isstandard,jdbcType=DECIMAL}
         where PRICE_ID = #{priceId,jdbcType=DECIMAL}
     </update>
     <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
@@ -482,10 +570,25 @@
             <if test="oilpriceChangeThreshold != null">
                 OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold,jdbcType=DECIMAL},
             </if>
+            <if test="oldDate != null">
+                OLD_DATE = #{oldDate,jdbcType=TIMESTAMP},
+            </if>
+            <if test="haulDistance != null">
+                HAUL_DISTANCE = #{haulDistance,jdbcType=DECIMAL},
+            </if>
+            <if test="referenceHt != null">
+                REFERENCE_HT = #{referenceHt,jdbcType=DECIMAL},
+            </if>
+            <if test="inventory != null">
+                INVENTORY = #{inventory,jdbcType=DECIMAL},
+            </if>
+            <if test="isstandard != null">
+                ISSTANDARD = #{isstandard,jdbcType=DECIMAL},
+            </if>
         </set>
         where PRICE_ID = #{priceId,jdbcType=DECIMAL}
     </update>
-    <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
+    <select id="selectByPrimaryKey" parameterType="DECIMAL" resultMap="BaseResultMap">
         <include refid="select" />
         where PRICE_ID = #{priceId,jdbcType=DECIMAL}
     </select>
@@ -507,7 +610,9 @@
         UPDATE_TIME, INSERT_UPDATE_REMARK,
         DELETED, PLACE_ID, TYPE,
         DEPARTMENT, OILPRICE_BASE, OIL_TYPE_ID,
-        OILPRICE_CHANGE_THRESHOLD)
+        OILPRICE_CHANGE_THRESHOLD, OLD_DATE,
+        HAUL_DISTANCE, REFERENCE_HT, INVENTORY,
+        ISSTANDARD)
         ( <foreach collection="list" item="item" separator="union all">
         select
         #{item.priceId,jdbcType=DECIMAL},
@@ -518,7 +623,9 @@
         #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
         #{item.deleted,jdbcType=DECIMAL}, #{item.placeId,jdbcType=DECIMAL}, #{item.type,jdbcType=DECIMAL},
         #{item.department,jdbcType=DECIMAL}, #{item.oilpriceBase,jdbcType=DECIMAL}, #{item.oilTypeId,jdbcType=DECIMAL},
-        #{item.oilpriceChangeThreshold,jdbcType=DECIMAL} from dual
+        #{item.oilpriceChangeThreshold,jdbcType=DECIMAL}, #{item.oldDate,jdbcType=TIMESTAMP},
+        #{item.haulDistance,jdbcType=DECIMAL}, #{item.referenceHt,jdbcType=DECIMAL}, #{item.inventory,jdbcType=DECIMAL},
+        #{item.isstandard,jdbcType=DECIMAL} from dual
     </foreach> )
     </insert>
     <update id="batchUpdate" parameterType="java.util.List">
@@ -608,6 +715,26 @@
         <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
             when #{item.priceId,jdbcType=DECIMAL} then #{item.oilpriceChangeThreshold,jdbcType=DECIMAL}
         </foreach>
+        ,OLD_DATE=
+        <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+            when #{item.priceId,jdbcType=DECIMAL} then #{item.oldDate,jdbcType=TIMESTAMP}
+        </foreach>
+        ,HAUL_DISTANCE=
+        <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+            when #{item.priceId,jdbcType=DECIMAL} then #{item.haulDistance,jdbcType=DECIMAL}
+        </foreach>
+        ,REFERENCE_HT=
+        <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+            when #{item.priceId,jdbcType=DECIMAL} then #{item.referenceHt,jdbcType=DECIMAL}
+        </foreach>
+        ,INVENTORY=
+        <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+            when #{item.priceId,jdbcType=DECIMAL} then #{item.inventory,jdbcType=DECIMAL}
+        </foreach>
+        ,ISSTANDARD=
+        <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+            when #{item.priceId,jdbcType=DECIMAL} then #{item.isstandard,jdbcType=DECIMAL}
+        </foreach>
         where PRICE_ID in
         <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
             #{item.priceId,jdbcType=DECIMAL}
@@ -622,6 +749,10 @@
     </delete>
     <!-- 友情提示!!!-->
     <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+    <!-- 友情提示!!!-->
+    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+    <!-- 友情提示!!!-->
+    <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
 
     <select id="selectMaxId" resultType="DECIMAL">
         SELECT MAX(PRICE_ID) + 1
@@ -862,4 +993,10 @@
                a_t_price.PRICE_TON_KILOMETER "priceTonKilometer"
         from AMS_CONTRACT_TRANSPORT_PRICE a_t_price
     </select>
+    <select id="getPlaceId" resultType="java.math.BigDecimal" parameterType="decimal">
+        SELECT ASOM.SALE_SHIPPING_ADDRESS_ID FROM OMSTRUCK_ORDER OO
+        LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
+        ON OO.ORDER_PLAN_ID = ASOM.SALE_ORDER_MATERIAL_ID
+        WHERE OO.ORDER_ID = #{orderId}
+    </select>
 </mapper>

+ 3 - 0
src/main/resources/com/steerinfo/dil/mapper/AmsContractTruckPriceMapper.xml

@@ -731,6 +731,7 @@
 --     and a_t_price.TYPE = 1 and a_t_price.DEPARTMENT = 2
     <where>
         TYPE=1
+        and a_t_price.ISSTANDARD is null
         <if test="deleted != null">
           and a_t_price.DELETED = #{deleted}
         </if>
@@ -861,6 +862,7 @@
     RRA.ADDRESS_TOWN "town",
     RRP.ADDRESS_DELIVERY_ADDRESS "address1",
     RRA.ADDRESS_PROVINCE ||RRA.ADDRESS_DISTRICT|| RRA.ADDRESS_TOWN||RRP.ADDRESS_DELIVERY_ADDRESS "address",
+    RRP.PLACE_ID "placeId",
     ACTP.PRICE_VALUE "pricevalue",
     ACTP.PRICE_ID  "priceid"
     FROM RMS_RECEIVE_ADDRESS RRA
@@ -869,6 +871,7 @@
     LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE ACTP
     ON ACTP.PLACE_ID=RRP.PLACE_ID
     WHERE ACTP.DELETED = 0
+    and ACTP.ISSTANDARD IS NULL
     ) RRRA
     <if test="con != null" >
       WHERE RRRA."address" LIKE #{con}

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

@@ -4570,7 +4570,7 @@
   </select>
   <select id="getMoreCarrier" resultType="java.math.BigDecimal" parameterType="string">
     SELECT count(RMCP.CARRIER_PLACE_ID) FROM RMS_MORE_CARRIER_PLACE RMCP
-    WHERE RMCP.CARRIER_PLACE_VALUE LIKE #{place}
+    WHERE  #{place} LIKE '%' || RMCP.CARRIER_PLACE_VALUE || '%'
   </select>
   <select id="getOrderIdByCapacity" resultType="java.util.Map">
     select OO.order_ID "orderId",

+ 14 - 0
src/main/resources/com/steerinfo/dil/mapper/AmstruckInwardRequirementMapper.xml

@@ -776,6 +776,7 @@
             #{item.requirementId,jdbcType=DECIMAL}
         </foreach>
     </update>
+
     <delete id="batchDelete" parameterType="java.util.List">
         delete from AMSTRUCK_INWARD_REQUIREMENT
         where REQUIREMENT_ID in
@@ -1425,4 +1426,17 @@
         select AIR.PURCHASE_ORDER_ID from AMSTRUCK_INWARD_REQUIREMENT AIR
         WHERE AIR.REQUIREMENT_ID = #{requirementId}
     </select>
+    <update id="closeOrderByRequirementId" parameterType="decimal">
+        update OMSTRUCK_ORDER OO
+        set oo.ORDER_STATUS = 7,
+            oo.INSERT_UPDATE_REMARK = '提前关闭运单'
+        where
+        OO.ORDER_STATUS = 4
+        AND OO.ORDER_TYPE = 11
+        AND oo.ORDER_PLAN_ID =
+              (SELECT ARP.PLAN_ID FROM AMSTRUCK_REQUIREMENT_PLAN ARP
+            WHERE ARP.REQUIREMENT_ID = #{requirementId}
+            )
+
+        </update>
 </mapper>

+ 9 - 1
src/main/resources/com/steerinfo/dil/mapper/AmstruckRequirementMaterialMapper.xml

@@ -353,6 +353,7 @@
                        on air.requirement_id = arm.requirement_id
       where air.requirement_id = #{requirementId}
     </select>
+
     <insert id="batchInsert" parameterType="java.util.List">
     insert into AMSTRUCK_REQUIREMENT_MATERIAL
     (REQUIREMENT_MATERIAL_ID,
@@ -442,5 +443,12 @@
   </delete>
   <!-- 友情提示!!!-->
   <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
-
+  <select id="getMaterialId" resultType="java.math.BigDecimal" parameterType="map">
+    select RM.MATERIAL_ID from RMS_MATERIAL RM
+    left join RMS_MATERIAL_TYPE RMT
+    on rmt.MATERIAL_TYPE_ID = rm.MATERIAL_TYPE_ID
+    where rmt.MATERIAL_TYPE_NAME = '钢坯'
+    and rm.MATERIAL_MODEL = #{model}
+    and rm.MATERIAL_SPECIFICATION = #{type}
+  </select>
 </mapper>