退料问题修复

This commit is contained in:
hongchao 2025-08-13 17:27:50 +08:00
parent 15895c528e
commit 6f7c3c9947
7 changed files with 259 additions and 5 deletions

View File

@ -33,6 +33,9 @@ public class LeaseApplyInfo extends BaseEntity{
@ApiModelProperty(value = "登录用户id")
private Long userId;
@ApiModelProperty(value = "登录用户部门id")
private Long deptId;
@ApiModelProperty(value = "申请时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "申请时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")

View File

@ -247,7 +247,7 @@ public interface BackApplyInfoMapper {
* @return
*/
int deleteDetails(BackApplyInfo backApplyInfo);
/**
* 查询机具
* @param dto
@ -427,4 +427,16 @@ public interface BackApplyInfoMapper {
* @return
*/
List<BackApplyDetails> selectBackApplyDetailsList(BackApplyDetails backApplyDetails);
List<MaCodeVo> getMachineByOne(BackApplyInfo dto);
List<MaCodeVo> getMachineByTwo(BackApplyInfo dto);
List<MaCodeVo> getMachineByThree(BackApplyInfo dto);
List<MaCodeVo> getMachineByOneMaCode(BackApplyInfo dto);
List<MaCodeVo> getMachineByTwoMaCode(BackApplyInfo dto);
List<MaCodeVo> getMachineByThreeMaCode(BackApplyInfo dto);
}

View File

@ -1527,12 +1527,43 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
List<MaCodeVo> list = new ArrayList<>();
dto.setUserId(SecurityUtils.getLoginUser().getUserid());
if (dto.getMaCode() != null) {
// 判断是否有这个设备编码
List<MaCodeVo> listOneMaCode = backApplyInfoMapper.getMachineByOneMaCode(dto);
if(CollectionUtils.isEmpty(listOneMaCode)){
return AjaxResult.error("该设备编码不存在,请重新选择");
}
// 判断是否是在用状态
List<MaCodeVo> listTwoMaCode = backApplyInfoMapper.getMachineByTwoMaCode(dto);
if(CollectionUtils.isEmpty(listTwoMaCode)){
return AjaxResult.error("该设备编码非在用状态,请重新选择");
}
// 判断是否是当前协议下的设备
List<MaCodeVo> listThreeMaCode = backApplyInfoMapper.getMachineByThreeMaCode(dto);
if(CollectionUtils.isEmpty(listThreeMaCode)){
return AjaxResult.error("该设备编码非当前协议下的设备,请重新选择");
}
// 判断是否是当前人负责的设备
list = backApplyInfoMapper.getMachine(dto);
if (CollectionUtils.isEmpty(list)) {
return AjaxResult.error("该编码非您负责的设备,请重新选择");
return AjaxResult.error("设备编码非您负责的设备,请重新选择");
}
} else if (dto.getQrCode() != null) {
// 判断是否有这个二维码
List<MaCodeVo> listOne = backApplyInfoMapper.getMachineByOne(dto);
if(CollectionUtils.isEmpty(listOne)){
return AjaxResult.error("该二维码不存在,请重新选择");
}
// 判断是否是在用状态
List<MaCodeVo> listTwo = backApplyInfoMapper.getMachineByTwo(dto);
if(CollectionUtils.isEmpty(listTwo)){
return AjaxResult.error("该二维码非在用状态,请重新选择");
}
// 判断是否是当前协议下的设备
List<MaCodeVo> listThree = backApplyInfoMapper.getMachineByThree(dto);
if(CollectionUtils.isEmpty(listThree)){
return AjaxResult.error("该二维码非当前协议下的设备,请重新选择");
}
// 判断是否是当前人负责的设备
list = backApplyInfoMapper.getMachineByQrCode(dto);
if (CollectionUtils.isEmpty(list)) {
return AjaxResult.error("该编码非您负责的设备,请重新选择");

View File

@ -553,7 +553,9 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
@Override
public List<LeaseApplyInfo> selectAuditLeaseApplyInfoList(LeaseApplyInfo leaseApplyInfo) {
Long userId = SecurityUtils.getLoginUser().getUserid();
leaseApplyInfo.setUserId(userId == 0 ? null : userId);
Long deptId = SecurityUtils.getLoginUser().getSysUser().getDeptId();
leaseApplyInfo.setUserId(userId == 1 ? null : userId);
leaseApplyInfo.setDeptId(deptId == 1 ? null : deptId);
log.info("用户id为{}",userId);
List<LeaseApplyInfo> list = mapper.selectAuditLeaseApplyInfoList(leaseApplyInfo);
try {

View File

@ -3,6 +3,7 @@ package com.bonus.material.work.controller;
import com.bonus.common.core.web.controller.BaseController;
import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.common.annotation.PreventRepeatSubmit;
import com.bonus.material.work.domain.SysWorkflowNode;
import com.bonus.material.work.domain.SysWorkflowRecordHistory;
import com.bonus.material.work.service.SysWorkflowRecordHistoryService;
@ -27,6 +28,7 @@ public class SysWorkflowRecordHisController extends BaseController {
*/
@ApiOperation(value = "审批")
@PostMapping("/update")
@PreventRepeatSubmit
public AjaxResult update(@RequestBody SysWorkflowRecordHistory sysWorkflowRecordHistory)
{
try {

View File

@ -1146,4 +1146,208 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
back_check_details
where parent_id = #{parentId} and type_id = #{typeId}
</select>
<select id="getMachineByOne" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
SELECT
mm.ma_id AS maId,
mm.ma_code AS maCode,
mm.ma_status AS maStatus,
mt1.type_name AS typeName,
mm.type_id AS typeId,
mt.type_name AS typeModelName,
mt2.type_name AS materialType,
ba.unit_id AS unitId,
bu.unit_name AS unitName,
ba.project_id AS proId,
bp.pro_name AS proName,
ba.agreement_id AS agreementId
FROM
slt_agreement_info sai
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
AND bp.del_flag = '0'
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
AND bu.del_flag = '0'
WHERE
mm.qr_code = #{qrCode}
GROUP BY mm.ma_id
</select>
<select id="getMachineByTwo" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
SELECT
mm.ma_id AS maId,
mm.ma_code AS maCode,
mm.ma_status AS maStatus,
mt1.type_name AS typeName,
mm.type_id AS typeId,
mt.type_name AS typeModelName,
mt2.type_name AS materialType,
ba.unit_id AS unitId,
bu.unit_name AS unitName,
ba.project_id AS proId,
bp.pro_name AS proName,
ba.agreement_id AS agreementId
FROM
slt_agreement_info sai
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
AND bp.del_flag = '0'
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
AND bu.del_flag = '0'
WHERE
sai.`status`= 0 and mm.qr_code = #{qrCode}
GROUP BY mm.ma_id
</select>
<select id="getMachineByThree" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
SELECT
mm.ma_id AS maId,
mm.ma_code AS maCode,
mm.ma_status AS maStatus,
mt1.type_name AS typeName,
mm.type_id AS typeId,
mt.type_name AS typeModelName,
mt2.type_name AS materialType,
ba.unit_id AS unitId,
bu.unit_name AS unitName,
ba.project_id AS proId,
bp.pro_name AS proName,
ba.agreement_id AS agreementId
FROM
slt_agreement_info sai
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
AND bp.del_flag = '0'
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
AND bu.del_flag = '0'
WHERE
sai.`status`=0 and mm.qr_code = #{qrCode}
<if test="unitId != null">
AND ba.unit_id = #{unitId}
</if>
<if test="proId != null">
AND ba.project_id = #{proId}
</if>
GROUP BY mm.ma_id
</select>
<select id="getMachineByOneMaCode" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
SELECT mm.ma_id AS maId,
mm.ma_code AS maCode,
mm.ma_status AS maStatus,
mt1.type_name AS typeName,
mm.type_id AS typeId,
mt.type_name AS materialName,
mt2.type_name AS materialType,
ba.unit_id AS unitId,
bu.unit_name AS unitName,
ba.project_id AS proId,
bp.pro_name AS proName,
ba.agreement_id AS agreementId
FROM slt_agreement_info sai
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
AND bp.del_flag = '0'
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
AND bu.del_flag = '0'
WHERE
and mm.ma_code = #{maCode}
</select>
<select id="getMachineByTwoMaCode" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
SELECT mm.ma_id AS maId,
mm.ma_code AS maCode,
mm.ma_status AS maStatus,
mt1.type_name AS typeName,
mm.type_id AS typeId,
mt.type_name AS materialName,
mt2.type_name AS materialType,
ba.unit_id AS unitId,
bu.unit_name AS unitName,
ba.project_id AS proId,
bp.pro_name AS proName,
ba.agreement_id AS agreementId
FROM slt_agreement_info sai
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
AND bp.del_flag = '0'
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
AND bu.del_flag = '0'
WHERE sai.`status`=0 and mm.ma_status = '2'
and mm.ma_code = #{maCode}
</select>
<select id="getMachineByThreeMaCode" resultType="com.bonus.material.back.domain.vo.MaCodeVo">
SELECT mm.ma_id AS maId,
mm.ma_code AS maCode,
mm.ma_status AS maStatus,
mt1.type_name AS typeName,
mm.type_id AS typeId,
mt.type_name AS materialName,
mt2.type_name AS materialType,
ba.unit_id AS unitId,
bu.unit_name AS unitName,
ba.project_id AS proId,
bp.pro_name AS proName,
ba.agreement_id AS agreementId
FROM slt_agreement_info sai
LEFT JOIN ma_machine mm ON sai.ma_id = mm.ma_id
LEFT JOIN ma_type_repair mtr ON mm.type_id = mtr.type_id
LEFT JOIN ma_type mt ON mm.type_id = mt.type_id
AND mt.del_flag = '0'
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
AND mt1.del_flag = '0'
LEFT JOIN ma_type mt2 ON mt1.parent_id = mt2.type_id
AND mt2.del_flag = '0'
LEFT JOIN bm_agreement_info ba ON sai.agreement_id = ba.agreement_id
LEFT JOIN bm_project bp on bp.pro_id = ba.project_id
AND bp.del_flag = '0'
LEFT JOIN bm_unit bu on bu.unit_id = ba.unit_id
AND bu.del_flag = '0'
WHERE sai.`status`=0 and mm.ma_status = '2'
and mm.ma_code = #{maCode}
AND ba.unit_id = #{unitId}
AND ba.project_id = #{proId}
</select>
</mapper>

View File

@ -589,7 +589,7 @@
LEFT JOIN sys_workflow_config swc ON swn.id = swc.node_id
LEFT JOIN sys_workflow_record_history swrs ON swr.id = swrs.record_id
where 1=1
<!-- <if test="userId != null and userId != ''">and swc.config_value LIKE CONCAT('%', #{userId}, '%')</if>-->
<if test="deptId != null">and bp.imp_unit = #{deptId}</if>
<if test="code != null and code != ''">and lai.code = #{code}</if>
<if test="taskId != null ">and lai.task_id = #{taskId}</if>
<if test="leasePerson != null and leasePerson != ''">and lai.lease_person = #{leasePerson}</if>