|
@@ -10,20 +10,14 @@ import com.platform.dao.bean.MyPage;
|
|
|
import com.platform.dao.bean.MyVOPage;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.platform.dao.dto.sb.SbInfoDTO;
|
|
|
-import com.platform.dao.entity.sb.SbInfo;
|
|
|
-import com.platform.dao.entity.sb.SbMeasureLog;
|
|
|
-import com.platform.dao.entity.sb.SbStopLog;
|
|
|
+import com.platform.dao.entity.sb.*;
|
|
|
import com.platform.dao.entity.upms.SysUser;
|
|
|
import com.platform.dao.enums.SbInfoStatusEnum;
|
|
|
import com.platform.dao.enums.SbMeasureLogOtherTypeEnum;
|
|
|
-import com.platform.dao.mapper.sb.SbInfoMapper;
|
|
|
-import com.platform.dao.mapper.sb.SbMeasureLogMapper;
|
|
|
-import com.platform.dao.mapper.sb.SbStopLogMapper;
|
|
|
+import com.platform.dao.mapper.sb.*;
|
|
|
import com.platform.dao.mapper.upms.SysUserMapper;
|
|
|
import com.platform.dao.vo.query.sb.SbStatusLogVO;
|
|
|
import com.platform.dao.dto.sb.SbStatusLogDTO;
|
|
|
-import com.platform.dao.entity.sb.SbStatusLog;
|
|
|
-import com.platform.dao.mapper.sb.SbStatusLogMapper;
|
|
|
import com.platform.dao.vo.sb.SbInfoVO;
|
|
|
import com.platform.service.sb.SbStatusLogService;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -54,6 +48,7 @@ public class SbStatusLogServiceImpl extends BaseServiceImpl<SbStatusLogMapper, S
|
|
|
private final SbStatusLogMapper sbStatusLogMapper;
|
|
|
private final SbStopLogMapper sbStopLogMapper;
|
|
|
private final SbMeasureLogMapper sbMeasureLogMapper;
|
|
|
+ private final SbPositionMapper sbPositionMapper;
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -97,24 +92,31 @@ public class SbStatusLogServiceImpl extends BaseServiceImpl<SbStatusLogMapper, S
|
|
|
if (model.getSbId()!=null) {
|
|
|
SbInfoDTO info = new SbInfoDTO();
|
|
|
info.setId(model.getSbId());
|
|
|
- List<SbInfoVO> sbInfoVOS = sbInfoMapper.selectVOList(info);
|
|
|
+ SbInfo sbInfoVOS = sbInfoMapper.selectByPrimaryKey(model.getSbId());
|
|
|
+ if (sbInfoVOS.getPositionId()!=null){
|
|
|
+ SbPosition position = sbPositionMapper.selectByPrimaryKey(sbInfoVOS.getPositionId());
|
|
|
+ if (position!=null){
|
|
|
+ sbInfoVOS.setPositionName(position.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
List<SbMeasureLog> measureLogs = new ArrayList<>();
|
|
|
- if (sbInfoVOS != null && sbInfoVOS.size() > 0) {
|
|
|
- for (SbInfoVO vo : sbInfoVOS) {
|
|
|
+ if (sbInfoVOS != null ) {
|
|
|
+// for (SbInfoVO vo : sbInfoVOS) {
|
|
|
SbMeasureLog log = new SbMeasureLog();
|
|
|
log.setOtherType(SbMeasureLogOtherTypeEnum.STOP.getValue());
|
|
|
log.setId(IdGeneratorUtils.getObjectId());
|
|
|
setCreateUserInfo(log);
|
|
|
- log.setSbId(vo.getId());
|
|
|
- String str = "设备位号为:" + (vo.getPositionNo() == null ? "" : vo.getPositionNo() )+ ",设备位置为:" + (vo.getPositionName() == null ? "" : vo.getPositionName()) + "的设备:" + vo.getName() + "于" + log.getCreatedTime() + "被" + log.getCreatedUserName() + "停用";
|
|
|
+ log.setSbId(sbInfoVOS.getId());
|
|
|
+ String str = "设备位号为:" + (sbInfoVOS.getPositionNo() == null ? "" : sbInfoVOS.getPositionNo() )+ ",设备位置为:" + (sbInfoVOS.getPositionName() == null ? "" : sbInfoVOS.getPositionName()) + "的设备:" + sbInfoVOS.getName() + "于" + log.getCreatedTime() + "被" + log.getCreatedUserName() + "停用";
|
|
|
// stringBuffer.append("设备位号为:" + vo.getPositionNo() == null ? "" : vo.getPositionNo() + ",设备位置为:" + vo.getPositionName() == null ? "" : vo.getPositionName() + "的设备:" + vo.getName() + "于" + log.getCreatedTime() + "被" + log.getCreatedUserName() + "停用");
|
|
|
// log.setContent(stringBuffer.toString());
|
|
|
log.setContent(str);
|
|
|
- measureLogs.add(log);
|
|
|
- }
|
|
|
+ sbMeasureLogMapper.insert(log);
|
|
|
+// measureLogs.add(log);
|
|
|
+// }
|
|
|
|
|
|
|
|
|
- sbMeasureLogMapper.insertListforComplex(measureLogs);
|
|
|
+// sbMeasureLogMapper.insertListforComplex(measureLogs);
|
|
|
}
|
|
|
}
|
|
|
}
|