Commit dce5787f authored by xixinzhao's avatar xixinzhao

检查结果提交

parent a62b8c59
...@@ -27,7 +27,6 @@ public class Check extends BasicEntity { ...@@ -27,7 +27,6 @@ public class Check extends BasicEntity {
/** /**
* 参考地址 * 参考地址
*/ */
...@@ -176,6 +175,18 @@ public class Check extends BasicEntity { ...@@ -176,6 +175,18 @@ public class Check extends BasicEntity {
@Column(name="dep_name") @Column(name="dep_name")
private String depName; private String depName;
/**
* 责任单位id
*/
@Column(name="company_id")
private String companyId;
/**
* 责任单位名称
*/
@Column(name="company_name")
private String companyName;
@Column(name="error_classify") @Column(name="error_classify")
private String errorClassify; private String errorClassify;
...@@ -412,4 +423,19 @@ public class Check extends BasicEntity { ...@@ -412,4 +423,19 @@ public class Check extends BasicEntity {
this.routeName = routeName; this.routeName = routeName;
} }
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
} }
\ No newline at end of file
package com.yeejoin.amos.supervision.dao.entity; package com.yeejoin.amos.supervision.dao.entity;
import javax.persistence.Column; import javax.persistence.*;
import javax.persistence.Entity; import java.util.List;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/** /**
...@@ -89,6 +85,53 @@ public class CheckInput extends BasicEntity { ...@@ -89,6 +85,53 @@ public class CheckInput extends BasicEntity {
*/ */
private String remark; private String remark;
/**
* 执行人ids
*/
@Column(name="user_id")
private String userId;
/**
* 执行人名称
*/
@Column(name="user_name")
private String userName;
/**
* 执行部门ids
*/
@Column(name="dep_id")
private String depId;
/**
* 执行部门名称
*/
@Column(name="dep_name")
private String depName;
/**
* 安全隐患个数
*/
@Column(name="safety_danger_num")
private int safetyDangerNum;
/**
* 重大隐患个数
*/
@Column(name="major_danger_num")
private int majorDangerNum;
@Transient
public List<CheckShot> getCheckShotList() {
return checkShotList;
}
public void setCheckShotList(List<CheckShot> checkShotList) {
this.checkShotList = checkShotList;
}
private List<CheckShot> checkShotList;
public String getRemark() { public String getRemark() {
return remark; return remark;
} }
...@@ -201,4 +244,51 @@ public class CheckInput extends BasicEntity { ...@@ -201,4 +244,51 @@ public class CheckInput extends BasicEntity {
this.pointClassifyName = pointClassifyName; this.pointClassifyName = pointClassifyName;
} }
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getDepId() {
return depId;
}
public void setDepId(String depId) {
this.depId = depId;
}
public String getDepName() {
return depName;
}
public void setDepName(String depName) {
this.depName = depName;
}
public int getMajorDangerNum() {
return majorDangerNum;
}
public void setMajorDangerNum(int majorDangerNum) {
this.majorDangerNum = majorDangerNum;
}
public int getSafetyDangerNum() {
return safetyDangerNum;
}
public void setSafetyDangerNum(int safetyDangerNum) {
this.safetyDangerNum = safetyDangerNum;
}
} }
\ No newline at end of file
...@@ -55,6 +55,30 @@ public class PlanTaskDetail extends BasicEntity { ...@@ -55,6 +55,30 @@ public class PlanTaskDetail extends BasicEntity {
@Column(name="status") @Column(name="status")
private String status="0"; private String status="0";
/**
* 检查项个数
*/
@Column(name="item_num")
private int itemNum;
/**
* 已执行个数
*/
@Column(name="executed_num")
private int executedNum;
/**
* 已执行个数
*/
@Column(name="safety_danger_num")
private int safetyDangerNum;
/**
* 已执行个数
*/
@Column(name="major_danger_num")
private int majorDangerNum;
public PlanTaskDetail() { public PlanTaskDetail() {
} }
...@@ -114,4 +138,43 @@ public class PlanTaskDetail extends BasicEntity { ...@@ -114,4 +138,43 @@ public class PlanTaskDetail extends BasicEntity {
} }
public int getItemNum() {
return itemNum;
}
public void setItemNum(int itemNum) {
this.itemNum = itemNum;
}
public int getExecutedNum() {
return executedNum;
}
public void setExecutedNum(int executedNum) {
this.executedNum = executedNum;
}
public Date getExecutorDate() {
return executorDate;
}
public void setExecutorDate(Date executorDate) {
this.executorDate = executorDate;
}
public int getSafetyDangerNum() {
return safetyDangerNum;
}
public void setSafetyDangerNum(int safetyDangerNum) {
this.safetyDangerNum = safetyDangerNum;
}
public int getMajorDangerNum() {
return majorDangerNum;
}
public void setMajorDangerNum(int majorDangerNum) {
this.majorDangerNum = majorDangerNum;
}
} }
\ No newline at end of file
...@@ -249,77 +249,6 @@ public class CheckController extends AbstractBaseController { ...@@ -249,77 +249,6 @@ public class CheckController extends AbstractBaseController {
FileHelper.exportZip(list, fileName, response); FileHelper.exportZip(list, fileName, response);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "保存巡检记录<font color='blue'>手机app</font>", notes = "保存巡检记录<font color='blue'>手机app</font>")
@RequestMapping(value = "/saveRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse saveCheckRecord(
@ApiParam(value = "检查信息", required = false) @RequestBody(required = true) CheckRecordParam requestParam) {
Toke token = new Toke();
token.setProduct(request.getHeader("product"));
token.setToke(request.getHeader("X-Access-Token"));
token.setAppKey(request.getHeader("appKey"));
int statu = -1;
PlanTask planTask = null;
if (requestParam.getPlanTaskId() != null && requestParam.getPlanTaskId() != 0) {
planTask = planTaskService.selectPlanTaskStatus(requestParam.getPlanTaskId());
}
AgencyUserModel user = getUserInfo();
String userId = user.getUserId();
String realName = user.getRealName();
requestParam.setIsOffline(requestParam.getIsOffline() == null ? false : requestParam.getIsOffline());
try {
if (planTask != null) {
if (!ToolUtils.transBeanList(planTask.getUserId()).contains(userId.toString())) {
return CommonResponseUtil.failure("无权执行该任务");
}
statu = planTask.getFinishStatus();
if (!requestParam.getIsOffline() && statu == PlanTaskFinishStatusEnum.OVERTIME.getValue()) {
return CommonResponseUtil.failure("任务已超时,上传失败!");
} else if (statu == PlanTaskFinishStatusEnum.FINISHED.getValue()) {
return CommonResponseUtil.failure("任务已完成!");
}
Date checkTime = requestParam.getIsOffline() ? DateUtil.getLongDate(requestParam.getCheckTime()) : new Date();
Date beginTime = DateUtil.getLongDate(planTask.getBeginTime());
Date endTime = DateUtil.getLongDate(planTask.getEndTime());
int beginCompareTo = checkTime.compareTo(beginTime);
int endCompareTo = checkTime.compareTo(endTime);
if (beginCompareTo == -1 || endCompareTo == 1) {
return CommonResponseUtil.failure("请在计划时间内完成任务!");
}
}
int count = checkService.checkHasRecord(requestParam);
if (count < 1 || requestParam.getPlanTaskId() < 1) {
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getOrgCode(reginParams);
String departmentId = getDepartmentId(reginParams);
requestParam.setOrgCode(orgCode);
requestParam.setUserId(getUserId());
requestParam.setCheckDepartmentId(departmentId);
CheckDto checkDto = checkService.saveCheckRecord(requestParam, getUserInfo(), reginParams.getDepartment(), token);
if (StringUtil.isNotEmpty(checkDto)) {
asyncTaskf(checkDto.getCheckId());
}
is.pointCheckInfoPushToB(checkDto.getCheckId());
//数字换流站页面刷新
try {
webMqttComponent.publish(patrolTopic, "");
} catch (Exception e) {
log.error("数字换流站页面推送失败-----------" + e.getMessage());
}
return CommonResponseUtil.success(checkDto);
} else {
return CommonResponseUtil.success("无需重新巡检");
}
} catch (Exception e) {
e.printStackTrace();
// TODO Auto-generated catch block
log.error(e.getMessage());
return CommonResponseUtil.failure("数据提交失败");
}
}
@Async @Async
public void asyncTaskf(Long id) { public void asyncTaskf(Long id) {
...@@ -645,4 +574,20 @@ public class CheckController extends AbstractBaseController { ...@@ -645,4 +574,20 @@ public class CheckController extends AbstractBaseController {
return ResponseHelper.buildResponse(checkService.getPlanExecuteTeams()); return ResponseHelper.buildResponse(checkService.getPlanExecuteTeams());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "保存检查记录", notes = "保存检查记录")
@RequestMapping(value = "/saveRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public ResponseModel saveSupervisionCheckRecord( @ApiParam(value = "检查信息", required = false) @RequestBody(required = true) CheckRecordParam requestParam) {
try {
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getOrgCode(reginParams);
requestParam.setOrgCode(orgCode);
CheckDto checkDto = checkService.saveCheckRecord(requestParam, reginParams);
return ResponseHelper.buildResponse(checkDto);
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseHelper.buildResponse(e.getMessage());
}
}
} }
...@@ -283,4 +283,6 @@ public interface CheckMapper extends BaseMapper { ...@@ -283,4 +283,6 @@ public interface CheckMapper extends BaseMapper {
List<Map<String, Object>> getPlanExecuteTeams(); List<Map<String, Object>> getPlanExecuteTeams();
int checkHasRecord(@Param(value = "planTaskId") Long planTaskId, @Param(value = "pointId") Long pointId);
} }
...@@ -6,7 +6,9 @@ import org.apache.ibatis.annotations.Param; ...@@ -6,7 +6,9 @@ import org.apache.ibatis.annotations.Param;
public interface PlanTaskDetailMapper extends BaseMapper { public interface PlanTaskDetailMapper extends BaseMapper {
void finishTaskDetail(@Param(value="planTaskDetailId") long planTaskDetailId, @Param(value="pointId") long pointId, @Param(value="planTaskId") long planTaskId void finishTaskDetail(@Param(value="planTaskDetailId") long planTaskDetailId, @Param(value="pointId") long pointId, @Param(value="planTaskId") long planTaskId
, @Param(value="executorId") String executorId); , @Param(value="executorId") String executorId , @Param(value="executorName") String executorName);
Map findPlanTaskByTaskIdAndPointId(@Param(value="planTaskId") long planTaskId,@Param(value="pointId") long pointId); Map findPlanTaskByTaskIdAndPointId(@Param(value="planTaskId") long planTaskId,@Param(value="pointId") long pointId);
int findPlanTaskDetailByTaskId( @Param(value="planTaskId") long planTaskId);
} }
package com.yeejoin.amos.supervision.business.param; package com.yeejoin.amos.supervision.business.param;
import com.yeejoin.amos.supervision.dao.entity.CheckShot;
import lombok.Data;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Data
public class CheckInputParam { public class CheckInputParam {
private long inputItemId; private long inputItemId;
private String inputValue; private String inputValue;
private String selectName; private String selectName;
private boolean isCheck; private boolean isCheck;
private String remark; private String remark;
private Long classifyIds;
private Long routePointItemId; private Long routePointItemId;
private List<String> checkInputImg; private String userId;
public List<String> getCheckInputImg() { private String userName;
return checkInputImg; private String depId;
} private String depName;
private List<CheckShot> checkInputShot = new ArrayList<>();
public void setCheckInputImg(List<String> checkInputImg) {
this.checkInputImg = checkInputImg;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public long getInputItemId() {
return inputItemId;
}
public void setInputItemId(long inputItemId) {
this.inputItemId = inputItemId;
}
public String getInputValue() {
return inputValue;
}
public void setInputValue(String inputValue) {
this.inputValue = inputValue;
}
public String getSelectName() {
return selectName;
}
public void setSelectName(String selectName) {
this.selectName = selectName;
}
public boolean getIsCheck() {
return isCheck;
}
public void setIsCheck(boolean isCheck) {
this.isCheck = isCheck;
}
public Long getClassifyIds() {
return classifyIds;
}
public void setClassifyIds(Long classifyIds) {
this.classifyIds = classifyIds;
}
public Long getRoutePointItemId() {
return routePointItemId;
}
public void setRoutePointItemId(Long routePointItemId) {
this.routePointItemId = routePointItemId;
}
} }
package com.yeejoin.amos.supervision.business.param; package com.yeejoin.amos.supervision.business.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Data
public class CheckRecordParam { public class CheckRecordParam {
@ApiModelProperty(value = "任务id",required = true)
private Long planTaskId; private Long planTaskId;
private Long pointId;
private String pointName;
private Long checkId;
private String remark;
private String userId;
private String orgCode;
private String checkDepartmentId;
private List<String> checkRecordImg;
/**
* 检查项分类
*/
private Long classId;
/**
* 路线id
*/
private Long routeId;
/**
* 检查时间
*/
private String checkTime;
private String checkMode;
/**
* 是否离线提交
*/
private Boolean isOffline = false;
private List<CheckInputParam> checkItems;
public Long getPointId() {
return pointId;
}
public void setPointId(Long pointId) {
this.pointId = pointId;
}
public Long getCheckId() {
return checkId;
}
public void setCheckId(Long checkId) {
this.checkId = checkId;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public List<CheckInputParam> getCheckItems() {
return checkItems;
}
public void setCheckItems(List<CheckInputParam> checkItems) {
this.checkItems = checkItems;
}
public Long getPlanTaskId() { @ApiModelProperty(value = "点id",required = true)
return planTaskId; private Long pointId;
}
public void setPlanTaskId(Long planTaskId) {
this.planTaskId = planTaskId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getCheckTime() {
return checkTime;
}
public String getCheckMode() {
return checkMode;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime;
}
public Long getRouteId() {
return routeId;
}
public void setRouteId(Long routeId) {
this.routeId = routeId;
}
public String getPointName() {
return pointName;
}
public void setPointName(String pointName) {
this.pointName = pointName;
}
public void setCheckMode(String checkMode) {
this.checkMode = checkMode;
}
public Long getClassId() {
return classId;
}
public void setClassId(Long classId) {
this.classId = classId;
}
public Boolean getIsOffline() {
return isOffline;
}
public void setIsOffline(Boolean isOffline) { @ApiModelProperty(value = "组织机构")
this.isOffline = isOffline; private String orgCode;
}
public String getCheckDepartmentId() { @ApiModelProperty(value = "备注")
return checkDepartmentId; private String remark;
}
public void setCheckDepartmentId(String checkDepartmentId) { @ApiModelProperty(value = "路线id")
this.checkDepartmentId = checkDepartmentId; private Long routeId;
}
public List<String> getCheckRecordImg() { @ApiModelProperty(value = "检查时间")
return checkRecordImg; private String checkTime;
}
public void setCheckRecordImg(List<String> checkRecordImg) { /**
this.checkRecordImg = checkRecordImg; * 检查项
} */
@ApiModelProperty(value = "检查项",required = true)
private List<CheckInputParam> checkItems = new ArrayList<>();
} }
...@@ -62,6 +62,12 @@ public class PlanInfoPageParam extends CommonPageable { ...@@ -62,6 +62,12 @@ public class PlanInfoPageParam extends CommonPageable {
*/ */
private String leadPerson; private String leadPerson;
/**
* 计划执行状态
* @return
*/
private int finishStatus;
public String getOwnerId() { public String getOwnerId() {
return ownerId; return ownerId;
} }
...@@ -141,4 +147,12 @@ public class PlanInfoPageParam extends CommonPageable { ...@@ -141,4 +147,12 @@ public class PlanInfoPageParam extends CommonPageable {
public void setLeadPerson(String leadPerson) { public void setLeadPerson(String leadPerson) {
this.leadPerson = leadPerson; this.leadPerson = leadPerson;
} }
public int getFinishStatus() {
return finishStatus;
}
public void setFinishStatus(int finishStatus) {
this.finishStatus = finishStatus;
}
} }
...@@ -16,11 +16,14 @@ import java.util.stream.Collectors; ...@@ -16,11 +16,14 @@ import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.supervision.business.constants.XJConstant; import com.yeejoin.amos.supervision.business.constants.XJConstant;
import com.yeejoin.amos.supervision.business.dao.mapper.CheckMapper; import com.yeejoin.amos.supervision.business.dao.mapper.CheckMapper;
import com.yeejoin.amos.supervision.business.service.intfc.ICheckService; import com.yeejoin.amos.supervision.business.service.intfc.ICheckService;
import com.yeejoin.amos.supervision.business.service.intfc.IEquipmentHandlerService; import com.yeejoin.amos.supervision.business.service.intfc.IEquipmentHandlerService;
import com.yeejoin.amos.supervision.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.supervision.business.service.intfc.IPointService; import com.yeejoin.amos.supervision.business.service.intfc.IPointService;
import com.yeejoin.amos.supervision.business.util.ToolUtils;
import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo; import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo; import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.common.enums.*; import com.yeejoin.amos.supervision.common.enums.*;
...@@ -144,6 +147,9 @@ public class CheckServiceImpl implements ICheckService { ...@@ -144,6 +147,9 @@ public class CheckServiceImpl implements ICheckService {
@Autowired @Autowired
IPointDao iPointDao; IPointDao iPointDao;
@Autowired
IPlanTaskService planTaskService;
// @Value("${file.ip}") // @Value("${file.ip}")
// private String fileIp; // private String fileIp;
// //
...@@ -173,224 +179,6 @@ public class CheckServiceImpl implements ICheckService { ...@@ -173,224 +179,6 @@ public class CheckServiceImpl implements ICheckService {
} }
@Override @Override
@Transactional
public CheckDto saveCheckRecord(CheckRecordParam requestParam, AgencyUserModel user, DepartmentBo departmentModel, Toke token) {
PlanTaskDetail taskDetail = null;
PlanTask planTask = null;
Check check = new Check();
HashMap<String, Object> routeParam = new HashMap<String, Object>();
Map detail = null;
Boolean isOffline = requestParam.getIsOffline();
Point point = iPointService.queryPointById(requestParam.getPointId());
try {
if (!ObjectUtils.isEmpty(requestParam) && !ObjectUtils.isEmpty(requestParam.getPlanTaskId()) && requestParam.getPlanTaskId() > 0) {
detail = planTaskDetailMapper.findPlanTaskByTaskIdAndPointId(requestParam.getPlanTaskId(), requestParam.getPointId());
if (!ObjectUtils.isEmpty(detail)) {
check = checkDao.findByPlanTaskIdAndPointId(requestParam.getPlanTaskId(), requestParam.getPointId());
planTask = planTaskDao.findById(requestParam.getPlanTaskId()).get();
routeParam.put("routeId", planTask.getRouteId());
routeParam.put("pointId", requestParam.getPointId());
if (ObjectUtils.isEmpty(check)) {
check = new Check();
}
check.setPlanTaskDetailId(Long.parseLong(detail.get("planTaskDetailId").toString()));
check.setRouteId(Long.parseLong(detail.get("routeId").toString()));
check.setRouteName(detail.get("routeName").toString());
check.setPlanTaskId(requestParam.getPlanTaskId());
check.setPlanId(planTask.getPlanId());
check.setPlanName(detail.get("planName").toString());
check.setPointName(detail.get("pointName").toString());
requestParam.setPointName(detail.get("pointName").toString());
}
} else {
taskDetail = new PlanTaskDetail();
planTask = new PlanTask();
check.setPlanTaskDetailId(0);
check.setRouteId(0);
check.setPlanTaskId(0);
check.setPlanId(0);
}
check.setPointId(requestParam.getPointId());
if (ObjectUtils.isEmpty(requestParam.getPointName())) {
check.setPointName(point == null ? "" : point.getName());
}
check.setRemark(requestParam.getRemark());
check.setCheckTime(DateUtil.getLongDate(requestParam.getCheckTime()));
check.setUploadTime(new Date());
check.setOrgCode(requestParam.getOrgCode());
check.setUserId(user.getUserId().toString());
check.setUserName(user.getRealName());
// Department dep = user.getDepartment();
if (departmentModel != null) {
check.setDepId(departmentModel.getSequenceNbr().toString());
check.setDepName(departmentModel.getDepartmentName());
}
check.setCheckMode(requestParam.getCheckMode());
List<CheckInputParam> list = requestParam.getCheckItems();
List<CheckInput> checkItemList = new ArrayList<>();
List<Map<String, Object>> unqualifiedcheckItemList = Lists.newArrayList();
String error = "";
HashMap<String, String> errorClassifyNames = new HashMap<>();
List<EquipmentInputItemRo> equipmentInputItemRoList = new ArrayList<>();
int score = 0;
for (CheckInputParam item : list) {
String pointClassifyName = null;
PointClassify pointClassify = null;
if (StringUtil.isNotEmpty(item.getClassifyIds()) && iPointClassifyDao.existsById(item.getClassifyIds())) {
pointClassify = iPointClassifyDao.findById(item.getClassifyIds()).get();
pointClassifyName = pointClassify.getName();
}
InputItem inputItem = inputItemDao.findById(item.getInputItemId()).get();
CheckInput checkInput = new CheckInput();
if (isOffline && check.getId() != 0) {
checkInput = checkInputDao.findByCheckIdAndInputIdAndPointClassifyId(check.getId(), inputItem.getId(), item.getClassifyIds());
}
checkInput.setCreateDate(new Date());
checkInput.setOrgCode(requestParam.getOrgCode());
checkInput.setInputId(Long.valueOf(item.getInputItemId() + ""));
checkInput.setInputName(inputItem.getName());
checkInput.setOrderNo(inputItem.getOrderNo());
checkInput.setRemark(item.getRemark());
//1.校验结果
if (XJConstant.INPUT_ITEM_SELECT.equals(inputItem.getItemType())) {
checkInput = paraseSelect(checkInput, inputItem.getDataJson(), item, inputItem.getIsScore());
} else if (XJConstant.INPUT_ITEM_NUMBER.equals(inputItem.getItemType())) {
checkInput = paraseNumber(checkInput, inputItem.getDataJson(), item, inputItem.getIsScore());
} else if (XJConstant.INPUT_ITEM_TEXT.equals(inputItem.getItemType())) {
checkInput = paraseText(checkInput, inputItem.getDataJson(), item, inputItem.getIsScore());
}
if (XJConstant.NO.equals(checkInput.getIsOk())) {
String classifyName = pointClassifyName != null ? pointClassifyName + "-" : "";
error += (classifyName + inputItem.getName() + "=" + (ObjectUtils.isEmpty(item.getInputValue()) ? "" : item.getInputValue()) + ";");
errorClassifyNames.put(pointClassifyName != null ? pointClassifyName : "", "");
checkInput.setIsOk(CheckStatusEnum.UNQUALIFIED.getCode());
Map<String, Object> unCheckMap = Maps.newHashMap();
unCheckMap.put("itemId", item.getInputItemId());
unCheckMap.put("routeId", check.getRouteId());
unCheckMap.put("pointId", requestParam.getPointId());
unCheckMap.put("name", inputItem.getName());
unCheckMap.put("inputValue", item.getInputValue());
unqualifiedcheckItemList.add(unCheckMap);
} else {
checkInput.setIsOk(CheckStatusEnum.QUALIFIED.getCode());
}
checkInput.setRoutePointItemId(item.getRoutePointItemId());
checkInput.setInputValue(item.getInputValue());
checkInput.setPointClassifyId(item.getClassifyIds());
checkInput.setPointClassifyName(pointClassifyName);
score += checkInput.getScore();
checkItemList.add(checkInput);
EquipmentInputItemRo equipmentInputItemRo = new EquipmentInputItemRo();
if (!StringUtils.isBlank(pointClassify.getName())) {
equipmentInputItemRo.setEquipmentName(pointClassify.getName());
}
equipmentInputItemRo.setCheckResult(item.getInputValue());
equipmentInputItemRo.setRuleType(RuleTypeEnum.CHECKRESULT.getCode());
equipmentInputItemRo.setCheckContent(inputItem.getItemNo());
if (!StringUtils.isBlank(pointClassify.getEquipmentId())) {
equipmentInputItemRoList.add(equipmentInputItemRo);
}
}
if (!ObjectUtils.isEmpty(error) && error.endsWith(";")) {
error.substring(0, error.length() - 1);
check.setIsOk(CheckStatusEnum.UNQUALIFIED.getCode());
} else {
check.setIsOk(CheckStatusEnum.QUALIFIED.getCode());
}
check.setError(error);
check.setErrorClassify(StringUtils.join(errorClassifyNames.keySet(), ","));
//计划外巡检是否计分 ,计划内默认都是计分
if (XJConstant.POINT_OK_SCORE.equals(point.getIsScore()) || requestParam.getPlanTaskId() != null) {
check.setScore(score);
} else {
check.setScore(Integer.parseInt(XJConstant.POINT_NOT_SCORE));
}
check = checkDao.save(check);
if (point != null) {
//冗余记录最新一次检查记录,方便其他业务查询
point.setLastCheckId(String.valueOf(check.getId()));
iPointDao.save(point);
}
List<CheckShot> imgList = new ArrayList<>();
for (CheckInput item : checkItemList) {
item.setCheckId(check.getId());
//检查点图片保存 checkInputId
Check finalCheck = check;
list.forEach(x -> {
if (x.getInputItemId() == item.getInputId() && (x.getClassifyIds() == item.getPointClassifyId() || x.getClassifyIds() == null)) {
if (x.getCheckInputImg() != null && x.getCheckInputImg().size() > 0) {
for (int i = 0; i < x.getCheckInputImg().size(); i++) {
CheckShot img = new CheckShot();
img.setCheckId(finalCheck.getId());
img.setOrgCode(finalCheck.getOrgCode());
img.setCreateDate(new Date());
img.setPointName(finalCheck.getPointName());
img.setShotType("1".equals(point.getIsFixed()) ? "定点" : "普通");
img.setPhotoData(x.getCheckInputImg().get(i));
img.setCheckInputId(x.getInputItemId());
if (item.getPointClassifyId() == null) {
img.setClassifyId(0);
} else {
img.setClassifyId(item.getPointClassifyId());
}
imgList.add(img);
}
}
}
});
}
//现场图片保存
if (requestParam.getCheckRecordImg() != null && requestParam.getCheckRecordImg().size() > 0) {
for (int i = 0; i < requestParam.getCheckRecordImg().size(); i++) {
CheckShot img = new CheckShot();
img.setCheckId(check.getId());
img.setOrgCode(check.getOrgCode());
img.setCreateDate(new Date());
img.setPointName(check.getPointName());
img.setCheckInputId(0);
img.setShotType("1".equals(point.getIsFixed()) ? "定点" : "普通");
img.setPhotoData(requestParam.getCheckRecordImg().get(i));
img.setClassifyId(0);
imgList.add(img);
}
}
List<CheckInput> checkInputList = checkInputDao.saveAll(checkItemList);
//规则请求结果
checkInputList.forEach(checkInput -> {
InputItem inputItem = inputItemDao.findById(checkInput.getInputId()).get();
for (int i = 0; i < equipmentInputItemRoList.size(); i++) {
if (inputItem.getItemNo().equals(equipmentInputItemRoList.get(i).getCheckContent())) {
equipmentInputItemRoList.get(i).setCheckInputId(Long.valueOf(checkInput.getId()).toString());
}
}
});
equipmentHandlerService.getRulesCheckResult(equipmentInputItemRoList, token);
if (imgList.size() > 0) {
checkService.saveCheckImg(imgList);
}
if (check.getPlanTaskId() > 0) {
planTaskDetailMapper.finishTaskDetail(Long.parseLong(detail.get("planTaskDetailId").toString()), requestParam.getPointId(), requestParam.getPlanTaskId(), user.getUserId());
} else {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
planTaskMapper.reformStatistics(user.getUserId(), sdf.format(new Date()), requestParam.getOrgCode());
}
return new CheckDto(check.getId(), unqualifiedcheckItemList);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@Override
public void delCheckById(List<Long> list) { public void delCheckById(List<Long> list) {
// List<Long> pointIdList = checkDao.getPointIdList(list); // List<Long> pointIdList = checkDao.getPointIdList(list);
checkDao.deleteBatch(list); checkDao.deleteBatch(list);
...@@ -505,11 +293,6 @@ public class CheckServiceImpl implements ICheckService { ...@@ -505,11 +293,6 @@ public class CheckServiceImpl implements ICheckService {
} }
@Override @Override
public int checkHasRecord(CheckRecordParam requestParam) {
return checkMapper.checkHasRecord(requestParam);
}
@Override
public AppPointCheckRespone queryCheckPointDetail(String toke, String product, String appKey, long checkId) { public AppPointCheckRespone queryCheckPointDetail(String toke, String product, String appKey, long checkId) {
// List list = checkMapper.queryCheckPointInputItem(planTaskId, pointId); // List list = checkMapper.queryCheckPointInputItem(planTaskId, pointId);
List<PointCheckDetailBo> list = checkMapper.findCheckPointInputItem(checkId); List<PointCheckDetailBo> list = checkMapper.findCheckPointInputItem(checkId);
...@@ -1597,4 +1380,216 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1597,4 +1380,216 @@ public class CheckServiceImpl implements ICheckService {
public List<Long> getPlanCheckDataCount(HashMap<String, Object> param) { public List<Long> getPlanCheckDataCount(HashMap<String, Object> param) {
return checkMapper.getPlanCheckDataCount(param); return checkMapper.getPlanCheckDataCount(param);
} }
@Override
@Transactional
public CheckDto saveCheckRecord(CheckRecordParam recordParam, ReginParams reginParams) throws Exception {
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
//执行人-维保人员,非amos 账号
if (ObjectUtils.isEmpty(reginParams.getUserModel()) && ObjectUtils.isEmpty(reginParams.getCompany()) && ObjectUtils.isEmpty(reginParams.getDepartment()) ) {
throw new RuntimeException("获取用户信息失败");
}
String mtUserSeq = reginParams.getUserModel().getUserId();
String userName = reginParams.getUserModel().getUserName();
// String mtUserSeq = personIdentity.getPersonSeq();
PlanTask planTask = planTaskService.selectPlanTaskStatus(recordParam.getPlanTaskId());
Map detail = planTaskDetailMapper.findPlanTaskByTaskIdAndPointId(recordParam.getPlanTaskId(), recordParam.getPointId());
//1.前置校验
this.checkCanFinishTask(mtUserSeq, planTask, recordParam.getPointId());
Point point = iPointService.queryPointById(recordParam.getPointId());
Check check = new Check();
if (ObjectUtils.isEmpty(point) || ObjectUtils.isEmpty(detail)) {
throw new Exception("前置校验不通过");
}
//2.加工准备的数据
try {
// 检查记录表中是否有该点记录
Check checkByPointId = checkDao.findByPlanTaskIdAndPointId(recordParam.getPlanTaskId(), recordParam.getPointId());
if (ObjectUtils.isEmpty(checkByPointId)) {
// 新增
check.setPlanTaskDetailId(Long.parseLong(detail.get("planTaskDetailId").toString()));
check.setRouteId(Long.parseLong(detail.get("routeId").toString()));
check.setRouteName(detail.get("routeName").toString());
check.setPlanTaskId(recordParam.getPlanTaskId());
check.setPlanId(planTask.getPlanId());
check.setPlanName(detail.get("planName").toString());
check.setPointName(point.getName());
check.setPointId(point.getId());
check.setRemark(recordParam.getRemark());
check.setOrgCode(recordParam.getOrgCode());
check.setUserId(mtUserSeq);
check.setCheckTime(new Date());
check.setUploadTime(new Date());
check.setUserName(reginParams.getUserModel().getUserName());
check.setCompanyId(reginParams.getCompany().getSequenceNbr().toString());
check.setCompanyName(reginParams.getCompany().getCompanyName());
check.setDepId(reginParams.getDepartment().getSequenceNbr().toString());
check.setDepName(reginParams.getDepartment().getDepartmentName());
} else {
// 更新
check = checkByPointId;
check.setCheckTime(new Date());
check.setUploadTime(new Date());
String userId = check.getUserId();
String userName1 = check.getUserName();
String companyId = check.getCompanyId();
String companyName = check.getCompanyName();
String depId = check.getDepId();
String depName = check.getDepName();
if (!userId.contains(mtUserSeq)) {
check.setUserId(userId+","+mtUserSeq);
check.setUserName(userName1+","+userName);
}
if (!companyId.contains(reginParams.getCompany().getSequenceNbr().toString())) {
check.setCompanyId(companyId+","+reginParams.getCompany().getSequenceNbr().toString());
}
if (!companyName.contains(reginParams.getCompany().getCompanyName())) {
check.setCompanyName(companyName+","+reginParams.getCompany().getCompanyName());
}
if (!depId.contains(reginParams.getDepartment().getSequenceNbr().toString())) {
check.setDepId(depId+","+reginParams.getDepartment().getSequenceNbr().toString());
}
if (!depName.contains(reginParams.getDepartment().getDepartmentName())) {
check.setDepName(depName+","+reginParams.getDepartment().getDepartmentName());
}
}
List<CheckInputParam> list = recordParam.getCheckItems();
List<CheckInput> checkItemList = new ArrayList<>();
List<Map<String, Object>> unqualifiedCheckItemList = Lists.newArrayList();
StringBuilder error = new StringBuilder();
int score = 0;
for (CheckInputParam item : list) {
List<CheckShot> checkShots = new ArrayList<>();
InputItem inputItem = inputItemDao.findById(item.getInputItemId()).get();
CheckInput checkInput = new CheckInput();
checkInput.setCreateDate(new Date());
checkInput.setOrgCode(recordParam.getOrgCode());
checkInput.setInputId(inputItem.getId());
checkInput.setInputName(inputItem.getName());
checkInput.setOrderNo(inputItem.getOrderNo());
checkInput.setRemark(item.getRemark());
checkInput.setUserId(item.getUserId());
checkInput.setUserName(item.getUserName());
checkInput.setDepId(item.getDepId());
checkInput.setDepName(item.getDepName());
checkInput.setSafetyDangerNum(0);
checkInput.setMajorDangerNum(0);
//1.校验结果
if (XJConstant.INPUT_ITEM_SELECT.equals(inputItem.getItemType())) {
paraseSelect(checkInput, inputItem.getDataJson(), item, inputItem.getIsScore());
} else if (XJConstant.INPUT_ITEM_NUMBER.equals(inputItem.getItemType())) {
paraseNumber(checkInput, inputItem.getDataJson(), item, inputItem.getIsScore());
} else if (XJConstant.INPUT_ITEM_TEXT.equals(inputItem.getItemType())) {
paraseText(checkInput, inputItem.getDataJson(), item, inputItem.getIsScore());
}
if (XJConstant.NO.equals(checkInput.getIsOk())) {
error.append(inputItem.getName()).append("=").append(ObjectUtils.isEmpty(item.getInputValue()) ? "" : item.getInputValue()).append(";");
checkInput.setIsOk(CheckStatusEnum.UNQUALIFIED.getCode());
Map<String, Object> unCheckMap = Maps.newHashMap();
unCheckMap.put("itemId", item.getInputItemId());
unCheckMap.put("routeId", check.getRouteId());
unCheckMap.put("pointId", point.getId());
unCheckMap.put("name", inputItem.getName());
unCheckMap.put("inputValue", item.getInputValue());
unqualifiedCheckItemList.add(unCheckMap);
} else {
checkInput.setIsOk(CheckStatusEnum.QUALIFIED.getCode());
}
checkInput.setRoutePointItemId(item.getRoutePointItemId());
checkInput.setInputValue(item.getInputValue());
score += checkInput.getScore();
for (CheckShot shotDto : item.getCheckInputShot()) {
CheckShot img = new CheckShot();
img.setCreateDate(new Date());
img.setPointName(check.getPointName());
img.setShotType(shotDto.getShotType());
img.setPhotoData(shotDto.getPhotoData());
checkShots.add(img);
}
checkInput.setCheckShotList(checkShots);
checkItemList.add(checkInput);
}
if (!ObjectUtils.isEmpty(error.toString()) && error.toString().endsWith(";")) {
error.substring(0, error.length() - 1);
check.setIsOk(CheckStatusEnum.UNQUALIFIED.getCode());
} else {
check.setIsOk(CheckStatusEnum.QUALIFIED.getCode());
}
check.setError(error.toString());
//计划外巡检是否计分 ,计划内默认都是计分
if (XJConstant.POINT_OK_SCORE.equals(point.getIsScore()) || recordParam.getPlanTaskId() != null) {
check.setScore(score);
} else {
check.setScore(Integer.parseInt(XJConstant.POINT_NOT_SCORE));
}
//3.主表入库
check = checkDao.save(check);
//冗余记录最新一次检查记录,方便其他业务查询--当前为维保到期时间用到
point.setLastCheckId(String.valueOf(check.getId()));
iPointDao.save(point);
Check finalCheck = check;
//4.检查项入库
checkItemList.forEach(checkInput -> checkInput.setCheckId(finalCheck.getId()));
if (!checkItemList.isEmpty()) {
checkInputDao.saveAll(checkItemList);
}
List<CheckShot> allShot = new ArrayList<>();
checkItemList.forEach(c -> {
c.getCheckShotList().forEach(s -> {
s.setCheckId(c.getCheckId());
s.setOrgCode(recordParam.getOrgCode());
s.setCheckInputId(c.getId());
});
allShot.addAll(c.getCheckShotList());
});
//5.图片入库
if (!allShot.isEmpty()) {
checkShotDao.saveAll(allShot);
}
planTaskDetailMapper.finishTaskDetail(Long.parseLong(detail.get("planTaskDetailId").toString()), recordParam.getPointId(), recordParam.getPlanTaskId(), mtUserSeq, userName);
//7.返回不合格记录
return new CheckDto(check.getId(), unqualifiedCheckItemList);
} catch (Exception e) {
throw new Exception(e.getMessage(),e);
}
}
private void checkCanFinishTask(String mtUserSeq, PlanTask planTask, Long pointId) throws Exception {
int status;
// int count = checkService.checkHasRecord(planTask.getId(), pointId);
// if (count > 0) {
// throw new RuntimeException("任务已执行,不能重复执行");
// }
if (!ToolUtils.transBeanList(planTask.getUserId()).contains(mtUserSeq)) {
throw new RuntimeException("无权执行该任务");
}
status = planTask.getFinishStatus();
if (status == PlanTaskFinishStatusEnum.OVERTIME.getValue()) {
throw new RuntimeException("任务已超时,上传失败!");
} else if (status == PlanTaskFinishStatusEnum.FINISHED.getValue()) {
throw new RuntimeException("任务已完成!");
}
Date checkTime = new Date();
Date beginTime = DateUtil.getLongDate(planTask.getBeginTime());
Date endTime = DateUtil.getLongDate(planTask.getEndTime());
int beginCompareTo = checkTime.compareTo(beginTime);
int endCompareTo = checkTime.compareTo(endTime);
if (beginCompareTo < 0 || endCompareTo > 0) {
throw new RuntimeException("请在计划时间内完成任务!");
}
}
@Override
public int checkHasRecord(Long planTaskId, Long pointId) {
return checkMapper.checkHasRecord(planTaskId, pointId);
}
} }
...@@ -36,15 +36,13 @@ import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone; ...@@ -36,15 +36,13 @@ import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone; import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.supervision.core.util.DateUtil; import com.yeejoin.amos.supervision.core.util.DateUtil;
import com.yeejoin.amos.supervision.core.util.StringUtil; import com.yeejoin.amos.supervision.core.util.StringUtil;
import com.yeejoin.amos.supervision.dao.entity.Check; import com.yeejoin.amos.supervision.dao.entity.*;
import com.yeejoin.amos.supervision.dao.entity.Plan;
import com.yeejoin.amos.supervision.dao.entity.PlanTask;
import com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail;
import com.yeejoin.amos.supervision.exception.YeeException; import com.yeejoin.amos.supervision.exception.YeeException;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService; import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import com.yeejoin.amos.supervision.quartz.IJobService; import com.yeejoin.amos.supervision.quartz.IJobService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.assertj.core.util.Lists; import org.assertj.core.util.Lists;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -96,6 +94,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -96,6 +94,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Autowired @Autowired
private EquipFeign equipFeign; private EquipFeign equipFeign;
@Autowired
private IPointInputItemDao pointInputItemDao;
@Override @Override
public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) { public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) {
long total = planTaskMapper.countPlanTask(params); long total = planTaskMapper.countPlanTask(params);
...@@ -510,6 +511,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -510,6 +511,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
planTaskDetailInstance.setIsFinish(Integer.parseInt(XJConstant.PLAN_TASK_DET_FINISH_YES)); planTaskDetailInstance.setIsFinish(Integer.parseInt(XJConstant.PLAN_TASK_DET_FINISH_YES));
planTaskDetailInstance.setStatus("1"); planTaskDetailInstance.setStatus("1");
} }
// 查询点下检查项的个数
List<PointInputItem> pointInputItemByPointId = pointInputItemDao.getPointInputItemByPointId(pointId.longValue());
planTaskDetailInstance.setItemNum(pointInputItemByPointId.size());
// 2.保存执行数据明细表 // 2.保存执行数据明细表
planTaskDetail.saveAndFlush(planTaskDetailInstance); planTaskDetail.saveAndFlush(planTaskDetailInstance);
} }
......
...@@ -4,6 +4,7 @@ import java.util.HashMap; ...@@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo; import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo; import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
...@@ -46,7 +47,7 @@ public interface ICheckService { ...@@ -46,7 +47,7 @@ public interface ICheckService {
void saveCheckImg(List<CheckShot> imgList); void saveCheckImg(List<CheckShot> imgList);
CheckDto saveCheckRecord(CheckRecordParam requestParam, AgencyUserModel user, DepartmentBo departmentModel, Toke token); // CheckDto saveCheckRecord(CheckRecordParam requestParam, AgencyUserModel user, DepartmentBo departmentModel, Toke token);
/** /**
* 巡检记录删除 * 巡检记录删除
...@@ -64,15 +65,6 @@ public interface ICheckService { ...@@ -64,15 +65,6 @@ public interface ICheckService {
*/ */
List<Map> queryUnqualifiedInputItem(int checkId); List<Map> queryUnqualifiedInputItem(int checkId);
/**
* 检查该店时候已经巡检完成
*
* @param requestParam
* @return
*/
int checkHasRecord(CheckRecordParam requestParam);
AppPointCheckRespone queryCheckPointDetail(String toke,String product,String appKey,long checkId); AppPointCheckRespone queryCheckPointDetail(String toke,String product,String appKey,long checkId);
AppPointCheckRespone queryCheckPointDetailInVersion2(String toke,String product,String appKey,long checkId); AppPointCheckRespone queryCheckPointDetailInVersion2(String toke,String product,String appKey,long checkId);
...@@ -278,4 +270,20 @@ public interface ICheckService { ...@@ -278,4 +270,20 @@ public interface ICheckService {
List<Map<String, String>> getPlanExecuteStates(); List<Map<String, String>> getPlanExecuteStates();
List<Map<String, Object>> getPlanExecuteTeams(); List<Map<String, Object>> getPlanExecuteTeams();
/**
* 保存检查记录
* @param recordParam 填写记录
* @param reginParams 权限信息
* @return CheckDto
*/
CheckDto saveCheckRecord(CheckRecordParam recordParam, ReginParams reginParams) throws Exception;
/**
* 校验是否已经填写过
* @param planTaskId
* @param pointId
* @return
*/
int checkHasRecord(Long planTaskId, Long pointId);
} }
...@@ -17,8 +17,6 @@ public class CheckParamUtil { ...@@ -17,8 +17,6 @@ public class CheckParamUtil {
if("checkTime".equals(name)){ if("checkTime".equals(name)){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
param.setCheckTime(daoCriterias.get(i).getValue().toString()); param.setCheckTime(daoCriterias.get(i).getValue().toString());
}else if("userId".equals(name)){
param.setUserId(daoCriterias.get(i).getValue().toString());
}else if("routeId".equals(name)){ }else if("routeId".equals(name)){
param.setRouteId(Long.valueOf(daoCriterias.get(i).getValue().toString())); param.setRouteId(Long.valueOf(daoCriterias.get(i).getValue().toString()));
}else if("orgCode".equals(name) && operator.equals(QueryOperatorEnum.EQUAL.getName())){ }else if("orgCode".equals(name) && operator.equals(QueryOperatorEnum.EQUAL.getName())){
......
...@@ -250,16 +250,16 @@ ...@@ -250,16 +250,16 @@
order by pci.order_no order by pci.order_no
</select> </select>
<select id="checkHasRecord" resultType="int"> <!-- <select id="checkHasRecord" resultType="int">-->
SELECT <!-- SELECT-->
count(1) num <!-- count(1) num-->
FROM <!-- FROM-->
p_check c <!-- p_check c-->
WHERE <!-- WHERE-->
is_ok in (1,2) <!-- is_ok in (1,2)-->
and c.point_id = #{pointId} <!-- and c.point_id = #{pointId}-->
and c.plan_task_id = #{planTaskId} <!-- and c.plan_task_id = #{planTaskId}-->
</select> <!-- </select>-->
<select id="pieChartData" resultType="Map"> <select id="pieChartData" resultType="Map">
SELECT SELECT
...@@ -1956,4 +1956,15 @@ ...@@ -1956,4 +1956,15 @@
FROM FROM
p_check pc p_check pc
</select> </select>
<select id="checkHasRecord" resultType="int">
SELECT
count(1) num
FROM
p_check c
WHERE
c.point_id = #{pointId}
and c.plan_task_id = #{planTaskId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper"> <mapper namespace="com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper">
<update id="finishTaskDetail"> <update id="finishTaskDetail">
call updatePlanTask(#{planTaskId}, #{pointId}, #{planTaskDetailId} ,#{executorId}) call updatePlanTask(#{planTaskId}, #{pointId}, #{planTaskDetailId} ,#{executorId},#{executorName})
</update> </update>
<select id="findPlanTaskByTaskIdAndPointId" resultType="Map"> <select id="findPlanTaskByTaskIdAndPointId" resultType="Map">
......
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