备份
This commit is contained in:
parent
a1602cd909
commit
09f6961f03
@ -1,7 +1,13 @@
|
||||
package com.cm.inspection;
|
||||
|
||||
import com.cm.common.constants.ISystemConstant;
|
||||
import com.cm.common.plugin.oauth.service.user.IUserService;
|
||||
import com.cm.inspection.pojo.dtos.check.CheckDTO;
|
||||
import com.cm.inspection.service.check.ICheckService;
|
||||
import org.activiti.engine.*;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.joda.time.DateTime;
|
||||
import org.joda.time.format.DateTimeFormat;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
@ -9,6 +15,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 隐患排查系统
|
||||
*
|
||||
@ -20,8 +30,28 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
@MapperScan({"com.cm.**.dao"})
|
||||
public class InspectionApplication {
|
||||
|
||||
@Autowired
|
||||
private ICheckService checkService;
|
||||
@Autowired
|
||||
private IUserService userService;
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(InspectionApplication.class, args);
|
||||
SpringApplication.run(InspectionApplication.class, args);
|
||||
}
|
||||
|
||||
/**
|
||||
* 钉钉超时消息
|
||||
*/
|
||||
public void sendDingDingTimeoutMessage() {
|
||||
DateTime currentDateTime = DateTime.now();
|
||||
String currentDate = currentDateTime.toString(DateTimeFormat.forPattern(ISystemConstant.DATE_FORMATTER_YYYY_MM_DD));
|
||||
// 获取截止到当前时间,没有完成的案件
|
||||
Map<String, Object> params = new HashMap<>(16);
|
||||
params.put("currentDate", currentDate);
|
||||
params.put("isComplete", 0);
|
||||
List<CheckDTO> checkDTOs = checkService.listCheckSimple(params);
|
||||
// 找出超时的未完成案件
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public class CheckController extends AbstractController {
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("savecheck")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult saveCheck(@RequestBody CheckVO checkVO) throws Exception {
|
||||
public synchronized SuccessResult saveCheck(@RequestBody CheckVO checkVO) throws Exception {
|
||||
if (checkVO.getIsCoordination() == 1) {
|
||||
if (checkVO.getHiddenDangerReports().isEmpty()) {
|
||||
throw new ParamsException("检查项列表为空");
|
||||
@ -64,7 +64,7 @@ public class CheckController extends AbstractController {
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("saverecheck/{checkId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult saveReCheck(@PathVariable("checkId") String checkId, @RequestBody CheckVO checkVO) throws Exception {
|
||||
public synchronized SuccessResult saveReCheck(@PathVariable("checkId") String checkId, @RequestBody CheckVO checkVO) throws Exception {
|
||||
if (checkVO.getIsCoordination() == 1) {
|
||||
if (checkVO.getHiddenDangerReports().isEmpty()) {
|
||||
throw new ParamsException("检查项列表为空");
|
||||
@ -81,7 +81,7 @@ public class CheckController extends AbstractController {
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("saveinspect/{checkId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult saveInspect(@PathVariable("checkId") String checkId, @RequestBody InspectVO inspectVO) throws Exception {
|
||||
public synchronized SuccessResult saveInspect(@PathVariable("checkId") String checkId, @RequestBody InspectVO inspectVO) throws Exception {
|
||||
return checkService.saveInspect(checkId, inspectVO);
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ public class CheckController extends AbstractController {
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("updatecheck/{checkId}")
|
||||
@CheckRequestBodyAnnotation
|
||||
public SuccessResult updateCheck(@PathVariable("checkId") String checkId, @RequestBody CheckVO checkVO) throws Exception {
|
||||
public synchronized SuccessResult updateCheck(@PathVariable("checkId") String checkId, @RequestBody CheckVO checkVO) throws Exception {
|
||||
return checkService.updateCheck(checkId, checkVO);
|
||||
}
|
||||
|
||||
|
@ -87,6 +87,8 @@ public class CheckDTO implements Serializable {
|
||||
private String checkLat;
|
||||
@ApiModelProperty(name = "gmtCreate", value = "时间")
|
||||
private String gmtCreate;
|
||||
@ApiModelProperty(name = "creator", value = "创建人")
|
||||
private String creator;
|
||||
@ApiModelProperty(name = "checkItems", value = "检查列表")
|
||||
private List<CheckItemDTO> checkItems;
|
||||
|
||||
@ -355,6 +357,14 @@ public class CheckDTO implements Serializable {
|
||||
this.gmtCreate = gmtCreate;
|
||||
}
|
||||
|
||||
public String getCreator() {
|
||||
return creator == null ? "" : creator.trim();
|
||||
}
|
||||
|
||||
public void setCreator(String creator) {
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public List<CheckItemDTO> getCheckItems() {
|
||||
if (checkItems == null) {
|
||||
return new ArrayList<>();
|
||||
|
@ -37,6 +37,7 @@
|
||||
<result column="is_complete" property="isComplete"/>
|
||||
<result column="check_lng" property="checkLng"/>
|
||||
<result column="check_lat" property="checkLat"/>
|
||||
<result column="creator" property="creator"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="checkSimpleWithEnterpriseDTO" type="com.cm.inspection.pojo.dtos.check.CheckSimpleWithEnterpriseDTO">
|
||||
@ -445,6 +446,14 @@
|
||||
#{checkIdList[${index}]}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="currentDate != null and currentDate != ''">
|
||||
AND
|
||||
LEFT(gmt_create, 10) <![CDATA[ <= ]]> #{currentDate}
|
||||
</if>
|
||||
<if test="isComplete != null and isComplete != ''">
|
||||
AND
|
||||
is_complete = #{isComplete}
|
||||
</if>
|
||||
<if test="userIdList != null and userIdList.size > 0">
|
||||
AND
|
||||
creator IN
|
||||
|
Loading…
Reference in New Issue
Block a user