维修优化
This commit is contained in:
parent
37ef52d6a8
commit
5f9211b19c
|
|
@ -54,6 +54,8 @@ public interface RepairInputDetailsMapper {
|
|||
*/
|
||||
public int deleteRepairInputDetailsById(Long id);
|
||||
|
||||
public int deleteRepairInputDetailsByTaskId(Long taskId);
|
||||
|
||||
/**
|
||||
* 批量删除修试后入库
|
||||
*
|
||||
|
|
|
|||
|
|
@ -468,7 +468,8 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
if (CollectionUtils.isEmpty(repairAuditDetailsByQuery)) {
|
||||
return 0;
|
||||
}
|
||||
batchInsertRepairInputDetails(repairAuditDetailsByQuery);
|
||||
repairInputDetailsMapper.deleteRepairInputDetailsByTaskId(repairAuditDetails.get(0).getTaskId());
|
||||
batchInsertRepairInputDetails(repairAuditDetailsByQuery, repairAuditDetails.get(0).getStatus());
|
||||
try {
|
||||
List<Long> ids = repairAuditDetailsByQuery.stream()
|
||||
.filter(Objects::nonNull)
|
||||
|
|
@ -497,7 +498,8 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
if (ids.isEmpty()) {
|
||||
return 0;
|
||||
}
|
||||
batchInsertRepairInputDetails(repairAuditDetails);
|
||||
//repairInputDetailsMapper.deleteRepairInputDetailsByIds((Long[]) ids.toArray());
|
||||
batchInsertRepairInputDetails(repairAuditDetails, repairAuditDetails.get(0).getStatus());
|
||||
try {
|
||||
return repairAuditDetailsMapper.updateRepairAuditDetailsBatch(ids, String.valueOf(repairAuditDetails.get(0).getStatus()));
|
||||
} catch (Exception e) {
|
||||
|
|
@ -505,12 +507,13 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
|||
}
|
||||
}
|
||||
|
||||
private void batchInsertRepairInputDetails(List<RepairAuditDetails> repairAuditDetailsByQuery) {
|
||||
private void batchInsertRepairInputDetails(List<RepairAuditDetails> repairAuditDetailsByQuery, String status) {
|
||||
List<RepairInputDetails> inputList = new ArrayList<>();
|
||||
for (RepairAuditDetails details : repairAuditDetailsByQuery) {
|
||||
RepairInputDetails inputVo = new RepairInputDetails();
|
||||
BeanUtils.copyProperties(details, inputVo);
|
||||
inputVo.setAuditId(details.getId());
|
||||
inputVo.setStatus(status);
|
||||
inputList.add(inputVo);
|
||||
}
|
||||
repairInputDetailsMapper.batchInsertRepairInputDetails(inputList);
|
||||
|
|
|
|||
|
|
@ -116,6 +116,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
delete from repair_input_details where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRepairInputDetailsByTaskId" parameterType="Long">
|
||||
delete from repair_input_details where task_id = #{taskId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteRepairInputDetailsByIds" parameterType="String">
|
||||
delete from repair_input_details where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
|
|
|
|||
Loading…
Reference in New Issue