功能修改

This commit is contained in:
hayu 2025-02-14 09:15:18 +08:00
parent 4ece73cc63
commit be975c3162
6 changed files with 60 additions and 7 deletions

View File

@ -333,4 +333,11 @@ public interface BackApplyInfoMapper {
/** 设置审批人签名url 防止代码冲突 **/ /** 设置审批人签名url 防止代码冲突 **/
String getDirectAuditUrl(BackApplyInfo backApplyInfo); String getDirectAuditUrl(BackApplyInfo backApplyInfo);
/**
* 根据任务id查询是否有签名
* @param taskId
* @return
*/
BackApplyInfo selectSignByTaskId(Long taskId);
} }

View File

@ -187,7 +187,12 @@ public class RepairController extends BaseController {
//@RequiresPermissions("repair:manage:export") //@RequiresPermissions("repair:manage:export")
@ApiOperation(value = "导出维修任务列表") @ApiOperation(value = "导出维修任务列表")
public void export(HttpServletResponse response, RepairTask bean) { public void export(HttpServletResponse response, RepairTask bean) {
List<RepairTask> list = service.exportRepairTaskList(bean); List<RepairTask> list=new ArrayList<>();
try {
list = service.exportRepairTaskList(bean);
} catch (Exception e) {
list = new ArrayList<>();
}
ExcelUtil<RepairTask> util = new ExcelUtil<>(RepairTask.class); ExcelUtil<RepairTask> util = new ExcelUtil<>(RepairTask.class);
util.exportExcel(response, list, "维修任务列表"); util.exportExcel(response, list, "维修任务列表");
} }

View File

@ -54,6 +54,9 @@ public class RepairDeviceVO {
@ApiModelProperty(value = "退料ID") @ApiModelProperty(value = "退料ID")
private Long backId; private Long backId;
@ApiModelProperty(value = "退料编码")
private String backCode;
@ApiModelProperty(value = "维修配件信息") @ApiModelProperty(value = "维修配件信息")
private String partInfo; private String partInfo;

View File

@ -26,6 +26,7 @@ import com.bonus.material.task.domain.TmTask;
import com.bonus.material.task.mapper.TmTaskMapper; import com.bonus.material.task.mapper.TmTaskMapper;
import com.bonus.system.api.domain.SysUser; import com.bonus.system.api.domain.SysUser;
import com.bonus.system.api.model.LoginUser; import com.bonus.system.api.model.LoginUser;
import org.hibernate.validator.internal.util.StringHelper;
import org.springframework.dao.DataAccessException; import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -35,6 +36,8 @@ import javax.annotation.Resource;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.ZoneId;
import java.util.*; import java.util.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -971,6 +974,26 @@ public class RepairServiceImpl implements RepairService {
// 3. 更新结算信息表 // 3. 更新结算信息表
sltAgreementInfoMapper.backRejectSltCope(tmTask.getPreTaskId()); sltAgreementInfoMapper.backRejectSltCope(tmTask.getPreTaskId());
//驳回操作不可跨月操作
if (!StringHelper.isNullOrEmptyString(String.valueOf(tmTask.getCreateTime()))) {
// createTime 转换为 LocalDate
LocalDate taskCreationDate = tmTask.getCreateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
// 获取当前日期
LocalDate today = LocalDate.now();
// 检查是否在同一月
if (taskCreationDate.getYear() != today.getYear() || taskCreationDate.getMonth() != today.getMonth()) {
throw new ServiceException("只可驳回本月任务");
}
}
//查询是否有签名 根据退料编码查询back_apply_info表
BackApplyInfo backApplyInfo = backApplyInfoMapper.selectSignByTaskId(taskId);
if (null != backApplyInfo){
if (!StringHelper.isNullOrEmptyString(backApplyInfo.getBackSignUrl()) || backApplyInfo.getDirectAuditBy()>0){
throw new ServiceException("该任务已有签名,不能驳回");
}
}
if (null == tmTask.getCode() || tmTask.getCode().isEmpty()) { if (null == tmTask.getCode() || tmTask.getCode().isEmpty()) {
throw new ServiceException("维修任务:" + taskId + "没有退料单号,系统异常!"); throw new ServiceException("维修任务:" + taskId + "没有退料单号,系统异常!");
} }

View File

@ -780,4 +780,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from sys_user su from sys_user su
where su.user_id = #{directAuditBy} and su.del_flag = 0 where su.user_id = #{directAuditBy} and su.del_flag = 0
</select> </select>
<select id="selectSignByTaskId" resultType="com.bonus.material.back.domain.BackApplyInfo">
SELECT
bai.`code`,
bai.direct_audit_by as directAuditBy,
bai.back_sign_url as backSignUrl
FROM
back_apply_info bai
LEFT JOIN repair_apply_details rad on rad.back_id=bai.id
LEFT JOIN tm_task tt on tt.task_id=rad.task_id
WHERE
tt.task_id=#{taskId}
GROUP BY bai.`code`
</select>
</mapper> </mapper>

View File

@ -220,7 +220,7 @@
rd.task_id, rd.task_id,
tt.CODE AS repairCode, tt.CODE AS repairCode,
bui.unit_name AS backUnit, bui.unit_name AS backUnit,
bpi.lot_name AS backPro, bpi.pro_name AS backPro,
su.nick_name AS createName, su.nick_name AS createName,
tt.create_time AS createTime, tt.create_time AS createTime,
bai.CODE AS backCode, bai.CODE AS backCode,
@ -243,15 +243,15 @@
LEFT JOIN back_apply_info bai ON rd.back_id = bai.id LEFT JOIN back_apply_info bai ON rd.back_id = bai.id
LEFT JOIN tm_task_agreement tta ON rd.task_id = tta.task_id LEFT JOIN tm_task_agreement tta ON rd.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id LEFT JOIN bm_agreement_info bai2 ON tta.agreement_id = bai2.agreement_id
LEFT JOIN bm_unit_info bui ON bai2.unit_id = bui.unit_id LEFT JOIN bm_unit bui ON bai2.unit_id = bui.unit_id
LEFT JOIN bm_project bpi ON bai2.project_id = bpi.lot_id AND bpi.STATUS = '0' AND bpi.del_flag = '0' LEFT JOIN bm_project bpi ON bai2.project_id = bpi.pro_id and bpi.del_flag = '0'
LEFT JOIN sys_user su ON rd.create_by = su.user_id LEFT JOIN sys_user su ON rd.create_by = su.user_id
left join sys_user su2 on rd.repairer = su2.user_id left join sys_user su2 on rd.repairer = su2.user_id
LEFT JOIN ma_machine mm ON mm.ma_id = rd.ma_id LEFT JOIN ma_machine mm ON mm.ma_id = rd.ma_id
where 1=1 where 1=1
<if test="keyword != null and keyword != ''"> <if test="keyWord != null and keyWord != ''">
AND (locate(#{keyword}, su.nick_name) > 0 AND (locate(#{keyWord}, su.nick_name) > 0
or locate(#{keyword}, tt.CODE) > 0) or locate(#{keyWord}, tt.CODE) > 0)
</if> </if>
<if test="backUnit != null and backUnit != ''"> <if test="backUnit != null and backUnit != ''">
AND bui.unit_id = #{backUnit} AND bui.unit_id = #{backUnit}
@ -301,6 +301,7 @@
rad.type_id as typeId, rad.type_id as typeId,
rad.back_id as backId, rad.back_id as backId,
rad.create_time, rad.create_time,
bai.CODE AS backCode,
( SELECT COUNT(*) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCostRecords, ( SELECT COUNT(*) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCostRecords,
( SELECT SUM( IFNULL( rc.costs, 0 )) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCost ( SELECT SUM( IFNULL( rc.costs, 0 )) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCost
from from
@ -309,6 +310,7 @@
left join ma_machine mm on mm.ma_id = rad.ma_id left join ma_machine mm on mm.ma_id = rad.ma_id
left join sys_user su on rad.repairer = su.user_id left join sys_user su on rad.repairer = su.user_id
left join ma_type mt2 on mt.parent_id = mt2.type_id left join ma_type mt2 on mt.parent_id = mt2.type_id
LEFT JOIN back_apply_info bai ON rd.back_id = bai.id
where where
rad.task_id = #{taskId} rad.task_id = #{taskId}
<if test="companyId != null and companyId != ''"> <if test="companyId != null and companyId != ''">