This commit is contained in:
parent
78f82c37c4
commit
8b938c25bb
|
|
@ -291,7 +291,7 @@ public class ProAuthorizeServiceImpl implements ProAuthorizeService {
|
|||
OutputStream out = response.getOutputStream()
|
||||
) {
|
||||
if (input == null) {
|
||||
throw new FileNotFoundException("模板文件不存在: " + templateName);
|
||||
throw new FileNotFoundException("模版文件不存在: " + templateName);
|
||||
}
|
||||
// 设置响应头
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
|
|
@ -309,7 +309,7 @@ public class ProAuthorizeServiceImpl implements ProAuthorizeService {
|
|||
}
|
||||
out.flush();
|
||||
} catch (IOException e) {
|
||||
log.error("下载模板失败: {}", e.getMessage(), e);
|
||||
log.error("下载模版失败: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,4 +80,10 @@ public class RepairInputInfo extends BaseEntity {
|
|||
* 修饰入库单号
|
||||
*/
|
||||
private String inputCode;
|
||||
|
||||
/**
|
||||
* 维修Id
|
||||
* 在老系统中表示维修任务Id
|
||||
*/
|
||||
private Long repairId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,4 +118,11 @@ public interface RepairApplyDetailsMapper {
|
|||
* @return
|
||||
*/
|
||||
RepairTaskDetails getMaxLevel(Long backId);
|
||||
|
||||
/**
|
||||
* 根据id查询维修任务详情
|
||||
* @param auditDetails1
|
||||
* @return
|
||||
*/
|
||||
RepairAuditDetails selectByIdNew(RepairAuditDetails auditDetails1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -692,12 +692,13 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
final RepairAuditDetails auditDetails1 = repairAuditDetails.get(0);
|
||||
final String status = auditDetails1.getStatus(); // 1通过 2驳回
|
||||
// 根据repairId查询前任务id
|
||||
RepairAuditDetails dto = repairApplyDetailsMapper.selectById(auditDetails1.getRepairId());
|
||||
// RepairAuditDetails dto = repairApplyDetailsMapper.selectById(auditDetails1.getRepairId());
|
||||
RepairAuditDetails dto = repairApplyDetailsMapper.selectByIdNew(auditDetails1);
|
||||
// 查询报废详情
|
||||
final List<ScrapApplyDetails> scrapApplyDetails = scrapApplyDetailsMapper.selectScrapByTaskId(dto);
|
||||
if ("1".equals(status)) {
|
||||
//根据任务id查询协议id
|
||||
final Long agreementId = taskAgreementMapper.selectAgreementIdByTaskId(auditDetails1.getTaskId());
|
||||
final Long agreementId = taskAgreementMapper.selectAgreementIdByTaskId(dto.getTaskId());
|
||||
batchInsertRepairInputDetails(scrapApplyDetails,repairAuditDetails, agreementId);
|
||||
} else if ("2".equals(status)) {
|
||||
RepairTask task = new RepairTask();
|
||||
|
|
|
|||
|
|
@ -93,6 +93,12 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
List<RepairInputInfo> inputInfos = repairInputDetailsMapper.selectRepairInputDetailsById(repairInputDetails);
|
||||
if (CollectionUtils.isNotEmpty(inputInfos)) {
|
||||
for (RepairInputInfo inputInfo : inputInfos) {
|
||||
//判断agreementId是否为空,为空则是老系统数据,需要特殊查询
|
||||
if (inputInfo.getAgreementId() == null && inputInfo.getRepairId() !=null){
|
||||
//根据入库表的repair_id关联任务协议表任务Id
|
||||
Long agreementId = taskAgreementMapper.selectAgreementIdByTaskId(inputInfo.getRepairId());
|
||||
inputInfo.setAgreementId(Math.toIntExact(agreementId));
|
||||
}
|
||||
RepairInputDetails inputDetails = new RepairInputDetails();
|
||||
inputDetails.setTaskId(inputInfo.getTaskId());
|
||||
inputDetails.setTypeId(inputInfo.getTypeId());
|
||||
|
|
|
|||
|
|
@ -441,13 +441,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
mm.ma_id as maId,
|
||||
mt2.type_name as materialName,
|
||||
mt.type_name as materialModel,
|
||||
CASE
|
||||
WHEN mm.machine_name is not null THEN
|
||||
mm.machine_name
|
||||
ELSE
|
||||
mt.type_name
|
||||
END materialModel,
|
||||
mm.ma_code as maCode,
|
||||
mm.this_check_time as thisCheckTime,
|
||||
mm.next_check_time as nextCheckTime,
|
||||
mm.check_man as checkMan,
|
||||
mm.inspect_man as inspectMan,
|
||||
mm.phone,
|
||||
'0551-63703966' as phone,
|
||||
'合格' as inspectStatus,
|
||||
mm.ma_vender as maVender,
|
||||
mm.ex_code as exCode,
|
||||
|
|
@ -636,7 +641,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
mm.ma_id as maId,
|
||||
mt2.type_name as maName,
|
||||
mt.type_name as maModel,
|
||||
ifnull(mm.machine_name,mt.type_name) as maModel,
|
||||
mm.ma_code as maCode,
|
||||
mm.qr_code as qrCode,
|
||||
mm.type_id as typeId,
|
||||
|
|
@ -728,7 +733,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
mm.ma_id as maId,
|
||||
mt2.type_name as maName,
|
||||
mt.type_name as maModel,
|
||||
CASE
|
||||
WHEN mm.machine_name is not null THEN
|
||||
mm.machine_name
|
||||
ELSE
|
||||
mt.type_name
|
||||
END maModel,
|
||||
mm.ma_code as maCode,
|
||||
mm.qr_code as qrCode,
|
||||
mm.type_id as typeId,
|
||||
|
|
@ -866,7 +876,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT
|
||||
mm.ma_id as maId,
|
||||
mt2.type_name as maName,
|
||||
mt.type_name as maModel,
|
||||
CASE
|
||||
WHEN mm.machine_name is not null THEN
|
||||
mm.machine_name
|
||||
ELSE
|
||||
mt.type_name
|
||||
END maModel,
|
||||
mm.ma_code as maCode,
|
||||
mm.qr_code as qrCode,
|
||||
mm.type_id as typeId,
|
||||
|
|
|
|||
|
|
@ -216,6 +216,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where id = #{repairId}
|
||||
</select>
|
||||
|
||||
<select id="selectByIdNew" resultType="com.bonus.material.repair.domain.RepairAuditDetails">
|
||||
SELECT task_id AS taskId,
|
||||
type_id AS typeId,
|
||||
ma_id AS maId,
|
||||
level AS level,
|
||||
create_time AS createTime
|
||||
FROM repair_apply_details
|
||||
WHERE id = #{repairId}
|
||||
AND create_time > '2025-08-20 00:00:00'
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT task_id AS taskId,
|
||||
type_id AS typeId,
|
||||
ma_id AS maId,
|
||||
level AS level,
|
||||
create_time AS createTime
|
||||
FROM repair_apply_details
|
||||
WHERE task_id = #{repairId}
|
||||
and type_id =#{typeId}
|
||||
<if test="maId !=null">
|
||||
AND ma_id = #{maId}
|
||||
</if>
|
||||
AND create_time <= '2025-08-20 00:00:00'
|
||||
GROUP BY task_id
|
||||
</select>
|
||||
|
||||
<select id="getMaxLevel" resultType="com.bonus.material.repair.domain.RepairTaskDetails">
|
||||
SELECT
|
||||
rad.id AS id,
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
tt.`code` as inputCode,
|
||||
rid.ma_id as maId,
|
||||
rid.type_id as typeId,
|
||||
rid.repair_id as repairId,
|
||||
SUM(IFNULL(rid.repair_num, 0)) as repairNum,
|
||||
SUM(IFNULL(rid.input_num, 0)) as inputNum,
|
||||
(SUM(IFNULL(rid.repair_num, 0)) - SUM(IFNULL(rid.input_num, 0)) - SUM(IFNULL(rid.reject_num, 0)))
|
||||
|
|
|
|||
Loading…
Reference in New Issue