|
|
|
@ -14,6 +14,7 @@ import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.SpringUtil; |
|
|
|
import org.springblade.core.tool.utils.SpringUtil; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
import org.springblade.hzinfo_inspect.obj.entity.ObjectEntity; |
|
|
|
import org.springblade.hzinfo_inspect.obj.entity.ObjectEntity; |
|
|
|
import org.springblade.hzinfo_inspect.obj.entity.TemplateEntity; |
|
|
|
import org.springblade.hzinfo_inspect.obj.entity.TemplateEntity; |
|
|
|
import org.springblade.hzinfo_inspect.obj.services.ObjectService; |
|
|
|
import org.springblade.hzinfo_inspect.obj.services.ObjectService; |
|
|
|
@ -41,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
@ -101,15 +103,16 @@ public class PlanServiceImpl extends BaseServiceImpl<PlanMapper, PlanEntity> imp |
|
|
|
return remove(Wrappers.<PlanEntity>lambdaQuery().eq(PlanEntity::getId, id)); |
|
|
|
return remove(Wrappers.<PlanEntity>lambdaQuery().eq(PlanEntity::getId, id)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 保存巡检计划 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Boolean submit(PlanVO plan) { |
|
|
|
public Boolean submit(PlanVO plan) { |
|
|
|
checkInputParam(plan); |
|
|
|
checkInputParam(plan); |
|
|
|
boolean modify = plan.getId() != null; |
|
|
|
boolean modify = plan.getId() != null; |
|
|
|
PlanEntity entity = BeanUtil.copy(plan, PlanEntity.class); |
|
|
|
PlanEntity entity = BeanUtil.copy(plan, PlanEntity.class); |
|
|
|
|
|
|
|
if (StringUtil.isBlank(plan.getName())) { |
|
|
|
|
|
|
|
String nameSuffix = "0".equals(plan.getAutoVideo()) ? "日常检查" : "维护养护"; |
|
|
|
|
|
|
|
entity.setName(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日")) + nameSuffix); |
|
|
|
|
|
|
|
} |
|
|
|
//不管是新增还是修改成功后都为待提交状态
|
|
|
|
//不管是新增还是修改成功后都为待提交状态
|
|
|
|
entity.setStatus(Integer.valueOf(PlanContants.PlanStatusEnum.PLAN_SUBMIT.getStatus())); |
|
|
|
entity.setStatus(Integer.valueOf(PlanContants.PlanStatusEnum.PLAN_SUBMIT.getStatus())); |
|
|
|
boolean success = this.saveOrUpdate(entity); |
|
|
|
boolean success = this.saveOrUpdate(entity); |
|
|
|
|