dda4c08d41693d2495a13e7db230c3e9747540de..a6c2271fc67508c41f680856e24744e4eebb78c0
2025-09-04 wujianwei
修改接口
a6c227 对比 | 目录
2025-09-04 wujianwei
修改接口
80821b 对比 | 目录
2025-09-04 wujianwei
修改接口
d87721 对比 | 目录
4个文件已修改
27 ■■■■ 已修改文件
api/src/main/java/com/ruoyi/api/third/controller/LockerApiController.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/KeyCollectionInfo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/KeyCollectionInfoServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/KeyCollectionInfoMapper.xml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/src/main/java/com/ruoyi/api/third/controller/LockerApiController.java
@@ -2,6 +2,7 @@
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.cwgl.domain.KeyCollectionInfo;
import com.ruoyi.cwgl.domain.RequestLog;
import com.ruoyi.cwgl.domain.dto.ReturnReportDto;
@@ -42,12 +43,18 @@
    @PostMapping("/takeReview")
    public AjaxResult takeReview(@Valid @RequestBody TakeReviewDto takeReviewDto){
        logger.info("请求上报参数{}",takeReviewDto);
        KeyCollectionInfo keyCollectionInfo = keyCollectionInfoService.selectCwData(takeReviewDto);
        //添加请求日志
        RequestLog requestLog = new RequestLog();
        requestLog.setDriverCode(takeReviewDto.getDriverCode());
        requestLog.setDriverName(takeReviewDto.getDriverName());
        requestLog.setReqTime(takeReviewDto.getHandleTime());
        if (keyCollectionInfo!=null){
        String boxNum = keyCollectionInfo.getBoxNum();
            requestLog.setBoxNum(boxNum);
        }
        requestLog.setType(0);
        logService.insertRequestLog(requestLog);
@@ -71,7 +78,7 @@
        requestLog.setType(1);
        logService.insertRequestLog(requestLog);
        return AjaxResult.success();
        return new AjaxResult(0, "",0);
    }
service/src/main/java/com/ruoyi/cwgl/domain/KeyCollectionInfo.java
@@ -173,4 +173,7 @@
    @TableField(exist = false)
    private Integer keyTimeout;
    @Excel(name = "钥匙柜编号")
    @TableField("box_num")
    private String boxNum;
}
service/src/main/java/com/ruoyi/cwgl/service/impl/KeyCollectionInfoServiceImpl.java
@@ -5,6 +5,7 @@
import javax.annotation.Resource;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.cwgl.domain.RequestLog;
@@ -203,6 +204,7 @@
        //调度超时
        Integer schedulingTimeout = keyCollectionInfo.getSchedulingTimeout();
        if(schedulingTimeout>5){
            logger.info("调度超时下单,超时"+schedulingTimeout+"个小时");
            return AjaxResult.error("调度超时下单,超时"+schedulingTimeout+"个小时",3);
        }
@@ -210,8 +212,12 @@
        if (keyTimeout!=null && keyTimeout>24){
            Date estimatedDepartureTime = keyCollectionInfo.getEstimatedDepartureTime();
            String dateToStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, estimatedDepartureTime);
            logger.info("要求出发时间"+ dateToStr+",领取钥匙超时"+keyTimeout+"个小时");
            return AjaxResult.error("要求出发时间"+ dateToStr+",领取钥匙超时"+keyTimeout+"个小时");
        }
        return AjaxResult.success("成功",2);
        AjaxResult success = new AjaxResult(0, "成功",2);
        success.put("boxNum",keyCollectionInfo.getBoxNum());
        logger.info("成功返回{}",success);
        return success;
    }
}
service/src/main/resources/mapper/cwgl/KeyCollectionInfoMapper.xml
@@ -27,10 +27,11 @@
        <result property="quantity"    column="quantity"    />
        <result property="dispatchQuantity"    column="dispatch_quantity"    />
        <result property="remark"    column="remark"    />
        <result property="boxNum"    column="box_num"    />
    </resultMap>
    <sql id="selectKeyCollectionInfoVo">
        select thisTab.id, thisTab.customer_name, thisTab.carrier, thisTab.dispatch_no, thisTab.driver_name, thisTab.driver_mobile, thisTab.license_plate_number, thisTab.order_time, thisTab.order_created_time, thisTab.dispatch_created_time, thisTab.key_collection_time, thisTab.estimated_departure_time, thisTab.required_arrival_time, thisTab.consignor_address, thisTab.consignee_address, thisTab.main_driver, thisTab.point_num, thisTab.transport_mode, thisTab.assistant_driver, thisTab.quantity, thisTab.dispatch_quantity, thisTab.remark from key_collection_info AS thisTab
        select thisTab.id, thisTab.customer_name, thisTab.carrier, thisTab.dispatch_no, thisTab.driver_name, thisTab.driver_mobile, thisTab.license_plate_number, thisTab.order_time, thisTab.order_created_time, thisTab.dispatch_created_time, thisTab.key_collection_time, thisTab.estimated_departure_time, thisTab.required_arrival_time, thisTab.consignor_address, thisTab.consignee_address, thisTab.main_driver, thisTab.point_num, thisTab.transport_mode, thisTab.assistant_driver, thisTab.quantity, thisTab.dispatch_quantity, thisTab.remark, thisTab.box_num from key_collection_info AS thisTab
    </sql>
    <sql id="selectKeyCollectionInfoVoCount">
        select count(0) from key_collection_info as thisTab
@@ -56,6 +57,7 @@
        <if test="transportMode != null  and transportMode != ''"> and thisTab.transport_mode = #{transportMode}</if>
        <if test="assistantDriver != null  and assistantDriver != ''"> and thisTab.assistant_driver = #{assistantDriver}</if>
        <if test="quantity != null "> and thisTab.quantity = #{quantity}</if>
        <if test="boxNum != null "> and thisTab.box_num = #{boxNum}</if>
        <if test="dispatchQuantity != null "> and thisTab.dispatch_quantity = #{dispatchQuantity}</if>
    </sql>
@@ -87,6 +89,7 @@
        driver_m.`NAME` as driverName,
        driver_m.MOBILE as driverMobile,
        vhc.LICENSE_PLATE_NUMBER as licensePlateNumber,
        vhc.NAME as boxNum,
        ord.ORDER_TIME as orderTime,
        ord.CREATED_TIME as orderCreatedTime,
        ts.CREATED_TIME as dispatchCreatedTime,
@@ -152,6 +155,7 @@
            <if test="quantity != null">quantity,</if>
            <if test="dispatchQuantity != null">dispatch_quantity,</if>
            <if test="remark != null">remark,</if>
            <if test="boxNum != null">box_num,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="customerName != null">#{customerName},</if>
@@ -175,6 +179,7 @@
            <if test="quantity != null">#{quantity},</if>
            <if test="dispatchQuantity != null">#{dispatchQuantity},</if>
            <if test="remark != null">#{remark},</if>
            <if test="boxNum != null">#{boxNum},</if>
         </trim>
    </insert>