Commit 8c13a0c3 authored by suhuiguang's avatar suhuiguang

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

# Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-maintenance-biz/src/main/java/com/yeejoin/amos/maintenance/business/param/CheckRecordParam.java
parents 9c503283 94fc52cf
......@@ -21,6 +21,8 @@ public class FailureDetailsDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "当前状态名")
private String currentStatusName;
@ApiModelProperty(value = "当前状态")
private Integer currentStatus;
......
......@@ -17,7 +17,9 @@ public enum OrderByEnum {
PLAN_TASK_NUM_ASC("计划维保设施数正序", "3", "taskPlanNum asc"),
PLAN_TASK_NUM_DESC("计划维保设施数倒序", "4", "taskPlanNum desc"),
FINISH_NUM_DESC("完成数倒序", "5", "finishNum desc"),
FINISH_NUM_ASC("完成数正序", "6", "finishNum asc");
FINISH_NUM_ASC("完成数正序", "6", "finishNum asc"),
DATE_DESC("维保记录时间倒序", "7", "checkDate desc"),
DATE_ASC("维保记录时间正序", "8", "checkDate asc");
/**
* 名字
......
......@@ -7,7 +7,7 @@ import java.util.Map;
public enum PlanTaskFinishStatusEnum {
NOTSTARTED("未开始",0),
UNDERWAY("待执行",1),
UNDERWAY("处理中",1),
FINISHED("已结束",2),
OVERTIME("已超时",3);
......
......@@ -70,7 +70,7 @@ public class DispatchConsultFeedbackDto extends BaseDto {
private String errorResult;
@ApiModelProperty(value = "备注")
private String remark;
private String Remark;
@ApiModelProperty(value = "维保反馈结果")
private String mainFeedbackResult;
......
......@@ -73,7 +73,7 @@ public class DispatchRepairFeedbackDto extends BaseDto {
private String errorResult;
@ApiModelProperty(value = "备注")
private String remark;
private String Remark;
@ApiModelProperty(value = "回访时间")
private Date feedbackTime;
......
......@@ -67,7 +67,7 @@ public class DispatchSaveFeedbackDto extends BaseDto {
private String errorResult;
@ApiModelProperty(value = "备注")
private String fixRemark;
private String Remark;
@ApiModelProperty(value = "回访时间")
private Date feedbackTime;
......
package com.yeejoin.amos.boot.module.common.biz.constats;
import java.util.HashMap;
import java.util.Map;
public class Constants {
public static final Map<Integer,String> currentStatusNameMap = new HashMap<>();
static {
currentStatusNameMap.put(0,"待审核");
currentStatusNameMap.put(1,"待提交");
currentStatusNameMap.put(2,"待维修");
currentStatusNameMap.put(3,"待验收");
currentStatusNameMap.put(4,"已拒绝");
currentStatusNameMap.put(5,"已完结");
}
}
package com.yeejoin.amos.boot.module.common.biz.controller;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto;
import com.yeejoin.amos.boot.module.common.biz.constats.Constants;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -20,21 +22,15 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FailureDetailsServiceImpl;
/*import com.yeejoin.amos.patrol.business.util.CommonResponse;
import com.yeejoin.amos.patrol.business.util.CommonResponseUtil;*/
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -70,8 +66,9 @@ public class FailureDetailsController extends BaseController {
result = failureDetailsServiceImpl.savemodel(model,getSelectedOrgInfo());
return ResponseHelper.buildResponse(result);
} catch (Exception e) {
e.printStackTrace();
// TODO Auto-generated catch block
return ResponseHelper.buildResponse("erro");
return ResponseHelper.buildResponse("error");
}
}
......@@ -113,7 +110,8 @@ public class FailureDetailsController extends BaseController {
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<FailureDetailsDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryBySeq(sequenceNbr));
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForOne(sequenceNbr));
}
/**
......@@ -126,13 +124,28 @@ public class FailureDetailsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<IPage<FailureDetails>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
public ResponseModel<IPage<FailureDetailsDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, @RequestParam Integer type) {
Page<FailureDetails> page = new Page<FailureDetails>();
page.setCurrent(current);
page.setSize(size);
final AgencyUserModel userInfo = getUserInfo();
return ResponseHelper.buildResponse(failureDetailsServiceImpl.queryForFailureDetailsPage(page,userInfo,type));
IPage<FailureDetailsDto> failureDetailDTOsIPage = new Page<>();
IPage<FailureDetails> failureDetailsIPage = failureDetailsServiceImpl.queryForFailureDetailsPage(page, userInfo, type);
BeanUtils.copyProperties(failureDetailsIPage,FailureDetailsDto.class);
List<FailureDetails> records = failureDetailsIPage.getRecords();
List<FailureDetailsDto> failureDetailsDtoList = new ArrayList<>();
records.forEach(failureDetails -> {
FailureDetailsDto failureDetailsDto = new FailureDetailsDto();
BeanUtils.copyProperties(failureDetails,failureDetailsDto);
failureDetailsDto.setCurrentStatusName(
Constants.currentStatusNameMap.get(failureDetails.getCurrentStatus()));
failureDetailsDtoList.add(failureDetailsDto);
});
failureDetailDTOsIPage.setRecords(failureDetailsDtoList);
return ResponseHelper.buildResponse(failureDetailDTOsIPage);
}
/**
......
......@@ -62,6 +62,7 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
this.createWithModel(model);
return model;
}*/
Integer auditResult = model.getAuditResult();
//根据审核的结果进行业务操作
if (auditResult.equals(AuditResultEnum.AGREE.getCode())) {
......@@ -97,6 +98,10 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
condition = AuditResultEnum.AGREE.getName();
repairlog(faultId,processAuditor,processTime,processDepartment,condition);
}
if (status.equals(AuditResultEnum.SEND_BACK)) {
condition = AuditResultEnum.SEND_BACK.getName();
repairlog(faultId,processAuditor,processTime,processDepartment,condition);
}
condition = AuditResultEnum.REFUSE.getName();
failureDetailsService.excuteTask(failureDetailsDto.getProcessId(), userInfo, condition);
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.biz.constats.Constants;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -24,12 +21,13 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.api.dto.FailureAuditDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureDetailsDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureRepairlogDto;
import com.yeejoin.amos.boot.module.common.api.dto.FailureStatusCountDto;
import com.yeejoin.amos.boot.module.common.api.entity.FailureDetails;
import com.yeejoin.amos.boot.module.common.api.entity.FailureRepairlog;
import com.yeejoin.amos.boot.module.common.api.enums.FailureStatuEnum;
......@@ -71,6 +69,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
IFailureRepairlogService failureRepairlog;
public static String EMERGENCY_COMMAND = "应急指挥科";
public static String[] PROCESS_NAME = {"提交维修单","审核","维修","验收"};
private final Logger logger = LoggerFactory.getLogger(FailureDetailsServiceImpl.class);
......@@ -130,6 +129,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
QueryWrapper<FailureDetails> wrapper = new QueryWrapper<>();
wrapper.eq("submission_pid",submissionPid);
wrapper.lt("current_status",FailureStatuEnum.REFUSE.getCode());
wrapper.lt("current_status",FailureStatuEnum.FINISH.getCode());
wrapper.lt("current_status",FailureStatuEnum.WAITING_AUDIT.getCode());
wrapper.orderByDesc("submission_time");
IPage<FailureDetails> failureDetailsPage = new Page<>(page.getCurrent(), page.getSize());
return baseMapper.selectPage(failureDetailsPage, wrapper);
......@@ -146,6 +147,19 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/**
* 根据状态查询
*/
public FailureDetailsDto queryForOne(Long sequenceNbr){
FailureDetailsDto failureDetailsDto = this.queryBySeq(sequenceNbr);
failureDetailsDto.setCurrentStatusName(
Constants.currentStatusNameMap.get(failureDetailsDto.getCurrentStatus()));
List<SourceFile> sourceFiles = sourceFileServiceImpl.findBySourceId(sequenceNbr);
failureDetailsDto.setAttachment(sourceFiles);
return failureDetailsDto ;
}
/**
* 根据状态查询
*/
public List<FailureDetails> queryForFailureStatus(Long currentStatus) {
String status = new String();
List<FailureStatuEnum> list = new ArrayList<>();
......@@ -189,12 +203,11 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
List<FailureStatusCountDto> list = new ArrayList<>();
// String[] statusName = new String[]{"待审核", "待提交", "待维修", "待验收", "已拒绝", "已完结"};
List<String> statusName = new ArrayList<>();
statusName.add("待审核");
statusName.add("待提交");
statusName.add("待维修");
statusName.add("待验收");
statusName.add("已拒绝");
statusName.add("已完结");
Collections.addAll(statusName, FailureStatuEnum.WAITING_AUDIT.getName(),
FailureStatuEnum.WAITING_SUBMIT.getName(),
FailureStatuEnum.WAITING_MAINTAIN.getName(),
FailureStatuEnum.WAITING_ACCEPTANCE.getName(),
FailureStatuEnum.REFUSE.getName());
for (int i = 0; i < failureDetailsDtos.size(); i++) {
if (failureDetailsDtos.get(i).getCurrentStatus().equals(FailureStatuEnum.WAITING_AUDIT.getCode())){
......@@ -290,9 +303,15 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
return false;
// return CommonResponseUtil.failure("添加失败");
}
if (ObjectUtils.isNotEmpty(model)) {
excuteTask(instance.getString("id"), userInfo, null);
try{
if (ObjectUtils.isNotEmpty(model)) {
excuteTask(instance.getString("id"), userInfo, null);
}
}catch (Exception e){
e.printStackTrace();
return false;
}
return true;
}
......@@ -461,7 +480,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
JSONObject object= workflowFeignService.queryHistoryTaskListByProcessId(processId);
JSONArray datArray=null;
if(ObjectUtils.isNotEmpty(object)) {
datArray=object.getJSONArray("data");
datArray=object.getJSONArray("rows");
}
List<Object> list = new ArrayList<Object>();
if(datArray!=null) {
......@@ -500,19 +519,19 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Map<String, Object> map = this.checkExcuteTaskAuthMap(sequenceNbr, userInfo);
if(Boolean.parseBoolean(map.get("checkFlag").toString())) {
String buttonValueString = map.get("name").toString();
if(buttonValueString.contains("提交保修单")) {
if(buttonValueString.contains(PROCESS_NAME[1])) { //提交维修单
flag=1;
}else if(buttonValueString.contains("审核")) {
}else if(buttonValueString.contains(PROCESS_NAME[2])) { //审核
flag=2;
}else if(buttonValueString.contains("维修")) {
}else if(buttonValueString.contains(PROCESS_NAME[3])) {//维修
flag=3;
}else if(buttonValueString.contains("验收")) {
}else if(buttonValueString.contains(PROCESS_NAME[4])) {//验收
flag=4;
}
}
FailureDetails details = this.baseMapper.selectById(sequenceNbr);
JSONObject object = workflowFeignService.queryTasksByProcessInstanceId(details.getProcessId());
JSONArray array = object.getJSONArray("data");
JSONObject object= workflowFeignService.queryHistoryTasksByProcessInstanceId(details.getProcessId());
JSONArray array= object.getJSONArray("rows");
for (Object historyDetail : array) {
JSONObject historyDetailJson= JSONObject.parseObject(JSONObject.toJSONString(historyDetail));
if("rejected".equals(historyDetailJson.getString("activityId"))) {
......
......@@ -178,7 +178,6 @@ public class CommonController extends AbstractBaseController {
return CommonResponseUtil.success(users);
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询公司下的风险模型(厂区、区域、风险点)")
@GetMapping(value = "/riskSource/list/{orgCode}",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public CommonResponse getRiskSourceList(@PathVariable String orgCode){
......
......@@ -10,11 +10,13 @@ import com.yeejoin.amos.maintenance.business.service.intfc.ICheckService;
import com.yeejoin.amos.maintenance.business.util.*;
import com.yeejoin.amos.maintenance.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.maintenance.business.vo.CheckInfoVo;
import com.yeejoin.amos.maintenance.common.enums.OrderByEnum;
import com.yeejoin.amos.maintenance.core.async.AsyncTask;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.request.CommonRequest;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.maintenance.core.common.response.GraphInitDataResponse;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import com.yeejoin.amos.maintenance.core.util.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -29,6 +31,7 @@ import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.servlet.http.HttpServletResponse;
......@@ -196,10 +199,7 @@ public class CheckController extends AbstractBaseController {
public CommonResponse saveCheckRecord(
@ApiParam(value = "检查信息") @RequestBody CheckRecordParam requestParam) {
try {
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getOrgCode(reginParams);
requestParam.setOrgCode(orgCode);
CheckDto checkDto = checkService.saveCheckRecord(requestParam, reginParams);
CheckDto checkDto = checkService.saveCheckRecord(requestParam, getSelectedOrgInfo());
return CommonResponseUtil.success(checkDto);
} catch (Exception e) {
log.error(e.getMessage(), e);
......@@ -480,4 +480,46 @@ public class CheckController extends AbstractBaseController {
@ApiParam(value = "源ids,逗号分隔", required = true) @PathVariable String... relationId) {
return CommonResponseUtil.success(checkService.obtainLastCheckRecord(relationId));
}
@PersonIdentify(isNeedIdentity = true)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保记录分页查询", notes = "维保记录分页查询")
@GetMapping(value = "/page")
public CommonResponse getCheckRecord(
@ApiParam(value = "查询范围") @RequestParam(value = "userId", required = false) String userId,
@ApiParam(value = "时间范围") @RequestParam(value = "timeType", required = false) String timeType,
@ApiParam(value = "维保结果") @RequestParam(value = "result", required = false) String result,
@ApiParam(value = "排序规则") @RequestParam(value = "orderRule", required = false) String orderRule,
@ApiParam(value = "开始时间") @RequestParam(value = "beginTime", required = false) String beginTime,
@ApiParam(value = "结束时间") @RequestParam(value = "endTime", required = false) String endTime,
@ApiParam(value = "维保人员") @RequestParam(value = "personId", required = false) String person,
@ApiParam(value = "业主单位") @RequestParam(value = "teamId", required = false) String teamId,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception{
HashMap<String, Object> params = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
Map<String, Object> authMap = Bean.BeantoMap(reginParams.getPersonIdentity());
params.putAll(authMap);
params.put("userId", userId);
params.put("timeType", timeType);
params.put("result", result);
params.put("orderRule", OrderByEnum.getEumByCode(orderRule).getOderBy());
params.put("beginTime", beginTime);
params.put("endTime", endTime);
params.put("person", person);
params.put("teamId", teamId);
params.put("orgCode", loginOrgCode);
CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
return CommonResponseUtil.success(checkService.getCheckPage(params, pageable));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保记录详情", notes = "维保记录详情")
@GetMapping(value = "/detail/{id}")
public CommonResponse getCheckDetail(
@ApiParam(value = "记录Id") @PathVariable(value = "id") String id) throws Exception{
return CommonResponseUtil.success(checkService.getCheckDetail(id));
}
}
......@@ -46,7 +46,6 @@ public class PlanTaskController extends AbstractBaseController {
/**
* 计划执行查询
*
* @param queryRequests
* @param commonPageable
* @return
......@@ -186,6 +185,27 @@ public class PlanTaskController extends AbstractBaseController {
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保设施分页列表-mobile", notes = "维保设施分页列表-mobile")
@RequestMapping(value = "/point/{planTaskId}/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryPlanTaskById(
@ApiParam(value = "巡检计划任务ID", required = true) @PathVariable Long planTaskId,
@ApiParam(value = "建筑id", required = true) @RequestParam(value = "buildingId", required = false) String buildingId,
@ApiParam(value = "维保状态", required = true) @RequestParam(value = "isFinish", required = false) String isFinish,
@ApiParam(value = "消防系统id", required = true) @RequestParam(value = "systemId", required = false) String systemId,
@ApiParam(value = "设备编号", required = true) @RequestParam(value = "pointNo", required = false) String pointNo,
@ApiParam(value = "设备名称", required = true) @RequestParam(value = "pointName", required = false) String pointName
) {
Map<String, Object> param = new HashMap<>();
param.put("planTaskId", planTaskId);
param.put("buildingId", buildingId);
param.put("isFinish", isFinish);
param.put("systemId", systemId);
param.put("pointNo", pointNo);
param.put("pointName", pointName);
return CommonResponseUtil.success(planTaskService.getPlanTaskPoints(param));
}
/**
* 查询任务列表
*
......@@ -221,30 +241,8 @@ public class PlanTaskController extends AbstractBaseController {
return CommonResponseUtil.success(planTaskService.getPlanTasks(params, pageable));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保设施分页列表-mobile", notes = "维保设施分页列表-mobile")
@RequestMapping(value = "/point/{planTaskId}/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryPlanTaskById(
@ApiParam(value = "巡检计划任务ID", required = true) @PathVariable Long planTaskId,
@ApiParam(value = "建筑id") @RequestParam(value = "buildingId", required = false) String buildingId,
@ApiParam(value = "维保状态") @RequestParam(value = "isFinish", required = false) String isFinish,
@ApiParam(value = "消防系统id") @RequestParam(value = "systemId", required = false) String systemId,
@ApiParam(value = "设备编号") @RequestParam(value = "pointNo", required = false) String pointNo,
@ApiParam(value = "设备名称") @RequestParam(value = "pointName", required = false) String pointName
) {
Map<String, Object> param = new HashMap<>();
param.put("planTaskId", planTaskId);
param.put("buildingId", buildingId);
param.put("isFinish", isFinish);
param.put("systemId", systemId);
param.put("pointNo", pointNo);
param.put("pointName", pointName);
return CommonResponseUtil.success(planTaskService.getPlanTaskPoints(param));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询维保设施,检查内容详情-mobile")
@ApiOperation(value = "查询维保设施,检查内容详情")
@GetMapping(value = "/task-point-detail")
public CommonResponse planTaskPointDetail(
@RequestParam(value = "routePointId") String routePointId,
......
......@@ -277,4 +277,10 @@ public interface CheckMapper extends BaseMapper {
//Map<String, String> queryUserInfoByIds(@Param(value = "userIds") String userIds);
long getCheckCount(HashMap<String, Object> params);
List<HashMap<String, Object>> getChecks(HashMap<String, Object> params);
Map<String, Object> getCheckDetail(@Param(value = "id") String id);
}
package com.yeejoin.amos.maintenance.business.dto;
import com.yeejoin.amos.maintenance.common.enums.LatentDangerExcuteTypeEnum;
import lombok.Data;
@Data
public class DangerExecuteSubmitDto extends ExecuteSubmitDto{
private String pointOriginalId;
private Long pointId;
private String dangerName;
private Long dangerId;
private LatentDangerExcuteTypeEnum executeTypeEnum;
}
package com.yeejoin.amos.maintenance.business.entity.mybatis.extend;
import lombok.Data;
@Data
public class RiskJudgmentFillRecordExtend {
/**
* 唯一标识
*/
private String itemFlag;
/**
* 风险研判项级别
*/
private Integer itemLevel;
/**
* 风险研判项类型(1:风险研判表;2:风险研判采集表)
*/
private Integer itemType;
/**
* 节点名称
*/
private String itemName;
/**
* 父节点编号
*/
private Long itemParentId;
private Integer itemCanCopy;
/**
* 选项名称
*/
private String selectName;
/**
* 选项是否需要(0:否;1:是)
*/
private Integer selectIsNeed;
/**
* 选项是否必选(0:否;1:是)
*/
private Integer selectIsRequired;
/**
* 选项json[{"id":1,"name":"否"}]
*/
private String selectJson;
/**
* 输入项名称
*/
private String inputName;
private Integer inputType;
private Integer inputCanEdit;
/**
* 输入是否需要(0:否;1:是)
*/
private Integer inputIsNeed;
/**
* 输入项是否必填(0:否;1:是)
*/
private Integer inputIsRequired;
/**
* 备注是否需要(0:否;1:是)
*/
private Integer remarkIsNeed;
/**
* 备注是否必填(0:否;1:是)
*/
private Integer remarkIsRequired;
/**
* 拍照是否需要(0:否;1:是)
*/
private Integer photoIsNeed;
/**
* 拍照是否必填(0:否;1:是)
*/
private Integer photoIsRequired;
}
......@@ -14,8 +14,10 @@ import java.util.List;
@AllArgsConstructor
@NoArgsConstructor
public class CheckInputParam {
private Long inputItemId;
private long inputItemId;
private String inputValue;
private String selectName;
private boolean isCheck;
private String remark;
private Long routePointItemId;
private List<CheckShotDto> checkInputShot;
......
......@@ -15,27 +15,27 @@ import java.util.List;
@ApiModel(value = "任务提交")
public class CheckRecordParam {
@ApiModelProperty(value = "任务id", required = true)
private Long planTaskId;
@ApiModelProperty(value = "任务id",required = true)
private Long planTaskId;
@ApiModelProperty(value = "点id", required = true)
private Long pointId;
@ApiModelProperty(value = "点id",required = true)
private Long pointId;
@ApiModelProperty(value = "任务id,非必输")
@ApiModelProperty(value = "组织机构",required = false)
private String orgCode;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "维保日期,非必输")
private String checkTime;
@ApiModelProperty(value = "路线id")
private Long routeId;
@ApiModelProperty(value = "路线id,非必输")
private Long routeId;
@ApiModelProperty(value = "检查时间")
private String checkTime;
/**
* 检查项
*/
@ApiModelProperty(value = "检查项", required = true)
private List<CheckInputParam> checkItems;
/**
* 检查项
*/
@ApiModelProperty(value = "检查项",required = true)
private List<CheckInputParam> checkItems;
}
package com.yeejoin.amos.maintenance.business.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.AppVersionDao;
import com.yeejoin.amos.maintenance.business.dao.repository.IMsgSubscribeDao;
......@@ -10,7 +8,6 @@ import com.yeejoin.amos.maintenance.business.param.UserMsgInitParam;
import com.yeejoin.amos.maintenance.business.service.intfc.IAppService;
import com.yeejoin.amos.maintenance.business.service.intfc.IMsgSubscribeService;
import com.yeejoin.amos.maintenance.common.enums.MsgSubscribeTypeEnum;
import com.yeejoin.amos.maintenance.common.enums.YesOrNoEnum;
import com.yeejoin.amos.maintenance.dao.entity.AppVersion;
import com.yeejoin.amos.maintenance.dao.entity.MsgSubscribe;
import org.assertj.core.util.Lists;
......@@ -29,7 +26,6 @@ public class AppServiceImpl implements IAppService {
private AppVersionDao appVersionDao;
@Autowired
private IMsgSubscribeService msgSubscribeService;
@Autowired
private PlanTaskMapper planTaskMapper;
......
......@@ -35,6 +35,7 @@ import com.yeejoin.amos.maintenance.common.enums.CheckStatusEnum;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.maintenance.common.enums.PointLevelEnum;
import com.yeejoin.amos.maintenance.common.enums.PointStatusEnum;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.response.*;
import com.yeejoin.amos.maintenance.core.util.DateUtil;
import com.yeejoin.amos.maintenance.core.util.StringUtil;
......@@ -159,10 +160,8 @@ public class CheckServiceImpl implements ICheckService {
checkInput.setOrgCode(recordParam.getOrgCode());
checkInput.setInputId(inputItem.getId());
checkInput.setInputName(inputItem.getName());
checkInput.setInputValue(item.getInputValue());
checkInput.setOrderNo(inputItem.getOrderNo());
checkInput.setRemark(item.getRemark());
checkInput.setRoutePointItemId(item.getRoutePointItemId());
//1.校验结果
if (XJConstant.INPUT_ITEM_SELECT.equals(inputItem.getItemType())) {
paraseSelect(checkInput, inputItem.getDataJson(), item, inputItem.getIsScore());
......@@ -184,6 +183,8 @@ public class CheckServiceImpl implements ICheckService {
} else {
checkInput.setIsOk(CheckStatusEnum.QUALIFIED.getCode());
}
checkInput.setRoutePointItemId(item.getRoutePointItemId());
checkInput.setInputValue(item.getInputValue());
score += checkInput.getScore();
for (CheckShotDto shotDto : item.getCheckInputShot()) {
CheckShot img = new CheckShot();
......@@ -217,7 +218,7 @@ public class CheckServiceImpl implements ICheckService {
Check finalCheck = check;
//4.检查项入库
checkItemList.forEach(checkInput -> checkInput.setCheckId(finalCheck.getId()));
if (!checkItemList.isEmpty()) {
if(!checkItemList.isEmpty()){
checkInputDao.saveAll(checkItemList);
}
List<CheckShot> allShot = new ArrayList<>();
......@@ -245,7 +246,7 @@ public class CheckServiceImpl implements ICheckService {
private void checkCanFinishTask(String mtUserSeq, PlanTask planTask, Long pointId) throws Exception {
int status;
int count = checkService.checkHasRecord(planTask.getId(), pointId);
if (count > 0) {
if(count > 0){
throw new RuntimeException("任务已执行,不能重复执行");
}
if (!ToolUtils.transBeanList(planTask.getUserId()).contains(mtUserSeq)) {
......@@ -1030,6 +1031,31 @@ public class CheckServiceImpl implements ICheckService {
}
@Override
public Page<HashMap<String, Object>> getCheckPage(HashMap<String, Object> params, CommonPageable page) {
List<HashMap<String, Object>> content = Lists.newArrayList();
long total = checkMapper.getCheckCount(params);
if (total == 0) {
return new PageImpl<>(content, page, total);
}
params.put("offset", page.getOffset());
params.put("pageSize", page.getPageSize());
content = checkMapper.getChecks(params);
if (0 < content.size()) {
for(HashMap<String, Object> map : content) {
if (map.containsKey("isOk")) {
map.put("status", CheckStatusEnum.getEnum(String.valueOf(map.get("isOk"))).getName());
}
}
}
return new PageImpl<>(content, page, total);
}
@Override
public Map<String, Object> getCheckDetail(String id) {
return checkMapper.getCheckDetail(id);
}
@Override
public List<HashMap<String, Object>> getEquipInputByCheckId(CheckDetailInputPageParam param) {
// 如果不传巡检ID,则获取最新一条巡检点对应的巡检记录ID
if (param.getCheckID() == -1) {
......
......@@ -24,7 +24,6 @@ import com.yeejoin.amos.maintenance.business.util.Toke;
import com.yeejoin.amos.maintenance.business.vo.CalDateVo;
import com.yeejoin.amos.maintenance.business.vo.LeavePlanTaskVo;
import com.yeejoin.amos.maintenance.business.vo.PlanTaskVo;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
......@@ -570,10 +569,6 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
params.put("offset", pageParam.getOffset());
params.put("pageSize", pageParam.getPageSize());
content = planTaskMapper.getPlanTasks(params);
content.forEach(r->{
String finishStatusDesc = PlanTaskFinishStatusEnum.getName(Integer.parseInt(r.get("finishStatus").toString()));
r.put("finishStatusDesc",finishStatusDesc);
});
return new PageImpl<>(content, pageParam, total);
}
......
package com.yeejoin.amos.maintenance.business.service.intfc;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import org.springframework.data.domain.Page;
import org.springframework.transaction.annotation.Transactional;
import com.yeejoin.amos.boot.biz.common.bo.DepartmentBo;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.maintenance.business.dto.CheckDto;
import com.yeejoin.amos.maintenance.business.dto.CheckRecordDto;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckDetailBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckInfoBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckInputBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckTraListBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckUserBo;
import com.yeejoin.amos.maintenance.business.entity.mybatis.PlanRoutePointBo;
import com.yeejoin.amos.maintenance.business.param.CheckInfoListPageParam;
import com.yeejoin.amos.maintenance.business.param.CheckInfoPageParam;
import com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam;
import com.yeejoin.amos.maintenance.business.param.CheckRecordParam;
import com.yeejoin.amos.maintenance.business.param.CheckStatisticalParam;
import com.yeejoin.amos.maintenance.business.entity.mybatis.*;
import com.yeejoin.amos.maintenance.business.param.*;
import com.yeejoin.amos.maintenance.business.util.CheckDetailInputPageParam;
import com.yeejoin.amos.maintenance.business.util.Toke;
import com.yeejoin.amos.maintenance.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.maintenance.business.vo.CheckInfoVo;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.maintenance.core.common.response.CommonPage;
import com.yeejoin.amos.maintenance.core.common.response.GraphInitDataResponse;
import com.yeejoin.amos.maintenance.core.common.response.QueryCriteriaRespone;
import com.yeejoin.amos.maintenance.dao.entity.CheckShot;
import com.yeejoin.amos.maintenance.exception.YeeException;
import org.springframework.data.domain.Page;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface ICheckService {
/**
......@@ -269,6 +256,9 @@ public interface ICheckService {
*/
Map<String,CheckRecordDto> obtainLastCheckRecord(String[] relationId);
Page<HashMap<String, Object>> getCheckPage(HashMap<String, Object> map, CommonPageable pageable);
Map<String, Object> getCheckDetail(String id);
/**
* 校验是否已经填写过
* @param planTaskId
......
......@@ -15,8 +15,9 @@ public class CheckParamUtil {
String operator = daoCriteria.getOperator();
String name = daoCriteria.getPropertyName();
if("checkTime".equals(name)){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
param.setCheckTime(daoCriterias.get(i).getValue().toString());
} else if("routeId".equals(name)){
}else if("routeId".equals(name)){
param.setRouteId(Long.valueOf(daoCriterias.get(i).getValue().toString()));
}else if("orgCode".equals(name) && operator.equals(QueryOperatorEnum.EQUAL.getName())){
param.setOrgCode(daoCriterias.get(i).getValue().toString()+"%");
......
//package com.yeejoin.amos.maintenance.common.remote;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import com.google.common.collect.Maps;
//import com.yeejoin.amos.maintenance.business.constants.XJConstant;
//import com.yeejoin.amos.maintenance.business.util.HttpUtil;
//import com.yeejoin.amos.maintenance.common.enums.WorkFlowRiskFactorUriEnum;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Service;
//import org.springframework.util.StringUtils;
//
//import java.util.Map;
//
//@Service("remoteSpcService")
//public class RemoteRiskFactorFlowService {
//
// private final Logger logger = LoggerFactory.getLogger(RemoteRiskFactorFlowService.class);
//
// /* @Value("${params.spc.address}")
// private String address;*/
//
// private static final String success = "SUCCESS";
//
// private String buildUrl(String address, WorkFlowRiskFactorUriEnum workFlowRiskFactorUriEnum, Map<String, String> map) {
// String uri = workFlowRiskFactorUriEnum.getUri();
// String params = workFlowRiskFactorUriEnum.getParams();
// if (!StringUtils.isEmpty(params) && map != null) {
// String[] paramsArr = params.split(",");
// for (String param : paramsArr) {
// uri = uri.replace("{" + param + "}", map.get(param));
// }
// }
// return address + uri;
// }
//
// private JSONObject handleResult(String resultStr) {
// if (resultStr == null) {
// return null;
// }
// JSONObject json = JSON.parseObject(resultStr);
// if (success.equals(json.getString("result"))) {
// return json;
// }
// return null;
// }
//
// /* public JSONObject wakeUpRiskFactorFlow(String pointClassifyOriginalId, String token) {
// String url = buildUrl(address, WorkFlowRiskFactorUriEnum.唤起流程, null);
// JSONObject body = new JSONObject();
// body.put("riskFactorId", pointClassifyOriginalId);
// Map<String, String> headerMap = Maps.newHashMap();
// headerMap.put(XJConstant.TOKEN_KEY, token);
// String resultStr = HttpUtil.sendHttpPostJsonWithHeader(url, body.toJSONString(), headerMap);
// return handleResult(resultStr);
// }
//*/
//
//}
package com.yeejoin.amos.boot.module.tzs.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordFile;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.VoiceRecordFileServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.Calendar;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.UUID;
/**
* 通话记录附件
......@@ -41,9 +40,6 @@ public class VoiceRecordFileController extends BaseController {
@Autowired
VoiceRecordFileServiceImpl voiceRecordFileServiceImpl;
@Autowired
AlertCalledServiceImpl iAlertCalledService;
/**
* 新增通话记录附件
*
......@@ -53,26 +49,8 @@ public class VoiceRecordFileController extends BaseController {
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增通话记录附件", notes = "新增通话记录附件")
public ResponseModel<VoiceRecordFileDto> save(@RequestBody VoiceRecordFileDto model) {
if (ValidationUtil.isEmpty(model.getAlertId())
|| ValidationUtil.isEmpty(model.getTel())){
throw new BadRequest("参数校验失败.");
}
Calendar startTime = Calendar.getInstance();
Calendar endTime = Calendar.getInstance();
endTime.add(Calendar.MINUTE, 6);
model.setTelStartTime(startTime.getTime());
model.setTelEndTime(endTime.getTime());
model.setFilePath(UUID.randomUUID().toString().replace("-",""));
model.setFileType("");
model.setSourceId(-1l);
AlertCalledFormDto alertDto = iAlertCalledService.selectAlertCalledByIdNoCache(model.getAlertId());
if(alertDto == null || alertDto.getAlertCalledDto() == null) {
throw new BadRequest("未找到相关警情");
}
model.setAlertStage(alertDto.getAlertCalledDto().getAlertStage());
model.setAlertStageCode(alertDto.getAlertCalledDto().getAlertStageCode());
model = voiceRecordFileServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
model = voiceRecordFileServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
......
......@@ -35,9 +35,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 派遣单服务实现类
......@@ -224,6 +222,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchSaveFeedbackDto.setFeedbackCode(dispatchPaper.getFeedbackCode());
dispatchSaveFeedbackDto.setFeedbackType(dispatchPaper.getFeedbackType());
dispatchSaveFeedbackDto.setFeedbackFinishTime(dispatchPaper.getFeedbackFinishTime());
dispatchSaveFeedbackDto.setRemark(dispatchPaper.getRemark());
if(StringUtils.isBlank(dispatchPaper.getFeedbackUid())) {
dispatchSaveFeedbackDto.setFeedbackUid(null);
} else {
......@@ -296,10 +295,6 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
value = alertFormValue.getFieldValueCode();
dispatchSaveFeedbackDto.setErrorResult(value);
break;
case "fix_remark":
value = alertFormValue.getFieldValueCode();
dispatchSaveFeedbackDto.setFixRemark(value);
break;
}
});
......@@ -342,10 +337,6 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getSaveFeedbackResult()))
alertFormValue.setFieldValue(dispatchSaveFeedbackDto.getSaveFeedbackResult());
break;
case "fix_remark":
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getFixRemark()))
alertFormValue.setFieldValue(dispatchSaveFeedbackDto.getFixRemark());
break;
case "fix_result":
if (StringUtils.isNotBlank(dispatchSaveFeedbackDto.getFixResult())) {
QueryWrapper<DataDictionary> queryWrapper = new QueryWrapper<>();
......@@ -371,6 +362,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchPaper.setFeedbackFinishTime(dispatchSaveFeedbackDto.getFeedbackFinishTime());
dispatchPaper.setFeedbackUid(dispatchSaveFeedbackDto.getFeedbackUid());
dispatchPaper.setFeedbackUname(dispatchSaveFeedbackDto.getFeedbackUname());
dispatchPaper.setRemark(dispatchSaveFeedbackDto.getRemark());
if(dispatchPaper.getFeedbackTime() == null && dispatchSaveFeedbackDto.getFeedbackTime() != null) {
// 维修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
......@@ -510,13 +502,19 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
// 动态字段
List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Map<String,Boolean> tempMap = new HashMap<String,Boolean>();
dynamicFormAlert.stream().forEach(alertFormValue -> {
switch (alertFormValue.getFieldCode()) {
case "fix_feedback_time":
if (dispatchRepairFeedbackDto.getFixFeedbackTime() != null) {
if(alertFormValue.getFieldValue() == null) {
tempMap.put("BXFK",true);
// 报修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到报修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchRepairFeedbackDto.getAlertId(),"BXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchRepairFeedbackDto.getAlertId(),"BXFK",taskId,user);
}
alertFormValue.setFieldValue(sdf.format(dispatchRepairFeedbackDto.getFixFeedbackTime()));
}
......@@ -578,14 +576,6 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchPaper.setFeedbackUname(dispatchRepairFeedbackDto.getFeedbackUname());
dispatchPaper.setRemark(dispatchRepairFeedbackDto.getRemark());
if(dispatchPaper.getFeedbackTime() == null && dispatchRepairFeedbackDto.getFeedbackTime() != null) {
tempMap.put("FEEDBACK",true);
}
dispatchPaper.setFeedbackTime(dispatchRepairFeedbackDto.getFeedbackTime());
// 保存动态表单数据
iAlertFormValueService.updateBatchById(dynamicFormAlert);
// 保存派遣表
flag = this.updateById(dispatchPaper);
if(tempMap.get("FEEDBACK") != null) {
// 维修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
......@@ -595,16 +585,11 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchRepairFeedbackDto.getAlertId(),"WXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchRepairFeedbackDto.getAlertId(),"WXFK",taskId,user);
}
if(tempMap.get("BXFK") != null) {
// 报修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchRepairFeedbackDto.getAlertId(),"BXFK",taskId,user);
// 修改警情到报修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchRepairFeedbackDto.getAlertId(),"BXFK");
}
dispatchPaper.setFeedbackTime(dispatchRepairFeedbackDto.getFeedbackTime());
// 保存动态表单数据
iAlertFormValueService.updateBatchById(dynamicFormAlert);
// 保存派遣表
flag = this.updateById(dispatchPaper);
return flag;
}
......@@ -725,13 +710,19 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
// 动态字段
List<AlertFormValue> dynamicFormAlert = dispatchPaperFormDto.getDynamicFormAlert();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Map<String,Boolean> tempMap = new HashMap<String,Boolean>();
dynamicFormAlert.stream().forEach(alertFormValue -> {
switch (alertFormValue.getFieldCode()) {
case "consult_feedback_time":
if (dispatchConsultFeedbackDto.getConsultFeedbackTime() != null) {
if(alertFormValue.getFieldValue() == null ) {
tempMap.put("TSRFK",true);
// 投诉人反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到投诉人反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchConsultFeedbackDto.getAlertId(),"TSRFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),"TSRFK",taskId,user);
}
alertFormValue.setFieldValue(sdf.format(dispatchConsultFeedbackDto.getConsultFeedbackTime()));
}
......@@ -780,7 +771,14 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchPaper.setFeedbackCode(dispatchConsultFeedbackDto.getFeedbackCode());
dispatchPaper.setFeedbackType(dispatchConsultFeedbackDto.getFeedbackType());
if(dispatchPaper.getFeedbackTime() == null && dispatchConsultFeedbackDto.getFeedbackTime() != null) {
tempMap.put("FEEDBACK",true);
// 维修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到维修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchConsultFeedbackDto.getAlertId(),"WXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),"WXFK-TS",taskId,user);
}
dispatchPaper.setFeedbackTime(dispatchConsultFeedbackDto.getFeedbackTime());
dispatchPaper.setFeedbackFinishTime(dispatchConsultFeedbackDto.getFeedbackFinishTime());
......@@ -791,26 +789,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
iAlertFormValueService.updateBatchById(dynamicFormAlert);
// 保存派遣表
flag = this.updateById(dispatchPaper);
if(tempMap.get("FEEDBACK") != null) {
// 维修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
// 修改警情到维修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchConsultFeedbackDto.getAlertId(),"WXFK");
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),"WXFK-TS",taskId,user);
}
if(tempMap.get("TSRFK") != null) {
// 修改警情到投诉人反馈
// 投诉人反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) {
throw new BadRequest("未找到反馈任务单");
}
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchConsultFeedbackDto.getAlertId(),"TSRFK",taskId,user);
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchConsultFeedbackDto.getAlertId(),"TSRFK");
}
return flag;
}
......
......@@ -1890,4 +1890,162 @@
d.date
</select>
<select id="getChecks" resultType="Map">
SELECT * FROM (
SELECT
pc.id checkId,
pc.user_id userId,
pc.is_ok isOk,
pp.owner_id ownerId,
date_format(
pc.check_time,
'%Y-%m-%d %H:%i:%s'
) checkDate,
pp.id pointId,
pp.equipment_id equipmentId,
pp.equipment_name equipmentName,
pp.belong_system_id systemId,
pp.belong_system_name systemName,
pp.address address,
CONCAT(pp.address, pp.building_name) buildingName
FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id
) a
<include refid="mobile-check-record-where" />
limit #{offset},#{pageSize}
</select>
<sql id="mobile-check-record-where">
<where>
<if test="userId != null and userId > 0 "> and find_in_set(#{userId},a.userId)>0</if>
<if test="timeType != null and timeType != '' and timeType == '1' ">
<include refid="mobile-check-time-today"></include>
</if>
<if test="timeType != null and timeType != '' and timeType == '2' ">
<include refid="mobile-check-time-tomorrow"></include>
</if>
<if test="timeType != null and timeType != '' and timeType == '3' ">
<include refid="mobile-check-time-week"></include>
</if>
<if test="timeType != null and timeType != '' and timeType == '4' ">
<include refid="mobile-check-time-last-week"></include>
</if>
<if test="timeType != null and timeType != '' and timeType == '5' ">
<include refid="mobile-check-time-month"></include>
</if>
<if test="timeType != null and timeType != '' and timeType == '5' ">
<include refid="mobile-check-time-last-month"></include>
</if>
<if test="finishStatus != null"> and a.finishStatus = #{finishStatus}</if>
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != '' ">
AND (
(
a.beginTime <![CDATA[>=]]> #{beginTime}
AND a.endTime <![CDATA[<=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{endTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{beginTime}
AND a.endTime <![CDATA[>]]> #{beginTime}
)
OR (
a.beginTime <![CDATA[<=]]> #{beginTime}
AND a.endTime <![CDATA[>=]]> #{endTime}
)
)
</if>
<choose>
<when test="identityType==1">
And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} )
<if test="companyId != null"> and a.ownerId = #{teamId}</if>
</when>
<when test="identityType==2">
And a.ownerId = #{teamId}
</when>
</choose>
</where>
<if test="orderRule != null and orderRule != ''"> order by ${orderRule} </if>
</sql>
<sql id="mobile-check-time-today">
and to_days(a.checkDate)= to_days(now())
</sql>
<sql id="mobile-check-time-tomorrow">
and to_days(now())-to_days(a.checkDate) <![CDATA[<=]]> 1
</sql>
<sql id="mobile-check-time-week">
and YEARWEEK(date_format(a.checkDate, '%Y-%m-%d')) = YEARWEEK(now())
</sql>
<sql id="mobile-check-time-last-week">
and YEARWEEK(date_format(a.checkDate, '%Y-%m-%d')) = YEARWEEK(now())-1
</sql>
<sql id="mobile-check-time-month">
and date_format(a.checkDate,'%Y-%m')=date_format(now(),'%Y-%m')
</sql>
<sql id="mobile-check-time-last-month">
and date_format(a.checkDate,'%Y-%m')=date_format(DATE_SUB(curdate(), INTERVAL 1 MONTH),'%Y-%m')
</sql>
<select id="getCheckCount" resultType="long">
SELECT COUNT(1) checkCount
FROM (
SELECT
pc.id checkId,
pc.user_id userId,
pc.is_ok isOk,
pp.owner_id ownerId,
date_format(
pc.check_time,
'%Y-%m-%d %H:%i:%s'
) checkDate,
pp.id pointId,
pp.equipment_id equipmentId,
pp.equipment_name equipmentName,
pp.belong_system_id systemId,
pp.belong_system_name systemName,
pp.address address,
CONCAT(pp.address, pp.building_name) buildingName
FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id
) a
<include refid="mobile-check-record-where" />
</select>
<select id="getCheckDetail" resultType="Map">
SELECT
pc.id checkId,
pc.is_ok isOk,
date_format(
pc.check_time,
'%Y-%m-%d %H:%i:%s'
) maintenanceDate,
pp.id pointId,
pp.equipment_id equipmentId,
pp.owner_name ownerName,
pp.equipment_name equipmentName,
pp.belong_system_id systemId,
pp.belong_system_name systemName,
CONCAT(pp.address, pp.building_name) address,
CONCAT(date_format(
ppl.plan_begin,
'%Y-%m-%d %H:%i:%s'
), '-', date_format(
ppl.plan_end,
'%Y-%m-%d %H:%i:%s'
)) planDate,
ppl.name planName,
pp.plan_type planType,
ppt.user_name planUser,
pii.name itemName
FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id
LEFT JOIN p_plan ppl ON ppl.id = pc.plan_id
LEFT JOIN p_check_input pci ON pci.check_id = pc.id
LEFT JOIN p_input_item pii ON pii.id = pci.input_id
LEFT JOIN p_plan_task ppt ON ppt.id = pc.plan_task_id
WHERE
pc.id = #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -178,6 +178,7 @@
pt.id planTaskId,
pt.org_code orgCode,
p.name taskName,
pt.status,
pt.user_id userId,
date_format(
pt.begin_time,
......@@ -338,11 +339,9 @@
<select id="getPlanTaskPoints" resultType="Map">
SELECT
ptd.id,
p.id as pointId,
p.name,
p.point_no pointNo,
concat_ws('',p.building_name,p.address) as position,
p.belong_system_id as belongSystemId,
concat_ws(' ',p.building_name,p.address) as position,
p.belong_system_name as belongSystemName,
ptd.status,
ptd.is_finish as isFinish,
......
......@@ -8,11 +8,7 @@
<select id="findPlanTaskByTaskIdAndPointId" resultType="Map">
SELECT
p.name planName,
pp.name pointName,
ptd.id planTaskDetailId,
pt.route_id routeId,
pr.name routeName
p.name planName, pt.begin_time beginTime, pt.end_time endTime, pp.name pointName, pp.point_no pointNo, ptd.id planTaskDetailId, pt.route_id routeId, pr.name routeName
FROM
p_plan_task pt
LEFT JOIN p_plan p ON pt.plan_id = p.id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment