快速保养工单检查项获取不到BUG解决

orign^2
wws 1 year ago
parent 7a5425e0ec
commit 99a7d37ed6

@ -46,6 +46,16 @@ public class EquUpkeepController extends BaseController {
return equUpkeepService.formatEquItem(equPlanEquList);
}
/**
*
* @param equPlanEquList
* @return
*/
@PostMapping("/formatEquItemNoCondition")
public AjaxResult formatEquItemNoCondition(@RequestBody List<EquPlanEqu> equPlanEquList) {
return equUpkeepService.formatEquItemNoCondition(equPlanEquList);
}
/**
*
*/

@ -69,4 +69,6 @@ public interface IEquUpkeepService {
* @return
*/
AjaxResult formatEquItem(List<EquPlanEqu> equPlanEquList);
AjaxResult formatEquItemNoCondition(List<EquPlanEqu> equPlanEquList);
}

@ -113,7 +113,13 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
@Override
@DS("#header.poolName")
public AjaxResult formatEquItem(List<EquPlanEqu> equPlanEquList) {
return formatEquItemCommon(equPlanEquList, "maintenance", "存在设备未设置保养项!");
return formatEquItemCommon(equPlanEquList, "maintenance", "存在设备未设置保养项!",true);
}
@Override
@DS("#header.poolName")
public AjaxResult formatEquItemNoCondition(List<EquPlanEqu> equPlanEquList) {
return formatEquItemCommon(equPlanEquList, "maintenance", "存在设备未设置保养项!",false);
}
/**
@ -124,7 +130,7 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
* @param message
* @return
*/
private AjaxResult formatEquItemCommon(List<EquPlanEqu> equPlanEquList, String planType, String message) {
private AjaxResult formatEquItemCommon(List<EquPlanEqu> equPlanEquList, String planType, String message,Boolean check) {
for (EquPlanEqu data : equPlanEquList) {
// 检查项名称临时对象
@ -139,7 +145,33 @@ public class EquUpkeepServiceImpl implements IEquUpkeepService {
// 处理检查项信息
for (EquCheckItem checkItem : equCheckItemList) {
// 获取循环周期一致的检查项
if (checkItem.getItemLoop() == data.getItemLoop() && checkItem.getItemLoopType().equals(data.getItemLoopType())) {
if (checkItem.getItemLoop() == data.getItemLoop() && checkItem.getItemLoopType().equals(data.getItemLoopType()) && check) {
// 创建检查项返回对象
EquPlanDetail detail = new EquPlanDetail();
BeanUtils.copyProperties(checkItem, detail);
if (!detail.getItemCode().isEmpty()) {
// 累加检查项名称(前端信息回显)
itemTempName.append(detail.getItemName()).append(",");
// 通过检查项code获取标准信息列表
List<EquCheckItemDetail> equCheckItemDetailList = equCheckItemDetailMapper.selectCheckItemDetailByItemCode(detail.getItemCode());
// 处理标准信息
if (equCheckItemList.size() > 0) {
// 创建标准列表返回对象
List<EquPlanStandard> standardList = new ArrayList<>();
for (EquCheckItemDetail standardTemp : equCheckItemDetailList) {
// 创建标准返回对象
EquPlanStandard standard = new EquPlanStandard();
BeanUtils.copyProperties(standardTemp, standard);
standard.setShowFlag(true);// 设置默认值(用于前端)
standardList.add(standard);// 返回对象添加到返回列表对象
}
detail.setEquPlanStandardList(standardList);// 标准列表信息置入检查项
}
}
detailList.add(detail);// 返回对象添加到返回列表对象
}else {
// 创建检查项返回对象
EquPlanDetail detail = new EquPlanDetail();
BeanUtils.copyProperties(checkItem, detail);

Loading…
Cancel
Save