|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.op.device.service.impl;
|
|
|
|
|
|
|
|
|
|
import java.text.Format;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -12,6 +13,7 @@ import com.op.common.core.web.domain.AjaxResult;
|
|
|
|
|
import com.op.common.log.annotation.Log;
|
|
|
|
|
import com.op.device.domain.EquCheckItemDetail;
|
|
|
|
|
import com.op.device.domain.dto.EquCheckItemDTO;
|
|
|
|
|
import com.op.device.domain.vo.EquCheckItemVO;
|
|
|
|
|
import com.op.device.mapper.EquCheckItemDetailMapper;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -48,8 +50,16 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public EquCheckItem selectEquCheckItemByItemId(String itemId) {
|
|
|
|
|
return equCheckItemMapper.selectEquCheckItemByItemId(itemId);
|
|
|
|
|
public EquCheckItemVO selectEquCheckItemByItemId(String itemId) {
|
|
|
|
|
EquCheckItem equCheckItem = equCheckItemMapper.selectEquCheckItemByItemId(itemId);
|
|
|
|
|
|
|
|
|
|
// 创建返回对象
|
|
|
|
|
EquCheckItemVO equCheckItemVO = new EquCheckItemVO();
|
|
|
|
|
BeanUtils.copyProperties(equCheckItem,equCheckItemVO);
|
|
|
|
|
|
|
|
|
|
equCheckItemVO.setFormStandard(equCheckItemDetailMapper.selectEquCheckItemDetailByParentCode(equCheckItem.getItemCode()));
|
|
|
|
|
|
|
|
|
|
return equCheckItemVO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -154,13 +164,36 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
|
|
|
|
|
/**
|
|
|
|
|
* 修改检查项维护
|
|
|
|
|
*
|
|
|
|
|
* @param equCheckItem 检查项维护
|
|
|
|
|
* @param equCheckItemDTO 检查项维护
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public int updateEquCheckItem(EquCheckItem equCheckItem) {
|
|
|
|
|
return equCheckItemMapper.updateEquCheckItem(equCheckItem);
|
|
|
|
|
public AjaxResult updateEquCheckItem(EquCheckItemDTO equCheckItemDTO) {
|
|
|
|
|
EquCheckItem equCheckItem = new EquCheckItem();
|
|
|
|
|
BeanUtils.copyProperties(equCheckItemDTO,equCheckItem);
|
|
|
|
|
|
|
|
|
|
// 处理检查项信息
|
|
|
|
|
equCheckItem.setUpdatedBy(SecurityContextHolder.getUserName());
|
|
|
|
|
equCheckItem.setUpdatedTime(DateUtils.getNowDate());
|
|
|
|
|
if (equCheckItem.getItemType().equals("spotInspection")) {
|
|
|
|
|
equCheckItem.setItemTypeName("点检");
|
|
|
|
|
}
|
|
|
|
|
if (equCheckItem.getItemType().equals("inspection")) {
|
|
|
|
|
equCheckItem.setItemTypeName("巡检");
|
|
|
|
|
}
|
|
|
|
|
if (equCheckItem.getItemType().equals("maintenance")) {
|
|
|
|
|
equCheckItem.setItemTypeName("保养");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
equCheckItemMapper.updateEquCheckItem(equCheckItem);
|
|
|
|
|
|
|
|
|
|
for (EquCheckItemDetail detail : equCheckItemDTO.getFormStandard()) {
|
|
|
|
|
detail.setUpdatedBy(SecurityContextHolder.getUserName());
|
|
|
|
|
detail.setUpdatedTime(DateUtils.getNowDate());
|
|
|
|
|
equCheckItemDetailMapper.updateEquCheckItemDetail(detail);
|
|
|
|
|
}
|
|
|
|
|
return success("修改成功");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|