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