zyf 2 gadi atpakaļ
vecāks
revīzija
e3fe3f9ef1

+ 4 - 3
src/main/java/com/steerinfo/dil/controller/RmsOilPriceController.java

@@ -99,9 +99,10 @@ public class RmsOilPriceController extends BaseRESTfulController {
      * @return
      */
 
-    @PostMapping(value = "/updateOilPrice/{id}", produces  = "application/json;charset=UTF-8")
-    public RESTfulResult updateOilPrice(@PathVariable("id") Integer id){
-        int result = rmsOilPriceService.updateOilPrice(id);
+    @PostMapping(value = "/updateOilPrice", produces  = "application/json;charset=UTF-8")
+    public RESTfulResult updateOilPrice(@RequestBody(required = false) Map<String, Object> map){
+        Integer priceId = (Integer) map.get("priceId");
+        int result = rmsOilPriceService.updateOilPrice(priceId);
         return success(result);
     }
 

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

@@ -41,4 +41,6 @@ public interface RmsCapacityMapper extends IBaseMapper<RmsCapacity, BigDecimal>
  int updateCapacityCarrier(@Param("capacityCarrierId") BigDecimal capacityCarrierId,@Param("carrierSSOId") String carrierSSOId);
 
  List<Map<String, Object>> getCapacityByCapacityId(Integer id);
+
+  int updatecapacityTel(String capacityNumber,String capacityTel);
 }

+ 9 - 0
src/main/java/com/steerinfo/dil/mapper/RmsOilPriceMapper.java

@@ -26,4 +26,13 @@ public interface RmsOilPriceMapper extends IBaseMapper<RmsOilPrice, BigDecimal>
 
     //关闭油价
     int closeLastOilPrice(Map<String, Object> map);
+
+    //物理删除油价
+    int deleteOilPrice(BigDecimal priceId);
+
+    //物理删除油价类型
+    int deleteOilPriceType(BigDecimal oilTypeId);
+
+    //查询出油价的数量
+    int queryNumber(BigDecimal oilTypeId);
 }

+ 15 - 0
src/main/java/com/steerinfo/dil/model/RmsCapacity.java

@@ -158,6 +158,21 @@ public class RmsCapacity implements IBasePO<BigDecimal> {
      */
     @ApiModelProperty(value="行驶证",required=false)
     private String driverLicenceUrl;
+
+    /**
+     * 司机电话(CAPACITY_TEL,VARCHAR,16)
+     */
+    @ApiModelProperty(value="司机电话",required=false)
+    private String capacityTel;
+
+    public String getCapacityTel() {
+        return capacityTel;
+    }
+
+    public void setCapacityTel(String capacityTel) {
+        this.capacityTel = capacityTel;
+    }
+
     public String getCapacitySsoId() {
         return capacitySsoId;
     }

+ 3 - 0
src/main/java/com/steerinfo/dil/service/impl/BmsshipContractPriceServiceImpl.java

@@ -9,6 +9,7 @@ import com.steerinfo.framework.mapper.IBaseMapper;
 import com.steerinfo.framework.service.impl.BaseServiceImpl;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import java.util.Date;
 import java.math.BigDecimal;
@@ -132,4 +133,6 @@ public class BmsshipContractPriceServiceImpl  implements IBmsshipContractPriceSe
     public List<Map<String, Object>> selectBmsshipPriceList(BigDecimal id) {
         return bmsshipContractPriceMapper.selectBmsshipPriceList(id);
     }
+
+
 }

+ 8 - 0
src/main/java/com/steerinfo/dil/service/impl/RmsCapacityServiceImpl.java

@@ -94,9 +94,13 @@ public class RmsCapacityServiceImpl implements IRmsCapacityService {
         rmsCapacity.setCapacityVip((String)mapValue.get("capacityVip"));
         rmsCapacity.setCapacityBlacklist((String)mapValue.get("capacityBlacklist"));
         Object remark = mapValue.get("remark");
+        Object capacityTel = mapValue.get("capacityTel");
         if(remark != null && (!remark.toString().equals("null") || !remark.toString().equals("undefined"))){
             rmsCapacity.setInsertUpdateRemark(remark.toString());
         }
+        if(capacityTel != null && (!capacityTel.toString().equals("null") || !capacityTel.toString().equals("undefined"))){
+            rmsCapacity.setCapacityTel(capacityTel.toString());
+        }
         if (mapValue.containsKey("driverLicence")&&mapValue.get("driverLicence") !=null){
             rmsCapacity.setDriverLicenceUrl(mapValue.get("driverLicence").toString());
         }
@@ -116,11 +120,15 @@ public class RmsCapacityServiceImpl implements IRmsCapacityService {
     public int updateCapacity(Map<String,Object> map) {
         String remark = (String) map.get("remark");
         String userDep =(String) map.get("userDep");
+        String capacityTel =(String) map.get("capacityTel");
+        String capacityNumber =(String) map.get("capacityNumber");
         BigDecimal capacityCarrierId =DataChange.dataToBigDecimal(map.get("capacityCarrierId"));
         RmsCapacityCarrier rmsCapacityCarrier=new RmsCapacityCarrier();
         rmsCapacityCarrier.setCapacityCarrierId(capacityCarrierId);
         rmsCapacityCarrier.setInsertUpdateRemark(remark);
         rmsCapacityCarrier.setCapacityUserDep(userDep);
+        //更新司机电话
+        rmsCapacityMapper.updatecapacityTel(capacityTel,capacityNumber);
         return rmsCapacityCarrierMapper.updateByPrimaryKeySelective(rmsCapacityCarrier);
     }
 

+ 14 - 1
src/main/java/com/steerinfo/dil/service/impl/RmsOilPriceServiceImpl.java

@@ -94,7 +94,16 @@ public class RmsOilPriceServiceImpl implements IRmsOilPriceService {
         RmsOilPrice rmsOilPrice = new RmsOilPrice();
         rmsOilPrice.setPriceId(id);
         rmsOilPrice.setDeleted(new BigDecimal(1));
-        return rmsOilPriceMapper.updateByPrimaryKeySelective(rmsOilPrice) ;
+        int result=0;
+        //物理删除油价
+        result+=rmsOilPriceMapper.deleteOilPrice(id);
+        //1.查询是否还有这个类型的油价
+        BigDecimal oilTypeId = (BigDecimal) mesMap.get("oilTypeId");
+        int i = rmsOilPriceMapper.queryNumber(oilTypeId);
+        if (i==0){
+            rmsOilPriceMapper.deleteOilPriceType(oilTypeId);
+        }
+        return result;
     }
 
 
@@ -139,6 +148,9 @@ public class RmsOilPriceServiceImpl implements IRmsOilPriceService {
             if (priceStatus){
                 //设置启用状态
                 rmsOilPrice.setPriceStatus(new BigDecimal(0));
+            }else {
+                //设置停用状态
+                rmsOilPrice.setPriceStatus(new BigDecimal(1));
             }
         }else {
             if(priceStatus && n.compareTo(BigDecimal.ZERO)==-1){
@@ -152,6 +164,7 @@ public class RmsOilPriceServiceImpl implements IRmsOilPriceService {
                 Map<String, Object> updateMesMap = new HashMap<>();
                 updateMesMap.put("oilTypeId",oilTypeId);
                 updateMesMap.put("newOilPrice", priceValue);
+                updateMesMap.put("priceDate",rmsOilPrice.getPriceDate());
                 amsFeign.batchUpdateTransportPriceByOilPrice1(updateMesMap);
             }else {
                 //否则设置停用状态

+ 17 - 3
src/main/resources/com/steerinfo/dil/mapper/RmsCapacityMapper.xml

@@ -27,6 +27,7 @@
     <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
     <result column="CAPACITY_SSO_ID" jdbcType="VARCHAR" property="capacitySsoId" />
     <result column="DRIVER_LICENCE_URL" jdbcType="VARCHAR" property="driverLicenceUrl" />
+    <result column="CAPACITY_TEL" jdbcType="VARCHAR" property="capacityTel" />
   </resultMap>
   
   <sql id="columns">
@@ -34,14 +35,14 @@
     CARRIER_ID, CAPACITY_ENERGY_ID, CAPACITY_LEN_VAL, CAPACITY_WID_VAL, CAPACITY_HIG_VAL, 
     CAPACITY_OIL_ID, CAPACITY_FUEL_CONSUMPTION, CAPACITY_OWNERIS, CAPACITY_BLACKLIST, 
     MEMO, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK, 
-    CAPACITY_CORLOR, CAPACITY_VIP, DELETED, CAPACITY_SSO_ID,DRIVER_LICENCE_URL
+    CAPACITY_CORLOR, CAPACITY_VIP, DELETED, CAPACITY_SSO_ID,DRIVER_LICENCE_URL,CAPACITY_TEL
   </sql>
   <sql id="columns_alias">
     t.CAPACITY_ID, t.CAPACITY_NUMBER, t.CAPACITY_MAX_LOAD, t.CAPACITY_TYPE_ID, t.CAPACITY_STATUS, 
     t.CARRIER_ID, t.CAPACITY_ENERGY_ID, t.CAPACITY_LEN_VAL, t.CAPACITY_WID_VAL, t.CAPACITY_HIG_VAL, 
     t.CAPACITY_OIL_ID, t.CAPACITY_FUEL_CONSUMPTION, t.CAPACITY_OWNERIS, t.CAPACITY_BLACKLIST, 
     t.MEMO, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, 
-    t.CAPACITY_CORLOR, t.CAPACITY_VIP, t.DELETED, t.CAPACITY_SSO_ID,DRIVER_LICENCE_URL
+    t.CAPACITY_CORLOR, t.CAPACITY_VIP, t.DELETED, t.CAPACITY_SSO_ID,DRIVER_LICENCE_URL,t.CAPACITY_TEL
   </sql>
   <sql id="select">
     SELECT <include refid="columns" /> FROM RMS_CAPACITY
@@ -385,6 +386,9 @@
       <if test="driverLicenceUrl != null">
         DRIVER_LICENCE_URL,
       </if>
+      <if test="capacityTel != null">
+        CAPACITY_TEL,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="capacityId != null">
@@ -462,6 +466,9 @@
       <if test="driverLicenceUrl != null">
         #{driverLicenceUrl,jdbcType=VARCHAR},
       </if>
+      <if test="capacityTel != null">
+        #{capacityTel,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsCapacity">
@@ -744,7 +751,8 @@
     RC.CAPACITY_BLACKLIST AS "capacityBlacklist",
     RCA.CARRIER_NAME AS "carrierName",
     RCC.INSERT_UPDATE_REMARK "insertRemark",
-    RCC.CAPACITY_CARRIER_ID "capacityCarrierId"
+    RCC.CAPACITY_CARRIER_ID "capacityCarrierId",
+    RC.CAPACITY_TEL "capacityTel"
     FROM RMS_CAPACITY RC
     LEFT JOIN RMS_CAPACITY_TYPE RCT
     ON RC.CAPACITY_TYPE_ID = RCT.CAPACITY_TYPE_ID
@@ -902,4 +910,10 @@
     <update id="updateCapacityCarrier">
     update RMS_CAPACITY_CARRIER RCC set DELETED=1 ,UPDATE_TIME=sysDate ,UPDATE_USERNAME = #{carrierSSOId} where RCC.CAPACITY_CARRIER_ID = #{capacityCarrierId}
   </update>
+
+  <update id="updatecapacityTel">
+     update RMS_CAPACITY RC
+     set RC.CAPACITY_TEL=#{capacityTel}
+     where RC.CAPACITY_NUMBER=#{capacityNumber}
+  </update>
 </mapper>

+ 10 - 0
src/main/resources/com/steerinfo/dil/mapper/RmsOilPriceMapper.xml

@@ -502,5 +502,15 @@
     where RP.PRICE_OIL_TYPE_ID = #{oilTypeId} and RP.PRICE_STATUS = 0
   </update>
 
+  <delete id="deleteOilPrice">
+    delete from RMS_OIL_PRICE where PRICE_ID=#{priceId}
+  </delete>
+
+  <delete id="deleteOilPriceType">
+    delete from RMS_OIL_TYPE where OIL_TYPE_ID=#{oilTypeId}
+  </delete>
 
+  <select id="queryNumber" resultType="java.lang.Integer">
+    select count(*) from RMS_OIL_PRICE where PRICE_OIL_TYPE_ID=#{oilTypeId}
+  </select>
 </mapper>