This commit is contained in:
parent
dc63eb8bf1
commit
1904789a0f
|
|
@ -143,6 +143,9 @@ public class RepairInputDetails extends BaseEntity {
|
|||
*/
|
||||
private String endTime;
|
||||
|
||||
@ApiModelProperty(value = "退料ID")
|
||||
private Long backId;
|
||||
|
||||
@ApiModelProperty(value = "操作前库存数量")
|
||||
private BigDecimal preStoreNum;
|
||||
|
||||
|
|
|
|||
|
|
@ -110,4 +110,10 @@ public interface RepairInputDetailsMapper {
|
|||
*/
|
||||
int insertRad(RepairInputDetails repairInputDetails);
|
||||
|
||||
/**
|
||||
* 根据任务id查询退料id
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
Long selectBackIdByTaskId(Long taskId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,6 +235,8 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
repairInputDetails1.setTaskId(rePairDto.getTaskId());
|
||||
repairInputDetails1.setAgreementId(rePairDto.getAgreementId());
|
||||
List<RepairInputInfo> list = repairInputDetailsMapper.selectRepairDetailsById(repairInputDetails1);
|
||||
//根据任务id查询退料id
|
||||
Long backId = repairInputDetailsMapper.selectBackIdByTaskId(rePairDto.getTaskId());
|
||||
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
//插入任务表
|
||||
|
|
@ -253,6 +255,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
repairInputDetails1.setTaskId(newTaskId);
|
||||
repairInputDetails1.setMaId(repairInputInfo.getMaId());
|
||||
repairInputDetails1.setRejectNum(repairInputInfo.getPendingInputNum());
|
||||
repairInputDetails1.setBackId(backId);
|
||||
result += insertWxTask(newTaskId, repairInputDetails1);
|
||||
}
|
||||
if (result > 0) {
|
||||
|
|
@ -300,9 +303,12 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
throw new ServiceException("驳回数量不能大于预入库数量");
|
||||
}
|
||||
}
|
||||
//根据任务id查询退料id
|
||||
Long backId = repairInputDetailsMapper.selectBackIdByTaskId(repairInputDetails.getTaskId());
|
||||
repairInputDetails.setCreateBy(SecurityUtils.getUsername());
|
||||
repairInputDetails.setUpdateBy(SecurityUtils.getUsername());
|
||||
repairInputDetails.setUpdateTime(DateUtils.getNowDate());
|
||||
repairInputDetails.setBackId(backId);
|
||||
// 编码类型驳回
|
||||
if (CollectionUtils.isNotEmpty(repairInputDetails.getMaCodeList())) {
|
||||
result += processCodeTypeReject(repairInputDetails);
|
||||
|
|
@ -333,6 +339,7 @@ public class RepairInputDetailsServiceImpl implements IRepairInputDetailsService
|
|||
inputDetails.setUpdateTime(DateUtils.getNowDate());
|
||||
inputDetails.setCreateBy(SecurityUtils.getUsername());
|
||||
inputDetails.setRejectReason(repairInputDetails.getRejectReason());
|
||||
inputDetails.setBackId(repairInputDetails.getBackId());
|
||||
result += repairInputDetailsMapper.updateRepairInputDetails(inputDetails);
|
||||
inputDetails.setStatus(MaMachineStatusEnum.BACK_REPAIR.getStatus().toString());
|
||||
updateRepairInputInfo(inputDetails);
|
||||
|
|
|
|||
|
|
@ -179,6 +179,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
</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 into repair_input_details
|
||||
(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">
|
||||
company_id,
|
||||
</if>
|
||||
<if test="backId != null">
|
||||
back_id,
|
||||
</if>
|
||||
create_time
|
||||
)
|
||||
values (
|
||||
|
|
@ -275,6 +288,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="companyId != null">
|
||||
#{companyId},
|
||||
</if>
|
||||
<if test="backId != null">
|
||||
#{backId},
|
||||
</if>
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
|
|
|||
Loading…
Reference in New Issue