瀏覽代碼

Merge branch 'master' of https://git.steerinfo.com/DAL-DAZHOU/DAL-DAZHOU-AMS-API

luobang 2 年之前
父節點
當前提交
fe601f1c2e

+ 16 - 1
src/main/java/com/steerinfo/dil/controller/AmsContractTruckPriceController.java

@@ -64,10 +64,14 @@ public class AmsContractTruckPriceController extends BaseRESTfulController {
                                                       Integer apiId,
                                                       Integer pageNum,
                                                       Integer pageSize,
+                                                      String con,
                                                       Integer deleted){
         if(deleted != null) {
             mapValue.put("deleted", deleted);
         }
+        if(con !=null){
+            mapValue.put("con",con);
+        }
         PageHelper.startPage(pageNum,pageSize);
         List<Map<String, Object>> amsContractTransportPrice1 = amsContractTruckPriceService.getAmsContractTransportPrice(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,amsContractTransportPrice1);
@@ -83,10 +87,14 @@ public class AmsContractTruckPriceController extends BaseRESTfulController {
                                                       Integer apiId,
                                                       Integer pageNum,
                                                       Integer pageSize,
-                                                      Integer deleted){
+                                                      Integer deleted,
+                                                      String con){
         if(deleted != null) {
             mapValue.put("deleted", deleted);
         }
+        if (con != null && !con.equals("undefined")) {
+            mapValue.put("con","%" + con + "%");
+        }
         PageHelper.startPage(pageNum,pageSize);
         List<Map<String, Object>> amsContractTransportPrice1 = amsContractTruckPriceService.getInwardContractPrice(mapValue);
         PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,amsContractTransportPrice1);
@@ -361,4 +369,11 @@ public class AmsContractTruckPriceController extends BaseRESTfulController {
         return b;
 
     }
+
+    @ApiOperation(value="修改内转汽运单价")
+    @PostMapping("/updateTransPrice")
+    public RESTfulResult updateTransPrice(@RequestBody(required=false) Map<String,Object> map){
+        int i = amsContractTruckPriceService.updatePriceByPriceId(map);
+        return success(i);
+    }
 }

+ 1 - 1
src/main/java/com/steerinfo/dil/mapper/AmsContaactPriceMaterialMapper.java

@@ -10,7 +10,7 @@ import java.util.Map;
 
 @Mapper
 public interface AmsContaactPriceMaterialMapper extends IBaseMapper<AmsContaactPriceMaterial, BigDecimal> {
-    List<Map<String, Object>> getMaterialName(BigDecimal priceId);
+    List<Map<String, Object>> getMaterialName(Map<String,Object> map);
 
 
 }

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

@@ -61,4 +61,5 @@ public interface AmsContractTruckPriceMapper extends IBaseMapper<AmsContractTran
 
     List<Map<String, Object>> getRangePoint(Map<String, Object> mapValue);
 
+    int updatePriceByPriceId(Map<String, Object> map);
 }

+ 1 - 0
src/main/java/com/steerinfo/dil/service/IAmsContractTruckPriceService.java

@@ -62,4 +62,5 @@ public interface IAmsContractTruckPriceService {
 
     int updatePriceById(Map<String, Object> map);
 
+    int updatePriceByPriceId(Map<String, Object> map);
 }

+ 7 - 2
src/main/java/com/steerinfo/dil/service/impl/AmsContractTruckPriceServiceImpl.java

@@ -604,7 +604,7 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
         List<Map<String,Object>>mapList =  amsContractTruckPriceMapper.getInwardContractPrice(mapValue);
         for (Map<String,Object>map:mapList
              ) {
-            List<Map<String,Object>> materialList = amsContaactPriceMaterialMapper.getMaterialName(DataChange.dataToBigDecimal(map.get("priceId")));
+            List<Map<String,Object>> materialList = amsContaactPriceMaterialMapper.getMaterialName(map);
             String materialNames = "";
             int i = 1;
             for (Map<String,Object>materialMap:materialList
@@ -625,7 +625,6 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
             }else if(((BigDecimal)map.get("type")).intValue() == 6){
                 map.put("type","元/趟");
             }
-
         }
         return mapList;
     }
@@ -667,4 +666,10 @@ public class AmsContractTruckPriceServiceImpl implements IAmsContractTruckPriceS
         }
         return count;
     }
+
+    @Override
+    public int updatePriceByPriceId(Map<String, Object> map){
+        int i = amsContractTruckPriceMapper.updatePriceByPriceId(map);
+        return i;
+    }
 }

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

@@ -176,6 +176,77 @@
       </if>
     </where>
   </sql>
+  <sql id="whereLikeForeach">
+    <where>
+      <if test="priceId != null">
+        <foreach collection="priceId" item="item" open="(" separator="or" close=")">
+          "priceId" = '${item}'
+        </foreach>
+      </if>
+      <if test="oilTypeName != null">
+        and
+        <foreach collection="oilTypeName" item="item" open="(" separator="or" close=")">
+          "oilTypeName" = '${item}'
+        </foreach>
+      </if>
+      <if test="capacityTypeName != null">
+        and
+        <foreach collection="capacityTypeName" item="item" open="(" separator="or" close=")">
+          "capacityTypeName" = '${item}'
+        </foreach>
+      </if>
+      <if test="priceValue != null">
+        and
+        <foreach collection="priceValue" item="item" open="(" separator="or" close=")">
+          "priceValue" = '${item}'
+        </foreach>
+      </if>
+      <if test="priceDate != null">
+        and
+        <foreach collection="priceDate" item="item" open="(" separator="or" close=")">
+          TO_CHAR("priceDate",'yyyy-mm-dd hh24:mi:ss') = '${item}'
+        </foreach>
+      </if>
+      <if test="oilpriceBase != null">
+        and
+        <foreach collection="oilpriceBase" item="item" open="(" separator="or" close=")">
+          "oilpriceBase" = '${item}'
+        </foreach>
+      </if>
+      <if test="insertTime != null">
+        and
+        <foreach collection="insertTime" item="item" open="(" separator="or" close=")">
+          TO_CHAR("insertTime",'yyyy-mm-dd hh24:mi:ss') = '${item}'
+        </foreach>
+      </if>
+      <if test="oilpriceChangeThreshold != null">
+        and
+        <foreach collection="oilpriceChangeThreshold" item="item" open="(" separator="or" close=")">
+          "oilpriceChangeThreshold" = '${item}'
+        </foreach>
+      </if>
+      <if test="transRange != null">
+        and
+        <foreach collection="transRange" item="item" open="(" separator="or" close=")">
+          "transRange" = '${item}'
+        </foreach>
+      </if>
+      <if test="type != null">
+        and
+        <foreach collection="type" item="item" open="(" separator="or" close=")">
+          <if test="item=='元/吨'">
+            "type" = '2'
+          </if>
+          <if test="item=='元/小时'">
+            "type" = '5'
+          </if>
+          <if test="item=='元/趟'">
+            "type" = '6'
+          </if>
+        </foreach>
+      </if>
+    </where>
+  </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
     delete from AMS_CONTRACT_TRANSPORT_PRICE
     where PRICE_ID = #{priceId,jdbcType=DECIMAL}
@@ -662,6 +733,12 @@
         <if test="deleted != null">
           and a_t_price.DELETED = #{deleted}
         </if>
+        <if test="con !=null and con != ''.toString()">
+          and
+          r_r_address.ADDRESS_PROVINCE || r_r_address.ADDRESS_DISTRICT  || r_r_address.ADDRESS_TOWN
+          || rrp.ADDRESS_DELIVERY_ADDRESS ||  r_carrier.CARRIER_NAME || r_c_type.CAPACITY_TYPE_NAME
+          like CONCAT('%',CONCAT(#{con},'%'))
+        </if>
     </where>
         )
 
@@ -906,7 +983,12 @@
         where TYPE in (2,5,6)
         <if test="deleted != null">
           and a_t_price.DELETED = #{deleted}
-        </if> )
+        </if>
+        <if test="con != null" >
+          and RGR.TRANS_RANGE_VALUE LIKE #{con}
+        </if>)
+        <include refid="whereLikeForeach"/>
+        <include refid="orderBy"></include>
   </select>
     <select id="selectInwardPrice" resultType="java.util.LinkedHashMap" parameterType="java.util.Map">
       select * from (select
@@ -967,4 +1049,8 @@
           </if>
         </where>
     </select>
+
+  <update id="updatePriceByPriceId" parameterType="java.util.Map">
+    update AMS_CONTRACT_TRANSPORT_PRICE set PRICE_VALUE=#{priceValue} where PRICE_ID=#{priceId}
+  </update>
 </mapper>