소스 검색

运力上传图片

Tiroble 3 년 전
부모
커밋
d15ffd7247

+ 14 - 3
src/main/java/com/steerinfo/dil/controller/RmsCapacityController.java

@@ -1,6 +1,7 @@
 package com.steerinfo.dil.controller;
 
 import com.alibaba.fastjson.JSON;
+import com.steerinfo.dil.component.ImageFileUtils;
 import com.steerinfo.dil.feign.ESFeign;
 import com.steerinfo.dil.model.RmsCapacity;
 import com.steerinfo.dil.service.impl.RmsCapacityServiceImpl;
@@ -16,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -35,7 +37,8 @@ public class RmsCapacityController extends BaseRESTfulController {
     ColumnDataUtil columnDataUtil;
     @Autowired
     ESFeign esFeign;
-
+    @Autowired
+    private ImageFileUtils imageFileUtils;
 
     /**
      * 创建运力信息
@@ -93,9 +96,17 @@ public class RmsCapacityController extends BaseRESTfulController {
     @ApiOperation(value="获取运力详细信息", notes="根据url的id来获取详细信息")
     @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
     @PostMapping(value = "/getCapacityById/{id}")
-    public RESTfulResult getCapacityById(@PathVariable("id") BigDecimal id){
+    public RESTfulResult getCapacityById(@PathVariable("id") BigDecimal id) throws Exception {
         List<Map<String,Object>> list= rmsCapacityService.getCapacityById(id);
-        return success(list);
+        List<Map<String,Object>> resultList= new ArrayList<>();
+        for (Map<String,Object> item :list){
+            if(item.containsKey("driverLicenceUrl")&&item.get("driverLicenceUrl")!=null){
+                String driverLicenceUrl = imageFileUtils.downloadFile(item.get("driverLicenceUrl").toString()).toString();
+                item.put("driverLicenceUrl",driverLicenceUrl);
+            }
+            resultList.add(item);
+        }
+        return success(resultList);
     }
 
     /*

+ 40 - 30
src/main/java/com/steerinfo/dil/model/RmsCapacity.java

@@ -153,6 +153,11 @@ public class RmsCapacity implements IBasePO<BigDecimal> {
     @ApiModelProperty(value="SSO主键",required=false)
     private String capacitySsoId;
 
+    /**
+     * 行驶证(DRIVER_LICENCE_URL,VARCHAR,100)
+     */
+    @ApiModelProperty(value="行驶证",required=false)
+    private String driverLicenceUrl;
     public String getCapacitySsoId() {
         return capacitySsoId;
     }
@@ -229,6 +234,14 @@ public class RmsCapacity implements IBasePO<BigDecimal> {
         this.capacityEnergyId = capacityEnergyId == null ? null : capacityEnergyId.trim();
     }
 
+    public String getDriverLicenceUrl() {
+        return driverLicenceUrl;
+    }
+
+    public void setDriverLicenceUrl(String driverLicenceUrl) {
+        this.driverLicenceUrl = driverLicenceUrl;
+    }
+
     public BigDecimal getCapacityLenVal() {
         return capacityLenVal;
     }
@@ -359,35 +372,32 @@ public class RmsCapacity implements IBasePO<BigDecimal> {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(getClass().getSimpleName());
-        sb.append(" [");
-        sb.append("Hash = ").append(hashCode());
-        sb.append(", capacityId=").append(capacityId);
-        sb.append(", capacityNumber=").append(capacityNumber);
-        sb.append(", capacityMaxLoad=").append(capacityMaxLoad);
-        sb.append(", capacityTypeId=").append(capacityTypeId);
-        sb.append(", capacityStatus=").append(capacityStatus);
-        sb.append(", carrierId=").append(carrierId);
-        sb.append(", capacityEnergyId=").append(capacityEnergyId);
-        sb.append(", capacityLenVal=").append(capacityLenVal);
-        sb.append(", capacityWidVal=").append(capacityWidVal);
-        sb.append(", capacityHigVal=").append(capacityHigVal);
-        sb.append(", capacityOilId=").append(capacityOilId);
-        sb.append(", capacityFuelConsumption=").append(capacityFuelConsumption);
-        sb.append(", capacityOwneris=").append(capacityOwneris);
-        sb.append(", capacityBlacklist=").append(capacityBlacklist);
-        sb.append(", memo=").append(memo);
-        sb.append(", insertUsername=").append(insertUsername);
-        sb.append(", insertTime=").append(insertTime);
-        sb.append(", updateUsername=").append(updateUsername);
-        sb.append(", updateTime=").append(updateTime);
-        sb.append(", insertUpdateRemark=").append(insertUpdateRemark);
-        sb.append(", capacityCorlor=").append(capacityCorlor);
-        sb.append(", capacityVip=").append(capacityVip);
-        sb.append(", deleted=").append(deleted);
-        sb.append(", serialVersionUID=").append(serialVersionUID);
-        sb.append("]");
-        return sb.toString();
+        return "RmsCapacity{" +
+                "capacityId=" + capacityId +
+                ", capacityNumber='" + capacityNumber + '\'' +
+                ", capacityMaxLoad=" + capacityMaxLoad +
+                ", capacityTypeId=" + capacityTypeId +
+                ", capacityStatus=" + capacityStatus +
+                ", carrierId=" + carrierId +
+                ", capacityEnergyId='" + capacityEnergyId + '\'' +
+                ", capacityLenVal=" + capacityLenVal +
+                ", capacityWidVal=" + capacityWidVal +
+                ", capacityHigVal=" + capacityHigVal +
+                ", capacityOilId=" + capacityOilId +
+                ", capacityFuelConsumption='" + capacityFuelConsumption + '\'' +
+                ", capacityOwneris='" + capacityOwneris + '\'' +
+                ", capacityBlacklist='" + capacityBlacklist + '\'' +
+                ", memo='" + memo + '\'' +
+                ", insertUsername='" + insertUsername + '\'' +
+                ", insertTime=" + insertTime +
+                ", updateUsername='" + updateUsername + '\'' +
+                ", updateTime=" + updateTime +
+                ", insertUpdateRemark='" + insertUpdateRemark + '\'' +
+                ", capacityCorlor='" + capacityCorlor + '\'' +
+                ", capacityVip='" + capacityVip + '\'' +
+                ", deleted=" + deleted +
+                ", capacitySsoId='" + capacitySsoId + '\'' +
+                ", driverLicenceUrl='" + driverLicenceUrl + '\'' +
+                '}';
     }
 }

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

@@ -97,6 +97,9 @@ public class RmsCapacityServiceImpl implements IRmsCapacityService {
         if(remark != null && (!remark.toString().equals("null") || !remark.toString().equals("undefined"))){
             rmsCapacity.setInsertUpdateRemark(remark.toString());
         }
+        if (mapValue.containsKey("driverLicence")&&mapValue.get("driverLicence") !=null){
+            rmsCapacity.setDriverLicenceUrl(mapValue.get("driverLicence").toString());
+        }
         rmsCapacity.setInsertUpdateRemark(((String)mapValue.get("remark")));
         rmsCapacity.setCapacitySsoId((String) mapValue.get("ssoId"));
         rmsCapacity.setCapacityStatus(new BigDecimal(0));

+ 1 - 1
src/main/resources/application-prod.yml

@@ -19,7 +19,7 @@ openFeign:
 piction:
   # path: /usr/share/nginx/html/image
   #  path: /test/data/nginx/html/image
-  #    path: C:\Users\24390\Desktop\work\a
+  # path: C:\Users\24390\Desktop\work\a
   path: /shared
 server:
     port: 8060

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

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

+ 32 - 6
src/main/resources/com/steerinfo/dil/mapper/RmsCapacityMapper.xml

@@ -26,20 +26,22 @@
     <result column="CAPACITY_VIP" jdbcType="VARCHAR" property="capacityVip" />
     <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" />
   </resultMap>
+  
   <sql id="columns">
     CAPACITY_ID, CAPACITY_NUMBER, CAPACITY_MAX_LOAD, CAPACITY_TYPE_ID, CAPACITY_STATUS, 
     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
+    CAPACITY_CORLOR, CAPACITY_VIP, DELETED, CAPACITY_SSO_ID,DRIVER_LICENCE_URL
   </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
+    t.CAPACITY_CORLOR, t.CAPACITY_VIP, t.DELETED, t.CAPACITY_SSO_ID,DRIVER_LICENCE_URL
   </sql>
   <sql id="select">
     SELECT <include refid="columns" /> FROM RMS_CAPACITY
@@ -121,6 +123,9 @@
       <if test="capacitySsoId != null and capacitySsoId != ''">
         and CAPACITY_SSO_ID = #{capacitySsoId}
       </if>
+      <if test="driverLicenceUrl != null and driverLicenceUrl != ''">
+        and DRIVER_LICENCE_URL = #{driverLicenceUrl}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -197,6 +202,9 @@
       <if test="capacitySsoId != null and capacitySsoId != ''">
         and CAPACITY_SSO_ID LIKE '%${capacitySsoId}%'
       </if>
+      <if test="driverLicenceUrl != null and driverLicenceUrl != ''">
+        and DRIVER_LICENCE_URL LIKE '%${driverLicenceUrl}%'
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
@@ -275,6 +283,9 @@
       <if test="capacitySsoId != null and capacitySsoId != ''">
         or CAPACITY_SSO_ID = #{capacitySsoId}
       </if>
+    <if test="driverLicenceUrl != null and driverLicenceUrl != ''">
+      or DRIVER_LICENCE_URL = #{driverLicenceUrl}
+    </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.dil.model.RmsCapacity">
     insert into RMS_CAPACITY (CAPACITY_ID, CAPACITY_NUMBER, CAPACITY_MAX_LOAD, 
@@ -284,7 +295,7 @@
       CAPACITY_OWNERIS, CAPACITY_BLACKLIST, MEMO, 
       INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, 
       UPDATE_TIME, INSERT_UPDATE_REMARK, CAPACITY_CORLOR, 
-      CAPACITY_VIP, DELETED, CAPACITY_SSO_ID
+      CAPACITY_VIP, DELETED, CAPACITY_SSO_ID,DRIVER_LICENCE_URL
       )
     values (#{capacityId,jdbcType=DECIMAL}, #{capacityNumber,jdbcType=VARCHAR}, #{capacityMaxLoad,jdbcType=DECIMAL}, 
       #{capacityTypeId,jdbcType=DECIMAL}, #{capacityStatus,jdbcType=DECIMAL}, #{carrierId,jdbcType=DECIMAL}, 
@@ -293,7 +304,7 @@
       #{capacityOwneris,jdbcType=VARCHAR}, #{capacityBlacklist,jdbcType=VARCHAR}, #{memo,jdbcType=VARCHAR}, 
       #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP}, #{updateUsername,jdbcType=VARCHAR}, 
       #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR}, #{capacityCorlor,jdbcType=VARCHAR}, 
-      #{capacityVip,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, #{capacitySsoId,jdbcType=VARCHAR}
+      #{capacityVip,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, #{capacitySsoId,jdbcType=VARCHAR}, #{driverLicenceUrl,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.dil.model.RmsCapacity">
@@ -371,6 +382,9 @@
       <if test="capacitySsoId != null">
         CAPACITY_SSO_ID,
       </if>
+      <if test="driverLicenceUrl != null">
+        DRIVER_LICENCE_URL,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="capacityId != null">
@@ -445,6 +459,9 @@
       <if test="capacitySsoId != null">
         #{capacitySsoId,jdbcType=VARCHAR},
       </if>
+      <if test="driverLicenceUrl != null">
+        #{driverLicenceUrl,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.RmsCapacity">
@@ -472,6 +489,7 @@
       CAPACITY_VIP = #{capacityVip,jdbcType=VARCHAR},
       DELETED = #{deleted,jdbcType=DECIMAL},
       CAPACITY_SSO_ID = #{capacitySsoId,jdbcType=VARCHAR}
+      DRIVER_LICENCE_URL = #{driverLicenceUrl,jdbcType=VARCHAR}
     where CAPACITY_ID = #{capacityId,jdbcType=DECIMAL}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.RmsCapacity">
@@ -546,6 +564,9 @@
       <if test="capacitySsoId != null">
         CAPACITY_SSO_ID = #{capacitySsoId,jdbcType=VARCHAR},
       </if>
+      <if test="driverLicenceUrl != null">
+        DRIVER_LICENCE_URL = #{driverLicenceUrl,jdbcType=VARCHAR},
+      </if>
     </set>
     where CAPACITY_ID = #{capacityId,jdbcType=DECIMAL}
   </update>
@@ -574,7 +595,7 @@
       INSERT_TIME, UPDATE_USERNAME, 
       UPDATE_TIME, INSERT_UPDATE_REMARK, 
       CAPACITY_CORLOR, CAPACITY_VIP, 
-      DELETED, CAPACITY_SSO_ID)
+      DELETED, CAPACITY_SSO_ID,DRIVER_LICENCE_URL)
     ( <foreach collection="list" item="item" separator="union all"> 
    select  
       #{item.capacityId,jdbcType=DECIMAL}, 
@@ -588,7 +609,7 @@
       #{item.insertTime,jdbcType=TIMESTAMP}, #{item.updateUsername,jdbcType=VARCHAR}, 
       #{item.updateTime,jdbcType=TIMESTAMP}, #{item.insertUpdateRemark,jdbcType=VARCHAR}, 
       #{item.capacityCorlor,jdbcType=VARCHAR}, #{item.capacityVip,jdbcType=VARCHAR}, 
-      #{item.deleted,jdbcType=DECIMAL}, #{item.capacitySsoId,jdbcType=VARCHAR} from dual  
+      #{item.deleted,jdbcType=DECIMAL}, #{item.capacitySsoId,jdbcType=VARCHAR}, #{item.driverLicenceUrl,jdbcType=VARCHAR} from dual
    </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
@@ -690,6 +711,10 @@
        <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
           when #{item.capacityId,jdbcType=DECIMAL} then #{item.capacitySsoId,jdbcType=VARCHAR}
        </foreach>
+        ,DRIVER_LICENCE_URL=
+        <foreach close="end" collection="list" index="index" item="item" open="case CAPACITY_ID" separator=" ">
+          when #{item.capacityId,jdbcType=DECIMAL} then #{item.driverLicenceUrl,jdbcType=VARCHAR}
+        </foreach>
      where CAPACITY_ID in 
      <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
     #{item.capacityId,jdbcType=DECIMAL}
@@ -816,6 +841,7 @@
       RC.CAPACITY_OWNERIS AS "capacityOwneris",
       RC.CAPACITY_VIP AS "capacityVip",
       RC.CAPACITY_BLACKLIST AS "capacityBlacklist",
+      RC.DRIVER_LICENCE_URL AS "driverLicenceUrl",
       RC.CARRIER_ID AS "carrierId"
     FROM RMS_CAPACITY RC
     WHERE RC.CAPACITY_ID=#{id}