退料、维修功能修改

This commit is contained in:
hayu 2025-06-11 20:21:19 +08:00
parent b8d00c0fe0
commit 955147c80f
6 changed files with 73 additions and 2 deletions

View File

@ -375,12 +375,12 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
} }
if (backApplyDetails.getGoodNum() != null && backApplyDetails.getBadNum() != null && backApplyDetails.getPreNum() != null) { if (backApplyDetails.getGoodNum() != null && backApplyDetails.getBadNum() != null && backApplyDetails.getPreNum() != null) {
if (backApplyDetails.getGoodNum().add(backApplyDetails.getBadNum()).compareTo( backApplyDetails.getPreNum())>0) { if (backApplyDetails.getGoodNum().add(backApplyDetails.getBadNum()).compareTo( backApplyDetails.getPreNum())>0) {
return AjaxResult.error(backApplyDetails.getTypeName() + "完好数量和损坏数量之和不能大于预退数量,请重新填写!"); return AjaxResult.error(backApplyDetails.getTypeName() + "完好数量和不合格数量之和不能大于预退数量,请重新填写!");
} }
} }
if (backApplyDetails.getGoodNum() != null && backApplyDetails.getBadNum() != null && CollectionUtils.isNotEmpty(backApplyDetails.getMaCodeList())) { if (backApplyDetails.getGoodNum() != null && backApplyDetails.getBadNum() != null && CollectionUtils.isNotEmpty(backApplyDetails.getMaCodeList())) {
if (backApplyDetails.getGoodNum().add(backApplyDetails.getBadNum()).compareTo( BigDecimal.valueOf(backApplyDetails.getMaCodeList().size()))>0) { if (backApplyDetails.getGoodNum().add(backApplyDetails.getBadNum()).compareTo( BigDecimal.valueOf(backApplyDetails.getMaCodeList().size()))>0) {
return AjaxResult.error(backApplyDetails.getTypeName() + "完好数量和损坏数量之和不能大于预退数量,请重新填写!"); return AjaxResult.error(backApplyDetails.getTypeName() + "完好数量和不合格数量之和不能大于预退数量,请重新填写!");
} }
} }
} }
@ -1031,6 +1031,8 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
details.setPreNum(BigDecimal.valueOf(1)); details.setPreNum(BigDecimal.valueOf(1));
details.setAuditNum(details.getPreNum()); details.setAuditNum(details.getPreNum());
details.setNum(BigDecimal.valueOf(num)); details.setNum(BigDecimal.valueOf(num));
details.setGoodNum(details.getGoodNum());
details.setBadNum(details.getBadNum());
details.setStatus(String.valueOf(BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus())); details.setStatus(String.valueOf(BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus()));
details.setCreateBy(SecurityUtils.getUsername()); details.setCreateBy(SecurityUtils.getUsername());
details.setCreateTime(DateUtils.getNowDate()); details.setCreateTime(DateUtils.getNowDate());

View File

@ -72,6 +72,20 @@ public class RepairController extends BaseController {
return getDataTable(list); return getDataTable(list);
} }
/**
* 获取维修任务列表--app
* @param bean
* @return
*/
@ApiOperation(value = "获取维修任务详情列表--分页")
@GetMapping("/getDetailsListApp")
//@RequiresPermissions(value = "repair:manage:list")
public TableDataInfo getDetailsListApp(RepairPartDetails bean) {
startPage();
List<RepairPartDetails> list = service.getDetailsListApp(bean);
return getDataTable(list);
}
/** /**
* 获取维修任务列表--不分页--NO_PAGE * 获取维修任务列表--不分页--NO_PAGE
*/ */

View File

@ -263,4 +263,11 @@ public interface RepairMapper {
* @return * @return
*/ */
List<RepairPartInfo> selectSecondRepairPartList(RepairPartInfo dto); List<RepairPartInfo> selectSecondRepairPartList(RepairPartInfo dto);
/**
* 获取维修任务列表--app
* @param bean
* @return
*/
List<RepairPartDetails> getDetailsListApp(RepairPartDetails bean);
} }

View File

@ -106,4 +106,11 @@ public interface RepairService {
* @return * @return
*/ */
List<RepairPartInfo> selectSecondRepairPartList(RepairPartInfo dto); List<RepairPartInfo> selectSecondRepairPartList(RepairPartInfo dto);
/**
* 获取维修任务列表--app
* @param bean
* @return
*/
List<RepairPartDetails> getDetailsListApp(RepairPartDetails bean);
} }

View File

@ -1235,6 +1235,11 @@ public class RepairServiceImpl implements RepairService {
return repairMapper.getDetailsList(bean); return repairMapper.getDetailsList(bean);
} }
@Override
public List<RepairPartDetails> getDetailsListApp(RepairPartDetails bean) {
return repairMapper.getDetailsListApp(bean);
}
/** /**
* 查询修试查询-维修配件查询列表 * 查询修试查询-维修配件查询列表
* @param dto * @param dto

View File

@ -826,6 +826,42 @@
HAVING HAVING
partName IS NOT NULL partName IS NOT NULL
</select> </select>
<select id="getDetailsListApp" resultType="com.bonus.material.repair.domain.RepairPartDetails">
SELECT
mt1.type_name as typeName,
mt.type_name as typeModelName,
rar.type_id as typeId,
rar.task_id as taskId,
mm.ma_code as maCode,
rar.repair_num as repairNum,
rar.scrap_num as scrapNum,
rar.create_by as createBy,
rar.create_time as createTime,
GROUP_CONCAT(DISTINCT su.nick_name) as repairer,
mpt2.pa_id as partId,
GROUP_CONCAT(DISTINCT mpt2.pa_name) as partName
FROM
repair_apply_record rar
LEFT JOIN ma_type mt ON rar.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_machine mm ON rar.ma_id = mm.ma_id
LEFT JOIN (
SELECT
GROUP_CONCAT(DISTINCT repairer) AS repairer,
task_id,
type_id
FROM repair_apply_details
GROUP BY type_id, task_id
) a ON a.task_id = rar.task_id AND a.type_id = rar.type_id
LEFT JOIN sys_user su ON su.user_id = a.repairer
LEFT JOIN ma_part_type mpt ON mpt.pa_id = rar.part_id
LEFT JOIN ma_part_type mpt2 ON mpt2.pa_id = mpt.parent_id
WHERE
rar.task_id = #{taskId} AND rar.type_id = #{typeId}
GROUP BY
mm.ma_code,
mpt2.pa_id
</select>
<update id="updateRepairedAndScrapNum"> <update id="updateRepairedAndScrapNum">
update update