Compare commits

...

2 Commits

  1. 4
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/feign/InspectPlanClient.java
  2. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java
  3. 13
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java
  4. 46
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/DemoController.java
  5. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java

4
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/feign/InspectPlanClient.java

@ -24,6 +24,10 @@ public class InspectPlanClient implements IInspectPlanClient {
@PostMapping("/addPlanAndChecked")
@Override
public R<List<Long>> addPlanAndChecked(PlanVO plan) {
boolean flag=planService.checkName(plan.getName());
if(flag) {
return R.fail("交班巡检计划已存在");
}
return R.data(planService.addAndChecked(plan));
}
}

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/IPlanService.java

@ -61,4 +61,6 @@ public interface IPlanService extends BaseService<PlanEntity> {
List<PlanOfflineVO> getPlans(List<Long> planIds);
Boolean revoke(Long planId);
boolean checkName(String name);
}

13
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/plan/service/impl/PlanServiceImpl.java

@ -1,5 +1,6 @@
package com.hnac.hzinfo.inspect.plan.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.hnac.hzinfo.inspect.plan.vo.PlanOfflineVO;
import org.springblade.system.feign.ISysClient;
import com.alibaba.fastjson.JSON;
@ -123,6 +124,18 @@ public class PlanServiceImpl extends BaseServiceImpl<PlanMapper, PlanEntity> imp
return re;
}
@Override
public boolean checkName(String name) {
LambdaQueryWrapper<PlanEntity> uw = new LambdaQueryWrapper<>();
uw.eq(PlanEntity::getName,name);
uw.eq(PlanEntity::getIsDeleted,0);
List<PlanEntity> list=this.list(uw);
if(list!=null && !list.isEmpty()){
return true;
}
return false;
}
/**
* 保存巡检计划
*/

46
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/DemoController.java

@ -1,46 +0,0 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.hnac.hzims.operational.duty.controller;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* Demo控制器
*
* @author Chill
*/
@RefreshScope
@RestController
@RequestMapping("demo")
@Api(value = "配置接口", tags = "即时刷新配置")
public class DemoController {
//@Value("${duty.name}")
private String name;
@GetMapping("name")
public String getName() {
return name;
}
}

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java

@ -208,16 +208,6 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
Assert.isTrue(Func.isNotEmpty(managerId),() -> {
throw new ServiceException("获取值班班组长失败!");
});
//防止多次创建巡检任务
LambdaQueryWrapper<ImsDutyRecEntity> wrapper=new LambdaQueryWrapper<>();
wrapper.eq(ImsDutyRecEntity::getDutyId,recDTO.getDutyId());
wrapper.isNotNull(ImsDutyRecEntity::getInspectTaskId);
List<ImsDutyRecEntity> list=this.list(wrapper);
if(list!=null && !list.isEmpty()){
throw new ServiceException("接班巡检任务已创建,不能多次提交!");
}
// 新建巡检计划并获取巡检任务Id
PlanVO planVO = new PlanVO();
planVO.setRouteId(recDTO.getRouteId());

Loading…
Cancel
Save