This commit is contained in:
mashuai 2024-12-19 14:48:12 +08:00
parent dc63eb8bf1
commit 1904789a0f
4 changed files with 32 additions and 0 deletions

View File

@ -143,6 +143,9 @@ public class RepairInputDetails extends BaseEntity {
*/ */
private String endTime; private String endTime;
@ApiModelProperty(value = "退料ID")
private Long backId;
@ApiModelProperty(value = "操作前库存数量") @ApiModelProperty(value = "操作前库存数量")
private BigDecimal preStoreNum; private BigDecimal preStoreNum;

View File

@ -110,4 +110,10 @@ public interface RepairInputDetailsMapper {
*/ */
int insertRad(RepairInputDetails repairInputDetails); int insertRad(RepairInputDetails repairInputDetails);
/**
* 根据任务id查询退料id
* @param taskId
* @return
*/
Long selectBackIdByTaskId(Long taskId);
} }

View File

@ -235,6 +235,8 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
repairInputDetails1.setTaskId(rePairDto.getTaskId()); repairInputDetails1.setTaskId(rePairDto.getTaskId());
repairInputDetails1.setAgreementId(rePairDto.getAgreementId()); repairInputDetails1.setAgreementId(rePairDto.getAgreementId());
List<RepairInputInfo> list = repairInputDetailsMapper.selectRepairDetailsById(repairInputDetails1); List<RepairInputInfo> list = repairInputDetailsMapper.selectRepairDetailsById(repairInputDetails1);
//根据任务id查询退料id
Long backId = repairInputDetailsMapper.selectBackIdByTaskId(rePairDto.getTaskId());
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
//插入任务表 //插入任务表
@ -253,6 +255,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
repairInputDetails1.setTaskId(newTaskId); repairInputDetails1.setTaskId(newTaskId);
repairInputDetails1.setMaId(repairInputInfo.getMaId()); repairInputDetails1.setMaId(repairInputInfo.getMaId());
repairInputDetails1.setRejectNum(repairInputInfo.getPendingInputNum()); repairInputDetails1.setRejectNum(repairInputInfo.getPendingInputNum());
repairInputDetails1.setBackId(backId);
result += insertWxTask(newTaskId, repairInputDetails1); result += insertWxTask(newTaskId, repairInputDetails1);
} }
if (result > 0) { if (result > 0) {
@ -300,9 +303,12 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
throw new ServiceException("驳回数量不能大于预入库数量"); throw new ServiceException("驳回数量不能大于预入库数量");
} }
} }
//根据任务id查询退料id
Long backId = repairInputDetailsMapper.selectBackIdByTaskId(repairInputDetails.getTaskId());
repairInputDetails.setCreateBy(SecurityUtils.getUsername()); repairInputDetails.setCreateBy(SecurityUtils.getUsername());
repairInputDetails.setUpdateBy(SecurityUtils.getUsername()); repairInputDetails.setUpdateBy(SecurityUtils.getUsername());
repairInputDetails.setUpdateTime(DateUtils.getNowDate()); repairInputDetails.setUpdateTime(DateUtils.getNowDate());
repairInputDetails.setBackId(backId);
// 编码类型驳回 // 编码类型驳回
if (CollectionUtils.isNotEmpty(repairInputDetails.getMaCodeList())) { if (CollectionUtils.isNotEmpty(repairInputDetails.getMaCodeList())) {
result += processCodeTypeReject(repairInputDetails); result += processCodeTypeReject(repairInputDetails);
@ -333,6 +339,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
inputDetails.setUpdateTime(DateUtils.getNowDate()); inputDetails.setUpdateTime(DateUtils.getNowDate());
inputDetails.setCreateBy(SecurityUtils.getUsername()); inputDetails.setCreateBy(SecurityUtils.getUsername());
inputDetails.setRejectReason(repairInputDetails.getRejectReason()); inputDetails.setRejectReason(repairInputDetails.getRejectReason());
inputDetails.setBackId(repairInputDetails.getBackId());
result += repairInputDetailsMapper.updateRepairInputDetails(inputDetails); result += repairInputDetailsMapper.updateRepairInputDetails(inputDetails);
inputDetails.setStatus(MaMachineStatusEnum.BACK_REPAIR.getStatus().toString()); inputDetails.setStatus(MaMachineStatusEnum.BACK_REPAIR.getStatus().toString());
updateRepairInputInfo(inputDetails); updateRepairInputInfo(inputDetails);

View File

@ -179,6 +179,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
</select> </select>
<select id="selectBackIdByTaskId" resultType="java.lang.Long">
SELECT
rad.back_id
FROM
repair_input_details rid
LEFT JOIN repair_apply_details rad ON rid.repair_id = rad.id
WHERE
rid.task_id = #{taskId}
</select>
<insert id="batchInsertRepairInputDetails" parameterType="com.bonus.material.repair.domain.RepairInputDetails"> <insert id="batchInsertRepairInputDetails" parameterType="com.bonus.material.repair.domain.RepairInputDetails">
insert into repair_input_details insert into repair_input_details
(task_id, audit_id, repair_id, ma_id, type_id, repair_num, input_num, create_by, create_time, (task_id, audit_id, repair_id, ma_id, type_id, repair_num, input_num, create_by, create_time,
@ -250,6 +260,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyId != null"> <if test="companyId != null">
company_id, company_id,
</if> </if>
<if test="backId != null">
back_id,
</if>
create_time create_time
) )
values ( values (
@ -275,6 +288,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyId != null"> <if test="companyId != null">
#{companyId}, #{companyId},
</if> </if>
<if test="backId != null">
#{backId},
</if>
NOW() NOW()
) )
</insert> </insert>