|
@@ -18,6 +18,7 @@ import com.platform.dao.mapper.sb.SbPositionMapper;
|
|
|
import com.platform.dao.util.MessageTemplateUtil;
|
|
|
import com.platform.service.event.WorkplaceBacklogEvent;
|
|
|
import com.platform.service.sb.SbInfoService;
|
|
|
+import com.platform.service.sb.SbMeasureLogService;
|
|
|
import com.platform.service.upms.SysFileService;
|
|
|
import com.platform.service.upms.SysUserService;
|
|
|
import com.platform.service.wechat.util.WeChatMessageUtil;
|
|
@@ -39,6 +40,8 @@ public abstract class AbstractRepairBaseStrategy implements RepairBaseStrategy{
|
|
|
protected SysUserService sysUserService;
|
|
|
@Resource
|
|
|
protected SbPositionMapper sbPositionMapper;
|
|
|
+ @Resource
|
|
|
+ protected SbMeasureLogService sbMeasureLogService;
|
|
|
|
|
|
@Override
|
|
|
public void nonPlanToPlan(RepairApplicationFormDTO model) {
|
|
@@ -60,6 +63,7 @@ public abstract class AbstractRepairBaseStrategy implements RepairBaseStrategy{
|
|
|
throw new DeniedException("设备录入方式不能为空");
|
|
|
}
|
|
|
SbInfo sb = null;
|
|
|
+ String sbId = "";
|
|
|
if(model.getInputType() == 1){
|
|
|
if(StringUtils.isBlank(model.getSbName()) && StringUtils.isBlank(model.getPositionNo())){
|
|
|
throw new DeniedException("请填写报修设备信息");
|
|
@@ -71,7 +75,7 @@ public abstract class AbstractRepairBaseStrategy implements RepairBaseStrategy{
|
|
|
if(StringUtils.isBlank(model.getSbId())){
|
|
|
throw new DeniedException("请填写报修设备");
|
|
|
}
|
|
|
- String sbId = model.getSbId();
|
|
|
+ sbId = model.getSbId();
|
|
|
sb = sbInfoService.getModelById(sbId);
|
|
|
if (sb == null) {
|
|
|
throw new DeniedException("设备不存在,无法报修");
|
|
@@ -118,7 +122,8 @@ public abstract class AbstractRepairBaseStrategy implements RepairBaseStrategy{
|
|
|
}
|
|
|
// 如果选择了设备停机,则要修改设备状态,记录设备状态变更变
|
|
|
if (model.getNeedStop() != null && model.getNeedStop().intValue() == RepairApplicationFormStopEnum.STOP.getValue()) {
|
|
|
-// info.setStatus(SbInfoStatusEnum.IN_STOP.getValue());
|
|
|
+ // 记录生命周期数据
|
|
|
+ sbMeasureLogService.addUseOrUnUseLog(sbId,SbMeasureLogOtherTypeEnum.STOP.getValue(), "停机");
|
|
|
updateSb = true;
|
|
|
}
|
|
|
if (updateSb) {
|