abb51ab390fa6cf9bf3747f57576c1507f89ae00..212f81d79dc966cdf5f73a658a070ca79d69e822
2025-09-09 wujianwei
新增接口
212f81 对比 | 目录
2025-09-09 wujianwei
新增接口
775568 对比 | 目录
2025-09-09 wujianwei
新增前后端
deb890 对比 | 目录
3个文件已修改
8个文件已添加
1143 ■■■■■ 已修改文件
api/src/main/java/com/ruoyi/api/third/controller/LockerApiController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/controller/SmartLockerApplicationController.java 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/domain/SmartLockerApplication.java 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/mapper/SmartLockerApplicationMapper.java 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/IKeyCollectionInfoService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/java/com/ruoyi/cwgl/service/ISmartLockerApplicationService.java 111 ●●●●● 补丁 | 查看 | 原始文档 | 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 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/src/main/resources/mapper/cwgl/SmartLockerApplicationMapper.xml 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/api/cwgl/smartLockerApplication.ts 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ui/admin-ui3/src/views/cwgl/smartLockerApplication/index.vue 184 ●●●●● 补丁 | 查看 | 原始文档 | 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
New file
@@ -0,0 +1,125 @@
package com.ruoyi.cwgl.controller;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.utils.file.DownloadExportUtil;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.cwgl.domain.SmartLockerApplication;
import com.ruoyi.cwgl.service.ISmartLockerApplicationService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
 * 智能柜物品申领管理Controller
 *
 * @author ruoyi
 * @date 2025-09-09
 */
@RestController
@RequestMapping("/cwgl/smartLockerApplication")
public class SmartLockerApplicationController extends BaseController
{
    @Autowired
    private ISmartLockerApplicationService smartLockerApplicationService;
    /**
     * 查询智能柜物品申领管理列表
     */
    @PreAuthorize("@ss.hasPermi('cwgl:smartLockerApplication:list')")
    @GetMapping("/list")
    public TableDataInfo list(SmartLockerApplication smartLockerApplication)
    {
        startPage();
        List<SmartLockerApplication> list = smartLockerApplicationService.selectSmartLockerApplicationList(smartLockerApplication);
        return getDataTable(list);
    }
    /**
     * 导出智能柜物品申领管理列表
     * @param smartLockerApplication 查询条件对象
     */
    @PreAuthorize("@ss.hasPermi('cwgl:smartLockerApplication:export')")
    @Log(title = "智能柜物品申领管理", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(SmartLockerApplication smartLockerApplication,String exportKey)
    {
        smartLockerApplicationService.export(smartLockerApplication,exportKey);
        return AjaxResult.success("导出请求成功,请稍后点击下载...!");
    }
    /**
     * 获取智能柜物品申领管理详细信息
     */
    @PreAuthorize("@ss.hasPermi('cwgl:smartLockerApplication:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id)
    {
        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));
    }
    /**
     * 新增智能柜物品申领管理
     */
    @PreAuthorize("@ss.hasPermi('cwgl:smartLockerApplication:add')")
    @Log(title = "智能柜物品申领管理", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SmartLockerApplication smartLockerApplication)
    {
        return toAjax(smartLockerApplicationService.insertSmartLockerApplication(smartLockerApplication));
    }
    @GetMapping("licensePlate/query")
    public AjaxResult query(String licensePlateNumber )
    {
        return AjaxResult.success(smartLockerApplicationService.selectCwByLicensePlateNumber(licensePlateNumber));
    }
    /**
     * 修改智能柜物品申领管理
     */
    @PreAuthorize("@ss.hasPermi('cwgl:smartLockerApplication:edit')")
    @Log(title = "智能柜物品申领管理", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SmartLockerApplication smartLockerApplication)
    {
        return toAjax(smartLockerApplicationService.updateSmartLockerApplication(smartLockerApplication));
    }
    /**
     * 删除智能柜物品申领管理
     */
    @PreAuthorize("@ss.hasPermi('cwgl:smartLockerApplication:remove')")
    @Log(title = "智能柜物品申领管理", businessType = BusinessType.DELETE)
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Integer[] ids)
    {
        return toAjax(smartLockerApplicationService.deleteSmartLockerApplicationByIds(ids));
    }
}
service/src/main/java/com/ruoyi/cwgl/domain/SmartLockerApplication.java
New file
@@ -0,0 +1,131 @@
package com.ruoyi.cwgl.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.Date;
import lombok.Data;
/**
 * 智能柜物品申领管理对象 smart_locker_application
 *
 * @author ruoyi
 * @date 2025-09-09
 */
@Data
public class SmartLockerApplication{
    /** ID */
        @TableField("id")
    private Integer id;
    /** 指令类型(0:开门指令;1:流转指令) */
    @Excel(name = "指令类型(0:开门指令;1:流转指令)")
        @TableField("command_type")
    private Integer commandType;
    /** 申领人编码 */
    @Excel(name = "申领人编码")
        @TableField("applicant_code")
    private String applicantCode;
    /** 申领人姓名 */
    @Excel(name = "申领人姓名")
        @TableField("applicant_name")
    private String applicantName;
    /** 领取物品类型(0:车钥匙;1:文件;2:印章;3:其他) */
    @Excel(name = "领取物品类型(0:车钥匙;1:文件;2:印章;3:其他)")
        @TableField("item_type")
    private Integer itemType;
    /** 物品名称(当领取物品类型是车钥匙的时候,填写车牌) */
    @Excel(name = "物品名称", readConverterExp = "当=领取物品类型是车钥匙的时候,填写车牌")
        @TableField("item_name")
    private String itemName;
    /** 智能柜编号默认接驳站智能钥匙柜 */
    @Excel(name = "智能柜编号默认接驳站智能钥匙柜")
        @TableField("locker_no")
    private String lockerNo;
    /** 智能柜格口号 */
    @Excel(name = "智能柜格口号")
        @TableField("locker_port")
    private Integer lockerPort;
    /** 状态(0:正常;1:作废;2:领取) */
    @Excel(name = "状态(0:正常;1:作废;2:领取)")
        @TableField("status")
    private Integer status;
    /** 作废时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "作废时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     @TableField("cancel_time")
    private Date cancelTime;
    /** 领取时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "领取时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField("receive_time")
    private Date receiveTime;
    /** 创建时间 */
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @TableField("create_time")
    private Date createTime;
    /** 更新时间 */
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @TableField("update_time")
    private Date updateTime;
    /** 备注 */
    @Excel(name = "备注")
        @TableField("remark")
    private String remark;
    /** 创建人 */
        @TableField("create_by")
    private String createBy;
    /** 更新人 */
        @TableField("update_by")
    private String updateBy;
    /** 删除标记(0:正常;1:删除) */
    @Excel(name = "删除标记(0:正常;1:删除)")
        @TableField("deleted")
    private Integer deleted;
}
service/src/main/java/com/ruoyi/cwgl/mapper/SmartLockerApplicationMapper.java
New file
@@ -0,0 +1,93 @@
package com.ruoyi.cwgl.mapper;
import java.util.List;
import com.ruoyi.cwgl.domain.SmartLockerApplication;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.cwgl.domain.dto.TakeReviewDto;
/**
 * 智能柜物品申领管理Mapper接口
 *
 * @author ruoyi
 * @date 2025-09-09
 */
public interface SmartLockerApplicationMapper  extends BaseMapper<SmartLockerApplication>
{
    /**
     * 查询智能柜物品申领管理
     *
     * @param id 智能柜物品申领管理ID
     * @return 智能柜物品申领管理
     */
    public SmartLockerApplication selectSmartLockerApplicationById(Integer id);
    /**
     * 查询智能柜物品申领管理 记录数
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @return 智能柜物品申领管理集合
     */
    public int selectSmartLockerApplicationCount(SmartLockerApplication smartLockerApplication);
    /**
     * 查询智能柜物品申领管理列表
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @return 智能柜物品申领管理集合
     */
    public List<SmartLockerApplication> selectSmartLockerApplicationList(SmartLockerApplication smartLockerApplication);
    /**
     * 新增智能柜物品申领管理
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @return 结果
     */
    public int insertSmartLockerApplication(SmartLockerApplication smartLockerApplication);
    /**
     * 新增智能柜物品申领管理[批量]
     *
     * @param smartLockerApplications 智能柜物品申领管理
     * @return 结果
     */
    public int insertSmartLockerApplicationBatch(List<SmartLockerApplication> smartLockerApplications);
    /**
     * 修改智能柜物品申领管理
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @return 结果
     */
    public int updateSmartLockerApplication(SmartLockerApplication smartLockerApplication);
    /**
     * 修改智能柜物品申领管理[批量]
     *
     * @param smartLockerApplications 智能柜物品申领管理
     * @return 结果
     */
    public int updateSmartLockerApplicationBatch(List<SmartLockerApplication> smartLockerApplications);
    /**
     * 删除智能柜物品申领管理
     *
     * @param id 智能柜物品申领管理ID
     * @return 结果
     */
    public int deleteSmartLockerApplicationById(Integer id);
    /**
     * 批量删除智能柜物品申领管理
     *
     * @param ids 需要删除的数据ID
     * @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
New file
@@ -0,0 +1,111 @@
package com.ruoyi.cwgl.service;
import java.util.List;
import com.ruoyi.cwgl.domain.SmartLockerApplication;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * 智能柜物品申领管理Service接口
 *
 * @author ruoyi
 * @date 2025-09-09
 */
public interface ISmartLockerApplicationService extends IService<SmartLockerApplication>
{
    /**
     * 查询智能柜物品申领管理
     *
     * @param id 智能柜物品申领管理ID
     * @return 智能柜物品申领管理
     */
    public SmartLockerApplication selectSmartLockerApplicationById(Integer id);
    /**
     * 查询智能柜物品申领管理 记录数
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @return 智能柜物品申领管理集合
     */
    public int selectSmartLockerApplicationCount(SmartLockerApplication smartLockerApplication);
    /**
     * 查询智能柜物品申领管理列表
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @return 智能柜物品申领管理集合
     */
    public List<SmartLockerApplication> selectSmartLockerApplicationList(SmartLockerApplication smartLockerApplication);
    /**
     * 查询智能柜物品申领管理列表 异步 导出
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @param exportKey 导出功能的唯一标识
     * @return 智能柜物品申领管理集合
     */
    public void export(SmartLockerApplication smartLockerApplication, String exportKey) ;
    /**
     * 新增智能柜物品申领管理
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @return 结果
     */
    public int insertSmartLockerApplication(SmartLockerApplication smartLockerApplication);
    /**
     * 新增智能柜物品申领管理[批量]
     *
     * @param smartLockerApplications 智能柜物品申领管理
     * @return 结果
     */
    public int insertSmartLockerApplicationBatch(List<SmartLockerApplication> smartLockerApplications);
    /**
     * 修改智能柜物品申领管理
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @return 结果
     */
    public int updateSmartLockerApplication(SmartLockerApplication smartLockerApplication);
    /**
     * 修改智能柜物品申领管理[批量]
     *
     * @param smartLockerApplications 智能柜物品申领管理
     * @return 结果
     */
    public int updateSmartLockerApplicationBatch(List<SmartLockerApplication> smartLockerApplications);
    /**
     * 批量删除智能柜物品申领管理
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteSmartLockerApplicationByIds(String ids);
    /**
     * 批量删除智能柜物品申领管理
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteSmartLockerApplicationByIds(Integer[] ids);
    /**
     * 删除智能柜物品申领管理信息
     *
     * @param id 智能柜物品申领管理ID
     * @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
New file
@@ -0,0 +1,205 @@
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;
import org.springframework.stereotype.Service;
import org.springframework.scheduling.annotation.Async;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.ruoyi.common.utils.PageUtils;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.core.service.BaseService;
import com.ruoyi.cwgl.mapper.SmartLockerApplicationMapper;
import com.ruoyi.cwgl.domain.SmartLockerApplication;
import com.ruoyi.cwgl.service.ISmartLockerApplicationService;
import com.ruoyi.common.core.text.Convert;
/**
 * 智能柜物品申领管理Service业务层处理
 *
 * @author ruoyi
 * @date 2025-09-09
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class SmartLockerApplicationServiceImpl  extends BaseService<SmartLockerApplicationMapper, SmartLockerApplication> implements ISmartLockerApplicationService
{
    protected final Logger logger = LoggerFactory.getLogger(getClass());
    @Resource
    private SmartLockerApplicationMapper smartLockerApplicationMapper;
    /**
     * 查询智能柜物品申领管理
     *
     * @param id 智能柜物品申领管理ID
     * @return 智能柜物品申领管理
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public SmartLockerApplication selectSmartLockerApplicationById(Integer id)
    {
        return smartLockerApplicationMapper.selectSmartLockerApplicationById(id);
    }
    /**
     * 查询智能柜物品申领管理 记录数
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @return 智能柜物品申领管理集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public int selectSmartLockerApplicationCount(SmartLockerApplication smartLockerApplication)
    {
        return smartLockerApplicationMapper.selectSmartLockerApplicationCount(smartLockerApplication);
    }
    /**
     * 查询智能柜物品申领管理列表
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @return 智能柜物品申领管理
     */
    @DataSource(DataSourceType.SLAVE)
    @Override
    public List<SmartLockerApplication> selectSmartLockerApplicationList(SmartLockerApplication smartLockerApplication)
    {
        return smartLockerApplicationMapper.selectSmartLockerApplicationList(smartLockerApplication);
    }
    /**
     * 查询智能柜物品申领管理列表 异步 导出
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @param exportKey 导出功能的唯一标识
     * @return 智能柜物品申领管理集合
     */
    @DataSource(DataSourceType.SLAVE)
    @Async
    @Override
    public void export(SmartLockerApplication smartLockerApplication,String exportKey) {
        super.export(SmartLockerApplication.class,exportKey,"smartLockerApplicationData",(pageNum)->{
            PageUtils.startPage(pageNum, Constants.EXPORT_PATE_SIZE);
            return selectSmartLockerApplicationList(smartLockerApplication);
        });
    }
    /**
     * 新增智能柜物品申领管理
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @return 结果
     */
    @Override
    public int insertSmartLockerApplication(SmartLockerApplication smartLockerApplication)
    {
        smartLockerApplication.setCreateTime(DateUtils.getNowDate());
        return smartLockerApplicationMapper.insertSmartLockerApplication(smartLockerApplication);
    }
    /**
     * 新增智能柜物品申领管理[批量]
     *
     * @param smartLockerApplications 智能柜物品申领管理
     * @return 结果
     */
    @Override
    public int insertSmartLockerApplicationBatch(List<SmartLockerApplication> smartLockerApplications)
    {
        int rows = smartLockerApplicationMapper.insertSmartLockerApplicationBatch(smartLockerApplications);
        return rows;
    }
    /**
     * 修改智能柜物品申领管理
     *
     * @param smartLockerApplication 智能柜物品申领管理
     * @return 结果
     */
    @Override
    public int updateSmartLockerApplication(SmartLockerApplication smartLockerApplication)
    {
        smartLockerApplication.setUpdateTime(DateUtils.getNowDate());
        return smartLockerApplicationMapper.updateSmartLockerApplication(smartLockerApplication);
    }
    /**
     * 修改智能柜物品申领管理[批量]
     *
     * @param smartLockerApplications 智能柜物品申领管理
     * @return 结果
     */
    @Override
    public int updateSmartLockerApplicationBatch(List<SmartLockerApplication> smartLockerApplications){
        return smartLockerApplicationMapper.updateSmartLockerApplicationBatch(smartLockerApplications);
    }
    /**
     * 删除智能柜物品申领管理对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSmartLockerApplicationByIds(String ids)
    {
        return deleteSmartLockerApplicationByIds(Convert.toIntArray(ids));
    }
    /**
     * 删除智能柜物品申领管理对象
     *
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSmartLockerApplicationByIds(Integer[] ids)
    {
        return smartLockerApplicationMapper.deleteSmartLockerApplicationByIds(ids);
    }
    /**
     * 删除智能柜物品申领管理信息
     *
     * @param id 智能柜物品申领管理ID
     * @return 结果
     */
    @Override
    public int deleteSmartLockerApplicationById(Integer id)
    {
        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
New file
@@ -0,0 +1,194 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.cwgl.mapper.SmartLockerApplicationMapper">
    <resultMap type="com.ruoyi.cwgl.domain.SmartLockerApplication" id="SmartLockerApplicationResult">
        <result property="id"    column="id"    />
        <result property="commandType"    column="command_type"    />
        <result property="applicantCode"    column="applicant_code"    />
        <result property="applicantName"    column="applicant_name"    />
        <result property="itemType"    column="item_type"    />
        <result property="itemName"    column="item_name"    />
        <result property="lockerNo"    column="locker_no"    />
        <result property="lockerPort"    column="locker_port"    />
        <result property="status"    column="status"    />
        <result property="cancelTime"    column="cancel_time"    />
        <result property="receiveTime"    column="receive_time"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
        <result property="createBy"    column="create_by"    />
        <result property="updateBy"    column="update_by"    />
        <result property="deleted"    column="deleted"    />
    </resultMap>
    <sql id="selectSmartLockerApplicationVo">
        select thisTab.id, thisTab.command_type, thisTab.applicant_code, thisTab.applicant_name, thisTab.item_type, thisTab.item_name, thisTab.locker_no, thisTab.locker_port, thisTab.status, thisTab.cancel_time, thisTab.receive_time, thisTab.create_time, thisTab.update_time, thisTab.remark, thisTab.create_by, thisTab.update_by, thisTab.deleted from smart_locker_application AS thisTab
    </sql>
    <sql id="selectSmartLockerApplicationVoCount">
        select count(0) from smart_locker_application as thisTab
    </sql>
    <sql id="whereCondition">
        <if test="commandType != null "> and thisTab.command_type = #{commandType}</if>
        <if test="applicantCode != null  and applicantCode != ''"> and thisTab.applicant_code = #{applicantCode}</if>
        <if test="applicantName != null  and applicantName != ''"> and  thisTab.applicant_name like concat('%', #{applicantName}, '%')</if>
        <if test="itemType != null "> and thisTab.item_type = #{itemType}</if>
        <if test="itemName != null  and itemName != ''"> and  thisTab.item_name like concat('%', #{itemName}, '%')</if>
        <if test="lockerNo != null  and lockerNo != ''"> and thisTab.locker_no = #{lockerNo}</if>
        <if test="lockerPort != null "> and thisTab.locker_port = #{lockerPort}</if>
        <if test="status != null "> and thisTab.status = #{status}</if>
        <if test="cancelTime != null "> and thisTab.cancel_time = #{cancelTime}</if>
        <if test="receiveTime != null "> and thisTab.receive_time = #{receiveTime}</if>
        <if test="deleted != null "> and thisTab.deleted = #{deleted}</if>
    </sql>
    <!--查询-->
    <select id="selectSmartLockerApplicationById" parameterType="Integer" resultMap="SmartLockerApplicationResult">
        <include refid="selectSmartLockerApplicationVo"/>
        where id = #{id}
    </select>
    <select id="selectSmartLockerApplicationCount" parameterType="com.ruoyi.cwgl.domain.SmartLockerApplication" resultType="int">
        <include refid="selectSmartLockerApplicationVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
    <select id="selectSmartLockerApplicationList" parameterType="com.ruoyi.cwgl.domain.SmartLockerApplication" resultMap="SmartLockerApplicationResult">
        <include refid="selectSmartLockerApplicationVo"/>
        <where>
            <include refid="whereCondition"/>
        </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">
        insert into smart_locker_application
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="commandType != null">command_type,</if>
            <if test="applicantCode != null and applicantCode != ''">applicant_code,</if>
            <if test="applicantName != null and applicantName != ''">applicant_name,</if>
            <if test="itemType != null">item_type,</if>
            <if test="itemName != null and itemName != ''">item_name,</if>
            <if test="lockerNo != null">locker_no,</if>
            <if test="lockerPort != null">locker_port,</if>
            <if test="status != null">status,</if>
            <if test="cancelTime != null">cancel_time,</if>
            <if test="receiveTime != null">receive_time,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="remark != null">remark,</if>
            <if test="createBy != null">create_by,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="deleted != null">deleted,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="commandType != null">#{commandType},</if>
            <if test="applicantCode != null and applicantCode != ''">#{applicantCode},</if>
            <if test="applicantName != null and applicantName != ''">#{applicantName},</if>
            <if test="itemType != null">#{itemType},</if>
            <if test="itemName != null and itemName != ''">#{itemName},</if>
            <if test="lockerNo != null">#{lockerNo},</if>
            <if test="lockerPort != null">#{lockerPort},</if>
            <if test="status != null">#{status},</if>
            <if test="cancelTime != null">#{cancelTime},</if>
            <if test="receiveTime != null">#{receiveTime},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="remark != null">#{remark},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="deleted != null">#{deleted},</if>
         </trim>
    </insert>
    <insert id="insertSmartLockerApplicationBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into smart_locker_application
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,command_type,applicant_code,applicant_name,item_type,item_name,locker_no,locker_port,status,cancel_time,receive_time,create_time,update_time,remark,create_by,update_by,deleted,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.commandType},#{item.applicantCode},#{item.applicantName},#{item.itemType},#{item.itemName},#{item.lockerNo},#{item.lockerPort},#{item.status},#{item.cancelTime},#{item.receiveTime},#{item.createTime},#{item.updateTime},#{item.remark},#{item.createBy},#{item.updateBy},#{item.deleted},
            </trim>
        </foreach>
    </insert>
    <!-- 修改 -->
    <update id="updateSmartLockerApplication" parameterType="com.ruoyi.cwgl.domain.SmartLockerApplication">
        update smart_locker_application
        <trim prefix="SET" suffixOverrides=",">
            <if test="commandType != null">command_type = #{commandType},</if>
            <if test="applicantCode != null and applicantCode != ''">applicant_code = #{applicantCode},</if>
            <if test="applicantName != null and applicantName != ''">applicant_name = #{applicantName},</if>
            <if test="itemType != null">item_type = #{itemType},</if>
            <if test="itemName != null and itemName != ''">item_name = #{itemName},</if>
            <if test="lockerNo != null">locker_no = #{lockerNo},</if>
            <if test="lockerPort != null">locker_port = #{lockerPort},</if>
            <if test="status != null">status = #{status},</if>
            <if test="cancelTime != null">cancel_time = #{cancelTime},</if>
            <if test="receiveTime != null">receive_time = #{receiveTime},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="deleted != null">deleted = #{deleted},</if>
        </trim>
        where id = #{id}
    </update>
    <!-- 修改 -->
    <update id="updateSmartLockerApplicationBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update smart_locker_application
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.commandType != null">command_type = #{item.commandType},</if>
                <if test="item.applicantCode != null and item.applicantCode != ''">applicant_code = #{item.applicantCode},</if>
                <if test="item.applicantName != null and item.applicantName != ''">applicant_name = #{item.applicantName},</if>
                <if test="item.itemType != null">item_type = #{item.itemType},</if>
                <if test="item.itemName != null and item.itemName != ''">item_name = #{item.itemName},</if>
                <if test="item.lockerNo != null">locker_no = #{item.lockerNo},</if>
                <if test="item.lockerPort != null">locker_port = #{item.lockerPort},</if>
                <if test="item.status != null">status = #{item.status},</if>
                <if test="item.cancelTime != null">cancel_time = #{item.cancelTime},</if>
                <if test="item.receiveTime != null">receive_time = #{item.receiveTime},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
                <if test="item.remark != null">remark = #{item.remark},</if>
                <if test="item.createBy != null">create_by = #{item.createBy},</if>
                <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
                <if test="item.deleted != null">deleted = #{item.deleted},</if>
            </trim>
        where id = #{item.id}
        </foreach>
    </update>
    <!--删除-->
    <delete id="deleteSmartLockerApplicationById" parameterType="Integer">
        delete from smart_locker_application where id = #{id}
    </delete>
    <delete id="deleteSmartLockerApplicationByIds" parameterType="Integer">
        delete from smart_locker_application where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
ui/admin-ui3/src/api/cwgl/smartLockerApplication.ts
New file
@@ -0,0 +1,67 @@
import request,{download,requestType} from "@/utils/request";
import {BaseEntityInterface} from "@/utils/globalInterface";
export interface SmartLockerApplicationI extends BaseEntityInterface{
            id ?:  number   ,            commandType ?:  number   ,            applicantCode ?:  string   ,            applicantName ?:  string   ,            itemType ?:  number   ,            itemName ?:  string   ,            lockerNo ?:  string   ,            lockerPort ?:  number   ,            status ?:  number   ,            cancelTime ?:  string   ,            receiveTime ?:  string   ,            createTime ?:  string   ,            updateTime ?:  string   ,            remark ?:  string   ,            createBy ?:  string   ,            updateBy ?:  string   ,            deleted ?:  number       }
/**
 * 查询智能柜物品申领管理列表
 */
export const listSmartLockerApplication:requestType = (query) => {
    return request({
        url: '/cwgl/smartLockerApplication/list',
        method:'get',
        params:query
    })
}
/**
 * 查询智能柜物品申领管理详细
 */
export const getSmartLockerApplication:requestType = (id) => {
    return request({
        url: '/cwgl/smartLockerApplication/' + id,
        method:'get'
    })
}
/**
 * 新增智能柜物品申领管理
 */
export const addSmartLockerApplication:requestType = (data) => {
    return request({
        url: '/cwgl/smartLockerApplication',
        method: 'post',
        data
    })
}
/**
 * 修改智能柜物品申领管理
 */
export const updateSmartLockerApplication:requestType = (data) => {
    return request({
        url: '/cwgl/smartLockerApplication',
        method: 'put',
        data
    })
}
/**
 * 删除智能柜物品申领管理
 */
export const delSmartLockerApplication:requestType = (id) => {
    return request({
        url: '/cwgl/smartLockerApplication/' + id,
        method: 'delete'
    })
}
/**
 * 导出智能柜物品申领管理
 */
export const exportSmartLockerApplication:requestType = (query) => {
    return new Promise<any>(()=>{
        download('/cwgl/smartLockerApplication/export',query);
    })
}
ui/admin-ui3/src/views/cwgl/smartLockerApplication/index.vue
New file
@@ -0,0 +1,184 @@
<template>
  <basicContainer >
    <avue-crud
        :option="option"
        :table-loading="pageF.loading"
        :data="tableData"
        :page="page"
        :permission="permissionList"
        :before-open="beforeOpen"
        v-model="form"
        ref="crudRef"
        @row-update="rowUpdate"
        @row-save="rowSave"
        @refresh-change="refreshChange"
        @row-del="rowDel"
        @search-change="searchChange"
        @search-reset="searchReset"
        @selection-change="selectionChange"
        @current-change="currentChange"
        @size-change="sizeChange"
        @on-load="onLoad"
    >
      <template #menu-left>
        <el-button
            type="success"
            icon="Edit"
            :disabled="pageF.single"
            v-hasPermi="['cwgl:smartLockerApplication:edit']"
            @click="handleUpdate">修改
        </el-button>
        <el-button
            type="danger"
            icon="Delete"
            :disabled="pageF.multiple"
            @click="handleDelete"
            v-hasPermi="['cwgl:smartLockerApplication:remove']"
        >删除
        </el-button>
        <el-button
            type="warning"
            plain
            icon="Download"
            @click="handleExport"
            v-hasPermi="['cwgl:smartLockerApplication:export']"
        >导出
        </el-button>
      </template>
    </avue-crud>
  </basicContainer>
</template>
<script setup name="smartLockerApplication" lang="ts">
  import {SmartLockerApplicationI,addSmartLockerApplication, delSmartLockerApplication, exportSmartLockerApplication, getSmartLockerApplication, listSmartLockerApplication, updateSmartLockerApplication} from "@/api/cwgl/smartLockerApplication";
  import useCurrentInstance from "@/utils/useCurrentInstance";
  import {computed,reactive, ref, toRefs} from "vue";
  import {PagesInterface, PageQueryInterface} from "@/utils/globalInterface";
  import {usePagePlus} from "@/hooks/usePagePlus";
  import {hasPermission} from "@/utils/permissionUtils";
  const { proxy } = useCurrentInstance();
  const crudRef = ref();
  const permissionList = computed(()=>{
    return {
      addBtn: hasPermission(["cwgl:smartLockerApplication:add"]),
      delBtn: hasPermission(["cwgl:smartLockerApplication:remove"]),
      editBtn: hasPermission(["cwgl:smartLockerApplication:edit"]),
      viewBtn: hasPermission(["cwgl:smartLockerApplication:query"]),
    }
  })
  const data = reactive({
    form:<SmartLockerApplicationI>{},
    queryParams:<SmartLockerApplicationI&PageQueryInterface>{},
    page: <PagesInterface>{
      pageSize: 10,
      total: 0,
      currentPage: 1,
    },
    selectionList:[],
  })
  const {queryParams,form,page,selectionList} = toRefs(data);
  const option = ref({
    pageKey: 'SmartLockerApplication',
    rowKey: 'id',
    column: {
                                id: {
          label: 'ID',
                            },
                                commandType: {
          label: '指令类型(0:开门指令;1:流转指令)',
                            },
                                applicantCode: {
          label: '申领人编码',
                                rules: [
              {
                required: true,
                message: "申领人编码不能为空", trigger: "blur" }
            ],                  },
                                applicantName: {
          label: '申领人姓名',
                                rules: [
              {
                required: true,
                message: "申领人姓名不能为空", trigger: "blur" }
            ],                  },
                                itemType: {
          label: '领取物品类型(0:车钥匙;1:文件;2:印章;3:其他)',
                            },
                                itemName: {
          label: '物品名称',
                                rules: [
              {
                required: true,
                message: "物品名称不能为空", trigger: "blur" }
            ],                  },
                                lockerNo: {
          label: '智能柜编号默认接驳站智能钥匙柜',
                            },
                                lockerPort: {
          label: '智能柜格口号',
                                rules: [
              {
                required: true,
                message: "智能柜格口号不能为空", trigger: "blur" }
            ],                  },
                                status: {
          label: '状态(0:正常;1:作废;2:领取)',
                            },
                                cancelTime: {
          label: '作废时间',
                            },
                                receiveTime: {
          label: '领取时间',
                            },
                                createTime: {
          label: '创建时间',
                                rules: [
              {
                required: true,
                message: "创建时间不能为空", trigger: "blur" }
            ],                  },
                                updateTime: {
          label: '更新时间',
                            },
                                remark: {
          label: '备注',
                      type: 'textarea', minRows: 3, maxRows: 5,
                            },
                                createBy: {
          label: '创建人',
                            },
                                updateBy: {
          label: '更新人',
                            },
                                deleted: {
          label: '删除标记(0:正常;1:删除)',
                            },
          }
  })
  const { tableData,pageF,rowSave,rowUpdate,rowDel,beforeOpen,searchChange,
    searchReset,selectionChange,onLoad,currentChange,sizeChange,handleDelete,handleExport,handleUpdate,refreshChange} = usePagePlus({
    form:form,
    option:option,
    queryParams:queryParams,
    idKey:'id',
    page:page.value,
    getListApi:listSmartLockerApplication,
    getDetailApi:getSmartLockerApplication,
    exportApi:exportSmartLockerApplication,
    deleteApi:delSmartLockerApplication,
    addApi:addSmartLockerApplication,
    updateApi:updateSmartLockerApplication,
    handleUpdateFunc:()=>{
      crudRef.value.rowEdit(selectionList.value[0]);
    },
    handleSelectionChangeFunc:(selection:any)=>{
      selectionList.value = selection;
    }
  })
</script>