This commit is contained in:
parent
76af0c8d07
commit
589ad3b135
|
|
@ -63,6 +63,11 @@ public class RepairDeviceVO {
|
|||
@ApiModelProperty(value = "维修配件信息")
|
||||
private String partInfo;
|
||||
|
||||
/**
|
||||
* 配件名称--返厂维修
|
||||
*/
|
||||
private String partName;
|
||||
|
||||
@ApiModelProperty(value = "维修方式: 1内部 2外部返厂 3报废")
|
||||
private Integer repairType;
|
||||
|
||||
|
|
@ -155,6 +160,8 @@ public class RepairDeviceVO {
|
|||
@ApiModelProperty(value = "组织id")
|
||||
private Long companyId;
|
||||
|
||||
List<BmFileInfo> bmFileInfos;
|
||||
|
||||
// 手动覆盖 getter 方法,确保 List 始终被初始化
|
||||
public List<RepairPartDetails> getCodeInRepairPartList() {
|
||||
if (this.codeInRepairPartList == null) {this.codeInRepairPartList = new ArrayList<>();}
|
||||
|
|
|
|||
|
|
@ -189,6 +189,39 @@ public class RepairServiceImpl implements RepairService {
|
|||
}
|
||||
List<RepairDeviceSummaryVo> repairDeviceSummaryVoList = new ArrayList<>();
|
||||
List<RepairDeviceVO> repairDeviceList = repairMapper.getRepairDeviceList(bean);
|
||||
for (RepairDeviceVO repairDeviceVO : repairDeviceList) {
|
||||
// if (!StringHelper.isNullOrEmptyString(repairDeviceVO.getFileUrl())){
|
||||
// BmFileInfo info =new BmFileInfo();
|
||||
// info.setUrl(repairDeviceVO.getFileUrl());
|
||||
// List<BmFileInfo> infoList = new ArrayList<>();
|
||||
// infoList.add(info);
|
||||
// repairDeviceVO.setBmFileInfos(infoList);
|
||||
// repairDeviceVO.setFileUrl("");
|
||||
// }
|
||||
BmFileInfo bmFileInfo =new BmFileInfo();
|
||||
bmFileInfo.setModelId(repairDeviceVO.getId());
|
||||
bmFileInfo.setTaskId(repairDeviceVO.getTaskId());
|
||||
List<BmFileInfo> bmFileInfos = bmFileInfoMapper.selectBmFileInfoList(bmFileInfo);
|
||||
if (bmFileInfos.size()>0) {
|
||||
repairDeviceVO.setBmFileInfos(bmFileInfos);
|
||||
}
|
||||
|
||||
String partName = repairDeviceVO.getPartName();
|
||||
String partInfo = repairDeviceVO.getPartInfo();
|
||||
|
||||
// partName为空则不处理
|
||||
if (StringHelper.isNullOrEmptyString(partName)) {
|
||||
continue;
|
||||
}
|
||||
// partInfo为空则设置为partName
|
||||
if (StringHelper.isNullOrEmptyString(partInfo)) {
|
||||
repairDeviceVO.setPartInfo(partName);
|
||||
} else {
|
||||
// partInfo不为空则拼接
|
||||
repairDeviceVO.setPartInfo(partName + "," + partInfo);
|
||||
}
|
||||
|
||||
}
|
||||
/*if (CollectionUtil.isNotEmpty(repairDeviceList)) {
|
||||
if (CollectionUtil.isNotEmpty(typeIdList)) {
|
||||
repairDeviceList = repairDeviceList.stream()
|
||||
|
|
@ -2085,6 +2118,7 @@ public class RepairServiceImpl implements RepairService {
|
|||
if (bean.getRepairType() == 3){
|
||||
if (partList.size() > 0){
|
||||
scrapType = partList.get(0).getScrapType();
|
||||
handleScrapRepairPart(bean, partList, loginUser);
|
||||
}
|
||||
}
|
||||
validPartList = partList.stream()
|
||||
|
|
@ -2102,7 +2136,9 @@ public class RepairServiceImpl implements RepairService {
|
|||
partList.addAll(validPartList);
|
||||
if (CollectionUtil.isEmpty(partList)) {
|
||||
// 配件为空时,添加默认维修记录
|
||||
addDefaultRepairRecord(bean, loginUser,scrapType);
|
||||
if (bean.getRepairType() != 3){
|
||||
addDefaultRepairRecord(bean, loginUser,scrapType);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -444,7 +444,9 @@
|
|||
( SELECT COUNT(*) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCostRecords,
|
||||
( SELECT COALESCE(SUM(rc.costs), 0) FROM repair_cost rc WHERE rc.repair_id = rad.id ) AS totalCost,
|
||||
rad2.`status` as dataStatus,
|
||||
mt.unit_value AS unitValue
|
||||
mt.unit_value AS unitValue,
|
||||
GROUP_CONCAT(rar.part_name) as partName,
|
||||
GROUP_CONCAT(mpt.pa_name) as partInfo
|
||||
from
|
||||
repair_apply_details rad
|
||||
left join ma_type mt on rad.type_id = mt.type_id
|
||||
|
|
@ -455,6 +457,8 @@
|
|||
left join ma_type mt3 ON mt2.parent_id = mt3.type_id and mt3.del_flag = '0'
|
||||
left join ma_type mt4 ON mt3.parent_id = mt4.type_id and mt4.del_flag = '0'
|
||||
left join repair_apply_details rad2 on rad2.task_id=rad.task_id and rad2.ma_id <=> rad.ma_id and rad2.type_id=rad.type_id and rad2.is_ds='1'
|
||||
LEFT JOIN repair_apply_record rar on rar.task_id=rad.task_id and rar.ma_id <=> rad.ma_id and rar.type_id=rad.type_id and rar.is_ds='0'
|
||||
LEFT JOIN ma_part_type mpt on mpt.pa_id=rar.part_id
|
||||
]]>
|
||||
<if test="userId != null">
|
||||
JOIN ma_type_repair mtr
|
||||
|
|
|
|||
Loading…
Reference in New Issue