dengyj 4 rokov pred
rodič
commit
2f37e61827

+ 8 - 0
src/main/java/com/steerinfo/baseinfo/meterbasecar/controller/MeterBaseCarController.java

@@ -8,6 +8,8 @@ import com.steerinfo.baseinfo.meterbasecussupcar.model.MeterBaseCusSupCar;
 import com.steerinfo.baseinfo.meterbasedriver.mapper.MeterBaseDriverMapper;
 import com.steerinfo.baseinfo.meterbasedriver.model.MeterBaseDriver;
 import com.steerinfo.baseinfo.meterbasedriver.service.IMeterBaseDriverService;
+import com.steerinfo.baseinfo.meterbasespecialunit.mapper.MeterBaseSpecialUnitMapper;
+import com.steerinfo.baseinfo.meterbasespecialunit.model.MeterBaseSpecialUnit;
 import com.steerinfo.baseinfo.meterbasetravellingmerchant.mapper.MeterBaseTravellingMerchantMapper;
 import com.steerinfo.baseinfo.meterbasetravellingmerchant.model.MeterBaseTravellingMerchant;
 import com.steerinfo.baseinfo.meterbaseverificationcode.mapper.MeterBaseVerificationCodeMapper;
@@ -26,6 +28,7 @@ import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.shiro.crypto.hash.Hash;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -57,6 +60,9 @@ public class MeterBaseCarController extends BaseRESTfulController {
     @Autowired
     IMeterBaseCarService meterBaseCarService;
 
+    @Resource
+    MeterBaseSpecialUnitMapper meterBaseSpecialUnitMapper;
+
     @Autowired
     IMeterBaseDriverService meterBaseDriverService;
 
@@ -226,10 +232,12 @@ public class MeterBaseCarController extends BaseRESTfulController {
 
                 // 车辆表已存在车辆信息时,跳过
                 if (queryList01.size()+queryList02.size() == 0) {
+
                     // 新增车辆
                     MeterBaseCar car = new MeterBaseCar();
                     car.setCarNo(params.get("carNo").toString());
                     car.setValidFlag("0");
+                    car.setIsSpecialunit(params.get("isSpecialunit").toString());
                     car.setCarTypeNo(params.get("carTypeNo").toString());
                     car.setCarTypeName(params.get("carTypeName").toString());
                     if (params.get("carCarrierWeight") != null) {

+ 73 - 48
src/main/java/com/steerinfo/baseinfo/meterbasecar/mapper/MeterBaseCarMapper.xml

@@ -32,6 +32,7 @@
     <result column="FILLING_USER" jdbcType="VARCHAR" property="fillingUser" />
     <result column="IS_INSURANCE" jdbcType="VARCHAR" property="isInsurance" />
     <result column="OTHER_INSURANCE" jdbcType="VARCHAR" property="otherInsurance" />
+    <result column="IS_SPECIALUNIT" jdbcType="VARCHAR" property="isSpecialunit" />
   </resultMap>
   <sql id="columns">
     PK_NO, CAR_NO, MNEMONIC_CODE, CUSTOMER_SUPPLIER_NO, CUSTOMER_SUPPLIER_NAME, CAR_TYPE_NO, 
@@ -39,7 +40,7 @@
     CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, DELETE_MAN_NO, 
     DELETE_MAN_NAME, DELETE_TIME, SSO_ID, VEHICLE_TYPE, BELONG_UNIT_TYPE_NO, BELONG_UNIT_TYPE_NAME, 
     USET_DEPARTMENT, VEHICLE_IDENTIFY_NO, FILLING_DEPARTMENT, FILLING_USER, IS_INSURANCE, 
-    OTHER_INSURANCE
+    OTHER_INSURANCE, IS_SPECIALUNIT
   </sql>
   <sql id="columns_alias">
     t.PK_NO, t.CAR_NO, t.MNEMONIC_CODE, t.CUSTOMER_SUPPLIER_NO, t.CUSTOMER_SUPPLIER_NAME, 
@@ -47,13 +48,14 @@
     t.VALID_FLAG, t.CREATE_MAN_NO, t.CREATE_MAN_NAME, t.CREATE_TIME, t.UPDATE_MAN_NO, 
     t.UPDATE_MAN_NAME, t.UPDATE_TIME, t.DELETE_MAN_NO, t.DELETE_MAN_NAME, t.DELETE_TIME, 
     t.SSO_ID, t.VEHICLE_TYPE, t.BELONG_UNIT_TYPE_NO, t.BELONG_UNIT_TYPE_NAME, t.USET_DEPARTMENT, 
-    t.VEHICLE_IDENTIFY_NO, t.FILLING_DEPARTMENT, t.FILLING_USER, t.IS_INSURANCE, t.OTHER_INSURANCE
+    t.VEHICLE_IDENTIFY_NO, t.FILLING_DEPARTMENT, t.FILLING_USER, t.IS_INSURANCE, t.OTHER_INSURANCE, 
+    t.IS_SPECIALUNIT
   </sql>
   <sql id="select">
-    SELECT <include refid="columns" /> FROM METER_BASE_CAR
+    SELECT <include refid="columns"/> FROM METER_BASE_CAR
   </sql>
   <sql id="select_alias">
-    SELECT <include refid="columns_alias" /> FROM METER_BASE_CAR t
+    SELECT <include refid="columns_alias"/> FROM METER_BASE_CAR t
   </sql>
   <sql id="where">
     <where> 
@@ -147,6 +149,9 @@
       <if test="otherInsurance != null and otherInsurance != ''">
         and OTHER_INSURANCE = #{otherInsurance}
       </if>
+      <if test="isSpecialunit != null and isSpecialunit != ''">
+        and IS_SPECIALUNIT = #{isSpecialunit}
+      </if>
     </where>
   </sql>
   <sql id="whereLike">
@@ -241,6 +246,9 @@
       <if test="otherInsurance != null and otherInsurance != ''">
         and OTHER_INSURANCE LIKE '%${otherInsurance}%'
       </if>
+      <if test="isSpecialunit != null and isSpecialunit != ''">
+        and IS_SPECIALUNIT LIKE '%${isSpecialunit}%'
+      </if>
     </where>
   </sql>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
@@ -337,6 +345,9 @@
       <if test="otherInsurance != null and otherInsurance != ''">
         or OTHER_INSURANCE = #{otherInsurance}
       </if>
+      <if test="isSpecialunit != null and isSpecialunit != ''">
+        or IS_SPECIALUNIT = #{isSpecialunit}
+      </if>
   </delete>
   <insert id="insert" parameterType="com.steerinfo.baseinfo.meterbasecar.model.MeterBaseCar">
     insert into METER_BASE_CAR (PK_NO, CAR_NO, MNEMONIC_CODE, 
@@ -349,7 +360,7 @@
       SSO_ID, VEHICLE_TYPE, BELONG_UNIT_TYPE_NO, 
       BELONG_UNIT_TYPE_NAME, USET_DEPARTMENT, VEHICLE_IDENTIFY_NO, 
       FILLING_DEPARTMENT, FILLING_USER, IS_INSURANCE, 
-      OTHER_INSURANCE)
+      OTHER_INSURANCE, IS_SPECIALUNIT)
     values (#{pkNo,jdbcType=VARCHAR}, #{carNo,jdbcType=VARCHAR}, #{mnemonicCode,jdbcType=VARCHAR}, 
       #{customerSupplierNo,jdbcType=VARCHAR}, #{customerSupplierName,jdbcType=VARCHAR}, 
       #{carTypeNo,jdbcType=VARCHAR}, #{carTypeName,jdbcType=VARCHAR}, #{carCarrierWeight,jdbcType=DECIMAL}, 
@@ -360,7 +371,7 @@
       #{ssoId,jdbcType=VARCHAR}, #{vehicleType,jdbcType=VARCHAR}, #{belongUnitTypeNo,jdbcType=VARCHAR}, 
       #{belongUnitTypeName,jdbcType=VARCHAR}, #{usetDepartment,jdbcType=VARCHAR}, #{vehicleIdentifyNo,jdbcType=VARCHAR}, 
       #{fillingDepartment,jdbcType=VARCHAR}, #{fillingUser,jdbcType=VARCHAR}, #{isInsurance,jdbcType=VARCHAR}, 
-      #{otherInsurance,jdbcType=VARCHAR})
+      #{otherInsurance,jdbcType=VARCHAR}, #{isSpecialunit,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterbasecar.model.MeterBaseCar">
     insert into METER_BASE_CAR
@@ -455,6 +466,9 @@
       <if test="otherInsurance != null">
         OTHER_INSURANCE,
       </if>
+      <if test="isSpecialunit != null">
+        IS_SPECIALUNIT,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="pkNo != null">
@@ -547,6 +561,9 @@
       <if test="otherInsurance != null">
         #{otherInsurance,jdbcType=VARCHAR},
       </if>
+      <if test="isSpecialunit != null">
+        #{isSpecialunit,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterbasecar.model.MeterBaseCar">
@@ -579,7 +596,8 @@
       FILLING_DEPARTMENT = #{fillingDepartment,jdbcType=VARCHAR},
       FILLING_USER = #{fillingUser,jdbcType=VARCHAR},
       IS_INSURANCE = #{isInsurance,jdbcType=VARCHAR},
-      OTHER_INSURANCE = #{otherInsurance,jdbcType=VARCHAR}
+      OTHER_INSURANCE = #{otherInsurance,jdbcType=VARCHAR},
+      IS_SPECIALUNIT = #{isSpecialunit,jdbcType=VARCHAR}
     where PK_NO = #{pkNo,jdbcType=VARCHAR}
   </update>
   <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbasecar.model.MeterBaseCar">
@@ -672,20 +690,23 @@
       <if test="otherInsurance != null">
         OTHER_INSURANCE = #{otherInsurance,jdbcType=VARCHAR},
       </if>
+      <if test="isSpecialunit != null">
+        IS_SPECIALUNIT = #{isSpecialunit,jdbcType=VARCHAR},
+      </if>
     </set>
     where PK_NO = #{pkNo,jdbcType=VARCHAR}
   </update>
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    <include refid="select" />
+    <include refid="select"/>
     where PK_NO = #{pkNo,jdbcType=VARCHAR}
   </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 METER_BASE_CAR 
@@ -700,8 +721,8 @@
       SSO_ID, VEHICLE_TYPE, BELONG_UNIT_TYPE_NO, 
       BELONG_UNIT_TYPE_NAME, USET_DEPARTMENT, 
       VEHICLE_IDENTIFY_NO, FILLING_DEPARTMENT, 
-      FILLING_USER, IS_INSURANCE, OTHER_INSURANCE
-      )
+      FILLING_USER, IS_INSURANCE, OTHER_INSURANCE, 
+      IS_SPECIALUNIT)
     ( <foreach collection="list" item="item" separator="union all"> 
    select  
       #{item.pkNo,jdbcType=VARCHAR}, 
@@ -715,142 +736,146 @@
       #{item.ssoId,jdbcType=VARCHAR}, #{item.vehicleType,jdbcType=VARCHAR}, #{item.belongUnitTypeNo,jdbcType=VARCHAR}, 
       #{item.belongUnitTypeName,jdbcType=VARCHAR}, #{item.usetDepartment,jdbcType=VARCHAR}, 
       #{item.vehicleIdentifyNo,jdbcType=VARCHAR}, #{item.fillingDepartment,jdbcType=VARCHAR}, 
-      #{item.fillingUser,jdbcType=VARCHAR}, #{item.isInsurance,jdbcType=VARCHAR}, #{item.otherInsurance,jdbcType=VARCHAR}
-       from dual  
+      #{item.fillingUser,jdbcType=VARCHAR}, #{item.isInsurance,jdbcType=VARCHAR}, #{item.otherInsurance,jdbcType=VARCHAR}, 
+      #{item.isSpecialunit,jdbcType=VARCHAR} from dual  
    </foreach> )
   </insert>
   <update id="batchUpdate" parameterType="java.util.List">
      update METER_BASE_CAR
      set
        PK_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.pkNo,jdbcType=VARCHAR}
        </foreach>
        ,CAR_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.carNo,jdbcType=VARCHAR}
        </foreach>
        ,MNEMONIC_CODE=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.mnemonicCode,jdbcType=VARCHAR}
        </foreach>
        ,CUSTOMER_SUPPLIER_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.customerSupplierNo,jdbcType=VARCHAR}
        </foreach>
        ,CUSTOMER_SUPPLIER_NAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.customerSupplierName,jdbcType=VARCHAR}
        </foreach>
        ,CAR_TYPE_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.carTypeNo,jdbcType=VARCHAR}
        </foreach>
        ,CAR_TYPE_NAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.carTypeName,jdbcType=VARCHAR}
        </foreach>
        ,CAR_CARRIER_WEIGHT=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.carCarrierWeight,jdbcType=DECIMAL}
        </foreach>
        ,CAR_SELF_WEIGHT=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.carSelfWeight,jdbcType=DECIMAL}
        </foreach>
        ,MEMO=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.memo,jdbcType=VARCHAR}
        </foreach>
        ,VALID_FLAG=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.validFlag,jdbcType=VARCHAR}
        </foreach>
        ,CREATE_MAN_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
        </foreach>
        ,CREATE_MAN_NAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
        </foreach>
        ,CREATE_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
        </foreach>
        ,UPDATE_MAN_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
        </foreach>
        ,UPDATE_MAN_NAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
        </foreach>
        ,UPDATE_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
        </foreach>
        ,DELETE_MAN_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.deleteManNo,jdbcType=VARCHAR}
        </foreach>
        ,DELETE_MAN_NAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.deleteManName,jdbcType=VARCHAR}
        </foreach>
        ,DELETE_TIME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.deleteTime,jdbcType=TIMESTAMP}
        </foreach>
        ,SSO_ID=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.ssoId,jdbcType=VARCHAR}
        </foreach>
        ,VEHICLE_TYPE=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.vehicleType,jdbcType=VARCHAR}
        </foreach>
        ,BELONG_UNIT_TYPE_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.belongUnitTypeNo,jdbcType=VARCHAR}
        </foreach>
        ,BELONG_UNIT_TYPE_NAME=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.belongUnitTypeName,jdbcType=VARCHAR}
        </foreach>
        ,USET_DEPARTMENT=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.usetDepartment,jdbcType=VARCHAR}
        </foreach>
        ,VEHICLE_IDENTIFY_NO=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.vehicleIdentifyNo,jdbcType=VARCHAR}
        </foreach>
        ,FILLING_DEPARTMENT=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.fillingDepartment,jdbcType=VARCHAR}
        </foreach>
        ,FILLING_USER=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.fillingUser,jdbcType=VARCHAR}
        </foreach>
        ,IS_INSURANCE=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.isInsurance,jdbcType=VARCHAR}
        </foreach>
        ,OTHER_INSURANCE=
-       <foreach close="end" collection="list" index="index" item="item" open="case PK_NO" separator=" ">
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
           when #{item.pkNo,jdbcType=VARCHAR} then #{item.otherInsurance,jdbcType=VARCHAR}
        </foreach>
+       ,IS_SPECIALUNIT=
+       <foreach collection="list" item="item" index="index" separator=" " open="case PK_NO" close="end">
+          when #{item.pkNo,jdbcType=VARCHAR} then #{item.isSpecialunit,jdbcType=VARCHAR}
+       </foreach>
      where PK_NO in 
-     <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
+     <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
     #{item.pkNo,jdbcType=VARCHAR}
      </foreach> 
   </update>
   <delete id="batchDelete" parameterType="java.util.List">
     delete from METER_BASE_CAR
     where PK_NO in 
-    <foreach close=")" collection="list" item="id" open="(" separator=",">
+    <foreach collection="list" item="id" open="(" close=")" separator=",">
       #{id}
     </foreach>
   </delete>

+ 17 - 3
src/main/java/com/steerinfo/baseinfo/meterbasecar/model/MeterBaseCar.java

@@ -3,7 +3,6 @@ package com.steerinfo.baseinfo.meterbasecar.model;
 import com.steerinfo.framework.model.IBasePO;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
-
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -70,9 +69,9 @@ public class MeterBaseCar implements IBasePO<String> {
     private String memo;
 
     /**
-     * 状态(0:服役;1:停役;2:删除)(VALID_FLAG,VARCHAR,1)
+     * 状态(0:服役;1:停役)(VALID_FLAG,VARCHAR,1)
      */
-    @ApiModelProperty(value="状态(0:服役;1:停役;2:删除)",required=true)
+    @ApiModelProperty(value="状态(0:服役;1:停役)",required=true)
     private String validFlag;
 
     /**
@@ -189,6 +188,12 @@ public class MeterBaseCar implements IBasePO<String> {
     @ApiModelProperty(value="其他保险项",required=false)
     private String otherInsurance;
 
+    /**
+     * 是否特殊单位(0:非特殊  1:特殊)(IS_SPECIALUNIT,VARCHAR,1)
+     */
+    @ApiModelProperty(value="是否特殊单位(0:非特殊  1:特殊)",required=false)
+    private String isSpecialunit;
+
     private static final long serialVersionUID = 1L;
 
     @Override
@@ -441,6 +446,14 @@ public class MeterBaseCar implements IBasePO<String> {
         this.otherInsurance = otherInsurance == null ? null : otherInsurance.trim();
     }
 
+    public String getIsSpecialunit() {
+        return isSpecialunit;
+    }
+
+    public void setIsSpecialunit(String isSpecialunit) {
+        this.isSpecialunit = isSpecialunit == null ? null : isSpecialunit.trim();
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -477,6 +490,7 @@ public class MeterBaseCar implements IBasePO<String> {
         sb.append(", fillingUser=").append(fillingUser);
         sb.append(", isInsurance=").append(isInsurance);
         sb.append(", otherInsurance=").append(otherInsurance);
+        sb.append(", isSpecialunit=").append(isSpecialunit);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 20 - 5
src/main/java/com/steerinfo/meterwork/meterworkrailwayactfirst/service/impl/MeterWorkRailwayActFirstServiceImpl.java

@@ -2167,13 +2167,28 @@ public class MeterWorkRailwayActFirstServiceImpl extends BaseServiceImpl<MeterWo
             Map<String, Object> mapSearchFirst = FieldsCollector.beanToMap(searchFirst);
             List<MeterWorkRailwayActFirst> searchFirstList = meterWorkRailwayActFirstMapper.selectByParameters(mapSearchFirst);
             if(StringUtils.isNotEmpty(model.getPredictionNo())) {
-                if (searchFirstList != null && searchFirstList.size() > 1) {
+                if (searchFirstList.size() > 1) {
                     throw new MarkerMetException(500, "车号【" + model.getRailwayNo() + "】存在【" + searchFirstList.size() + "】条有效数据,不允许计量操作,请先在网页上进行作废!");
                 }
-                if (searchFirstList != null && searchFirstList.size() == 1) {
-                    if (!model.getPredictionNo().equals(searchFirstList.get(0).getPredictionNo())) {
-                        throw new MarkerMetException(500, "车号【" + model.getRailwayNo() + "】一次计量的预报【"
-                                + searchFirstList.get(0).getPredictionNo() + "】与当前使用的预报【" + model.getPredictionNo() + "】不一致,不允许计量操作,请先在网页上进行修改!");
+                if (searchFirstList.size() == 1) {
+                    if(StringUtils.isNotEmpty(searchFirst.getPredictionNo())){
+                        if (!model.getPredictionNo().equals(searchFirstList.get(0).getPredictionNo())) {
+                            throw new MarkerMetException(500, "车号【" + model.getRailwayNo() + "】一次计量的预报【"
+                                    + searchFirstList.get(0).getPredictionNo() + "】与当前使用的预报【" + model.getPredictionNo() + "】不一致,不允许计量操作,请先在网页上进行修改!");
+                        }
+                    }else {
+                        //判断上一次的一次计量是否匹配委托,没有委托将当前委托匹配给上一次计量数据
+                        String predictionNo01 = model.getPredictionNo();
+                        MeterWorkRailwayActFirst first01 = searchFirstList.get(0);
+                        //将委托中的编号和收发货的等数据拷贝进一次数据中
+                        MeterWorkRailwayActFirst first1 = meterWorkRailwayActFirstMapper.selectAndMatch(first01.getActualFirstNo(), predictionNo01);
+                        BeanUtils.copyProperties(first1,first01);
+
+                        first01.setValueFlag("1");
+                        first01.setUpdateTime(new Date());
+                        first01.setIsPreSacale("1");
+                        first01.setPredictionNo(predictionNo01);
+                        meterWorkRailwayActFirstMapper.updateByPrimaryKeySelective(first01);
                     }
                 }
             }

+ 2 - 1
src/main/resources/log4j.properties

@@ -1,5 +1,6 @@
 ## LOG4J配置
-log4j.rootCategory=INFO,stdout,file, RUNNING,errorfile
+#log4j.rootCategory=INFO,stdout,file, RUNNING,errorfile
+log4j.rootCategory=ERROR,file, RUNNING,errorfile 
 ## 控制台输出
 log4j.appender.stdout=org.apache.log4j.ConsoleAppender
 log4j.appender.stdout.layout=org.apache.log4j.PatternLayout