Sfoglia il codice sorgente

Merge branch 'dev'

txf 3 anni fa
parent
commit
f0227b1054

+ 7 - 2
pom.xml

@@ -111,8 +111,13 @@
                     <!--包名-->
                     <targetPackage>com.steerinfo.dil</targetPackage>
                     <tables>
-<!--                            <param>RMS_OIL_PRICE</param>-->
-<!--                            <param>RMS_OIL_TYPE</param>-->
+<!--                        <param>AMS_SALE_ORDER</param>&lt;!&ndash;销售计划&ndash;&gt;-->
+<!--                        <param>AMSTRUCK_INWARD_REQUIREMENT</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;-->
+<!--                        <param>AMSTRUCK_RAIL_DAYPLAN</param>&lt;!&ndash;销售计划物资中间表&ndash;&gt;-->
+<!--                        <param>AMS_CONTRACT_TRANSPORT_PRICE</param>&lt;!&ndash;销售订单&ndash;&gt;-->
+<!--                        <param>AMS_SALE_ORDER_MATERIAL</param>&lt;!&ndash;销售订单车序号表&ndash;&gt;-->
+<!--                        <param>AMS_SALE_TRUCKNO_MATERIAL</param>&lt;!&ndash;车序号物资中间表&ndash;&gt;-->
+                            <param>AMS_CONTRACT_TRANSPORT_PRICE</param>
                     </tables>
                 </configuration>
                 <executions>

+ 33 - 7
src/main/java/com/steerinfo/dil/controller/AmsContractTruckPriceController.java

@@ -58,12 +58,12 @@ public class AmsContractTruckPriceController extends BaseRESTfulController {
     public RESTfulResult getAmsContractTransportPrice(@RequestBody(required=false) Map<String,Object> mapValue,
                                                       Integer apiId,
                                                       Integer pageNum,
-                                                      Integer pageSize){
-
-        List<Map<String, Object>> amsContractTransportPrice = amsContractTruckPriceService.getAmsContractTransportPrice(mapValue);
+                                                      Integer pageSize,
+                                                      Integer deleted){
+        if(deleted != null) mapValue.put("deleted", deleted);
         PageHelper.startPage(pageNum,pageSize);
         List<Map<String, Object>> amsContractTransportPrice1 = amsContractTruckPriceService.getAmsContractTransportPrice(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, amsContractTransportPrice,amsContractTransportPrice1);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,amsContractTransportPrice1);
         return success(pageList);
     }
 
@@ -122,7 +122,7 @@ public class AmsContractTruckPriceController extends BaseRESTfulController {
             @ApiImplicitParam(name = "amsContractTransportPrice", value = "销售订单对象", required = false, dataType = "AmsContractTransportPrice")
     })
     @PostMapping(value = "/updateAmsContractTransportPrice1")
-    public RESTfulResult updateAmsContractTransportPrice(@RequestBody(required = false) AmsContractTransportPrice amsContractTransportPrice){
+    public RESTfulResult updateAmsContractTransportPrice(@RequestParam AmsContractTransportPrice amsContractTransportPrice){
         int i = amsContractTruckPriceService.updateAmsContractTransportPrice(amsContractTransportPrice);
         return success(i);
     }
@@ -136,8 +136,8 @@ public class AmsContractTruckPriceController extends BaseRESTfulController {
     @ApiImplicitParams({
     })
     @PostMapping(value = "/batchUpdateTransportPriceByOilPrice1")
-    public RESTfulResult batchUpdateTransportPriceByOilPrice(){
-        int i = amsContractTruckPriceService.batchUpdateTransportPriceByOilPrice();
+    public RESTfulResult batchUpdateTransportPriceByOilPrice(@RequestBody Map<String,Object> map){
+        int i = amsContractTruckPriceService.batchUpdateTransportPriceByOilPrice(map);
         return success(i);
     }
 
@@ -209,4 +209,30 @@ public class AmsContractTruckPriceController extends BaseRESTfulController {
 
     }
 
+    /**
+     * 获取货物类型
+     * @param
+     * @return
+     */
+    @ApiOperation(value="获取货物类型")
+    @ApiImplicitParams({
+    })
+    @GetMapping(value = "/getCargoName")
+    public RESTfulResult getCargoName(){
+        return success(amsContractTruckPriceService.getCargoName());
+    }
+
+    /**
+     * 获取油品名称
+     * @param
+     * @return
+     */
+    @ApiOperation(value="获取油品名称")
+    @ApiImplicitParams({
+    })
+    @GetMapping(value = "/getOilTypeName")
+    public RESTfulResult getOilTypeName(){
+        return success(amsContractTruckPriceService.getOilTypeName());
+    }
+
 }

+ 9 - 13
src/main/java/com/steerinfo/dil/controller/AmsSaleOrderController.java

@@ -504,10 +504,9 @@ public class AmsSaleOrderController extends BaseRESTfulController {
                                             Integer pageNum,
                                             Integer pageSize){
 
-        List<Map<String, Object>> amsSaleOrder = amsSaleOrderService.getSaleOrderInfoes(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         List<Map<String, Object>> amsSaleOrder1 = amsSaleOrderService.getSaleOrderInfoes(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, amsSaleOrder,amsSaleOrder1);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,amsSaleOrder1);
         return success(pageList);
     }
 
@@ -521,10 +520,9 @@ public class AmsSaleOrderController extends BaseRESTfulController {
                                                 Integer pageNum,
                                                 Integer pageSize){
 
-        List<Map<String, Object>> amsSaleOrder = amsSaleOrderService.getSaleOrderReportedes(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         List<Map<String, Object>> amsSaleOrder1 = amsSaleOrderService.getSaleOrderReportedes(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, amsSaleOrder,amsSaleOrder1);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,amsSaleOrder1);
         return success(pageList);
     }
 
@@ -540,15 +538,14 @@ public class AmsSaleOrderController extends BaseRESTfulController {
                                                          Integer pageSize,
                                                          Integer apiId,
                                                          String con) {
-        if (con != null && !con.equals("undefined")) {
-            mapValue.put("con","%" + con + "%");
+        if (con != null  && !"".equals(con) && !"null".equals(con)) {
+            mapValue.put("con", con);
         }
         //不分页筛选数据
-        List<Map<String, Object>> saleCompanyList =  amsSaleOrderService.getSaleOrderListBySaleCompanyes(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         //分页数据
         List<Map<String, Object>> saleOrderList = amsSaleOrderService.getSaleOrderListBySaleCompanyes(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, saleCompanyList,saleOrderList);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,saleOrderList);
         return success(pageList);
     }
 
@@ -561,14 +558,13 @@ public class AmsSaleOrderController extends BaseRESTfulController {
                                                    Integer apiId,
                                                    Integer pageNum,
                                                    Integer pageSize,
-                                                   @RequestParam String index){
-        if (index != null && !index.equals("undefined")) {
-            mapValue.put("index", "%" + index + "%");
+                                                   @RequestParam String con){
+        if (con != null && !"undefined".equals(con)) {
+            mapValue.put("con", con);
         }
-        List<Map<String, Object>> amsSaleOrder = amsSaleOrderService.getAmsSaleOrderApprovedes(mapValue);
         PageHelper.startPage(pageNum,pageSize);
         List<Map<String, Object>> amsSaleOrder1 = amsSaleOrderService.getAmsSaleOrderApprovedes(mapValue);
-        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, amsSaleOrder,amsSaleOrder1);
+        PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,amsSaleOrder1);
         return success(pageList);
     }
 

+ 10 - 0
src/main/java/com/steerinfo/dil/mapper/AmsContractTruckPriceMapper.java

@@ -32,8 +32,18 @@ public interface AmsContractTruckPriceMapper extends IBaseMapper<AmsContractTran
     int batchUpdateTransportPriceByOilPrice(Double updateOilPrice);
     //通过主键查询参考运距
     BigDecimal getLinePathLength(BigDecimal lineId);
+    //获取符合条件运价数值列表
+    List<Map<String, Object>> getPriceValueList(BigDecimal oilTypeId);
     //获取运价和吨公里数值列表
     List<Map<String, Object>> getPriceValueAndPriceTonKilometer();
     //通过主键修改吨公里数
     int updatePriceTonKilometer(BigDecimal priceId,BigDecimal priceTonKilometer);
+    //获取焦炭运价计算公式
+    String getTruckFormula(BigDecimal formulaId);
+    //查询货物名称
+    String getCargonameValue(BigDecimal cargonameId);
+    //获取货物类型
+    List<Map<String, Object>> getCargoName();
+    //获取油品名称
+    List<Map<String, Object>> getOilTypeName();
 }

+ 61 - 16
src/main/java/com/steerinfo/dil/model/AmsContractTransportPrice.java

@@ -34,16 +34,16 @@ public class AmsContractTransportPrice implements IBasePO<BigDecimal> {
     private BigDecimal lineId;
 
     /**
-     * 运力ID(CAPACITY_ID,DECIMAL,0)
+     * 运力类型ID(CAPACITY_TYPE_ID,DECIMAL,0)
      */
-    @ApiModelProperty(value="运力ID",required=false)
-    private BigDecimal capacityId;
+    @ApiModelProperty(value="运力类型ID",required=false)
+    private BigDecimal capacityTypeId;
 
     /**
-     * 物资ID(MATERIAL_ID,CHAR,10)
+     * 货物类型ID(CARGONAME_ID,CHAR,10)
      */
-    @ApiModelProperty(value="物资ID",required=false)
-    private String materialId;
+    @ApiModelProperty(value="货物类型ID",required=false)
+    private String cargonameId;
 
     /**
      * 吨公里(元/吨.km)(PRICE_TON_KILOMETER,DECIMAL,0)
@@ -117,6 +117,24 @@ public class AmsContractTransportPrice implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="所属部门: 1:为物流运输部 2:为化产焦炭部",required=false)
     private BigDecimal department;
 
+    /**
+     * 油价基准(OILPRICE_BASE,DECIMAL,0)
+     */
+    @ApiModelProperty(value="油价基准",required=false)
+    private BigDecimal oilpriceBase;
+
+    /**
+     * 油品名称ID(OIL_TYPE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="油品名称ID",required=false)
+    private BigDecimal oilTypeId;
+
+    /**
+     * 油价变化率阈值(OILPRICE_CHANGE_THRESHOLD,DECIMAL,0)
+     */
+    @ApiModelProperty(value="油价变化率阈值",required=false)
+    private BigDecimal oilpriceChangeThreshold;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -161,20 +179,20 @@ public class AmsContractTransportPrice implements IBasePO<BigDecimal> {
         this.lineId = lineId;
     }
 
-    public BigDecimal getCapacityId() {
-        return capacityId;
+    public BigDecimal getCapacityTypeId() {
+        return capacityTypeId;
     }
 
-    public void setCapacityId(BigDecimal capacityId) {
-        this.capacityId = capacityId;
+    public void setCapacityTypeId(BigDecimal capacityTypeId) {
+        this.capacityTypeId = capacityTypeId;
     }
 
-    public String getMaterialId() {
-        return materialId;
+    public String getCargonameId() {
+        return cargonameId;
     }
 
-    public void setMaterialId(String materialId) {
-        this.materialId = materialId == null ? null : materialId.trim();
+    public void setCargonameId(String cargonameId) {
+        this.cargonameId = cargonameId == null ? null : cargonameId.trim();
     }
 
     public BigDecimal getPriceTonKilometer() {
@@ -273,6 +291,30 @@ public class AmsContractTransportPrice implements IBasePO<BigDecimal> {
         this.department = department;
     }
 
+    public BigDecimal getOilpriceBase() {
+        return oilpriceBase;
+    }
+
+    public void setOilpriceBase(BigDecimal oilpriceBase) {
+        this.oilpriceBase = oilpriceBase;
+    }
+
+    public BigDecimal getOilTypeId() {
+        return oilTypeId;
+    }
+
+    public void setOilTypeId(BigDecimal oilTypeId) {
+        this.oilTypeId = oilTypeId;
+    }
+
+    public BigDecimal getOilpriceChangeThreshold() {
+        return oilpriceChangeThreshold;
+    }
+
+    public void setOilpriceChangeThreshold(BigDecimal oilpriceChangeThreshold) {
+        this.oilpriceChangeThreshold = oilpriceChangeThreshold;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -283,8 +325,8 @@ public class AmsContractTransportPrice implements IBasePO<BigDecimal> {
         sb.append(", shipperId=").append(shipperId);
         sb.append(", carrierId=").append(carrierId);
         sb.append(", lineId=").append(lineId);
-        sb.append(", capacityId=").append(capacityId);
-        sb.append(", materialId=").append(materialId);
+        sb.append(", capacityTypeId=").append(capacityTypeId);
+        sb.append(", cargonameId=").append(cargonameId);
         sb.append(", priceTonKilometer=").append(priceTonKilometer);
         sb.append(", priceValue=").append(priceValue);
         sb.append(", priceDate=").append(priceDate);
@@ -297,6 +339,9 @@ public class AmsContractTransportPrice implements IBasePO<BigDecimal> {
         sb.append(", addressId=").append(addressId);
         sb.append(", type=").append(type);
         sb.append(", department=").append(department);
+        sb.append(", oilpriceBase=").append(oilpriceBase);
+        sb.append(", oilTypeId=").append(oilTypeId);
+        sb.append(", oilpriceChangeThreshold=").append(oilpriceChangeThreshold);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 39 - 9
src/main/java/com/steerinfo/dil/model/OmstruckOrder.java

@@ -10,15 +10,15 @@ import java.util.Date;
 @ApiModel(value="汽运运输订单")
 public class OmstruckOrder implements IBasePO<BigDecimal> {
     /**
-     * 运输订单id(ORDER_ID,DECIMAL,38)
+     * 运输订单id(ORDER_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="运输订单id",required=true)
     private BigDecimal orderId;
 
     /**
-     * 销售订单和物资的中间表ID/发运计划ID/采购订单ID/内转物流计划ID(ORDER_PLAN_ID,DECIMAL,38)
+     * 销售订单和物资的中间表ID/发运计划ID/采购订单ID/内转物流计划ID/零星订单ID(ORDER_PLAN_ID,DECIMAL,0)
      */
-    @ApiModelProperty(value="销售订单和物资的中间表ID/发运计划ID/采购订单ID/内转物流计划ID",required=false)
+    @ApiModelProperty(value="销售订单和物资的中间表ID/发运计划ID/采购订单ID/内转物流计划ID/零星订单ID",required=false)
     private BigDecimal orderPlanId;
 
     /**
@@ -28,7 +28,7 @@ public class OmstruckOrder implements IBasePO<BigDecimal> {
     private String orderNumber;
 
     /**
-     * 运力ID(CAPACITY_ID,DECIMAL,38)
+     * 运力ID(CAPACITY_ID,DECIMAL,0)
      */
     @ApiModelProperty(value="运力ID",required=false)
     private BigDecimal capacityId;
@@ -40,7 +40,7 @@ public class OmstruckOrder implements IBasePO<BigDecimal> {
     private Date orderIssueTime;
 
     /**
-     * 司机操作订单行为:0:拒绝;1:接收(ORDER_RECEIVE_STATUS,DECIMAL,38)
+     * 司机操作订单行为:0:拒绝;1:接收(ORDER_RECEIVE_STATUS,DECIMAL,0)
      */
     @ApiModelProperty(value="司机操作订单行为:0:拒绝;1:接收",required=false)
     private BigDecimal orderReceiveStatus;
@@ -58,7 +58,7 @@ public class OmstruckOrder implements IBasePO<BigDecimal> {
     private BigDecimal orderCommunicationDuration;
 
     /**
-     * 运单状态 :0:待运输,1:执行中,2:已结束,3:未下发,4:已下发,5:已接收,6:已拒绝,7:逻辑删除 8: 关闭  9:退货关闭(ORDER_STATUS,DECIMAL,38)
+     * 运单状态 :0:待运输,1:执行中,2:已结束,3:未下发,4:已下发,5:已接收,6:已拒绝,7:逻辑删除 8: 关闭  9:退货关闭(ORDER_STATUS,DECIMAL,0)
      */
     @ApiModelProperty(value="运单状态 :0:待运输,1:执行中,2:已结束,3:未下发,4:已下发,5:已接收,6:已拒绝,7:逻辑删除 8: 关闭  9:退货关闭",required=false)
     private BigDecimal orderStatus;
@@ -100,13 +100,13 @@ public class OmstruckOrder implements IBasePO<BigDecimal> {
     private BigDecimal deleted;
 
     /**
-     * 订单类型(1:销售订单;2:焦炭发运计划;3:水渣发运计划;4:内转到异地库;5:采购辅料订单;6:采购老区燃料订单;7:采购新区燃料订单;8:采购进口矿(万州-厂内);9:采购内转(达州-厂内);10:采购内转(老区-厂内); 11:厂内内转)(ORDER_TYPE,DECIMAL,0)
+     * 订单类型(1:销售订单;2:焦炭发运计划;3:水渣发运计划;4:内转到异地库;5:采购辅料订单;6:采购老区燃料订单;7:采购新区燃料订单;8:采购进口矿(万州-厂内);9:采购内转(达州-厂内);10:采购内转(老区-厂内); 11:厂内内转;12:零星物资进厂、13:零星物资出厂:14:钢材退货 ;15 内转精煤进厂;16 内转精煤出厂;17 采购化工材料新区订单; 18 采购化工材料老区订单)(ORDER_TYPE,DECIMAL,0)
      */
-    @ApiModelProperty(value="订单类型(1:销售订单;2:焦炭发运计划;3:水渣发运计划;4:内转到异地库;5:采购辅料订单;6:采购老区燃料订单;7:采购新区燃料订单;8:采购进口矿(万州-厂内);9:采购内转(达州-厂内);10:采购内转(老区-厂内); 11:厂内内转)",required=false)
+    @ApiModelProperty(value="订单类型(1:销售订单;2:焦炭发运计划;3:水渣发运计划;4:内转到异地库;5:采购辅料订单;6:采购老区燃料订单;7:采购新区燃料订单;8:采购进口矿(万州-厂内);9:采购内转(达州-厂内);10:采购内转(老区-厂内); 11:厂内内转;12:零星物资进厂、13:零星物资出厂:14:钢材退货 ;15 内转精煤进厂;16 内转精煤出厂;17 采购化工材料新区订单; 18 采购化工材料老区订单)",required=false)
     private BigDecimal orderType;
 
     /**
-     * 路段顺序号:(1:进厂 ; 2:计毛;3:卸货;4:计皮;5:出厂;6:装货)(ORDER_LINE_SEQUENCE,DECIMAL,38)
+     * 路段顺序号:(1:进厂 ; 2:计毛;3:卸货;4:计皮;5:出厂;6:装货)(ORDER_LINE_SEQUENCE,DECIMAL,0)
      */
     @ApiModelProperty(value="路段顺序号:(1:进厂 ; 2:计毛;3:卸货;4:计皮;5:出厂;6:装货)",required=false)
     private BigDecimal orderLineSequence;
@@ -135,6 +135,18 @@ public class OmstruckOrder implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="司机确认订单(1:已确认)",required=false)
     private BigDecimal driverConfirmation;
 
+    /**
+     * 运输单价ID(PRICE_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="运输单价ID",required=false)
+    private BigDecimal priceId;
+
+    /**
+     * 订单所属承运商ID(CARRIER_ID,DECIMAL,0)
+     */
+    @ApiModelProperty(value="订单所属承运商ID",required=false)
+    private BigDecimal carrierId;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -315,6 +327,22 @@ public class OmstruckOrder implements IBasePO<BigDecimal> {
         this.driverConfirmation = driverConfirmation;
     }
 
+    public BigDecimal getPriceId() {
+        return priceId;
+    }
+
+    public void setPriceId(BigDecimal priceId) {
+        this.priceId = priceId;
+    }
+
+    public BigDecimal getCarrierId() {
+        return carrierId;
+    }
+
+    public void setCarrierId(BigDecimal carrierId) {
+        this.carrierId = carrierId;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -342,6 +370,8 @@ public class OmstruckOrder implements IBasePO<BigDecimal> {
         sb.append(", orderEntryTime=").append(orderEntryTime);
         sb.append(", unloadPointId=").append(unloadPointId);
         sb.append(", driverConfirmation=").append(driverConfirmation);
+        sb.append(", priceId=").append(priceId);
+        sb.append(", carrierId=").append(carrierId);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 5 - 2
src/main/java/com/steerinfo/dil/service/IAmsContractTruckPriceService.java

@@ -41,6 +41,9 @@ public interface IAmsContractTruckPriceService {
     //获取所有的油价
     List<Map<String, Object>> getOriginAndNowOilPrice();
     //油价联动导致运价变动,批量修改运价,同时修改吨公里的数值
-    int batchUpdateTransportPriceByOilPrice();
-
+    int batchUpdateTransportPriceByOilPrice(Map<String,Object> map);
+    //获取货物类型
+    List<Map<String,Object>> getCargoName();
+    //获取油品名称
+    List<Map<String,Object>> getOilTypeName();
 }

+ 8 - 4
src/main/java/com/steerinfo/dil/service/impl/AmsContractTransportPriceServiceImpl.java

@@ -1,6 +1,7 @@
 package com.steerinfo.dil.service.impl;
 
 import com.steerinfo.dil.mapper.AmsContractTransportPriceMapper;
+import com.steerinfo.dil.mapper.AmsContractTruckPriceMapper;
 import com.steerinfo.dil.model.AmsContractTransportPrice;
 import com.steerinfo.dil.service.IAmsContractTransportPriceService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,6 +23,9 @@ public class AmsContractTransportPriceServiceImpl implements IAmsContractTranspo
 
     @Autowired
     AmsContractTransportPriceMapper amsContractTransportPriceMapper;
+
+    @Autowired
+    AmsContractTruckPriceMapper amsContractTruckPriceMapper;
     /**
      * 得到最大id
      * @return
@@ -62,23 +66,23 @@ public class AmsContractTransportPriceServiceImpl implements IAmsContractTranspo
     }
 
     /**
-     * 新增运单价
+     * 新增运单价
      * @param amsContractTransportPrice
      * @return
      */
     @Override
     public int insertTruck(AmsContractTransportPrice amsContractTransportPrice) {
-        BigDecimal priceId = selectMaxId();
+        BigDecimal priceId = amsContractTruckPriceMapper.selectMaxId();;
         amsContractTransportPrice.setPriceId(priceId);
         // 设置常规字段
         amsContractTransportPrice.setInsertUsername("admin");
         amsContractTransportPrice.setInsertTime(new Date());
-        amsContractTransportPrice.setType(new BigDecimal(4));
+//        amsContractTransportPrice.setType(new BigDecimal(4));
         amsContractTransportPrice.setUpdateTime(new Date());
         amsContractTransportPrice.setUpdateUsername("admin");
         amsContractTransportPrice.setInsertUpdateRemark("无");
         amsContractTransportPrice.setDeleted(new BigDecimal(0));
-        return amsContractTransportPriceMapper.insertSelective(amsContractTransportPrice);
+        return amsContractTransportPriceMapper.insert(amsContractTransportPrice);
     }
 
     /**

+ 313 - 39
src/main/java/com/steerinfo/dil/service/impl/AmsContractTruckPriceServiceImpl.java

@@ -3,13 +3,18 @@ package com.steerinfo.dil.service.impl;
 import com.steerinfo.dil.mapper.AmsContractTruckPriceMapper;
 import com.steerinfo.dil.model.AmsContractTransportPrice;
 import com.steerinfo.dil.service.IAmsContractTruckPriceService;
+import com.steerinfo.dil.util.DataChange;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.Stack;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 /**
  * AmsContractTransportPrice服务实现:
@@ -132,55 +137,324 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
         return amsContractTruckPriceMapper.getOriginAndNowOilPrice();
     }
 
+    @Override
+    public List<Map<String, Object>> getCargoName() {
+        return amsContractTruckPriceMapper.getCargoName();
+    }
+
+    @Override
+    public List<Map<String, Object>> getOilTypeName() {
+        return amsContractTruckPriceMapper.getOilTypeName();
+    }
+
     /**
-     * 批量修改油价
+     * 批量修改运输单
      * @return
      */
     @Override
-    public int batchUpdateTransportPriceByOilPrice() {
-        //获取所有油价信息
-        List<Map<String, Object>> originAndNowOilPrice = amsContractTruckPriceMapper.getOriginAndNowOilPrice();
-        //原油价
-        BigDecimal originOilPrice = new BigDecimal("1");
-        //现油价
-        BigDecimal nowOilPrice = new BigDecimal("0");
-        for (int i = 0; i < 2; i++) {
-            if(i==0){
-                nowOilPrice = (BigDecimal) originAndNowOilPrice.get(i).get("priceValue");
-            }else if(i==1){
-                originOilPrice = (BigDecimal) originAndNowOilPrice.get(i).get("priceValue");
+    @Transactional
+    public int batchUpdateTransportPriceByOilPrice(Map<String,Object> map) {
+        //运输单价变化的条数
+        int i = 0;
+        //获取油品名称ID
+        BigDecimal oilTypeId = DataChange.dataToBigDecimal(map.get("oilTypeId"));
+        //获取预执行油价
+        BigDecimal newOilPrice = DataChange.dataToBigDecimal(map.get("newOilPrice"));
+        //根据油品名称ID和非历史油价筛选出符合条件的运价合集
+        List<Map<String, Object>> PriceValueList = amsContractTruckPriceMapper.getPriceValueList(oilTypeId);
+        for (Map<String, Object> stringObjectMap : PriceValueList) {
+            //获取该条单价的原油价基准
+            BigDecimal oilpriceBase = DataChange.dataToBigDecimal(stringObjectMap.get("oilpriceBase"));
+            //获取该条单价的油价变化率阈值
+            BigDecimal oilpriceChangeThreshold = DataChange.dataToBigDecimal(stringObjectMap.get("oilpriceChangeThreshold"));
+            //计算油价变化率,公式:n=(当前油价-基数)÷基数×100%
+            BigDecimal n = (newOilPrice.subtract(oilpriceBase)).divide(oilpriceBase,4,4);
+            //若油价变化率超过该条单价的油价变化率阈值,修改原单价为历史数据,新增一条单价
+            if(n.abs().doubleValue()>oilpriceChangeThreshold.doubleValue()){
+                i+=addANewAmsContractTransportPrice(stringObjectMap,n,newOilPrice);
             }
         }
-        //油价变动率
-        Double updateOilPrice = nowOilPrice.doubleValue()/originOilPrice.doubleValue()-1;
-        //获取原运价和吨公里数
-        List<Map<String, Object>> priceValueAndPriceTonKilometer = amsContractTruckPriceMapper.getPriceValueAndPriceTonKilometer();
-
-        if(updateOilPrice>0.05||updateOilPrice<-0.05) {
-            //逐条修改吨公里数
-            for (Map<String, Object> stringObjectMap : priceValueAndPriceTonKilometer) {
-                //主键Id
-                BigDecimal priceId = (BigDecimal) stringObjectMap.get("priceId");
-                //原运价
-                BigDecimal priceValue = (BigDecimal) stringObjectMap.get("priceValue");
-                //吨公里数
-                BigDecimal priceTonKilometer = (BigDecimal) stringObjectMap.get("priceTonKilometer");
-                //参考距离,四舍五入,保留两位小数
-                BigDecimal distance;
-                if (priceTonKilometer.doubleValue() != 0) {
-                    distance = priceValue.divide(priceTonKilometer, 2, BigDecimal.ROUND_HALF_UP);
-                    //现运价
-                    Double nowPriceValue = priceValue.doubleValue() * 0.65 + priceValue.doubleValue() * 0.35 * (1 + updateOilPrice);
-                    BigDecimal nowPriceValue1 = new BigDecimal(nowPriceValue);
-                    //新吨公里数
-                    BigDecimal newPriceTonKilometer = nowPriceValue1.divide(distance, 4, BigDecimal.ROUND_HALF_UP);
-                    //通过主键修改一条吨公里数
-                    amsContractTruckPriceMapper.updatePriceTonKilometer(priceId, newPriceTonKilometer);
+        return i;
+        //        if(updateOilPrice>0.05||updateOilPrice<-0.05) {
+//            //逐条修改吨公里数
+//            for (Map<String, Object> stringObjectMap : priceValueAndPriceTonKilometer) {
+//                //主键Id
+//                BigDecimal priceId = (BigDecimal) stringObjectMap.get("priceId");
+//                //原运价
+//                BigDecimal priceValue = (BigDecimal) stringObjectMap.get("priceValue");
+//                //吨公里数
+//                BigDecimal priceTonKilometer = (BigDecimal) stringObjectMap.get("priceTonKilometer");
+//                //参考距离,四舍五入,保留两位小数
+//                BigDecimal distance;
+//                if (priceTonKilometer.doubleValue() != 0) {
+//                    distance = priceValue.divide(priceTonKilometer, 2, BigDecimal.ROUND_HALF_UP);
+//                    //现运价
+//                    Double nowPriceValue = priceValue.doubleValue() * 0.65 + priceValue.doubleValue() * 0.35 * (1 + updateOilPrice);
+//                    BigDecimal nowPriceValue1 = new BigDecimal(nowPriceValue);
+//                    //新吨公里数
+//                    BigDecimal newPriceTonKilometer = nowPriceValue1.divide(distance, 4, BigDecimal.ROUND_HALF_UP);
+//                    //通过主键修改一条吨公里数
+//                    amsContractTruckPriceMapper.updatePriceTonKilometer(priceId, newPriceTonKilometer);
+//                }
+//                return amsContractTruckPriceMapper.batchUpdateTransportPriceByOilPrice(updateOilPrice);
+//            }
+//        }
+    }
+
+    /**
+     * 油价变化率超过该条单价的油价变化率阈值,修改原单价为历史数据,新增一条执行单价
+     * @param stringObjectMap
+     * @param n
+     * @param newOilPrice
+     * @return
+     * @throws Exception
+     */
+    @Transactional
+    public int addANewAmsContractTransportPrice(Map<String, Object> stringObjectMap,BigDecimal n,BigDecimal newOilPrice){
+        //定义将要改变的执行价
+        BigDecimal nowPriceValue;
+        //存储原运输单价实绩对象
+        AmsContractTransportPrice oldAmsContractTransportPrice = new AmsContractTransportPrice();
+        //查询货物名称
+        String cargonameValue = amsContractTruckPriceMapper.getCargonameValue(new BigDecimal(stringObjectMap.get("cargonameId").toString()));
+        //获取原主键Id
+        BigDecimal priceId = (BigDecimal) stringObjectMap.get("priceId");
+        //修改原单价为历史数据
+        oldAmsContractTransportPrice.setPriceId(priceId);
+        oldAmsContractTransportPrice.setDeleted(new BigDecimal(1));
+        amsContractTruckPriceMapper.updateByPrimaryKeySelective(oldAmsContractTransportPrice);
+        //获取原单价的所有数据
+        AmsContractTransportPrice amsContractTransportPrice = amsContractTruckPriceMapper.selectByPrimaryKey(priceId);
+        //生成主键
+        BigDecimal i = amsContractTruckPriceMapper.selectMaxId();
+        amsContractTransportPrice.setPriceId(i);
+        //生成执行日期
+        amsContractTransportPrice.setPriceDate(new Date());
+        //常规字段
+        amsContractTransportPrice.setInsertUsername("admin");
+        amsContractTransportPrice.setInsertTime(new Date());
+        amsContractTransportPrice.setUpdateUsername("admin");
+        amsContractTransportPrice.setUpdateTime(new Date());
+        amsContractTransportPrice.setInsertUpdateRemark("无");
+        //修改现单价为执行数据
+        amsContractTransportPrice.setDeleted(new BigDecimal(0));
+        //若货物名称为焦炭
+        if(cargonameValue.equals("焦炭")){
+            //现执行价=((63.00+63.00*0.13*n)+(66.50+66.50*0.3*n)+40.00)
+            //调用焦炭运价计算公式计算现执行价
+            try {
+                nowPriceValue = UpdateCokePriceValueByOilPrice(n.toString());
+                //保留两位小数
+                nowPriceValue = nowPriceValue.divide(new BigDecimal(1),2,4);
+                //调整焦炭运价
+                amsContractTransportPrice.setPriceValue(nowPriceValue);
+                //修改基准油价
+                amsContractTransportPrice.setOilpriceBase(newOilPrice);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if(cargonameValue.equals("纯苯")){
+            //现执行价=(中标价*0.7)+(中标价*0.3)*(1+n)
+            //调用纯苯运价计算公式计算现执行价
+            try {
+                nowPriceValue = UpdatePureBenzenePriceValueByOilPrice(n.toString(),amsContractTransportPrice.getPriceValue());
+                //保留两位小数
+                nowPriceValue = nowPriceValue.divide(new BigDecimal(1),2,4);
+                //调整纯苯运价
+                amsContractTransportPrice.setPriceValue(nowPriceValue);
+                //修改基准油价
+                amsContractTransportPrice.setOilpriceBase(newOilPrice);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        //新增数据
+        int insert = amsContractTruckPriceMapper.insert(amsContractTransportPrice);
+        return insert;
+    }
+
+    /**
+     * 替换焦炭运价公式并进行计算
+     * @param n
+     * @return
+     * @throws Exception
+     */
+    public BigDecimal UpdateCokePriceValueByOilPrice(String n) throws Exception {
+        // 得到运算公式
+        String formula_string = null;
+            // 得到焦炭运价计算公式
+            formula_string = amsContractTruckPriceMapper.getTruckFormula(new BigDecimal(12));
+            // 替换焦炭运价计算公式
+            formula_string = formula_string.replace("油价变动率",n);
+
+        String s = toSufExpr(formula_string);
+        return calSufExpr(s);
+    }
+
+    /**
+     * 替换纯苯运价公式并进行计算
+     * @param n
+     * @return
+     * @throws Exception
+     */
+    public BigDecimal UpdatePureBenzenePriceValueByOilPrice(String n,BigDecimal priceValue) throws Exception {
+        // 得到运算公式
+        String formula_string = null;
+        // 得到纯苯运价计算公式
+        formula_string = amsContractTruckPriceMapper.getTruckFormula(new BigDecimal(13));
+        // 替换纯苯运价计算公式
+        formula_string = formula_string.replace("中标价",priceValue.toString())
+        .replace("油价变动率",n);
+        String s = toSufExpr(formula_string);
+        return calSufExpr(s);
+    }
+
+    /**
+     * 中缀转换后缀表达式
+     */
+    public  String toSufExpr(String s) {
+        StringBuffer sufExpr = new StringBuffer();
+        Stack<String> stack = new Stack<>();
+        //压入空方便判断
+        stack.push(null);
+        Pattern pattern = Pattern.compile("\\(int\\)|(?<!\\d|[)])-?\\d+(\\.\\d+)?|!=|>=|<=|==|[+\\-*/%()><=|]");
+        Matcher matcher = pattern.matcher(s);
+        while (matcher.find()) {
+            String group = matcher.group();
+            if (group.matches("!=|>=|<=|==|[+\\-*/%()><=|]|\\(int\\)")) {//是运算符
+                if (group.equals("(")) {//之间压栈
+                    stack.push(group);
+                } else if (group.equals(")")) {//等于右括号,一直弹栈,直到遇到左括号
+                    String pop = null;
+                    while (!(pop = stack.pop()).equals("(")) {//遍历循环至左括号
+                        sufExpr.append(pop + " ");
+                    }
+                } else {//是运算符:加减乘除强转,根据优先级压栈
+                    while (getPriority(group) <= getPriority(stack.peek())) {
+                        String pop = stack.pop();
+                        System.out.println(pop);
+                        System.out.println(sufExpr);
+                        if(pop!=null&&!pop.equals("|")){
+                            sufExpr.append(pop + " ");
+                        }
+                    }
+                    stack.push(group);
                 }
-                return amsContractTruckPriceMapper.batchUpdateTransportPriceByOilPrice(updateOilPrice);
+            } else {//是数字
+                sufExpr.append(group + " ");
             }
         }
+        String pop = null;
+        while (null != (pop = stack.pop())) {
+            sufExpr.append(pop + " ");
+        }
+        return sufExpr.toString();
+    }
+
+    /**
+     * 设置出栈优先级,(:优先级最低,表示只有遇到)才能出栈
+     * 当栈顶遇到优先级比自己小或等于的弹栈
+     */
+    public  Integer getPriority(String c) {
+        if (c == null) {
+            return 0;
+        }
+        switch (c) {
+            case "(":
+                return 1;
+            case "+":
+            case "-":
+                return 2;
+            case "*":
+            case "/":
+            case "%":
+                return 3;
+            case ">":
+            case "<":
+            case ">=":
+            case "<=":
+            case "!=":
+            case "==":
+                return 4;
+            case "|":
+                return 5;
+            case "=":
+                return 6;
+            case "(int)":
+                return 7;
+        }
         return 0;
     }
 
+    /**
+     * 计算值
+     */
+    public  BigDecimal cal(BigDecimal a1, BigDecimal a2, String operator) throws Exception {
+        switch (operator){
+            case "+":return a1.add(a2);
+            case "-":return a1.subtract(a2);
+            case "*":return a1.multiply(a2);
+            case "/":return a1.divide(a2,3,BigDecimal.ROUND_CEILING);
+            case "%":return a1.divideAndRemainder(a2)[1];
+            default:
+                break;
+        }
+        throw new Exception("非法运算符");
+    }
+
+    public  Boolean calBoolean(BigDecimal a1, BigDecimal a2, String operator) throws Exception {
+        switch (operator){
+            case ">":return a1.compareTo(a2) == 1;
+            case "<":return a1.compareTo(a2) == -1;
+            case ">=":return a1.compareTo(a2) > -1;
+            case "<=":return a1.compareTo(a2) < 1;
+            case "!=":return a1.compareTo(a2) != 0;
+            case "==":return a1.compareTo(a2) == 0;
+            default:
+                break;
+        }
+        throw new Exception("非法运算符");
+    }
+
+    /**
+     * 计算后缀表达式
+     */
+    public  BigDecimal calSufExpr(String sufExpr) throws Exception {
+        Stack<BigDecimal> stack = new Stack<>();
+        Pattern pattern=Pattern.compile("\\(int\\)|-?\\d+(\\.\\d+)?|!=|>=|<=|==|[+\\-*/%><=]");//提取运算符和数字
+        Matcher matcher = pattern.matcher(sufExpr);
+        BigDecimal result=new BigDecimal("0.0");
+        while (matcher.find()){
+            String group = matcher.group();
+            if(group.matches("[+\\-*/%]")){
+                BigDecimal a1 =stack.pop();
+                BigDecimal a2 =stack.pop();
+                result = cal(a2, a1, group);
+                stack.push(result);
+            }
+            else if(group.equals("(int)")){
+                BigDecimal pop = stack.pop();
+                BigDecimal bigDecimal = pop.setScale(0, BigDecimal.ROUND_DOWN);
+                stack.push(bigDecimal);
+            }
+            else if(group.matches("!=|>=|<=|==|[><]")){
+                BigDecimal a1 =stack.pop();
+                BigDecimal a2 =stack.pop();
+                stack.push(calBoolean(a2,a1,group)?new BigDecimal(1):new BigDecimal(0));
+            }
+            else if(group.equals("=")){
+                BigDecimal a1 =stack.pop();
+                BigDecimal a2 =stack.pop();
+                if (a2.compareTo(new BigDecimal(1))==0) {
+                    stack.push(a1);
+                }
+            }
+            else {//为数字直接压栈
+                stack.push(new BigDecimal(group));
+            }
+        }
+        return result;
+    }
+
 }

+ 18 - 11
src/main/java/com/steerinfo/dil/service/impl/AmsSaleOrderMaterialServiceImpl.java

@@ -309,6 +309,19 @@ public class AmsSaleOrderMaterialServiceImpl implements IAmsSaleOrderMaterialSer
         List<Map<String,Object>> mapList = (List<Map<String, Object>>) mapValue.get("mapList");
         // 销售订单主键
         BigDecimal saleOrderId = DataChange.dataToBigDecimal(mapValue.get("saleOrderId"));
+        if(mapValue.get("sendAgain") == null){
+            // 得到销售订单中的总重量和销售订单下的总净重
+            BigDecimal saleMaterialWeight = amsSaleOrderMaterialMapper.getMaterialWeightByOrderId(saleOrderId);
+            BigDecimal saleMaterialNetWeight = amsSaleOrderMaterialMapper.getMaterialNetWeightBySaleId(saleOrderId);
+            if (saleMaterialNetWeight == null) {
+                saleMaterialNetWeight = new BigDecimal(0);
+            }
+            // 计算净重所占销售订单中的比例
+            Double percent = saleMaterialNetWeight.doubleValue()/saleMaterialWeight.doubleValue();
+            if (percent >= 0.97) {
+                return -1;
+            }
+        }
         // 车序号计数
         int count = 1;
         // 遍历每一个列
@@ -409,6 +422,10 @@ public class AmsSaleOrderMaterialServiceImpl implements IAmsSaleOrderMaterialSer
             omstruckOrder.setOrderId(orderId);
             // 车序号主键
             omstruckOrder.setOrderPlanId(saleOrderMaterialId);
+            //添加承运商ID 和 运价ID
+            Object priceId = map.get("priceId");
+            if(priceId != null) omstruckOrder.setPriceId(DataChange.dataToBigDecimal(priceId));
+            omstruckOrder.setCarrierId(carrierId);
             // 运输订单号
             omstruckOrder.setOrderNumber(DataChange.generateEightDigitsNumber("WYSDD",orderId.intValue()));
             // 运力id
@@ -462,17 +479,7 @@ public class AmsSaleOrderMaterialServiceImpl implements IAmsSaleOrderMaterialSer
             // 车序号累加
             count++;
         }
-        // 得到销售订单中的总重量和销售订单下的总净重
-        BigDecimal saleMaterialWeight = amsSaleOrderMaterialMapper.getMaterialWeightByOrderId(saleOrderId);
-        BigDecimal saleMaterialNetWeight = amsSaleOrderMaterialMapper.getMaterialNetWeightBySaleId(saleOrderId);
-        if (saleMaterialNetWeight == null) {
-            saleMaterialNetWeight = new BigDecimal(0);
-        }
-        // 计算净重所占销售订单中的比例
-        Double percent = saleMaterialNetWeight.doubleValue()/saleMaterialWeight.doubleValue();
-        if (percent >= 0.97) {
-            result = -1;
-        }
+
         return result;
     }
 

+ 95 - 20
src/main/java/com/steerinfo/dil/util/DataChange.java

@@ -40,25 +40,22 @@ public class DataChange {
      * @param data
      * @return
      */
-    public static BigDecimal
-    dataToBigDecimal(Object data){
+    public static BigDecimal dataToBigDecimal(Object data){
         if (data != null){
-            if(data instanceof String){
-                String data1 = (String) data;
-                if(data1.length() == 0)
-                    return new BigDecimal(0);
-                return new BigDecimal(data1);
-            }
-            if(data instanceof Integer){
-                Integer data2 = (Integer) data;
-                return new BigDecimal(data2);
-            }
-            if(data instanceof Double){
-                Double data3 = (Double) data;
-                return new BigDecimal(data3);
-            }
             if(data instanceof BigDecimal){
                 return (BigDecimal) data;
+            }else{
+                String str = String.valueOf(data);
+                BigDecimal decimal = null;
+                if(!"".equals(str)){
+                    try {
+                        decimal = new BigDecimal(str);
+                    } catch (Exception e) {
+                        System.out.println(data + ":数据解析失败!返回0");
+                        return new BigDecimal(0);
+                    }
+                }
+                return decimal;
             }
         }
         return new BigDecimal(0);
@@ -72,6 +69,8 @@ public class DataChange {
     public static String dateToDayDate(Object date){
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         Date changeDate = null;
+        if(date == null)
+            return null;
         try{
             changeDate = (Date) date;
         }catch (Exception e){
@@ -111,10 +110,15 @@ public class DataChange {
         for (Map<String, Object> map : list) {
             for (String s : key) {
                 //修改数据为带两位小数
-                BigDecimal oldDate = (BigDecimal) map.get(s);
-                DecimalFormat df =  new DecimalFormat("0.00");
-                String resultDeduction = df.format(oldDate.doubleValue());
-                map.put(s, resultDeduction);
+                try {
+                    BigDecimal oldDate = (BigDecimal) map.get(s);
+                    DecimalFormat df =  new DecimalFormat("0.00");
+                    String resultDeduction = df.format(oldDate.doubleValue());
+                    map.put(s, resultDeduction);
+                } catch (Exception e) {
+                    System.out.println("原料扣减量数据有误");
+                }
+
             }
         }
     }
@@ -161,4 +165,75 @@ public class DataChange {
         );
         return sb.toString();
     }
+
+    /**
+     * 根据时间段查询数据 支持只选择单个时间
+     * @Author TXF
+     * @Date 2022/1/10 23:21
+     * @param startTime
+     * @param endTime
+     * @param map
+     * @param sdf
+     * @return
+     **/
+    public static void queryDataByDate(String startTime, String endTime, Map<String, Object> map, SimpleDateFormat sdf){
+        if (startTime != null && !"null".equals(startTime) && endTime != null && !"null".equals(endTime)) {
+            map.put("startDate", sdf.format(new Date(Long.parseLong(startTime))));
+            map.put("endDate", sdf.format(new Date(Long.parseLong(endTime) + 86400000)));
+        } else if (startTime != null && !"null".equals(startTime)) {
+            map.put("oneDate", sdf.format(new Date(Long.parseLong(startTime))));
+        } else if (endTime != null && !"null".equals(endTime)) {
+            map.put("oneDate", sdf.format(new Date(Long.parseLong(endTime))));
+        } else {
+            map.put("oneDate", sdf.format(new Date()));
+        }
+    }
+
+    /**
+     * 只支持两个时间查询
+     * @Author TXF
+     * @Date 2022/1/15 9:08
+     * @param startTime
+     * @param endTime
+     * @param sdf
+     * @return
+     **/
+    public static void queryDataByDateTime(String startTime, String endTime, Map<String, Object> map,SimpleDateFormat sdf){
+        SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
+        if (startTime != null && !"null".equals(startTime) && endTime != null && !"null".equals(endTime)) {
+            map.put("startDate", sdf.format(new Date(Long.parseLong(startTime))));
+            map.put("endDate", sdf.format(new Date(Long.parseLong(endTime))));
+        }
+        //如果开始时间和结束时间有且只有一个为空 则只查那天的数据
+        else if((startTime != null && !"null".equals(startTime)) || (endTime != null && !"null".equals(endTime))){
+            if(startTime != null && !"null".equals(startTime)){
+                queryDataByTwoDateSon(map, startTime, sdfDate);
+            }
+            if(endTime != null && !"null".equals(endTime)){
+                queryDataByTwoDateSon(map, endTime, sdfDate);
+            }
+        }else {
+            //如果两者时间都为空,则查询当天数据
+            String nowDate = sdfDate.format(new Date());
+            map.put("oneDate", nowDate + " 00:00:00");
+        }
+    }
+
+    /**
+     * 上面方法的儿子方法 如果只传入了一个时间 则查询那天的数据
+     * @Author TXF
+     * @Date 2022/1/17 16:17
+     * @param map
+     * @param time
+     * @param sdfDate
+     * @return
+     **/
+    private static void queryDataByTwoDateSon(Map<String, Object> map, String time, SimpleDateFormat sdfDate){
+        Date date1 = new Date(Long.parseLong(time));
+        Date date2 = new Date(Long.parseLong(time) + 86400000);
+        String dayStartTime = sdfDate.format(date1);
+        String dayEndTime = sdfDate.format(date2);
+        map.put("startDate", dayStartTime + " 00:00:00");
+        map.put("endDate", dayEndTime + " 00:00:00");
+    }
 }

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -1,7 +1,7 @@
 api.version: api/v1/ams
 spring:
   profiles:
-    include: ${SPRING_PROFILES:prod}
+    include: ${SPRING_PROFILES:dev}
   jackson:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8

+ 125 - 47
src/main/resources/com/steerinfo/dil/mapper/AmsContractTransportPriceMapper.xml

@@ -6,8 +6,8 @@
         <result column="SHIPPER_ID" jdbcType="DECIMAL" property="shipperId" />
         <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
         <result column="LINE_ID" jdbcType="DECIMAL" property="lineId" />
-        <result column="CAPACITY_ID" jdbcType="DECIMAL" property="capacityId" />
-        <result column="MATERIAL_ID" jdbcType="CHAR" property="materialId" />
+        <result column="CAPACITY_TYPE_ID" jdbcType="DECIMAL" property="capacityTypeId" />
+        <result column="CARGONAME_ID" jdbcType="CHAR" property="cargonameId" />
         <result column="PRICE_TON_KILOMETER" jdbcType="DECIMAL" property="priceTonKilometer" />
         <result column="PRICE_VALUE" jdbcType="DECIMAL" property="priceValue" />
         <result column="PRICE_DATE" jdbcType="TIMESTAMP" property="priceDate" />
@@ -20,17 +20,21 @@
         <result column="ADDRESS_ID" jdbcType="DECIMAL" property="addressId" />
         <result column="TYPE" jdbcType="DECIMAL" property="type" />
         <result column="DEPARTMENT" jdbcType="DECIMAL" property="department" />
+        <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" />
     </resultMap>
     <sql id="columns">
-        PRICE_ID, SHIPPER_ID, CARRIER_ID, LINE_ID, CAPACITY_ID, MATERIAL_ID, PRICE_TON_KILOMETER, 
+        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, ADDRESS_ID, TYPE, DEPARTMENT
+    INSERT_UPDATE_REMARK, DELETED, ADDRESS_ID, TYPE, DEPARTMENT, OILPRICE_BASE, OIL_TYPE_ID, 
+    OILPRICE_CHANGE_THRESHOLD
     </sql>
     <sql id="columns_alias">
-        t.PRICE_ID, t.SHIPPER_ID, t.CARRIER_ID, t.LINE_ID, t.CAPACITY_ID, t.MATERIAL_ID, 
+        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.ADDRESS_ID, 
-    t.TYPE, t.DEPARTMENT
+    t.TYPE, t.DEPARTMENT, t.OILPRICE_BASE, t.OIL_TYPE_ID, t.OILPRICE_CHANGE_THRESHOLD
     </sql>
     <sql id="select">
         SELECT <include refid="columns" /> FROM AMS_CONTRACT_TRANSPORT_PRICE
@@ -52,11 +56,11 @@
             <if test="lineId != null">
                 and LINE_ID = #{lineId}
             </if>
-            <if test="capacityId != null">
-                and CAPACITY_ID = #{capacityId}
+            <if test="capacityTypeId != null">
+                and CAPACITY_TYPE_ID = #{capacityTypeId}
             </if>
-            <if test="materialId != null">
-                and MATERIAL_ID = #{materialId}
+            <if test="cargonameId != null">
+                and CARGONAME_ID = #{cargonameId}
             </if>
             <if test="priceTonKilometer != null">
                 and PRICE_TON_KILOMETER = #{priceTonKilometer}
@@ -94,6 +98,15 @@
             <if test="department != null">
                 and DEPARTMENT = #{department}
             </if>
+            <if test="oilpriceBase != null">
+                and OILPRICE_BASE = #{oilpriceBase}
+            </if>
+            <if test="oilTypeId != null">
+                and OIL_TYPE_ID = #{oilTypeId}
+            </if>
+            <if test="oilpriceChangeThreshold != null">
+                and OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
+            </if>
         </where>
     </sql>
     <sql id="whereLike">
@@ -110,11 +123,11 @@
             <if test="lineId != null">
                 and LINE_ID = #{lineId}
             </if>
-            <if test="capacityId != null">
-                and CAPACITY_ID = #{capacityId}
+            <if test="capacityTypeId != null">
+                and CAPACITY_TYPE_ID = #{capacityTypeId}
             </if>
-            <if test="materialId != null">
-                and MATERIAL_ID = #{materialId}
+            <if test="cargonameId != null">
+                and CARGONAME_ID = #{cargonameId}
             </if>
             <if test="priceTonKilometer != null">
                 and PRICE_TON_KILOMETER = #{priceTonKilometer}
@@ -152,9 +165,18 @@
             <if test="department != null">
                 and DEPARTMENT = #{department}
             </if>
+            <if test="oilpriceBase != null">
+                and OILPRICE_BASE = #{oilpriceBase}
+            </if>
+            <if test="oilTypeId != null">
+                and OIL_TYPE_ID = #{oilTypeId}
+            </if>
+            <if test="oilpriceChangeThreshold != null">
+                and OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
+            </if>
         </where>
     </sql>
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
+    <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
         delete from AMS_CONTRACT_TRANSPORT_PRICE
         where PRICE_ID = #{priceId,jdbcType=DECIMAL}
     </delete>
@@ -170,11 +192,11 @@
         <if test="lineId != null">
             or LINE_ID = #{lineId}
         </if>
-        <if test="capacityId != null">
-            or CAPACITY_ID = #{capacityId}
+        <if test="capacityTypeId != null">
+            or CAPACITY_TYPE_ID = #{capacityTypeId}
         </if>
-        <if test="materialId != null">
-            or MATERIAL_ID = #{materialId}
+        <if test="cargonameId != null">
+            or CARGONAME_ID = #{cargonameId}
         </if>
         <if test="priceTonKilometer != null">
             or PRICE_TON_KILOMETER = #{priceTonKilometer}
@@ -212,21 +234,32 @@
         <if test="department != null">
             or DEPARTMENT = #{department}
         </if>
+        <if test="oilpriceBase != null">
+            or OILPRICE_BASE = #{oilpriceBase}
+        </if>
+        <if test="oilTypeId != null">
+            or OIL_TYPE_ID = #{oilTypeId}
+        </if>
+        <if test="oilpriceChangeThreshold != null">
+            or OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold}
+        </if>
     </delete>
     <insert id="insert" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
         insert into AMS_CONTRACT_TRANSPORT_PRICE (PRICE_ID, SHIPPER_ID, CARRIER_ID,
-                                                  LINE_ID, CAPACITY_ID, MATERIAL_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,
-                                                  ADDRESS_ID, TYPE, DEPARTMENT
+                                                  ADDRESS_ID, TYPE, DEPARTMENT,
+                                                  OILPRICE_BASE, OIL_TYPE_ID, OILPRICE_CHANGE_THRESHOLD
         )
         values (#{priceId,jdbcType=DECIMAL}, #{shipperId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL},
-                #{lineId,jdbcType=DECIMAL}, #{capacityId,jdbcType=DECIMAL}, #{materialId,jdbcType=CHAR},
+                #{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},
-                #{addressId,jdbcType=DECIMAL}, #{type,jdbcType=DECIMAL}, #{department,jdbcType=DECIMAL}
+                #{addressId,jdbcType=DECIMAL}, #{type,jdbcType=DECIMAL}, #{department,jdbcType=DECIMAL},
+                #{oilpriceBase,jdbcType=DECIMAL}, #{oilTypeId,jdbcType=DECIMAL}, #{oilpriceChangeThreshold,jdbcType=DECIMAL}
                )
     </insert>
     <insert id="insertSelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
@@ -244,11 +277,11 @@
             <if test="lineId != null">
                 LINE_ID,
             </if>
-            <if test="capacityId != null">
-                CAPACITY_ID,
+            <if test="capacityTypeId != null">
+                CAPACITY_TYPE_ID,
             </if>
-            <if test="materialId != null">
-                MATERIAL_ID,
+            <if test="cargonameId != null">
+                CARGONAME_ID,
             </if>
             <if test="priceTonKilometer != null">
                 PRICE_TON_KILOMETER,
@@ -286,6 +319,15 @@
             <if test="department != null">
                 DEPARTMENT,
             </if>
+            <if test="oilpriceBase != null">
+                OILPRICE_BASE,
+            </if>
+            <if test="oilTypeId != null">
+                OIL_TYPE_ID,
+            </if>
+            <if test="oilpriceChangeThreshold != null">
+                OILPRICE_CHANGE_THRESHOLD,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="priceId != null">
@@ -300,11 +342,11 @@
             <if test="lineId != null">
                 #{lineId,jdbcType=DECIMAL},
             </if>
-            <if test="capacityId != null">
-                #{capacityId,jdbcType=DECIMAL},
+            <if test="capacityTypeId != null">
+                #{capacityTypeId,jdbcType=DECIMAL},
             </if>
-            <if test="materialId != null">
-                #{materialId,jdbcType=CHAR},
+            <if test="cargonameId != null">
+                #{cargonameId,jdbcType=CHAR},
             </if>
             <if test="priceTonKilometer != null">
                 #{priceTonKilometer,jdbcType=DECIMAL},
@@ -342,6 +384,15 @@
             <if test="department != null">
                 #{department,jdbcType=DECIMAL},
             </if>
+            <if test="oilpriceBase != null">
+                #{oilpriceBase,jdbcType=DECIMAL},
+            </if>
+            <if test="oilTypeId != null">
+                #{oilTypeId,jdbcType=DECIMAL},
+            </if>
+            <if test="oilpriceChangeThreshold != null">
+                #{oilpriceChangeThreshold,jdbcType=DECIMAL},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
@@ -349,8 +400,8 @@
         set SHIPPER_ID = #{shipperId,jdbcType=DECIMAL},
             CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
             LINE_ID = #{lineId,jdbcType=DECIMAL},
-            CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
-            MATERIAL_ID = #{materialId,jdbcType=CHAR},
+            CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
+            CARGONAME_ID = #{cargonameId,jdbcType=CHAR},
             PRICE_TON_KILOMETER = #{priceTonKilometer,jdbcType=DECIMAL},
             PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
             PRICE_DATE = #{priceDate,jdbcType=TIMESTAMP},
@@ -362,7 +413,10 @@
             DELETED = #{deleted,jdbcType=DECIMAL},
             ADDRESS_ID = #{addressId,jdbcType=DECIMAL},
             TYPE = #{type,jdbcType=DECIMAL},
-            DEPARTMENT = #{department,jdbcType=DECIMAL}
+            DEPARTMENT = #{department,jdbcType=DECIMAL},
+            OILPRICE_BASE = #{oilpriceBase,jdbcType=DECIMAL},
+            OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL},
+            OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold,jdbcType=DECIMAL}
         where PRICE_ID = #{priceId,jdbcType=DECIMAL}
     </update>
     <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.AmsContractTransportPrice">
@@ -377,11 +431,11 @@
             <if test="lineId != null">
                 LINE_ID = #{lineId,jdbcType=DECIMAL},
             </if>
-            <if test="capacityId != null">
-                CAPACITY_ID = #{capacityId,jdbcType=DECIMAL},
+            <if test="capacityTypeId != null">
+                CAPACITY_TYPE_ID = #{capacityTypeId,jdbcType=DECIMAL},
             </if>
-            <if test="materialId != null">
-                MATERIAL_ID = #{materialId,jdbcType=CHAR},
+            <if test="cargonameId != null">
+                CARGONAME_ID = #{cargonameId,jdbcType=CHAR},
             </if>
             <if test="priceTonKilometer != null">
                 PRICE_TON_KILOMETER = #{priceTonKilometer,jdbcType=DECIMAL},
@@ -419,10 +473,19 @@
             <if test="department != null">
                 DEPARTMENT = #{department,jdbcType=DECIMAL},
             </if>
+            <if test="oilpriceBase != null">
+                OILPRICE_BASE = #{oilpriceBase,jdbcType=DECIMAL},
+            </if>
+            <if test="oilTypeId != null">
+                OIL_TYPE_ID = #{oilTypeId,jdbcType=DECIMAL},
+            </if>
+            <if test="oilpriceChangeThreshold != null">
+                OILPRICE_CHANGE_THRESHOLD = #{oilpriceChangeThreshold,jdbcType=DECIMAL},
+            </if>
         </set>
         where PRICE_ID = #{priceId,jdbcType=DECIMAL}
     </update>
-    <select id="selectByPrimaryKey" parameterType="java.lang.Short" resultMap="BaseResultMap">
+    <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
         <include refid="select" />
         where PRICE_ID = #{priceId,jdbcType=DECIMAL}
     </select>
@@ -438,22 +501,24 @@
         insert into AMS_CONTRACT_TRANSPORT_PRICE
         (PRICE_ID,
         SHIPPER_ID, CARRIER_ID, LINE_ID,
-        CAPACITY_ID, MATERIAL_ID, PRICE_TON_KILOMETER,
+        CAPACITY_TYPE_ID, CARGONAME_ID, PRICE_TON_KILOMETER,
         PRICE_VALUE, PRICE_DATE, INSERT_USERNAME,
         INSERT_TIME, UPDATE_USERNAME,
         UPDATE_TIME, INSERT_UPDATE_REMARK,
         DELETED, ADDRESS_ID, TYPE,
-        DEPARTMENT)
+        DEPARTMENT, OILPRICE_BASE, OIL_TYPE_ID,
+        OILPRICE_CHANGE_THRESHOLD)
         ( <foreach collection="list" item="item" separator="union all">
         select
         #{item.priceId,jdbcType=DECIMAL},
         #{item.shipperId,jdbcType=DECIMAL}, #{item.carrierId,jdbcType=DECIMAL}, #{item.lineId,jdbcType=DECIMAL},
-        #{item.capacityId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=CHAR}, #{item.priceTonKilometer,jdbcType=DECIMAL},
+        #{item.capacityTypeId,jdbcType=DECIMAL}, #{item.cargonameId,jdbcType=CHAR}, #{item.priceTonKilometer,jdbcType=DECIMAL},
         #{item.priceValue,jdbcType=DECIMAL}, #{item.priceDate,jdbcType=TIMESTAMP}, #{item.insertUsername,jdbcType=VARCHAR},
         #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR},
         #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
         #{item.deleted,jdbcType=DECIMAL}, #{item.addressId,jdbcType=DECIMAL}, #{item.type,jdbcType=DECIMAL},
-        #{item.department,jdbcType=DECIMAL} from dual
+        #{item.department,jdbcType=DECIMAL}, #{item.oilpriceBase,jdbcType=DECIMAL}, #{item.oilTypeId,jdbcType=DECIMAL},
+        #{item.oilpriceChangeThreshold,jdbcType=DECIMAL} from dual
     </foreach> )
     </insert>
     <update id="batchUpdate" parameterType="java.util.List">
@@ -475,13 +540,13 @@
         <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
             when #{item.priceId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
         </foreach>
-        ,CAPACITY_ID=
+        ,CAPACITY_TYPE_ID=
         <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
-            when #{item.priceId,jdbcType=DECIMAL} then #{item.capacityId,jdbcType=DECIMAL}
+            when #{item.priceId,jdbcType=DECIMAL} then #{item.capacityTypeId,jdbcType=DECIMAL}
         </foreach>
-        ,MATERIAL_ID=
+        ,CARGONAME_ID=
         <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
-            when #{item.priceId,jdbcType=DECIMAL} then #{item.materialId,jdbcType=CHAR}
+            when #{item.priceId,jdbcType=DECIMAL} then #{item.cargonameId,jdbcType=CHAR}
         </foreach>
         ,PRICE_TON_KILOMETER=
         <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
@@ -531,6 +596,18 @@
         <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
             when #{item.priceId,jdbcType=DECIMAL} then #{item.department,jdbcType=DECIMAL}
         </foreach>
+        ,OILPRICE_BASE=
+        <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+            when #{item.priceId,jdbcType=DECIMAL} then #{item.oilpriceBase,jdbcType=DECIMAL}
+        </foreach>
+        ,OIL_TYPE_ID=
+        <foreach close="end" collection="list" index="index" item="item" open="case PRICE_ID" separator=" ">
+            when #{item.priceId,jdbcType=DECIMAL} then #{item.oilTypeId,jdbcType=DECIMAL}
+        </foreach>
+        ,OILPRICE_CHANGE_THRESHOLD=
+        <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>
         where PRICE_ID in
         <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
             #{item.priceId,jdbcType=DECIMAL}
@@ -545,6 +622,7 @@
     </delete>
     <!-- 友情提示!!!-->
     <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
+
     <select id="selectMaxId" resultType="DECIMAL">
         SELECT MAX(PRICE_ID) + 1
         FROM AMS_CONTRACT_TRANSPORT_PRICE

File diff suppressed because it is too large
+ 590 - 487
src/main/resources/com/steerinfo/dil/mapper/AmsContractTruckPriceMapper.xml


+ 3 - 2
src/main/resources/com/steerinfo/dil/mapper/AmsPurchaseOrderMapper.xml

@@ -519,14 +519,15 @@
     ON apo.PURCHASING_ORGANIZATION_ID = rsb.SHIPPER_ID
     LEFT JOIN RMS_SHIPPER rsr
     ON apo.RECEIVE_UNIT_ID = rsr.SHIPPER_ID
-    <where>
+    where
+      apo.DELETED = 0
       <if test="con != null" >
         and instr(apo.PURCHASE_ORDER_NO, #{con}) > 0 or instr(rsu.SUPPLIER_NAME, #{con}) > 0
       </if>
       <if test="sendCompId != null and con == null">
         and apo.SUPPLIER_UNIT_ID = #{sendCompId}
       </if>
-    </where>
+
 
     )
     <where>

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

@@ -1766,93 +1766,90 @@
     on a_s_order.RECEIVE_ID=r_consignee.CONSIGNEE_ID
     where a_s_order.SALE_ORDER_STATUS in (2,4)
     and a_s_order.CLOSE_STATUS is null
-    and a_s_order.DELETED = 0) SSSR
-    <if test="con != null">
-      where SSSR."consigneeCompanyName" LIKE #{con}
-    </if>
+    and a_s_order.DELETED = 0
     <if test="con != null">
-      or SSSR."saleNumber" LIKE #{con}
+      and (instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0 or instr(a_s_order.SALE_NUMBER, #{con}) > 0)
     </if>
-<!--    <where>-->
-<!--          <if test="saleNumber != null">-->
-<!--            and-->
-<!--            <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">-->
-<!--              "saleNumber" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--          <if test="shipperName != null">-->
-<!--            and-->
-<!--            <foreach collection="shipperName" item="item" open="(" separator="or" close=")">-->
-<!--              "shipperName" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--          <if test="consigneeCompanyName != null">-->
-<!--            and-->
-<!--            <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">-->
-<!--              "consigneeCompanyName" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--          <if test="consigneeWarrantyAmount != null">-->
-<!--            and-->
-<!--            <foreach collection="consigneeWarrantyAmount" item="item" open="(" separator="or" close=")">-->
-<!--              "consigneeWarrantyAmount" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--          <if test="consigneeWarrantyWeight != null">-->
-<!--            and-->
-<!--            <foreach collection="consigneeWarrantyWeight" item="item" open="(" separator="or" close=")">-->
-<!--              "consigneeWarrantyWeight" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--          <if test="saleOrderIsselfMention != null">-->
-<!--            and-->
-<!--            <foreach collection="saleOrderIsselfMention" item="item" open="(" separator="or" close=")">-->
-<!--              "saleOrderIsselfMention" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--          <if test="saleAccountBalance != null">-->
-<!--            and-->
-<!--            <foreach collection="saleAccountBalance" item="item" open="(" separator="or" close=")">-->
-<!--              "saleAccountBalance" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--          <if test="saleCurrentOrderAmount != null">-->
-<!--            and-->
-<!--            <foreach collection="saleCurrentOrderAmount" item="item" open="(" separator="or" close=")">-->
-<!--              "saleCurrentOrderAmount" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--          <if test="saleHistoricalOrderAmout != null">-->
-<!--            and-->
-<!--            <foreach collection="saleHistoricalOrderAmout" item="item" open="(" separator="or" close=")">-->
-<!--              "saleHistoricalOrderAmout" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--          <if test="saleOrderReceiveCustomer != null">-->
-<!--            and-->
-<!--            <foreach collection="saleOrderReceiveCustomer" item="item" open="(" separator="or" close=")">-->
-<!--              "saleOrderReceiveCustomer" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--          <if test="saleUnitPrice != null">-->
-<!--            and-->
-<!--            <foreach collection="saleUnitPrice" item="item" open="(" separator="or" close=")">-->
-<!--              "saleUnitPrice" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--          <if test="saleOrderTax != null">-->
-<!--            and-->
-<!--            <foreach collection="saleOrderTax" item="item" open="(" separator="or" close=")">-->
-<!--              "saleOrderTax" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--          <if test="saleRemark != null">-->
-<!--            and-->
-<!--            <foreach collection="saleRemark" item="item" open="(" separator="or" close=")">-->
-<!--              "saleRemark" like '%${item}%'-->
-<!--            </foreach>-->
-<!--          </if>-->
-<!--        </where>-->
+    )
+    <where>
+      <if test="saleNumber != null">
+        <foreach collection="saleNumber" item="item" open="(" separator="or" close=")">
+          "saleNumber" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="shipperName != null">
+        and
+        <foreach collection="shipperName" item="item" open="(" separator="or" close=")">
+          "shipperName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="consigneeCompanyName != null">
+        and
+        <foreach collection="consigneeCompanyName" item="item" open="(" separator="or" close=")">
+          "consigneeCompanyName" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="consigneeWarrantyAmount != null">
+        and
+        <foreach collection="consigneeWarrantyAmount" item="item" open="(" separator="or" close=")">
+          "consigneeWarrantyAmount" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="consigneeWarrantyWeight != null">
+        and
+        <foreach collection="consigneeWarrantyWeight" item="item" open="(" separator="or" close=")">
+          "consigneeWarrantyWeight" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderIsselfMention != null">
+        and
+        <foreach collection="saleOrderIsselfMention" item="item" open="(" separator="or" close=")">
+          "saleOrderIsselfMention" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleAccountBalance != null">
+        and
+        <foreach collection="saleAccountBalance" item="item" open="(" separator="or" close=")">
+          "saleAccountBalance" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleCurrentOrderAmount != null">
+        and
+        <foreach collection="saleCurrentOrderAmount" item="item" open="(" separator="or" close=")">
+          "saleCurrentOrderAmount" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleHistoricalOrderAmout != null">
+        and
+        <foreach collection="saleHistoricalOrderAmout" item="item" open="(" separator="or" close=")">
+          "saleHistoricalOrderAmout" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderReceiveCustomer != null">
+        and
+        <foreach collection="saleOrderReceiveCustomer" item="item" open="(" separator="or" close=")">
+          "saleOrderReceiveCustomer" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleUnitPrice != null">
+        and
+        <foreach collection="saleUnitPrice" item="item" open="(" separator="or" close=")">
+          "saleUnitPrice" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleOrderTax != null">
+        and
+        <foreach collection="saleOrderTax" item="item" open="(" separator="or" close=")">
+          "saleOrderTax" like '%${item}%'
+        </foreach>
+      </if>
+      <if test="saleRemark != null">
+        and
+        <foreach collection="saleRemark" item="item" open="(" separator="or" close=")">
+          "saleRemark" like '%${item}%'
+        </foreach>
+      </if>
+    </where>
     <include refid="orderBy"></include>
   </select>
 
@@ -1878,7 +1875,11 @@
     on a_s_order.SHIPPER_ID=r_shipper.SHIPPER_ID
     left join RMS_CONSIGNEE r_consignee
     on a_s_order.RECEIVE_ID=r_consignee.CONSIGNEE_ID
-    where a_s_order.SALE_ORDER_STATUS=4)
+    where a_s_order.SALE_ORDER_STATUS=4
+    <if test="con != null">
+      and instr(r_consignee.CONSIGNEE_COMPANY_NAME, #{con}) > 0
+    </if>
+        )
     <where>
       <if test="saleNumber != null">
         and
@@ -1969,6 +1970,7 @@
     ASM.SALE_MATERIAL_ID                           as "saleMaterialId",
     RM.MATERIAL_ID                                 as "materialId",
     ASO.SALE_NUMBER                                as "saleNumber",
+    ASO.SALE_ORDER_ISSELF_MENTION                  as "saleOrderIsselfMention",
     RS.SHIPPER_NAME                                as "shipperName",
     RC.CONSIGNEE_COMPANY_NAME                      as "consigneeCompanyName",
     RM.MATERIAL_NAME                               as "materialName",
@@ -2035,7 +2037,7 @@
     ON RM.MATERIAL_ID = ASM.MATERIAL_ID
     WHERE ASM.SALE_ORDER_ID = #{saleOrderId}
     <if test="con != null" >
-      AND RM.MATERIAL_NAME LIKE #{con}
+      AND instr(RM.MATERIAL_NAME, #{con}) > 0
     </if>
   </select>
 

+ 90 - 37
src/main/resources/com/steerinfo/dil/mapper/OmstruckOrderMapper.xml

@@ -23,25 +23,28 @@
         <result column="ORDER_ENTRY_TIME" jdbcType="TIMESTAMP" property="orderEntryTime" />
         <result column="UNLOAD_POINT_ID" jdbcType="DECIMAL" property="unloadPointId" />
         <result column="DRIVER_CONFIRMATION" jdbcType="DECIMAL" property="driverConfirmation" />
+        <result column="PRICE_ID" jdbcType="DECIMAL" property="priceId" />
+        <result column="CARRIER_ID" jdbcType="DECIMAL" property="carrierId" />
     </resultMap>
     <sql id="columns">
         ORDER_ID, ORDER_PLAN_ID, ORDER_NUMBER, CAPACITY_ID, ORDER_ISSUE_TIME, ORDER_RECEIVE_STATUS,
     ORDER_RECEIVE_REFUSE_TIME, ORDER_COMMUNICATION_DURATION, ORDER_STATUS, INSERT_USERNAME,
     INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, DELETED, ORDER_TYPE,
-    ORDER_LINE_SEQUENCE, LINE_ID, ORDER_ENTRY_TIME, UNLOAD_POINT_ID, DRIVER_CONFIRMATION
+    ORDER_LINE_SEQUENCE, LINE_ID, ORDER_ENTRY_TIME, UNLOAD_POINT_ID, DRIVER_CONFIRMATION,
+    PRICE_ID, CARRIER_ID
     </sql>
     <sql id="columns_alias">
         t.ORDER_ID, t.ORDER_PLAN_ID, t.ORDER_NUMBER, t.CAPACITY_ID, t.ORDER_ISSUE_TIME, t.ORDER_RECEIVE_STATUS,
     t.ORDER_RECEIVE_REFUSE_TIME, t.ORDER_COMMUNICATION_DURATION, t.ORDER_STATUS, t.INSERT_USERNAME,
     t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.DELETED,
     t.ORDER_TYPE, t.ORDER_LINE_SEQUENCE, t.LINE_ID, t.ORDER_ENTRY_TIME, t.UNLOAD_POINT_ID,
-    t.DRIVER_CONFIRMATION
+    t.DRIVER_CONFIRMATION, t.PRICE_ID, t.CARRIER_ID
     </sql>
     <sql id="select">
-        SELECT <include refid="columns"/> FROM OMSTRUCK_ORDER
+        SELECT <include refid="columns" /> FROM OMSTRUCK_ORDER
     </sql>
     <sql id="select_alias">
-        SELECT <include refid="columns_alias"/> FROM OMSTRUCK_ORDER t
+        SELECT <include refid="columns_alias" /> FROM OMSTRUCK_ORDER t
     </sql>
     <sql id="where">
         <where>
@@ -108,6 +111,12 @@
             <if test="driverConfirmation != null">
                 and DRIVER_CONFIRMATION = #{driverConfirmation}
             </if>
+            <if test="priceId != null">
+                and PRICE_ID = #{priceId}
+            </if>
+            <if test="carrierId != null">
+                and CARRIER_ID = #{carrierId}
+            </if>
         </where>
     </sql>
     <sql id="whereLike">
@@ -175,6 +184,12 @@
             <if test="driverConfirmation != null">
                 and DRIVER_CONFIRMATION = #{driverConfirmation}
             </if>
+            <if test="priceId != null">
+                and PRICE_ID = #{priceId}
+            </if>
+            <if test="carrierId != null">
+                and CARRIER_ID = #{carrierId}
+            </if>
         </where>
     </sql>
     <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
@@ -244,6 +259,12 @@
         <if test="driverConfirmation != null">
             or DRIVER_CONFIRMATION = #{driverConfirmation}
         </if>
+        <if test="priceId != null">
+            or PRICE_ID = #{priceId}
+        </if>
+        <if test="carrierId != null">
+            or CARRIER_ID = #{carrierId}
+        </if>
     </delete>
     <insert id="insert" parameterType="com.steerinfo.dil.model.OmstruckOrder">
         insert into OMSTRUCK_ORDER (ORDER_ID, ORDER_PLAN_ID, ORDER_NUMBER,
@@ -253,7 +274,8 @@
                                     UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
                                     DELETED, ORDER_TYPE, ORDER_LINE_SEQUENCE,
                                     LINE_ID, ORDER_ENTRY_TIME, UNLOAD_POINT_ID,
-                                    DRIVER_CONFIRMATION)
+                                    DRIVER_CONFIRMATION, PRICE_ID, CARRIER_ID
+        )
         values (#{orderId,jdbcType=DECIMAL}, #{orderPlanId,jdbcType=DECIMAL}, #{orderNumber,jdbcType=VARCHAR},
                 #{capacityId,jdbcType=DECIMAL}, #{orderIssueTime,jdbcType=TIMESTAMP}, #{orderReceiveStatus,jdbcType=DECIMAL},
                 #{orderReceiveRefuseTime,jdbcType=TIMESTAMP}, #{orderCommunicationDuration,jdbcType=DECIMAL},
@@ -261,7 +283,8 @@
                 #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
                 #{deleted,jdbcType=DECIMAL}, #{orderType,jdbcType=DECIMAL}, #{orderLineSequence,jdbcType=DECIMAL},
                 #{lineId,jdbcType=DECIMAL}, #{orderEntryTime,jdbcType=TIMESTAMP}, #{unloadPointId,jdbcType=DECIMAL},
-                #{driverConfirmation,jdbcType=DECIMAL})
+                #{driverConfirmation,jdbcType=DECIMAL}, #{priceId,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL}
+               )
     </insert>
     <insert id="insertSelective" parameterType="com.steerinfo.dil.model.OmstruckOrder">
         insert into OMSTRUCK_ORDER
@@ -329,6 +352,12 @@
             <if test="driverConfirmation != null">
                 DRIVER_CONFIRMATION,
             </if>
+            <if test="priceId != null">
+                PRICE_ID,
+            </if>
+            <if test="carrierId != null">
+                CARRIER_ID,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="orderId != null">
@@ -394,6 +423,12 @@
             <if test="driverConfirmation != null">
                 #{driverConfirmation,jdbcType=DECIMAL},
             </if>
+            <if test="priceId != null">
+                #{priceId,jdbcType=DECIMAL},
+            </if>
+            <if test="carrierId != null">
+                #{carrierId,jdbcType=DECIMAL},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.OmstruckOrder">
@@ -417,7 +452,9 @@
             LINE_ID = #{lineId,jdbcType=DECIMAL},
             ORDER_ENTRY_TIME = #{orderEntryTime,jdbcType=TIMESTAMP},
             UNLOAD_POINT_ID = #{unloadPointId,jdbcType=DECIMAL},
-            DRIVER_CONFIRMATION = #{driverConfirmation,jdbcType=DECIMAL}
+            DRIVER_CONFIRMATION = #{driverConfirmation,jdbcType=DECIMAL},
+            PRICE_ID = #{priceId,jdbcType=DECIMAL},
+            CARRIER_ID = #{carrierId,jdbcType=DECIMAL}
         where ORDER_ID = #{orderId,jdbcType=DECIMAL}
     </update>
     <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.OmstruckOrder">
@@ -483,20 +520,26 @@
             <if test="driverConfirmation != null">
                 DRIVER_CONFIRMATION = #{driverConfirmation,jdbcType=DECIMAL},
             </if>
+            <if test="priceId != null">
+                PRICE_ID = #{priceId,jdbcType=DECIMAL},
+            </if>
+            <if test="carrierId != null">
+                CARRIER_ID = #{carrierId,jdbcType=DECIMAL},
+            </if>
         </set>
         where ORDER_ID = #{orderId,jdbcType=DECIMAL}
     </update>
     <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
-        <include refid="select"/>
+        <include refid="select" />
         where ORDER_ID = #{orderId,jdbcType=DECIMAL}
     </select>
     <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-        <include refid="select"/>
-        <include refid="where"/>
+        <include refid="select" />
+        <include refid="where" />
     </select>
     <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
-        <include refid="select"/>
-        <include refid="whereLike"/>
+        <include refid="select" />
+        <include refid="whereLike" />
     </select>
     <insert id="batchInsert" parameterType="java.util.List">
         insert into OMSTRUCK_ORDER
@@ -509,7 +552,8 @@
         UPDATE_TIME, INSERT_UPDATE_REMARK,
         DELETED, ORDER_TYPE, ORDER_LINE_SEQUENCE,
         LINE_ID, ORDER_ENTRY_TIME, UNLOAD_POINT_ID,
-        DRIVER_CONFIRMATION)
+        DRIVER_CONFIRMATION, PRICE_ID,
+        CARRIER_ID)
         ( <foreach collection="list" item="item" separator="union all">
         select
         #{item.orderId,jdbcType=DECIMAL},
@@ -521,105 +565,114 @@
         #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR},
         #{item.deleted,jdbcType=DECIMAL}, #{item.orderType,jdbcType=DECIMAL}, #{item.orderLineSequence,jdbcType=DECIMAL},
         #{item.lineId,jdbcType=DECIMAL}, #{item.orderEntryTime,jdbcType=TIMESTAMP}, #{item.unloadPointId,jdbcType=DECIMAL},
-        #{item.driverConfirmation,jdbcType=DECIMAL} from dual
+        #{item.driverConfirmation,jdbcType=DECIMAL}, #{item.priceId,jdbcType=DECIMAL},
+        #{item.carrierId,jdbcType=DECIMAL} from dual
     </foreach> )
     </insert>
     <update id="batchUpdate" parameterType="java.util.List">
         update OMSTRUCK_ORDER
         set
         ORDER_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.orderId,jdbcType=DECIMAL}
         </foreach>
         ,ORDER_PLAN_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.orderPlanId,jdbcType=DECIMAL}
         </foreach>
         ,ORDER_NUMBER=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.orderNumber,jdbcType=VARCHAR}
         </foreach>
         ,CAPACITY_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.capacityId,jdbcType=DECIMAL}
         </foreach>
         ,ORDER_ISSUE_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.orderIssueTime,jdbcType=TIMESTAMP}
         </foreach>
         ,ORDER_RECEIVE_STATUS=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.orderReceiveStatus,jdbcType=DECIMAL}
         </foreach>
         ,ORDER_RECEIVE_REFUSE_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.orderReceiveRefuseTime,jdbcType=TIMESTAMP}
         </foreach>
         ,ORDER_COMMUNICATION_DURATION=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.orderCommunicationDuration,jdbcType=DECIMAL}
         </foreach>
         ,ORDER_STATUS=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.orderStatus,jdbcType=DECIMAL}
         </foreach>
         ,INSERT_USERNAME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
         </foreach>
         ,INSERT_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
         </foreach>
         ,UPDATE_USERNAME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.updateUsername,jdbcType=VARCHAR}
         </foreach>
         ,UPDATE_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
         </foreach>
         ,INSERT_UPDATE_REMARK=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
         </foreach>
         ,DELETED=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
         </foreach>
         ,ORDER_TYPE=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.orderType,jdbcType=DECIMAL}
         </foreach>
         ,ORDER_LINE_SEQUENCE=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.orderLineSequence,jdbcType=DECIMAL}
         </foreach>
         ,LINE_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.lineId,jdbcType=DECIMAL}
         </foreach>
         ,ORDER_ENTRY_TIME=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.orderEntryTime,jdbcType=TIMESTAMP}
         </foreach>
         ,UNLOAD_POINT_ID=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.unloadPointId,jdbcType=DECIMAL}
         </foreach>
         ,DRIVER_CONFIRMATION=
-        <foreach collection="list" item="item" index="index" separator=" " open="case ORDER_ID" close="end">
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
             when #{item.orderId,jdbcType=DECIMAL} then #{item.driverConfirmation,jdbcType=DECIMAL}
         </foreach>
+        ,PRICE_ID=
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+            when #{item.orderId,jdbcType=DECIMAL} then #{item.priceId,jdbcType=DECIMAL}
+        </foreach>
+        ,CARRIER_ID=
+        <foreach close="end" collection="list" index="index" item="item" open="case ORDER_ID" separator=" ">
+            when #{item.orderId,jdbcType=DECIMAL} then #{item.carrierId,jdbcType=DECIMAL}
+        </foreach>
         where ORDER_ID in
-        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
+        <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
             #{item.orderId,jdbcType=DECIMAL}
         </foreach>
     </update>
     <delete id="batchDelete" parameterType="java.util.List">
         delete from OMSTRUCK_ORDER
         where ORDER_ID in
-        <foreach collection="list" item="id" open="(" close=")" separator=",">
+        <foreach close=")" collection="list" item="id" open="(" separator=",">
             #{id}
         </foreach>
     </delete>

Some files were not shown because too many files changed in this diff