chengf
2025-08-05 c4a333b83ba54bcadf2a6a2b34fe66ab88a6ba9d
车辆导入去除校验2025/08/05
21个文件已修改
417 ■■■■■ 已修改文件
java110-bean/src/main/java/com/java110/dto/machine/CarInoutDto.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/owner/OwnerCarDto.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/po/car/CarInoutPo.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/CarInoutServiceDaoImplMapper.xml 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/common/CarInoutV1ServiceDaoImplMapper.xml 139 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/fee/PropertyWhiteListFlowDaoImplMapper.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-api/src/main/java/com/java110/api/configuration/ServiceConfiguration.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-api/src/main/java/com/java110/api/importData/adapt/ImportOwnerCarDataCleaningAdapt.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-api/src/main/java/com/java110/api/smo/assetImport/impl/AssetImportSMOImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-common/src/main/java/com/java110/common/dao/impl/CarInoutServiceDaoImpl.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/parkingSpaceApply/AuditParkingSpaceApplyCmd.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-community/src/main/java/com/java110/community/cmd/parkingSpaceApply/UpdateParkingSpaceApplyCmd.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/adapt/car/CarOutParkingAreaAdapt.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/adapt/market/CarInSendMarketInfoAdapt.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/cmd/importCarInout/CarInout.java 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-job/src/main/java/com/java110/job/importData/adapt/ImportOwnerCarQueueDataAdapt.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/cmd/admin/QueryAdminCountCmd.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/owner/EditOwnerCarCmd.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service-user/src/main/java/com/java110/user/cmd/owner/SaveOwnerCarCmd.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springboot/src/main/resources/application.yml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/machine/CarInoutDto.java
@@ -60,7 +60,6 @@
    private String merchantId;
    private String direction;
    public String getInoutId() {
        return inoutId;
    }
java110-bean/src/main/java/com/java110/dto/owner/OwnerCarDto.java
@@ -26,14 +26,19 @@
    public static final String CAR_TYPE_CD_TEMP = "1003";
    public static final String LEASE_TYPE_MONTH = "H"; // 月租车
    public static final String LEASE_TYPE_SALE = "S"; // 出售车
    public static final String LEASE_TYPE_INNER = "I"; //内部车
    public static final String LEASE_TYPE_NO_MONEY = "NM"; //免费车
    public static final String LEASE_TYPE_RESERVE = "R"; //预约车
    // public static final String LEASE_TYPE_MONTH = "H"; // 月租车
    // public static final String LEASE_TYPE_SALE = "S"; // 出售车
    // public static final String LEASE_TYPE_INNER = "I"; //内部车
    // public static final String LEASE_TYPE_NO_MONEY = "NM"; //免费车
    // public static final String LEASE_TYPE_RESERVE = "R"; //预约车
    public static final String LEASE_TYPE_TEMP = "T";//临时车
    public static final String LEASE_TYPE_STORE = "S"; // 商铺车
    public static final String LEASE_TYPE_INNER = "I"; //业委会照顾车
    public static final String LEASE_TYPE_NO_MONEY = "NM"; //小业主产权车
    public static final String LEASE_TYPE_RESERVE = "R"; //租客车
    public static final String CAR_TYPE_CREDIT = "9906"; //信用期车牌
    private String carColor;
java110-bean/src/main/java/com/java110/po/car/CarInoutPo.java
@@ -26,6 +26,8 @@
    private String direction;
    private String bId;
    private String createTime;
    private String errorTest;
    private String communityName;
    public String getInoutId() {
@@ -139,4 +141,20 @@
    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
    public String getErrorTest() {
        return errorTest;
    }
    public void setErrorTest(String errorTest) {
        this.errorTest = errorTest;
    }
    public String getCommunityName() {
        return communityName;
    }
    public void setCommunityName(String communityName) {
        this.communityName = communityName;
    }
}
java110-db/src/main/resources/mapper/common/CarInoutServiceDaoImplMapper.xml
@@ -215,24 +215,21 @@
        status_cd,
        pa_id
        ) VALUES
        <!-- 将 collection="carInoutList" 改为 collection="list" -->
        <foreach collection="list" item="item" separator=",">
            (
            #{item.inoutId},
            #{item.bId},
            #{item.communityId},
            #{item.carNum},
            #{item.vehicleType},
            #{item.paymentAmount},
            #{item.merchantId},
            #{item.direction},
            #{item.state},
            #{item.inTime},
            #{item.outTime},
            #{item.createTime},
            #{item.statusCd},
            #{item.paId}
            #{inoutId},
            #{bId},
            #{communityId},
            #{carNum},
            #{vehicleType},
            #{paymentAmount},
            #{merchantId},
            #{direction},
            #{state},
            #{inTime},
            #{outTime},
            #{createTime},
            #{statusCd},
            #{paId}
            )
        </foreach>
    </insert>
</mapper>
java110-db/src/main/resources/mapper/common/CarInoutV1ServiceDaoImplMapper.xml
@@ -17,65 +17,127 @@
    <!-- 查询车辆进出场信息 add by wuxw 2018-07-03 -->
    <select id="getCarInoutInfo" parameterType="Map" resultType="Map">
        select t.in_time,t.in_time inTime,t.inout_id,t.inout_id inoutId,t.pa_id,t.pa_id paId,t.car_num,t.car_num
        carNum,t.status_cd,t.status_cd statusCd,t.state,t.community_id,t.community_id communityId,t.out_time,t.out_time
        outTime,td.`name` stateName,pa.num areaNum,tcfc.fee_name feeName,tcfc.config_id configId,max(cid.car_type) carType,max(cid.car_type_name) carTypeName
        from car_inout t
        LEFT JOIN car_inout_detail cid on t.inout_id = cid.inout_id and cid.status_cd = '0' and cid.state in ('100300','100400','100600')
        left join t_dict td on t.state = td.status_cd and td.table_columns='state' and td.table_name = 'car_inout'
        left join parking_area pa on t.pa_id = pa.pa_id and pa.status_cd = '0'
        left join temp_car_fee_config tcfc on pa.pa_id = tcfc.pa_id and tcfc.status_cd = '0'
        where 1 =1
        <if test="inTime !=null and inTime != ''">
            and t.in_time= #{inTime}
        SELECT
        -- 出场记录字段
        out_rec.in_time outInTime,
        out_rec.inout_id outInoutId,
        out_rec.pa_id paId,
        out_rec.car_num carNum,
        out_rec.vehicle_type vehicleType,
        out_rec.payment_amount paymentAmount,
        out_rec.merchant_id merchantId,
        out_rec.direction,
        out_rec.status_cd statusCd,
        out_rec.state outState,
        out_rec.community_id communityId,
        out_rec.out_time outTime,
        -- 关联的进场记录字段
        in_rec.in_time inTime,
        in_rec.inout_id inInoutId,
        in_rec.state inState,
        -- 其他关联信息
        td_out.`name` outStateName,
        td_in.`name` inStateName,
        pa.num areaNum,
        tcfc.fee_name feeName,
        tcfc.config_id configId,
        MAX(cid_out.car_type) carType,
        MAX(cid_out.car_type_name) carTypeName,
        -- 停车时长
        TIMESTAMPDIFF(MINUTE, in_rec.in_time, out_rec.out_time) parkMinutes
        FROM car_inout out_rec
        -- 关联最新的进场记录
        LEFT JOIN (
        SELECT
        car_num, in_time, inout_id, state, pa_id, community_id,
        ROW_NUMBER() OVER (PARTITION BY car_num ORDER BY in_time DESC) rn
        FROM car_inout
        WHERE state = '100300'  -- 进场状态
        AND status_cd = '0'
        ) in_rec ON out_rec.car_num = in_rec.car_num
        AND out_rec.in_time > in_rec.in_time
        AND in_rec.rn = 1
        AND out_rec.pa_id = in_rec.pa_id
        -- 原有关联表(调整为关联出场记录)
        LEFT JOIN car_inout_detail cid_out ON out_rec.inout_id = cid_out.inout_id
        AND cid_out.status_cd = '0'
        AND cid_out.state IN ('100300','100400','100600')
        LEFT JOIN t_dict td_out ON out_rec.state = td_out.status_cd
        AND td_out.table_columns = 'state'
        AND td_out.table_name = 'car_inout'
        LEFT JOIN t_dict td_in ON in_rec.state = td_in.status_cd
        AND td_in.table_columns = 'state'
        AND td_in.table_name = 'car_inout'
        LEFT JOIN parking_area pa ON out_rec.pa_id = pa.pa_id
        AND pa.status_cd = '0'
        LEFT JOIN temp_car_fee_config tcfc ON pa.pa_id = tcfc.pa_id
        AND tcfc.status_cd = '0'
        WHERE 1 = 1
        -- 主表筛选离场记录
        AND out_rec.state = '100500'  -- 离场状态
        AND out_rec.status_cd = '0'
        -- 保留原始所有查询条件(调整别名适配新结构)
        <if test="inTime != null and inTime != ''">
            AND in_rec.in_time = #{inTime}
        </if>
        <if test="inoutId !=null and inoutId != ''">
            and t.inout_id= #{inoutId}
        <if test="inoutId != null and inoutId != ''">
            AND out_rec.inout_id = #{inoutId}
        </if>
        <if test="paId !=null and paId != ''">
            and t.pa_id= #{paId}
        <if test="paId != null and paId != ''">
            AND out_rec.pa_id = #{paId}
        </if>
        <if test="paIds !=null">
            and t.pa_id in
        <if test="paIds != null">
            AND out_rec.pa_id IN
            <foreach collection="paIds" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="carNum !=null and carNum != ''">
            and t.car_num like concat('%',#{carNum},'%')
        <if test="carNum != null and carNum != ''">
            AND out_rec.car_num LIKE CONCAT('%', #{carNum}, '%')
        </if>
        <if test="carType !=null and carType != ''">
            and cid.car_type= #{carType}
        <if test="carType != null and carType != ''">
            AND cid_out.car_type = #{carType}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        <if test="statusCd != null and statusCd != ''">
            AND out_rec.status_cd = #{statusCd}
        </if>
        <if test="state !=null and state != ''">
            and t.state= #{state}
        <if test="state != null and state != ''">
            AND out_rec.state = #{state}
        </if>
        <if test="states !=null">
            and t.state in
        <if test="states != null">
            AND out_rec.state IN
            <foreach collection="states" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        <if test="communityId != null and communityId != ''">
            AND out_rec.community_id = #{communityId}
        </if>
        <if test="outTime !=null and outTime != ''">
            and t.out_time= #{outTime}
        <if test="outTime != null and outTime != ''">
            AND out_rec.out_time = #{outTime}
        </if>
        <if test="startTime !=null and startTime != ''">
            and t.in_time &gt; #{startTime}
        <if test="startTime != null and startTime != ''">
            AND in_rec.in_time &gt; #{startTime}
        </if>
        <if test="endTime !=null and endTime != ''">
            and t.in_time &lt; #{endTime}
        <if test="endTime != null and endTime != ''">
            AND in_rec.in_time &lt; #{endTime}
        </if>
        group by t.in_time,t.inout_id,t.pa_id,t.car_num,t.status_cd,t.state,t.community_id,t.out_time,td.`name`,pa.num,tcfc.fee_name,tcfc.config_id,t.create_time
        order by t.create_time desc
        GROUP BY
        out_rec.in_time, out_rec.inout_id, out_rec.pa_id, out_rec.car_num,
        out_rec.status_cd, out_rec.state, out_rec.community_id, out_rec.out_time,
        in_rec.in_time, in_rec.inout_id, in_rec.state,
        td_out.`name`, td_in.`name`, pa.num, tcfc.fee_name, tcfc.config_id
        ORDER BY out_rec.create_time DESC
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
@@ -117,9 +179,6 @@
        where 1 =1
        <if test="inTime !=null and inTime != ''">
            and t.in_time= #{inTime}
        </if>
        <if test="inoutId !=null and inoutId != ''">
            and t.inout_id= #{inoutId}
        </if>
        <if test="paId !=null and paId != ''">
            and t.pa_id= #{paId}
java110-db/src/main/resources/mapper/fee/PropertyWhiteListFlowDaoImplMapper.xml
@@ -127,6 +127,9 @@
            <if test="feeYear != null and feeYear != ''">
                and YEAR(charge_time) = #{feeYear}
            </if>
            <if test="communityId != null and communityId != ''">
                and community_id = #{communityId}
            </if>
        </where>
        <!-- 排序 -->
@@ -188,6 +191,9 @@
            <if test="feeYear != null and feeYear != ''">
                and YEAR(charge_time) = #{feeYear}
            </if>
            <if test="communityId != null and communityId != ''">
                and community_id = #{communityId}
            </if>
        </where>
    </select>
    <select id="countPropertyWhiteListFlowFilter" parameterType="Map" resultType="Map">
@@ -223,6 +229,9 @@
            <if test="chargeEnd != null">
                AND charge_end = #{chargeEnd}
            </if>
            <if test="communityId != null and communityId != ''">
                and community_id = #{communityId}
            </if>
        </where>
    </select>
</mapper>
service-api/src/main/java/com/java110/api/configuration/ServiceConfiguration.java
@@ -27,6 +27,8 @@
    public FilterRegistrationBean jwtFilter() {
        StringBuffer exclusions = new StringBuffer();
        exclusions.append("/app/carInout.*,");
        exclusions.append("/app/import.CarInout,");
        exclusions.append("/app/import.QueryCarInout,");
        exclusions.append("/callComponent/login/*,");
        exclusions.append("/secondaryFeeTypeCdGl/*,");
        exclusions.append("/app/ext/992020051967020024/query_token,");
service-api/src/main/java/com/java110/api/importData/adapt/ImportOwnerCarDataCleaningAdapt.java
@@ -60,14 +60,14 @@
            Assert.hasValue(os[0], (osIndex + 1) + "车牌号不能为空");
            Assert.hasValue(os[1], (osIndex + 1) + "业主不能为空");
//            Assert.hasValue(os[2], (osIndex + 1) + "手机号不能为空");
            Assert.hasValue(os[3], (osIndex + 1) + "车辆品牌不能为空");
            Assert.hasValue(os[4], (osIndex + 1) + "车辆类型不能为空");
            Assert.hasValue(os[5], (osIndex + 1) + "颜色不能为空");
            Assert.hasValue(os[6], (osIndex + 1) + "停车场不能为空");
            Assert.hasValue(os[7], (osIndex + 1) + "车位不能为空");
//            Assert.hasValue(os[3], (osIndex + 1) + "车辆品牌不能为空");
//            Assert.hasValue(os[4], (osIndex + 1) + "车辆类型不能为空");
//            Assert.hasValue(os[5], (osIndex + 1) + "颜色不能为空");
//            Assert.hasValue(os[6], (osIndex + 1) + "停车场不能为空");
//            Assert.hasValue(os[7], (osIndex + 1) + "车位不能为空");
            Assert.hasValue(os[8], (osIndex + 1) + "起租时间不能为空");
            Assert.hasValue(os[9], (osIndex + 1) + "截止时间不能为空");
            Assert.hasValue(os[10], (osIndex + 1) + "停车场类型不能为空");
//            Assert.hasValue(os[10], (osIndex + 1) + "停车场类型不能为空");
            Assert.hasValue(os[11], (osIndex + 1) + "车位类型不能为空");
            String startTime = excelDoubleToDate(os[8].toString());
            String endTime = excelDoubleToDate(os[9].toString());
@@ -77,16 +77,16 @@
            importOwnerCar.setCarNum(os[0].toString().trim());
            importOwnerCar.setOwnerName(os[1].toString().trim());
            importOwnerCar.setLink(os[2] == null ? "" : os[2].toString().trim());
            importOwnerCar.setCarBrand(os[3].toString().trim());
            importOwnerCar.setCarType(os[4].toString().trim());
            importOwnerCar.setCarColor(os[5].toString().trim());
            importOwnerCar.setAreaNum(os[6].toString().trim());
            importOwnerCar.setCarBrand(os[3] == null ? "" : os[3].toString().trim());
            importOwnerCar.setCarType(os[4] == null ? "" : os[4].toString().trim());
            importOwnerCar.setCarColor(os[5] == null ? "" : os[5].toString().trim());
            importOwnerCar.setAreaNum(os[6] == null ? "" : os[6].toString().trim());
            //获取车位
            String parkingLot = os[7].toString().trim();
            String parkingLot = os[7] == null ? "" : os[7].toString().trim();
            importOwnerCar.setNum(parkingLot);
            importOwnerCar.setLogStartTime(startTime);
            importOwnerCar.setLogEndTime(endTime);
            importOwnerCar.setTypeCd(os[10].toString().trim());
            importOwnerCar.setTypeCd(os[10] == null ? "" : os[10].toString().trim());
            importOwnerCar.setSpaceSate(os[11].toString().trim());
            importOwnerCar.setCommunityId(result.getCommunityId());
            importOwnerCar.setUserId(result.getUserId());
@@ -102,7 +102,9 @@
     */
    private void validateCarInfo(List<OwnerCarDto> ownerCars) {
        for (OwnerCarDto ownerCarDto : ownerCars) {
            if ("".equals(ownerCarDto.getTypeCd()) || ownerCarDto.getTypeCd() == null) {
                continue;
            }
            if (!"1001".equals(ownerCarDto.getTypeCd()) && !"2001".equals(ownerCarDto.getTypeCd())) {
                throw new IllegalArgumentException(ownerCarDto.getCarNum() + "停车场类型应填写 1001(地上停车场)或者 2001 (地下停车场)");
            }
service-api/src/main/java/com/java110/api/smo/assetImport/impl/AssetImportSMOImpl.java
@@ -135,15 +135,7 @@
        assetImportLogPo.setErrorCount("0");
        assetImportLogPo.setSuccessCount("0");
        String userId = null;
        try {
            userId = new ObjectMapper().readValue(pd.getReqData(), HashMap.class).get("userId").toString();
        } catch (JsonMappingException e) {
            throw new RuntimeException(e);
        } catch (JsonParseException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        userId = pd.getUserId();
        if(userId != null) {
            UserDto userDto = new UserDto();
            userDto.setUserId(userId);
service-common/src/main/java/com/java110/common/dao/impl/CarInoutServiceDaoImpl.java
@@ -6,10 +6,12 @@
import com.java110.po.car.CarInoutPo;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.DAOException;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.DateUtil;
import org.activiti.engine.impl.util.CollectionUtil;
import org.slf4j.Logger;
import com.java110.core.log.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -135,6 +137,9 @@
    }
    @Autowired
    private CarInoutServiceDaoImpl carInoutServiceDaoImpl;
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int[] batchSaveCarInout(List<CarInoutPo> successRecords) {
@@ -143,33 +148,38 @@
        }
        int totalSize = successRecords.size();
        int[] result = new int[totalSize]; // 存储每条记录的插入结果(默认 0 表示失败)
        int batchSize = 500; // 每批插入 500 条
        int batchCount = 0;  // 记录当前处理到第几批
        int[] result = new int[totalSize]; // 存储每条记录的插入结果(0表示失败,1表示成功)
        for (int i = 0; i < totalSize; i += batchSize) {
            // 截取当前批次数据
            List<CarInoutPo> batchList = successRecords.subList(i, Math.min(i + batchSize, totalSize));
        for (int i = 0; i < totalSize; i++) {
            CarInoutPo record = successRecords.get(i);
            try {
            // 执行批量插入,返回当前批次总影响行数
            int batchAffectedRows = sqlSessionTemplate.insert(
                    "carInoutServiceDaoImpl.batchInsert",
                    batchList
            );
                int existCount = carInoutServiceDaoImpl.queryCarInoutsCount(BeanConvertUtil.beanCovertMap(record));
            // 标记当前批次记录为成功(简单处理:假设要么全成功,要么全失败)
            if (batchAffectedRows == batchList.size()) {
                for (int j = i; j < i + batchSize && j < totalSize; j++) {
                    result[j] = 1; // 1 表示插入成功
                if (existCount > 0) {
                    // 3. 记录已存在,标记为去重(可用2表示去重,与0/1区分)
                    record.setErrorTest("重复的内容");
                    continue;
                }
            } else {
                // 批次插入失败(如主键冲突、字段错误),标记为 0
                for (int j = i; j < i + batchSize && j < totalSize; j++) {
                    result[j] = 0; // 0 表示插入失败
                // 逐条插入
                int affectedRows = sqlSessionTemplate.insert(
                        "carInoutServiceDaoImpl.batchInsert", // 注意这里需要改为单条插入的statement ID
                        BeanConvertUtil.beanCovertMap(record)
                );
                // 单条插入成功
                if (affectedRows > 0) {
                    result[i] = 1;
                } else {
                    result[i] = 0;
                }
            } catch (Exception e) {
                // 捕获SQL异常,标记为失败
                result[i] = 0;
                // 可以根据需要记录错误日志
                 record.setErrorTest("插入CarInoutPo失败,记录: "+e);
            }
            batchCount++;
        }
        return result;
service-community/src/main/java/com/java110/community/cmd/parkingSpaceApply/AuditParkingSpaceApplyCmd.java
@@ -124,7 +124,7 @@
        OwnerCarDto ownerCarDto = new OwnerCarDto();
        ownerCarDto.setCarNum(parkingSpaceApplyPo.getCarNum());
        ownerCarDto.setCommunityId(parkingSpaceApplyPo.getCommunityId());
        ownerCarDto.setLeaseType(OwnerCarDto.LEASE_TYPE_MONTH);
        ownerCarDto.setLeaseType(OwnerCarDto.LEASE_TYPE_TEMP);
        List<OwnerCarDto> ownerCarDtos = ownerCarV1InnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
        String catId = "";
        OwnerCarPo ownerCarPo = new OwnerCarPo();
@@ -145,7 +145,7 @@
            ownerCarPo.setState("1001");
            ownerCarPo.setUserId(userId);
            ownerCarPo.setRemark("车位申请,系统自动写入");
            ownerCarPo.setLeaseType(OwnerCarDto.LEASE_TYPE_MONTH);
            ownerCarPo.setLeaseType(OwnerCarDto.LEASE_TYPE_TEMP);
            flag = ownerCarV1InnerServiceSMOImpl.saveOwnerCar(ownerCarPo);
            if (flag < 1) {
                throw new CmdException("更新数据失败");
service-community/src/main/java/com/java110/community/cmd/parkingSpaceApply/UpdateParkingSpaceApplyCmd.java
@@ -106,7 +106,7 @@
        OwnerCarDto ownerCarDto = new OwnerCarDto();
        ownerCarDto.setCarNum(parkingSpaceApplyPo.getCarNum());
        ownerCarDto.setCommunityId(parkingSpaceApplyPo.getCommunityId());
        ownerCarDto.setLeaseType(OwnerCarDto.LEASE_TYPE_MONTH);
        ownerCarDto.setLeaseType(OwnerCarDto.LEASE_TYPE_RESERVE);
        List<OwnerCarDto> ownerCarDtos = ownerCarV1InnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
        String catId = "";
        if (ownerCarDtos == null || ownerCarDtos.size() < 1) {
service-job/src/main/java/com/java110/job/adapt/car/CarOutParkingAreaAdapt.java
@@ -98,9 +98,9 @@
        ownerCarDto.setCarNum(carInoutDetailPo.getCarNum());
        ownerCarDto.setCommunityId(communityId);
        ownerCarDto.setLeaseTypes(new String[]{OwnerCarDto.LEASE_TYPE_INNER,
                OwnerCarDto.LEASE_TYPE_MONTH,
                OwnerCarDto.LEASE_TYPE_STORE,
                OwnerCarDto.LEASE_TYPE_NO_MONEY,
                OwnerCarDto.LEASE_TYPE_SALE});
                OwnerCarDto.LEASE_TYPE_RESERVE});
        List<OwnerCarDto> ownerCarDtos = ownerCarV1InnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
        if (ownerCarDtos == null || ownerCarDtos.size() < 1) {
service-job/src/main/java/com/java110/job/adapt/market/CarInSendMarketInfoAdapt.java
@@ -91,9 +91,9 @@
        ownerCarDto.setCarNum(carInoutDetailPo.getCarNum());
        ownerCarDto.setCommunityId(communityId);
        ownerCarDto.setLeaseTypes(new String[]{OwnerCarDto.LEASE_TYPE_INNER,
                OwnerCarDto.LEASE_TYPE_MONTH,
                OwnerCarDto.LEASE_TYPE_STORE,
                OwnerCarDto.LEASE_TYPE_NO_MONEY,
                OwnerCarDto.LEASE_TYPE_SALE});
                OwnerCarDto.LEASE_TYPE_RESERVE});
        List<OwnerCarDto> ownerCarDtos = ownerCarV1InnerServiceSMOImpl.queryOwnerCars(ownerCarDto);
        if(ownerCarDtos == null || ownerCarDtos.size()<1){
service-job/src/main/java/com/java110/job/cmd/importCarInout/CarInout.java
@@ -115,19 +115,45 @@
                        // 将解析成功的数据存入数据库,使用你的Service实现
                        if (result.getSuccessRecords() != null && !result.getSuccessRecords().isEmpty()) {
                            int min = 100000000;
                            int max = 999999999;
                            Random RANDOM = new Random();
                            for (CarInoutPo carInoutPo : result.getSuccessRecords()) {
//                                carInoutPo.setInoutId("937510345");
                                carInoutPo.setInoutId((min + RANDOM.nextInt(max - min + 1))+"");
                                carInoutPo.setCommunityId(community.getCommunityId());
                            }
                            int[] counts = carInoutInnerServiceSMOImpl.batchSaveCarInout(result.getSuccessRecords());
                            log.info("成功导入 {} 条记录到小区: {} 的 {} 日期数据",
                                    Arrays.stream(counts).sum(), communityName, date);
                        }
                        // 处理失败的记录,生成错误Excel并上传到OSS
                        if (result.getErrorRecords() != null && !result.getErrorRecords().isEmpty()) {
                            handleErrorRecords(ossClient, bucketName, communityName, date, fileName, result.getErrorRecords());
                            log.info("小区: {} 的 {} 日期数据中有 {} 条记录导入失败,已生成错误文件",
                                    communityName, date, result.getErrorRecords().size());
// 统计成功和失败的总条数
                            int successTotal = 0;
                            int errorTotal = 0;
                            for (int count : counts) {
                                if (count == 1) {
                                    successTotal++;
                                } else {
                                    errorTotal++;
                                }
                            }
// 输出总体导入结果日志
                            log.info("小区: {} 的 {} 日期数据导入完成 - 总记录数: {}, 成功: {}, 失败: {}",
                                    communityName, date, counts.length, successTotal, errorTotal);
// 处理失败的记录,生成错误Excel并上传到OSS
                            if (errorTotal > 0) {
                                // 收集具体失败的记录(根据counts数组筛选)
                                List<ErrorExcelRowData> failedRecords = new ArrayList<>();
                                for (int i = 0; i < counts.length; i++) {
                                    if (counts[i] == 0) {
                                        failedRecords.add(convertPoToErrorRowData(result.getSuccessRecords().get(i)));
                                    }
                                }
                                handleErrorRecords(ossClient, bucketName, communityName, date, fileName, failedRecords);
                                log.info("小区: {} 的 {} 日期数据中,{} 条失败记录已生成错误文件",
                                        communityName, date, errorTotal);
                            }
                        }
                        inputStream.close();
@@ -169,12 +195,29 @@
            out.close();
            inputStream.close();
            log.info("错误记录文件已上传至: {}", errorFileKey);
            System.out.println("错误记录文件已上传至: "+errorFileKey);
        } catch (Exception e) {
            log.error("处理错误记录时发生异常", e);
        }
    }
    private ErrorExcelRowData convertPoToErrorRowData(CarInoutPo po) {
        ErrorExcelRowData errorRow = new ErrorExcelRowData();
        // 根据实际字段映射关系赋值
        errorRow.setPlateNumber(po.getCarNum()); // 车牌号
        // errorRow.setCommunityName(po.getCommunityName()); // 若CarInoutPo有小区名称字段
        errorRow.setEntryTime(po.getInTime()); // 进场时间
        errorRow.setExitName(po.getOutTime()); // 离场时间(原代码中ExcelRowData的exitName实际对应离场时间)
        errorRow.setVehicleType(po.getVehicleType()); // 车辆类型
        errorRow.setPaidStatus(po.getState()); // 支付状态
        errorRow.setPaymentAmount(po.getPaymentAmount()); // 支付金额
        errorRow.setMerchantId(po.getMerchantId()); // 商户ID
        errorRow.setDirection(po.getDirection()); // 方向
        // 可在此处设置错误原因(如数据库插入失败的具体原因)
         errorRow.setErrorReason(po.getErrorTest());
        return errorRow;
    }
    /**
     * 解析Excel文件并验证数据,分离成功和失败的记录
     */
service-job/src/main/java/com/java110/job/importData/adapt/ImportOwnerCarQueueDataAdapt.java
@@ -134,7 +134,7 @@
        }
        if (!StringUtil.isEmpty(state) && !state.equals("F")) {
            throw new IllegalArgumentException(ownerCarDto.getAreaNum() + "停车场-" + ownerCarDto.getNum() + "停车位不是空闲状态!");
//            throw new IllegalArgumentException(ownerCarDto.getAreaNum() + "停车场-" + ownerCarDto.getNum() + "停车位不是空闲状态!");
        }
        ownerCarPo.setPsId(psId);
        ownerCarPo.setOwnerId(ownerCarDto.getOwnerId());
service-report/src/main/java/com/java110/report/cmd/admin/QueryAdminCountCmd.java
@@ -136,8 +136,7 @@
        OwnerCarDto ownerCarDto = new OwnerCarDto();
        ownerCarDto.setLeaseTypes(new String[]{OwnerCarDto.LEASE_TYPE_INNER,
                OwnerCarDto.LEASE_TYPE_MONTH,
                OwnerCarDto.LEASE_TYPE_SALE,
                OwnerCarDto.LEASE_TYPE_STORE,
                OwnerCarDto.LEASE_TYPE_NO_MONEY,
                OwnerCarDto.LEASE_TYPE_RESERVE
        });
service-report/src/main/java/com/java110/report/smo/impl/GeneratorFeeMonthStatisticsInnerServiceSMOImpl.java
@@ -167,7 +167,10 @@
        ReportCarDto reportCarDto = new ReportCarDto();
        reportCarDto.setCommunityId(reportFeeMonthStatisticsPo.getCommunityId());
        reportCarDto.setLeaseTypes(new String[]{OwnerCarDto.LEASE_TYPE_MONTH,OwnerCarDto.LEASE_TYPE_INNER,OwnerCarDto.LEASE_TYPE_SALE,OwnerCarDto.LEASE_TYPE_NO_MONEY});
        reportCarDto.setLeaseTypes(new String[]{OwnerCarDto.LEASE_TYPE_INNER,
                OwnerCarDto.LEASE_TYPE_STORE,
                OwnerCarDto.LEASE_TYPE_NO_MONEY,
                OwnerCarDto.LEASE_TYPE_RESERVE});
        int count = reportCommunityServiceDaoImpl.getCarCount(reportCarDto);
service-user/src/main/java/com/java110/user/cmd/owner/EditOwnerCarCmd.java
@@ -83,9 +83,9 @@
        if (StringUtil.isEmpty(psId) || "-1".equals(psId)) {
            throw new IllegalArgumentException("车位已经被释放,不允许修改车辆信息");
        }
        if (!reqJson.containsKey("leaseType")) {
            reqJson.put("leaseType", OwnerCarDto.LEASE_TYPE_MONTH);
        }
//        if (!reqJson.containsKey("leaseType")) {
//            reqJson.put("leaseType", OwnerCarDto.LEASE_TYPE_MONTH);
//        }
//        if (!OwnerCarDto.LEASE_TYPE_MONTH.equals(reqJson.getString("leaseType"))) {
//            reqJson.put("startTime", DateUtil.getFormatTimeString(new Date(), DateUtil.DATE_FORMATE_STRING_B));
service-user/src/main/java/com/java110/user/cmd/owner/SaveOwnerCarCmd.java
@@ -62,12 +62,12 @@
        Assert.hasKeyAndValue(reqJson, "carType", "请求报文中未包含carType");
//        Assert.hasKeyAndValue(reqJson, "psId", "未包含psId");
        if (OwnerCarDto.LEASE_TYPE_MONTH.equals(reqJson.getString("leaseType"))) {
            Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含开始时间");
            Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含结束时间");
            Assert.isDate(reqJson.getString("startTime"),DateUtil.DATE_FORMATE_STRING_B,"开始时间格式错误");
            Assert.isDate(reqJson.getString("endTime"),DateUtil.DATE_FORMATE_STRING_B,"结束时间格式错误");
        }
//        if (OwnerCarDto.LEASE_TYPE_MONTH.equals(reqJson.getString("leaseType"))) {
//            Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含开始时间");
//            Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含结束时间");
//            Assert.isDate(reqJson.getString("startTime"),DateUtil.DATE_FORMATE_STRING_B,"开始时间格式错误");
//            Assert.isDate(reqJson.getString("endTime"),DateUtil.DATE_FORMATE_STRING_B,"结束时间格式错误");
//        }
        String startTime = reqJson.getString("startTime");
        String endTime = reqJson.getString("endTime");
@@ -131,9 +131,9 @@
    @Override
    @Java110Transactional
    public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
        if (!reqJson.containsKey("leaseType")) {
            reqJson.put("leaseType", OwnerCarDto.LEASE_TYPE_MONTH);
        }
//        if (!reqJson.containsKey("leaseType")) {
//            reqJson.put("leaseType", OwnerCarDto.LEASE_TYPE_MONTH);
//        }
        JSONObject businessOwnerCar = new JSONObject();
        businessOwnerCar.putAll(reqJson);
springboot/src/main/resources/application.yml
@@ -1,7 +1,6 @@
spring:
  profiles:
    active:  debug
    active:  dev
#  docker build -t lx .
#