wujianwei
2025-09-09 77556842bbe4f4c55513a50fb51f8a5622018f4a
新增接口
8个文件已修改
100 ■■■■■ 已修改文件
api/src/main/java/com/ruoyi/api/third/controller/LockerApiController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/controller/SmartLockerApplicationController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/mapper/SmartLockerApplicationMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/IKeyCollectionInfoService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/ISmartLockerApplicationService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/KeyCollectionInfoServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/impl/SmartLockerApplicationServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/SmartLockerApplicationMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/src/main/java/com/ruoyi/api/third/controller/LockerApiController.java
@@ -72,7 +72,12 @@
        requestLog.setType(0);
        logService.insertRequestLog(requestLog);
        return keyCollectionInfoService.takeReview(keyCollectionInfo);
        AjaxResult ajaxResult = keyCollectionInfoService.takeReview(keyCollectionInfo);
        if (!ajaxResult.get("code").equals(0)){
            ajaxResult =  keyCollectionInfoService.selectSmartLockerApplication(takeReviewDto);
        }
        return ajaxResult;
    }
service/src/main/java/com/ruoyi/cwgl/controller/SmartLockerApplicationController.java
@@ -72,6 +72,17 @@
    {
        return AjaxResult.success(smartLockerApplicationService.selectSmartLockerApplicationById(id));
    }
    /**
     * 作废
     */
    @PreAuthorize("@ss.hasPermi('cwgl:smartLockerApplication:invalid')")
    @GetMapping(value = "invalid/{id}")
    public AjaxResult invalid(@PathVariable("id") Integer id)
    {
        return toAjax(smartLockerApplicationService.invalid(id));
    }
    /**
     * 新增智能柜物品申领管理
@@ -84,6 +95,12 @@
        return toAjax(smartLockerApplicationService.insertSmartLockerApplication(smartLockerApplication));
    }
    @GetMapping("query")
    public AjaxResult query(String licensePlateNumber )
    {
        return AjaxResult.success(smartLockerApplicationService.selectCwByLicensePlateNumber(licensePlateNumber));
    }
    /**
     * 修改智能柜物品申领管理
     */
service/src/main/java/com/ruoyi/cwgl/mapper/SmartLockerApplicationMapper.java
@@ -3,6 +3,7 @@
import java.util.List;
import com.ruoyi.cwgl.domain.SmartLockerApplication;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.cwgl.domain.dto.TakeReviewDto;
/**
@@ -84,4 +85,9 @@
     * @return 结果
     */
    public int deleteSmartLockerApplicationByIds(Integer[] ids);
    SmartLockerApplication selectSmartLockerApplication(TakeReviewDto takeReviewDto);
    Integer selectCwByLicensePlateNumber(String licensePlateNumber);
}
service/src/main/java/com/ruoyi/cwgl/service/IKeyCollectionInfoService.java
@@ -113,4 +113,11 @@
     */
    AjaxResult takeReview(KeyCollectionInfo keyCollectionInfo);
    /**
     * 查询自家库有没有数据
     * @param takeReviewDto
     * @return
     */
    AjaxResult selectSmartLockerApplication(TakeReviewDto takeReviewDto);
}
service/src/main/java/com/ruoyi/cwgl/service/ISmartLockerApplicationService.java
@@ -99,4 +99,13 @@
     * @return 结果
     */
    public int deleteSmartLockerApplicationById(Integer id);
    /**
     * 作废
     * @param id
     * @return
     */
    int invalid(Integer id);
    Integer selectCwByLicensePlateNumber(String licensePlateNumber);
}
service/src/main/java/com/ruoyi/cwgl/service/impl/KeyCollectionInfoServiceImpl.java
@@ -9,7 +9,9 @@
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.cwgl.domain.RequestLog;
import com.ruoyi.cwgl.domain.SmartLockerApplication;
import com.ruoyi.cwgl.domain.dto.TakeReviewDto;
import com.ruoyi.cwgl.mapper.SmartLockerApplicationMapper;
import com.ruoyi.cwgl.service.IRequestLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
@@ -41,6 +43,8 @@
    protected final Logger logger = LoggerFactory.getLogger(getClass());
    @Resource
    private KeyCollectionInfoMapper keyCollectionInfoMapper;
    @Resource
    private SmartLockerApplicationMapper smartLockerApplicationMapper;
@@ -220,4 +224,19 @@
        logger.info("成功返回{}",success);
        return success;
    }
    @Override
    public AjaxResult selectSmartLockerApplication(TakeReviewDto takeReviewDto) {
        SmartLockerApplication smartLockerApplication  =smartLockerApplicationMapper.selectSmartLockerApplication(takeReviewDto);
        if (smartLockerApplication == null){
            return AjaxResult.error("查无符合要求的调度单,请联系调度人员",3);
        }
        smartLockerApplication.setStatus(2);
        smartLockerApplication.setReceiveTime(new Date());
        smartLockerApplicationMapper.updateSmartLockerApplication(smartLockerApplication);
        AjaxResult success = new AjaxResult(0, "成功",1);
        success.put("boxNum",smartLockerApplication.getLockerPort());
        logger.info("成功返回{}",success);
        return success;
    }
}
service/src/main/java/com/ruoyi/cwgl/service/impl/SmartLockerApplicationServiceImpl.java
@@ -1,7 +1,9 @@
package com.ruoyi.cwgl.service.impl;
import java.util.Date;
import java.util.List;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.transaction.annotation.Transactional;
@@ -179,4 +181,25 @@
    {
        return smartLockerApplicationMapper.deleteSmartLockerApplicationById(id);
    }
    @Override
    public int invalid(Integer id) {
        SmartLockerApplication smartLockerApplication = smartLockerApplicationMapper.selectSmartLockerApplicationById(id);
        if (smartLockerApplication==null){
            throw new ServiceException("数据不存在");
        }
        smartLockerApplication.setCancelTime(new Date());
        smartLockerApplication.setStatus(1);
        return smartLockerApplicationMapper.updateSmartLockerApplication(smartLockerApplication);
    }
    @Override
    @DataSource(DataSourceType.CWSJ)
    public Integer selectCwByLicensePlateNumber(String licensePlateNumber) {
        Integer integer = smartLockerApplicationMapper.selectCwByLicensePlateNumber(licensePlateNumber);
        if (integer==null){
            throw new ServiceException("查询不到智能柜格口号");
        }
        return integer;
    }
}
service/src/main/resources/mapper/cwgl/SmartLockerApplicationMapper.xml
@@ -65,6 +65,18 @@
        </where>
        order by thisTab.id desc
    </select>
    <select id="selectSmartLockerApplication" resultMap="SmartLockerApplicationResult">
        <include refid="selectSmartLockerApplicationVo"/>
        where applicant_name = #{driverName}
        and applicant_code = #{driverCode}
        and status = 0
        limit 1
    </select>
    <select id="selectCwByLicensePlateNumber" resultType="java.lang.Integer">
        SELECT `NAME` from tms_vehicle WHERE LICENSE_PLATE_NUMBER = #{licensePlateNumber} and BE_DELETE =0 order by id asc LIMIT 1
    </select>
    <!-- 新增 -->
    <insert id="insertSmartLockerApplication" parameterType="com.ruoyi.cwgl.domain.SmartLockerApplication"  useGeneratedKeys="true" keyProperty="id">