Commit c3552a83 authored by kongfm's avatar kongfm

Merge remote-tracking branch 'origin/developer' into developer

parents daeb0f9e b9103c7f
package com.yeejoin.amos.boot.biz.common.feign;
import com.yeejoin.amos.boot.biz.common.dto.OptionDto;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.feign.utils.FeignUtil;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.client.AgencyUserClient;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import org.apache.logging.log4j.LogManager;
......@@ -76,4 +80,20 @@ public class AmosFeignService {
);
return optionsMoList;
}
/**
* 根据用户id查询指定平台用户信息.
*
* @param userId
* @return
*/
public AgencyUserModel queryAgencyUserByUserId(String userId) {
AgencyUserModel userModel = null;
try {
userModel = FeignUtil.remoteCall(() -> Privilege.agencyUserClient.queryByUserId(userId));
return userModel;
} catch (Exception e) {
throw new RuntimeException("获取平台用户数据出错");
}
}
}
package com.yeejoin.amos.boot.module.common.api.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -36,7 +37,7 @@ public class FailureAuditDto extends BaseDto {
private String auditOpinion;
@ApiModelProperty(value = "审核结果")
private Integer auditResult;
private int auditResult;
@ApiModelProperty(value = "设备故障报修单id")
private Long faultId;
......
......@@ -21,10 +21,6 @@ public class FailureRepairlogDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "流程处理人")
private String processAuditor;
@ApiModelProperty(value = "流程处理人Id")
private Integer processAuditorId;
......@@ -44,7 +40,7 @@ public class FailureRepairlogDto extends BaseDto {
@ApiModelProperty(value = "设备故障报修主表ID")
private Long faultId;
@ApiModelProperty(value = "操作人中文名称")
@ApiModelProperty(value = "流程处理人")
private String processAuditorCid;
}
......@@ -34,7 +34,9 @@ public class FailureAudit extends BaseEntity {
*/
@TableField("audit_department")
private String auditDepartment;
/**
* 审核部门id
*/
@TableField("audit_department_id")
private Long auditDepartmentId;
......@@ -61,6 +63,12 @@ public class FailureAudit extends BaseEntity {
*/
@TableField("fault_id")
private Long faultId;
/**
* 审核结果
*/
@TableField("audit_result")
private int auditResult;
......
......@@ -27,11 +27,7 @@ public class FailureRepairlog extends BaseEntity {
*/
@TableField("process_auditor_id")
private Integer processAuditorId;
/**
* 流程处理人
*/
@TableField("process_auditor")
private String processAuditor;
/**
* 流程处理人
*/
......@@ -66,10 +62,6 @@ public class FailureRepairlog extends BaseEntity {
@TableField("fault_id")
private Long faultId;
/**
* 操作人中文名称
*/
@TableField("process_auditor_name")
private String processAuditorCid;
}
......@@ -124,19 +124,19 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
Long faultId = model.getFaultId();
Date processTime = model.getAuditTime();
String processDepartment = model.getAuditDepartment();
String processAuditor = model.getAuditor();
// String processAuditor = model.getAuditor();
Integer processAuditorId = Integer.parseInt(userInfo.getUserModel().getUserId());
String processAuditorCid = userInfo.getUserModel().getUserName();
String processAuditorCid = userInfo.getRole().getRoleName();
Long auditDepartmentId = (userInfo.getDepartment().getSequenceNbr());
if (condition == AuditResultEnum.AGREE.getCode()) {
conditionText = AuditResultEnum.AGREE.getName();
repairlog(faultId, processAuditor, processAuditorId, auditDepartmentId, processTime, processDepartment, conditionText, processAuditorCid);
repairlog(faultId, processAuditorId, auditDepartmentId, processTime, processDepartment, conditionText, processAuditorCid);
} else if (condition == AuditResultEnum.SEND_BACK.getCode()) {
conditionText = AuditResultEnum.SEND_BACK.getName();
repairlog(faultId, processAuditor, processAuditorId, auditDepartmentId, processTime, processDepartment, conditionText, processAuditorCid);
repairlog(faultId, processAuditorId, auditDepartmentId, processTime, processDepartment, conditionText, processAuditorCid);
} else if (condition == AuditResultEnum.REFUSE.getCode()) {
conditionText = AuditResultEnum.REFUSE.getName();
repairlog(faultId, processAuditor, processAuditorId, auditDepartmentId, processTime, processDepartment, conditionText, processAuditorCid);
repairlog(faultId, processAuditorId, auditDepartmentId, processTime, processDepartment, conditionText, processAuditorCid);
}
if (failureDetailsService.excuteTask(failureDetailsDto.getProcessId(), userInfo, condition + "")){
return true;
......@@ -151,11 +151,10 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
* 添加报修日志
*/
@Transactional
public Boolean repairlog(Long faultId, String processAuditor, Integer processAuditorId, Long departmentId, Date processTime,
public Boolean repairlog(Long faultId, Integer processAuditorId, Long departmentId, Date processTime,
String processDepartment, String processResult, String processAuditorCid) {
FailureRepairlogDto failureRepairlogDto = new FailureRepairlogDto();
failureRepairlogDto.setFaultId(faultId);
failureRepairlogDto.setProcessAuditor(processAuditor);
failureRepairlogDto.setProcessAuditorId(processAuditorId);
failureRepairlogDto.setProcessDepartmentId(departmentId);
failureRepairlogDto.setProcessTime(processTime);
......
......@@ -299,14 +299,13 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
// 添加至报修日志
Long faultId = model.getSequenceNbr();
String processAuditor = model.getRecUserName();
Integer processAuditorId = model.getSubmissionPid();
String processResult = "提交报修单";
String processDepartment = userInfo.getDepartment().getDepartmentName();
Long departmentId = userInfo.getDepartment().getSequenceNbr();
Date processTime = model.getSubmissionTime();
String processAuditorCid = userInfo.getUserModel().getUserName();
repairlog(faultId, processAuditor,processAuditorId,departmentId, processTime, processDepartment, processResult,processAuditorCid);
String processAuditorCid = userInfo.getRole().getRoleName();
repairlog(faultId,processAuditorId,departmentId, processTime, processDepartment, processResult,processAuditorCid);
if (excuteTask(instance.getString("id"), userInfo, null)){
return true;
......@@ -320,11 +319,10 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
* 添加报修日志
*/
@Transactional
public Boolean repairlog(Long faultId, String processAuditor, Integer processAuditorId, Long departmentId,
public Boolean repairlog(Long faultId, Integer processAuditorId, Long departmentId,
Date processTime, String processDepartment, String processResult, String processAuditorCid) {
FailureRepairlogDto failureRepairlogDto = new FailureRepairlogDto();
failureRepairlogDto.setFaultId(faultId);
failureRepairlogDto.setProcessAuditor(processAuditor);
failureRepairlogDto.setProcessAuditorId(processAuditorId);
failureRepairlogDto.setProcessDepartmentId(departmentId);
failureRepairlogDto.setProcessTime(processTime);
......
......@@ -132,8 +132,8 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
// 添加报修日志
String processResult = MAINTENANCE_STATUS[1];// 维修中
Integer processAuditorId = Integer.parseInt(failureMaintainDto.getRecUserId());
String processAuditorCid = userInfo.getUserModel().getUserName();
repairlog(failureMaintainDto.getFaultId(), failureMaintainDto.getMaintainMan(), processAuditorId,
String processAuditorCid = userInfo.getRole().getRoleName();
repairlog(failureMaintainDto.getFaultId(), processAuditorId,
userInfo.getDepartment().getSequenceNbr(), failureMaintainDto.getMaintainTime(),
failureMaintainDto.getDepartment(), processResult, processAuditorCid);
if (ObjectUtils.isNotEmpty(failureMaintainDto.getAttachment())) {
......@@ -179,8 +179,8 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
// 添加报修日志
String processResult = MAINTENANCE_STATUS[0];// 维修完成
Integer processAuditorId = Integer.parseInt(failureMaintainDto.getRecUserId());
String processAuditorCid = userInfo.getUserModel().getUserName();
repairlog(failureMaintainDto.getFaultId(), failureMaintainDto.getMaintainMan(), processAuditorId,
String processAuditorCid = userInfo.getRole().getRoleName();
repairlog(failureMaintainDto.getFaultId(), processAuditorId,
userInfo.getDepartment().getSequenceNbr(), failureMaintainDto.getMaintainTime(),
failureMaintainDto.getDepartment(), processResult, processAuditorCid);
if (ObjectUtils.isNotEmpty(failureMaintainDto.getAttachment())) {
......@@ -225,9 +225,9 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
// 添加报修日志
Integer processAuditorId = Integer.parseInt(failureMaintainDto.getRecUserId());
String processAuditorCid = userInfo.getUserModel().getUserName();
String processAuditorCid = userInfo.getRole().getRoleName();
Boolean repairlog = repairlog(failureMaintainDto.getFaultId(), failureMaintainDto.getMaintainMan(), processAuditorId,
Boolean repairlog = repairlog(failureMaintainDto.getFaultId(), processAuditorId,
userInfo.getDepartment().getSequenceNbr(), failureMaintainDto.getMaintainTime(),
failureMaintainDto.getDepartment(), processResult, processAuditorCid);
if (ObjectUtils.isEmpty(repairlog)){
......@@ -272,14 +272,13 @@ public class FailureMaintainServiceImpl extends BaseService<FailureMaintainDto,
/**
* 添加报修日志
*/
public Boolean repairlog(Long faultId, String processAuditor, Integer processAuditorId, Long departmentId,
public Boolean repairlog(Long faultId, Integer processAuditorId, Long departmentId,
Date processTime,
String processDepartment, String processResult, String processAuditorCid) {
FailureRepairlogDto failureRepairlogDto = new FailureRepairlogDto();
failureRepairlogDto.setFaultId(faultId);
failureRepairlogDto.setProcessAuditor(processAuditor);
failureRepairlogDto.setProcessAuditorId(processAuditorId);
failureRepairlogDto.setProcessDepartmentId(departmentId);
failureRepairlogDto.setProcessTime(processTime);
......
......@@ -51,10 +51,11 @@ public class FailureRepairlogServiceImpl extends BaseService<FailureRepairlogDto
public FailureRepairlog findByprocessAuditor(String userId) {
LambdaQueryWrapper<FailureRepairlog> queryWrapper = new LambdaQueryWrapper<FailureRepairlog>();
queryWrapper.eq(FailureRepairlog::getProcessAuditor, userId);
queryWrapper.eq(FailureRepairlog::getProcessAuditorName, userId);
queryWrapper.last("LIMIT 1");
return baseMapper.selectOne(queryWrapper);
}
public FailureRepairlog findByFaultId(Long faultId) {
LambdaQueryWrapper<FailureRepairlog> wrapper = new LambdaQueryWrapper<FailureRepairlog>();
wrapper.eq(FailureRepairlog::getIsDelete, false);
......
......@@ -122,16 +122,15 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
Date processTime = model.getVerifyTime();
String processDepartment = model.getVerifyDepartment();
Integer processAuditorId = Integer.parseInt(userInfo.getUserModel().getUserId());
String processVerifyor = model.getAcceptor();
String processAuditorCid = userInfo.getUserModel().getUserName();
String processAuditorCid = userInfo.getRole().getRoleName();
Long auditDepartmentId = (userInfo.getDepartment().getSequenceNbr());
Boolean repairlog = null;
if (condition == AuditResultEnum.AGREE.getCode()) {
conditionText = AuditResultEnum.AGREE.getName();
repairlog = repairlog(faultId, processVerifyor, processAuditorId, auditDepartmentId, processTime, processDepartment, conditionText, processAuditorCid);
repairlog = repairlog(faultId, processAuditorId, auditDepartmentId, processTime, processDepartment, conditionText, processAuditorCid);
} else if (condition == AuditResultEnum.REFUSE.getCode()) {
conditionText = AuditResultEnum.REFUSE.getName();
repairlog = repairlog(faultId, processVerifyor, processAuditorId, auditDepartmentId, processTime, processDepartment, conditionText, processAuditorCid);
repairlog = repairlog(faultId, processAuditorId, auditDepartmentId, processTime, processDepartment, conditionText, processAuditorCid);
}
if (!repairlog) {
throw new Exception("执行流程失败");
......@@ -146,11 +145,10 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
* 添加报修日志
*/
@Transactional
public Boolean repairlog(Long faultId, String processAuditor, Integer processAuditorId, Long departmentId, Date processTime,
public Boolean repairlog(Long faultId, Integer processAuditorId, Long departmentId, Date processTime,
String processDepartment, String processResult, String processVerifyorCid) {
FailureRepairlogDto failureRepairlogDto = new FailureRepairlogDto();
failureRepairlogDto.setFaultId(faultId);
failureRepairlogDto.setProcessAuditor(processAuditor);
failureRepairlogDto.setProcessAuditorId(processAuditorId);
failureRepairlogDto.setProcessDepartmentId(departmentId);
failureRepairlogDto.setProcessTime(processTime);
......
......@@ -186,27 +186,6 @@ 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));
}
/**
* 查询任务列表
*
......@@ -243,6 +222,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));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询维保设施,检查内容详情")
@GetMapping(value = "/task-point-detail")
public CommonResponse planTaskPointDetail(
......
......@@ -9,4 +9,6 @@ public interface PlanTaskDetailMapper extends BaseMapper {
, @Param(value="executorId") String executorId);
Map findPlanTaskByTaskIdAndPointId(@Param(value="planTaskId") long planTaskId,@Param(value="pointId") long pointId);
void deleteByPointIdAndRouteId(@Param("pointId") long pointId, @Param("routeId") long routeId);
}
......@@ -56,4 +56,6 @@ public interface IPlanTaskDao extends BaseDao<PlanTask, Long> {
List<PlanTask> findByPlanId(Long planId);
PlanTask findByUserIdAndBeginTimeAndEndTimeAndPlanIdAndRouteId(String userId, String startTime, String endTime, long id, long routeId);
List<PlanTask> findByRouteId(long pointId);
}
package com.yeejoin.amos.maintenance.business.dao.repository;
import java.util.List;
import com.yeejoin.amos.maintenance.dao.entity.PlanTaskDetail;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.yeejoin.amos.maintenance.dao.entity.PlanTaskDetail;
import java.util.List;
@Repository("planTaskDetail")
public interface IPlanTaskDetailDao extends BaseDao<PlanTaskDetail, Long> {
@Modifying
@Transactional
@Query(value = "DELETE FROM p_plan_task_detail WHERE point_id IN (?1)", nativeQuery = true)
void deletePlanTaskDetailByPointId(List<Long> pointIds);
/**
* 根据任务id获取任务详情
* @param planTaskId
* @return
*/
public List<PlanTaskDetail> findAllByTaskNo(Long planTaskId);
/**
* 根据任务id及状态获取计划详情
* @param planTaskId
* @return
*/
public List<PlanTaskDetail> findAllByTaskNoAndStatus(Long planTaskId,String status);
int countByIsFinish(int status);
int countByIsFinishAndTaskNo(int status,Long taskNo);
@Modifying
@Transactional
@Query(value = "DELETE FROM p_plan_task_detail WHERE task_no IN (?1)", nativeQuery = true)
void deletePlanTaskDetailByTaskNo(List<Long> planTaskNo);
@Query(value = "select * FROM p_plan_task_detail WHERE point_id IN (?1)", nativeQuery = true)
@Modifying
@Transactional
@Query(value = "DELETE FROM p_plan_task_detail WHERE point_id IN (?1)", nativeQuery = true)
void deletePlanTaskDetailByPointId(List<Long> pointIds);
/**
* 根据任务id及状态获取计划详情
*
* @param planTaskId
* @return
*/
List<PlanTaskDetail> findAllByTaskNoAndStatus(Long planTaskId, String status);
int countByIsFinishAndTaskNo(int status, Long taskNo);
@Modifying
@Transactional
@Query(value = "DELETE FROM p_plan_task_detail WHERE task_no IN (?1)", nativeQuery = true)
void deletePlanTaskDetailByTaskNo(List<Long> planTaskNo);
@Query(value = "select * FROM p_plan_task_detail WHERE point_id IN (?1)", nativeQuery = true)
List<PlanTaskDetail> findALLByPointId(Long pointId);
}
List<PlanTaskDetail> findByPointId(long pointId);
}
\ No newline at end of file
......@@ -64,9 +64,6 @@ public class PointServiceImpl implements IPointService {
private IPointInputItemDao iPointInputItemDao;
@Autowired
private IPointPhotoDao iPointPhotoDao;
@Autowired
private IRoutePointDao iRoutePointDao;
@Autowired
......
package com.yeejoin.amos.maintenance.business.service.impl;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PointMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskDetailMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.RoutePointItemMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.*;
import com.yeejoin.amos.maintenance.business.param.RoutePageParam;
import com.yeejoin.amos.maintenance.business.service.intfc.IPlanService;
......@@ -18,7 +16,6 @@ import com.yeejoin.amos.maintenance.core.common.response.RoutePointRespone;
import com.yeejoin.amos.maintenance.core.util.query.BaseQuerySpecification;
import com.yeejoin.amos.maintenance.dao.entity.*;
import com.yeejoin.amos.maintenance.exception.YeeException;
import com.yeejoin.amos.maintenance.feign.RemoteSecurityService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
......@@ -29,6 +26,8 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
@Service("routeService")
public class RouteServiceImpl implements IRouteService {
......@@ -53,15 +52,6 @@ public class RouteServiceImpl implements IRouteService {
@Resource
private RouteMapper routeMapper;
@Resource
private PointMapper pointMapper;
@Resource
private InputItemMapper inputItemMapper;
@Resource
private RoutePointItemMapper routePointItemMapper;
@Autowired
private IPointInputItemDao iPointInputItemDao;
......@@ -72,9 +62,17 @@ public class RouteServiceImpl implements IRouteService {
private IPlanTaskService planTaskService;
@Autowired
PlanTaskDetailMapper planTaskDetailMapper;
@Autowired
private IRoutePointItemDao iRoutePointItemDao;
@Autowired
private RemoteSecurityService remoteSecurityService;
private IPlanTaskDetailDao iPlanTaskDetailDao;
@Autowired
IPlanTaskDao planTaskDao;
@Override
@Transactional
......@@ -119,6 +117,7 @@ public class RouteServiceImpl implements IRouteService {
Long routeId = route.getId();
String orgCode = route.getOrgCode();
String creatorId = route.getCreatorId();
Route finalRoute = route;
routePoints.forEach(rp -> {
rp.setOrgCode(orgCode);
rp.setRouteId(routeId);
......@@ -126,6 +125,8 @@ public class RouteServiceImpl implements IRouteService {
if (rp.getIsDelete()) {
iRoutePointItemDao.delRoutePointItem(rp.getId());
iRoutePointDao.deleteById(rp.getId());
//删除p_plan_task_detail 对应点、更新p_plan_task点数量、完成数量
this.updatePlanTask(rp.getPointId(),finalRoute.getId());
} else {
List<RoutePointItem> routePointItems = rp.getRoutePointItem();
iRoutePointDao.saveAndFlush(rp);
......@@ -151,7 +152,26 @@ public class RouteServiceImpl implements IRouteService {
}
}
});
return iRouteDao.save(route);
return route;
}
private void updatePlanTask(long pointId, long routeId) {
List<PlanTask> planTaskList = planTaskDao.findByRouteId(routeId);
List<PlanTaskDetail> planTaskDetailList = iPlanTaskDetailDao.findByPointId(pointId);
Map<Long,PlanTask> planTaskMap = planTaskList.stream().collect(Collectors.toMap(BasicEntity::getId, Function.identity()));
for (PlanTaskDetail planTaskDetail : planTaskDetailList) {
PlanTask planTask = planTaskMap.get(planTaskDetail.getTaskNo());
if (1 == planTaskDetail.getIsFinish()) {
planTask.setFinishNum(planTask.getFinishNum() - 1);
planTask.setPointNum(planTask.getPointNum() - 1);
} else {
planTask.setPointNum(planTask.getPointNum() - 1);
}
}
//更新主表完成数量,点数量
planTaskDao.saveAll(planTaskList);
//删除路线下的维保点
planTaskDetailMapper.deleteByPointIdAndRouteId(pointId, routeId);
}
......
......@@ -5,12 +5,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.MaintenanceUnitDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.MaintenanceUnitNameDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.entity.MaintenanceUnit;
import com.yeejoin.amos.boot.module.tzs.api.service.IMaintenanceUnitService;
import com.yeejoin.amos.boot.module.tzs.api.dto.MaintenanceUnitNameDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ElevatorServiceImpl;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import io.swagger.annotations.Api;
......@@ -19,7 +19,11 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
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;
......
......@@ -205,6 +205,7 @@
p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id
where pt.status = 0
) a
<include refid="mobile-plan-task-where" />
<if test="orderBy != null and orderBy != ''"> order by ${orderBy}</if>
......@@ -263,6 +264,7 @@
p_plan_task pt
INNER JOIN p_plan p ON pt.plan_id = p.id
INNER JOIN p_route r on r.id = pt.route_id
where pt.status = 0
) a
<include refid="mobile-plan-task-where" />
</select>
......
......@@ -5,8 +5,13 @@
<update id="finishTaskDetail">
call updatePlanTask(#{planTaskId}, #{pointId}, #{planTaskDetailId} ,#{executorId})
</update>
<select id="findPlanTaskByTaskIdAndPointId" resultType="Map">
<delete id="deleteByPointIdAndRouteId">
delete FROM `p_plan_task_detail`
where
point_id = #{pointId}
and task_no in (select id from p_plan_task t where t.route_id = #{routeId}) ;
</delete>
<select id="findPlanTaskByTaskIdAndPointId" resultType="Map">
SELECT
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
......
spring.application.name=TZS
server.servlet.context-path=/tzs
server.port=10000
server.port=11000
spring.profiles.active=dev
spring.jackson.time-zone=GMT+8
......@@ -20,4 +20,8 @@ spring.datasource.hikari.connection-test-query=SELECT 1
iot.fegin.name=AMOS-API-IOT
equip.fegin.name=AMOS-EQUIPMANAGE
\ No newline at end of file
equip.fegin.name=AMOS-EQUIPMANAGE
supervision.feign.name = AMOS-SUPERVISION-API
security.systemctl.name=AMOS-API-SYSTEMCTL
\ No newline at end of file
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