故障保修 功能修改 审批 验收
This commit is contained in:
@@ -1,20 +1,20 @@
|
|||||||
|
|
||||||
package com.lideeyunji.module.biz.controller;
|
package com.lideeyunji.module.biz.controller;
|
||||||
|
|
||||||
import com.lideeyunji.module.biz.entity.DevGzbxDO;
|
|
||||||
import com.lideeyunji.module.biz.service.DevGzbxService;
|
import com.lideeyunji.module.biz.service.DevGzbxService;
|
||||||
import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant;
|
import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant;
|
||||||
import com.lideeyunji.tool.framework.common.pojo.CommonResult;
|
import com.lideeyunji.tool.framework.constants.FrameErrorCodeConstants;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import com.lideeyunji.tool.framework.yunji.model.global.BaseWebResult;
|
||||||
|
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.lideeyunji.tool.framework.common.pojo.CommonResult.success;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DX
|
* @author DX
|
||||||
@@ -30,11 +30,24 @@ public class DevGzbxController {
|
|||||||
@Resource
|
@Resource
|
||||||
private DevGzbxService devGzbxService;
|
private DevGzbxService devGzbxService;
|
||||||
|
|
||||||
@PutMapping("/updateStatus")
|
@PostMapping("/auditNotPass")
|
||||||
@Operation(tags = "故障报修",summary = "故障报修状态修改")
|
public BaseWebResult auditNotPass(@RequestBody Map<String,Object> model) {
|
||||||
public CommonResult<Boolean> updateConfig(@Valid @RequestBody DevGzbxDO devGzbxDO) {
|
Long id = lideeYunJiUtils.getMap2Long(model, "id");
|
||||||
devGzbxService.updateDevgGzbx(devGzbxDO);
|
if(id == null){
|
||||||
return success(true);
|
return BaseWebResult.error(FrameErrorCodeConstants.FRAME_OP_ERROR);
|
||||||
|
}
|
||||||
|
devGzbxService.auditNotPass(id);
|
||||||
|
return BaseWebResult.success("审批成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/orderAuditNotPass")
|
||||||
|
public BaseWebResult orderAuditNotPass(@RequestBody Map<String,Object> model) {
|
||||||
|
Long id = lideeYunJiUtils.getMap2Long(model, "id");
|
||||||
|
if(id == null){
|
||||||
|
return BaseWebResult.error(FrameErrorCodeConstants.FRAME_OP_ERROR);
|
||||||
|
}
|
||||||
|
devGzbxService.orderAuditNotPass(id);
|
||||||
|
return BaseWebResult.success("审批成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
|
|
||||||
package com.lideeyunji.module.biz.controller;
|
package com.lideeyunji.module.biz.controller;
|
||||||
|
|
||||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||||
import com.lideeyunji.module.biz.entity.*;
|
import com.lideeyunji.module.biz.entity.DevGzbxDO;
|
||||||
import com.lideeyunji.module.biz.mapper.*;
|
import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO;
|
||||||
|
import com.lideeyunji.module.biz.mapper.DevGzbxMapper;
|
||||||
|
import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper;
|
||||||
|
import com.lideeyunji.tool.framework.security.core.LoginUser;
|
||||||
|
import com.lideeyunji.tool.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import com.lideeyunji.tool.framework.yunji.enums.AcceptanceStatusEnum;
|
import com.lideeyunji.tool.framework.yunji.enums.AcceptanceStatusEnum;
|
||||||
import com.lideeyunji.tool.framework.yunji.enums.ProcessingStatusEnum;
|
|
||||||
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -32,14 +36,33 @@ public class EquipmentMalfunctionCheck implements AroundAdvicePlugin {
|
|||||||
Map<String, Object> params = enhanceContext.getParam().getParams();
|
Map<String, Object> params = enhanceContext.getParam().getParams();
|
||||||
Long id = lideeYunJiUtils.getMap2Long(params, "id");
|
Long id = lideeYunJiUtils.getMap2Long(params, "id");
|
||||||
DevGzbxWxgdDO yorn = devGzbxWxgdMapper.selectOne("id",id);
|
DevGzbxWxgdDO yorn = devGzbxWxgdMapper.selectOne("id",id);
|
||||||
yorn.setProcessingStatus(ProcessingStatusEnum.ACCEPTED.getType());
|
|
||||||
yorn.setDevStatus(AcceptanceStatusEnum.COMPLETED.getType());
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
yorn.setCompletionTime(new Date());
|
if (loginUser == null) {
|
||||||
yorn.setAcceptanceTime(new Date());
|
return;
|
||||||
DevGzbxDO devGzbxDO = devGzbxMapper.selectOne("id", yorn.getGzbxId());
|
}
|
||||||
devGzbxDO.setProcessingStatus(AcceptanceStatusEnum.COMPLETED.getType());
|
Long userId = loginUser.getId();
|
||||||
|
|
||||||
|
String remark = lideeYunJiUtils.getMap2Str(params, "remark");
|
||||||
|
|
||||||
|
if(yorn.getAssignYsZt() == 0 && userId.equals(yorn.getAssignDeptLeader())){
|
||||||
|
yorn.setAssignYsZt(1);
|
||||||
|
yorn.setAssignYsYj(remark);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(yorn.getLeaderYsZt() == 0 && userId.equals(yorn.getLeaderUserId())){
|
||||||
|
yorn.setLeaderYsZt(1);
|
||||||
|
yorn.setLeaderYsYj(remark);
|
||||||
|
}
|
||||||
|
if(yorn.getLeaderYsZt() == 1 && yorn.getAssignYsZt() == 1){
|
||||||
|
yorn.setProcessingStatus(2);
|
||||||
|
yorn.setCompletionTime(new Date());
|
||||||
|
yorn.setAcceptanceTime(new Date());
|
||||||
|
DevGzbxDO devGzbxDO = devGzbxMapper.selectOne("id", yorn.getGzbxId());
|
||||||
|
devGzbxDO.setProcessingStatus(AcceptanceStatusEnum.COMPLETED.getType());
|
||||||
|
devGzbxMapper.updateById(devGzbxDO);
|
||||||
|
}
|
||||||
devGzbxWxgdMapper.updateById(yorn);
|
devGzbxWxgdMapper.updateById(yorn);
|
||||||
devGzbxMapper.updateById(devGzbxDO);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -47,10 +47,10 @@ public class EquipmentMalfunctionOrder implements AroundAdvicePlugin {
|
|||||||
yorn.setDevStatus(2);
|
yorn.setDevStatus(2);
|
||||||
devGzbxWxfaMapper.insertOrUpdate(yorn);
|
devGzbxWxfaMapper.insertOrUpdate(yorn);
|
||||||
DevGzbxWxgdDO devGzbxWxgdDO = devGzbxWxgdMapper.selectOne("gzbx_id", gzbx_id);
|
DevGzbxWxgdDO devGzbxWxgdDO = devGzbxWxgdMapper.selectOne("gzbx_id", gzbx_id);
|
||||||
devGzbxWxgdDO.setDevStatus(2);
|
// devGzbxWxgdDO.setDevStatus(2);
|
||||||
devGzbxWxgdMapper.updateBatch(devGzbxWxgdDO);
|
devGzbxWxgdMapper.updateBatch(devGzbxWxgdDO);
|
||||||
DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbx_id);
|
DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbx_id);
|
||||||
devGzbxDO.setDevStatus(2);
|
// devGzbxDO.setDevStatus(2);
|
||||||
devGzbxMapper.insertOrUpdate(devGzbxDO);
|
devGzbxMapper.insertOrUpdate(devGzbxDO);
|
||||||
}
|
}
|
||||||
} else if (status == 0) {
|
} else if (status == 0) {
|
||||||
@@ -59,11 +59,11 @@ public class EquipmentMalfunctionOrder implements AroundAdvicePlugin {
|
|||||||
devGzbxWxfaDO.setDevStatus(0);
|
devGzbxWxfaDO.setDevStatus(0);
|
||||||
devGzbxWxfaMapper.updateBatch(devGzbxWxfaDO);
|
devGzbxWxfaMapper.updateBatch(devGzbxWxfaDO);
|
||||||
DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbx_id);
|
DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbx_id);
|
||||||
devGzbxDO.setDevStatus(0);
|
// devGzbxDO.setDevStatus(0);
|
||||||
devGzbxMapper.insertOrUpdate(devGzbxDO);
|
devGzbxMapper.insertOrUpdate(devGzbxDO);
|
||||||
} else {
|
} else {
|
||||||
DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbx_id);
|
DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbx_id);
|
||||||
devGzbxDO.setDevStatus(0);
|
// devGzbxDO.setDevStatus(0);
|
||||||
devGzbxMapper.insertOrUpdate(devGzbxDO);
|
devGzbxMapper.insertOrUpdate(devGzbxDO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class EquipmentMalfunctionRecord implements AroundAdvicePlugin {
|
|||||||
|
|
||||||
DevGzbxWxgdDO devGzbxWxgdDO = devGzbxWxgdMapper.selectOne("id", gzbxId);
|
DevGzbxWxgdDO devGzbxWxgdDO = devGzbxWxgdMapper.selectOne("id", gzbxId);
|
||||||
if (devGzbxWxgdDO != null) {
|
if (devGzbxWxgdDO != null) {
|
||||||
devGzbxWxgdDO.setDevStatus(2);
|
// devGzbxWxgdDO.setDevStatus(2);
|
||||||
devGzbxWxgdMapper.updateById(devGzbxWxgdDO);
|
devGzbxWxgdMapper.updateById(devGzbxWxgdDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,17 +3,16 @@ package com.lideeyunji.module.biz.controller;
|
|||||||
|
|
||||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||||
import com.lideeyunji.core.framework.mapper.AdapterMapper;
|
|
||||||
import com.lideeyunji.module.biz.entity.DevGzbxDO;
|
import com.lideeyunji.module.biz.entity.DevGzbxDO;
|
||||||
import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO;
|
import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO;
|
||||||
import com.lideeyunji.module.biz.mapper.DevGzbxMapper;
|
import com.lideeyunji.module.biz.mapper.DevGzbxMapper;
|
||||||
import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper;
|
import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper;
|
||||||
|
import com.lideeyunji.service.system.api.IApiDeptApi;
|
||||||
|
import com.lideeyunji.service.system.dto.DeptRespDTO;
|
||||||
import com.lideeyunji.tool.framework.security.core.LoginUser;
|
import com.lideeyunji.tool.framework.security.core.LoginUser;
|
||||||
import com.lideeyunji.tool.framework.security.core.util.SecurityFrameworkUtils;
|
import com.lideeyunji.tool.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import com.lideeyunji.tool.framework.yunji.enums.AcceptanceStatusEnum;
|
import com.lideeyunji.tool.framework.yunji.enums.AcceptanceStatusEnum;
|
||||||
import com.lideeyunji.tool.framework.yunji.enums.ProcessingStatusEnum;
|
|
||||||
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
||||||
import jodd.util.StringUtil;
|
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -22,7 +21,6 @@ import javax.annotation.Resource;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备报修工单-环绕
|
* 设备报修工单-环绕
|
||||||
@@ -37,53 +35,99 @@ public class EquipmentMalfunctionRepair implements AroundAdvicePlugin {
|
|||||||
private DevGzbxMapper devGzbxMapper;
|
private DevGzbxMapper devGzbxMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AdapterMapper adapterMapper;
|
private IApiDeptApi apiDeptApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void beforeExecute(EnhanceContext enhanceContext) {
|
public void beforeExecute(EnhanceContext enhanceContext) {
|
||||||
|
|
||||||
Map<String, Object> params = enhanceContext.getParam().getParams();
|
Map<String, Object> params = enhanceContext.getParam().getParams();
|
||||||
|
|
||||||
String submitType = lideeYunJiUtils.getMap2Str(params, "submitType");
|
String submitType = lideeYunJiUtils.getMap2Str(params, "submitType");
|
||||||
if (!"ys".equals(submitType)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Long id = lideeYunJiUtils.getMap2Long(params, "id");
|
Long id = lideeYunJiUtils.getMap2Long(params, "id");
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ("cl".equals(submitType)) {
|
||||||
|
DevGzbxWxgdDO existingRecord = devGzbxWxgdMapper.selectOne("gzbx_id", id);
|
||||||
|
if (existingRecord != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DevGzbxWxgdDO existingRecord = devGzbxWxgdMapper.selectOne("gzbx_id", id);
|
DevGzbxDO gzbxDO = devGzbxMapper.selectOne("id", id);
|
||||||
if (existingRecord != null) {
|
if (gzbxDO == null) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
if (loginUser == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Long userId = loginUser.getId();
|
||||||
|
if(gzbxDO.getLeaderUserZt() == 0 && userId.equals(gzbxDO.getLeaderUserId())){
|
||||||
|
Long assign_dept_id = lideeYunJiUtils.getMap2Long(params, "assign_dept_id");
|
||||||
|
String leader_user_yj = lideeYunJiUtils.getMap2Str(params, "leader_user_yj");
|
||||||
|
gzbxDO.setAssignDeptId(assign_dept_id);
|
||||||
|
gzbxDO.setLeaderUserYj(leader_user_yj);
|
||||||
|
gzbxDO.setLeaderUserZt(1);
|
||||||
|
|
||||||
|
// 通过部门ID获取部门信息,进而获取负责人ID
|
||||||
|
Long assignDeptLeader = null;
|
||||||
|
if (assign_dept_id != null) {
|
||||||
|
DeptRespDTO dept = apiDeptApi.getDept(assign_dept_id);
|
||||||
|
if (dept != null) {
|
||||||
|
assignDeptLeader = dept.getLeaderUserId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gzbxDO.setAssignDeptLeader(assignDeptLeader);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(gzbxDO.getAssignUserZt() == 0 && userId.equals(gzbxDO.getAssignDeptLeader())){
|
||||||
|
String assign_user_yj = lideeYunJiUtils.getMap2Str(params, "assign_user_yj");
|
||||||
|
gzbxDO.setAssignUserYj(assign_user_yj);
|
||||||
|
gzbxDO.setAssignUserZt(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(gzbxDO.getAssignUserZt() == 1 && gzbxDO.getLeaderUserZt() == 1){
|
||||||
|
DevGzbxWxgdDO newRecord = new DevGzbxWxgdDO();
|
||||||
|
BeanUtils.copyProperties(gzbxDO, newRecord);
|
||||||
|
newRecord.setId(null);
|
||||||
|
newRecord.setGzbxId(id);
|
||||||
|
newRecord.setFaultType(gzbxDO.getType());
|
||||||
|
newRecord.setFaultRemark(gzbxDO.getRemark());
|
||||||
|
newRecord.setNumber(generateFaultNumber());
|
||||||
|
newRecord.setProcessingStatus(AcceptanceStatusEnum.UNTREATED.getType());
|
||||||
|
newRecord.setCreateUserName(gzbxDO.getCreateUserName());
|
||||||
|
devGzbxWxgdMapper.insert(newRecord);
|
||||||
|
}
|
||||||
|
gzbxDO.setProcessingStatus(AcceptanceStatusEnum.TREATED.getType());
|
||||||
|
devGzbxMapper.updateById(gzbxDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
DevGzbxDO gzbxDO = devGzbxMapper.selectOne("id", id);
|
|
||||||
if (gzbxDO == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
DevGzbxWxgdDO newRecord = new DevGzbxWxgdDO();
|
|
||||||
BeanUtils.copyProperties(gzbxDO, newRecord);
|
|
||||||
newRecord.setId(null);
|
|
||||||
newRecord.setGzbxId(id);
|
|
||||||
newRecord.setFaultType(gzbxDO.getType());
|
|
||||||
newRecord.setFaultRemark(gzbxDO.getRemark());
|
|
||||||
newRecord.setNumber(generateFaultNumber(params));
|
|
||||||
newRecord.setCreateUserName(gzbxDO.getCreateUserName());
|
|
||||||
devGzbxWxgdMapper.insert(newRecord);
|
|
||||||
gzbxDO.setProcessingStatus(AcceptanceStatusEnum.TREATED.getType());
|
|
||||||
devGzbxMapper.updateById(gzbxDO);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterExecute(EnhanceContext enhanceContext) {
|
public void afterExecute(EnhanceContext enhanceContext) {
|
||||||
|
Map<String, Object> params = enhanceContext.getParam().getParams();
|
||||||
|
Long id = lideeYunJiUtils.getMap2Long(params, "id");
|
||||||
|
if (id == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
DevGzbxDO gzbxDO = devGzbxMapper.selectOne("id", id);
|
||||||
|
if (gzbxDO == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(gzbxDO.getProcessingStatus() == 3){
|
||||||
|
//不通过时 编辑
|
||||||
|
gzbxDO.setProcessingStatus(0);
|
||||||
|
gzbxDO.setLeaderUserZt(0);
|
||||||
|
gzbxDO.setLeaderUserYj(null);
|
||||||
|
gzbxDO.setAssignUserYj(null);
|
||||||
|
gzbxDO.setAssignUserZt(0);
|
||||||
|
gzbxDO.setAssignDeptLeader(null);
|
||||||
|
gzbxDO.setAssignDeptId(null);
|
||||||
|
devGzbxMapper.updateById(gzbxDO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String generateFaultNumber(Map<String, Object> params) {
|
private String generateFaultNumber() {
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||||
return "GD" + LocalDateTime.now().format(formatter);
|
return "GD" + LocalDateTime.now().format(formatter);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,22 +5,21 @@ import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
|||||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||||
import com.lideeyunji.core.framework.mapper.AdapterMapper;
|
import com.lideeyunji.core.framework.mapper.AdapterMapper;
|
||||||
import com.lideeyunji.module.biz.entity.DevGzbxDO;
|
import com.lideeyunji.module.biz.entity.DevGzbxDO;
|
||||||
import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO;
|
|
||||||
import com.lideeyunji.module.biz.mapper.DevGzbxMapper;
|
import com.lideeyunji.module.biz.mapper.DevGzbxMapper;
|
||||||
import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper;
|
import com.lideeyunji.service.system.api.IApiDeptApi;
|
||||||
|
import com.lideeyunji.service.system.dto.DeptRespDTO;
|
||||||
import com.lideeyunji.tool.framework.security.core.LoginUser;
|
import com.lideeyunji.tool.framework.security.core.LoginUser;
|
||||||
import com.lideeyunji.tool.framework.security.core.util.SecurityFrameworkUtils;
|
import com.lideeyunji.tool.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import com.lideeyunji.tool.framework.yunji.enums.ProcessingStatusEnum;
|
|
||||||
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
||||||
import jodd.util.StringUtil;
|
import jodd.util.StringUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
|
import static com.lideeyunji.tool.framework.security.core.util.SecurityFrameworkUtils.getLoginDeptId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 故障报修-新增-java增强
|
* 故障报修-新增-java增强
|
||||||
@@ -31,10 +30,12 @@ public class AddFaultReportingFunctionRecord implements AroundAdvicePlugin {
|
|||||||
@Resource
|
@Resource
|
||||||
private DevGzbxMapper devGzbxMapper;
|
private DevGzbxMapper devGzbxMapper;
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private AdapterMapper adapterMapper;
|
private AdapterMapper adapterMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IApiDeptApi apiDeptApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeExecute(EnhanceContext enhanceContext) {
|
public void beforeExecute(EnhanceContext enhanceContext) {
|
||||||
|
|
||||||
@@ -51,10 +52,21 @@ public class AddFaultReportingFunctionRecord implements AroundAdvicePlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Long userId = loginUser.getId();
|
Long userId = loginUser.getId();
|
||||||
|
// 获取当前登录人的部门ID
|
||||||
|
Long deptId = getLoginDeptId();
|
||||||
|
// 通过部门ID获取部门信息,进而获取负责人ID
|
||||||
|
Long leaderUserId = null;
|
||||||
|
if (deptId != null) {
|
||||||
|
DeptRespDTO dept = apiDeptApi.getDept(deptId);
|
||||||
|
if (dept != null) {
|
||||||
|
leaderUserId = dept.getLeaderUserId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DevGzbxDO devGzbxDO = new DevGzbxDO();
|
DevGzbxDO devGzbxDO = new DevGzbxDO();
|
||||||
devGzbxDO.setId(id);
|
devGzbxDO.setId(id);
|
||||||
devGzbxDO.setFaultNumber(faultNumber);
|
devGzbxDO.setFaultNumber(faultNumber);
|
||||||
|
devGzbxDO.setLeaderUserId(leaderUserId);
|
||||||
devGzbxDO.setReporter(userId);
|
devGzbxDO.setReporter(userId);
|
||||||
devGzbxDO.setCreateUserName(adapterMapper.getNickname(userId));
|
devGzbxDO.setCreateUserName(adapterMapper.getNickname(userId));
|
||||||
devGzbxMapper.updateById(devGzbxDO);
|
devGzbxMapper.updateById(devGzbxDO);
|
||||||
|
|||||||
@@ -2,20 +2,15 @@ package com.lideeyunji.module.biz.controller.maintenance;
|
|||||||
|
|
||||||
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
|
||||||
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
|
||||||
import com.lideeyunji.module.biz.entity.DevGzbxWxfaDO;
|
|
||||||
import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO;
|
import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO;
|
||||||
import com.lideeyunji.module.biz.mapper.DevGzbxWxfaMapper;
|
import com.lideeyunji.module.biz.mapper.DevGzbxMapper;
|
||||||
import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper;
|
import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper;
|
||||||
import com.lideeyunji.tool.framework.yunji.enums.AcceptanceStatusEnum;
|
import com.lideeyunji.tool.framework.yunji.enums.AcceptanceStatusEnum;
|
||||||
import com.lideeyunji.tool.framework.yunji.enums.ProcessingStatusEnum;
|
|
||||||
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
|
||||||
import jodd.util.StringUtil;
|
import jodd.util.StringUtil;
|
||||||
import org.springframework.beans.BeanUtils;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -24,19 +19,19 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
@Component("FaultRepairFunctionRecord")
|
@Component("FaultRepairFunctionRecord")
|
||||||
public class FaultRepairFunctionRecord implements AroundAdvicePlugin {
|
public class FaultRepairFunctionRecord implements AroundAdvicePlugin {
|
||||||
@Resource
|
|
||||||
private DevGzbxWxfaMapper devGzbxWxfaMapper;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DevGzbxWxgdMapper devGzbxWxgdMapper;
|
private DevGzbxWxgdMapper devGzbxWxgdMapper;
|
||||||
|
|
||||||
// @Resource
|
@Resource
|
||||||
|
private DevGzbxMapper devGzbxMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeExecute(EnhanceContext enhanceContext) {
|
public void beforeExecute(EnhanceContext enhanceContext) {
|
||||||
Map<String, Object> params = enhanceContext.getParam().getParams();
|
Map<String, Object> params = enhanceContext.getParam().getParams();
|
||||||
|
|
||||||
String submitType = lideeYunJiUtils.getMap2Str(params, "submitType");
|
String submitType = lideeYunJiUtils.getMap2Str(params, "submitType");
|
||||||
if (!"ys".equals(submitType)) {
|
if (!"zdldcl".equals(submitType)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,25 +40,30 @@ public class FaultRepairFunctionRecord implements AroundAdvicePlugin {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DevGzbxWxfaDO existingRecord = devGzbxWxfaMapper.selectOne("gzbx_id", id);
|
|
||||||
if (existingRecord != null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
DevGzbxWxgdDO wxgdDO = devGzbxWxgdMapper.selectOne("id", id);
|
DevGzbxWxgdDO wxgdDO = devGzbxWxgdMapper.selectOne("id", id);
|
||||||
if (wxgdDO == null) {
|
if (wxgdDO == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DevGzbxWxfaDO newRecord = new DevGzbxWxfaDO();
|
String maintenance_person = lideeYunJiUtils.getMap2Str(params, "maintenance_person");
|
||||||
BeanUtils.copyProperties(wxgdDO, newRecord);
|
String accessories = lideeYunJiUtils.getMap2Str(params, "accessories");
|
||||||
newRecord.setId(null);
|
String solution = lideeYunJiUtils.getMap2Str(params, "solution");
|
||||||
newRecord.setGzbxId(id);
|
String repair_date_str = lideeYunJiUtils.getMap2Str(params, "repair_date");
|
||||||
newRecord.setDevStatus(0);
|
Date repair_date = null;
|
||||||
newRecord.setCreateTime(new Date());
|
if (StringUtil.isNotBlank(repair_date_str)) {
|
||||||
newRecord.setNumber(generateFaultNumber(params));
|
try {
|
||||||
devGzbxWxfaMapper.insert(newRecord);
|
repair_date = new java.text.SimpleDateFormat("yyyy-MM-dd").parse(repair_date_str);
|
||||||
wxgdDO.setDevStatus(AcceptanceStatusEnum.TREATED.getType());
|
} catch (Exception e) {
|
||||||
wxgdDO.setProcessingStatus(null);
|
// 忽略解析异常
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String repair_time = lideeYunJiUtils.getMap2Str(params, "repair_time");
|
||||||
|
wxgdDO.setMaintenancePerson(maintenance_person);
|
||||||
|
wxgdDO.setAccessories(accessories);
|
||||||
|
wxgdDO.setSolution(solution);
|
||||||
|
wxgdDO.setRepair_date(repair_date);
|
||||||
|
wxgdDO.setRepair_time(repair_time);
|
||||||
|
wxgdDO.setProcessingStatus(AcceptanceStatusEnum.TREATED.getType());
|
||||||
devGzbxWxgdMapper.updateById(wxgdDO);
|
devGzbxWxgdMapper.updateById(wxgdDO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,9 +72,4 @@ public class FaultRepairFunctionRecord implements AroundAdvicePlugin {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private String generateFaultNumber(Map<String, Object> params) {
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
|
||||||
return "FA" + LocalDateTime.now().format(formatter);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package com.lideeyunji.module.biz.entity;
|
package com.lideeyunji.module.biz.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.lideeyunji.tool.framework.tenant.core.db.TenantBaseDO;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.*;
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -91,6 +92,45 @@ public class DevGzbxDO {
|
|||||||
@TableField("reporter")
|
@TableField("reporter")
|
||||||
private Long reporter;
|
private Long reporter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门领导
|
||||||
|
*/
|
||||||
|
private Long leaderUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门领导意见
|
||||||
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||||
|
private String leaderUserYj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门领导审批状态
|
||||||
|
*/
|
||||||
|
private Integer leaderUserZt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定下级部门
|
||||||
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||||
|
private Long assignDeptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定下级部门领导
|
||||||
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||||
|
private Long assignDeptLeader;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定下级部门领导意见
|
||||||
|
*/
|
||||||
|
@TableField(updateStrategy = FieldStrategy.ALWAYS)
|
||||||
|
private String assignUserYj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定下级部门领导审批状态
|
||||||
|
*/
|
||||||
|
private Integer assignUserZt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号码
|
* 手机号码
|
||||||
*/
|
*/
|
||||||
@@ -135,13 +175,7 @@ public class DevGzbxDO {
|
|||||||
private Integer isDeleted;
|
private Integer isDeleted;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设备状态(0-正常 1-异常 2-维护中 3-已报废)
|
* 处理状态(0-待处理 1-处理中 2-已完成 )
|
||||||
*/
|
|
||||||
@TableField("dev_status")
|
|
||||||
private Integer devStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理状态(0-待处理 1-处理中 2-已处理 3-已关闭)
|
|
||||||
*/
|
*/
|
||||||
@TableField("processing_status")
|
@TableField("processing_status")
|
||||||
private Integer processingStatus;
|
private Integer processingStatus;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class DevGzbxWxgdDO {
|
|||||||
private Long tenantId;
|
private Long tenantId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理状态(0-待处理 1-处理中 2-已处理 3-已关闭)
|
* 处理状态(0-待处理 1-处理中 2-已完成)
|
||||||
*/
|
*/
|
||||||
@TableField("processing_status")
|
@TableField("processing_status")
|
||||||
private Integer processingStatus;
|
private Integer processingStatus;
|
||||||
@@ -143,7 +143,7 @@ public class DevGzbxWxgdDO {
|
|||||||
* 维修人员ID
|
* 维修人员ID
|
||||||
*/
|
*/
|
||||||
@TableField("maintenance_person")
|
@TableField("maintenance_person")
|
||||||
private Long maintenancePerson;
|
private String maintenancePerson;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否停机(0-否 1-是)
|
* 是否停机(0-否 1-是)
|
||||||
@@ -163,17 +163,58 @@ public class DevGzbxWxgdDO {
|
|||||||
@TableField("reporter")
|
@TableField("reporter")
|
||||||
private Long reporter;
|
private Long reporter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门领导
|
||||||
|
*/
|
||||||
|
private Long leaderUserId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门领导意见
|
||||||
|
*/
|
||||||
|
private String leaderUserYj;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定下级部门
|
||||||
|
*/
|
||||||
|
private Long assignDeptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定下级部门领导
|
||||||
|
*/
|
||||||
|
private Long assignDeptLeader;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定下级部门领导验收状态 0 1已验收
|
||||||
|
*/
|
||||||
|
private Integer assignYsZt;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门领导验收状态0 1已验收
|
||||||
|
*/
|
||||||
|
private Integer leaderYsZt;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更换配件情况
|
||||||
|
*/
|
||||||
|
private String accessories;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解决措施
|
||||||
|
*/
|
||||||
|
private String solution;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 手机号码
|
* 手机号码
|
||||||
*/
|
*/
|
||||||
@TableField("phone_number")
|
@TableField("phone_number")
|
||||||
private String phoneNumber;
|
private String phoneNumber;
|
||||||
|
|
||||||
/**
|
|
||||||
* 设备状态
|
|
||||||
*/
|
|
||||||
@TableField("dev_status")
|
|
||||||
private Integer devStatus;
|
|
||||||
/**
|
/**
|
||||||
* 严重级别
|
* 严重级别
|
||||||
*/
|
*/
|
||||||
@@ -195,5 +236,14 @@ public class DevGzbxWxgdDO {
|
|||||||
*/
|
*/
|
||||||
@TableField("create_user_name")
|
@TableField("create_user_name")
|
||||||
private String createUserName;
|
private String createUserName;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||||
|
private Date repair_date;
|
||||||
|
|
||||||
|
private String repair_time;
|
||||||
|
|
||||||
|
private String leaderYsYj;
|
||||||
|
|
||||||
|
private String assignYsYj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
package com.lideeyunji.module.biz.service;
|
package com.lideeyunji.module.biz.service;
|
||||||
import com.lideeyunji.module.biz.entity.DevGzbxDO;
|
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 故障报修 Service 接口
|
* 故障报修 Service 接口
|
||||||
@@ -10,14 +7,8 @@ import javax.validation.Valid;
|
|||||||
*/
|
*/
|
||||||
public interface DevGzbxService {
|
public interface DevGzbxService {
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建故障报修
|
|
||||||
*
|
|
||||||
* @param devGzbxDO 修改报修状态
|
|
||||||
* @return 配置编号
|
|
||||||
*/
|
|
||||||
void updateDevgGzbx(@Valid DevGzbxDO devGzbxDO);
|
|
||||||
|
|
||||||
|
|
||||||
|
void auditNotPass(Long id);
|
||||||
|
|
||||||
|
void orderAuditNotPass(Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.lideeyunji.module.biz.service.impl;
|
package com.lideeyunji.module.biz.service.impl;
|
||||||
|
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
import com.lideeyunji.module.biz.entity.DevGzbxDO;
|
import com.lideeyunji.module.biz.entity.DevGzbxDO;
|
||||||
|
import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO;
|
||||||
import com.lideeyunji.module.biz.mapper.DevGzbxMapper;
|
import com.lideeyunji.module.biz.mapper.DevGzbxMapper;
|
||||||
|
import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper;
|
||||||
import com.lideeyunji.module.biz.service.DevGzbxService;
|
import com.lideeyunji.module.biz.service.DevGzbxService;
|
||||||
|
import com.lideeyunji.tool.framework.yunji.enums.AcceptanceStatusEnum;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -20,11 +22,23 @@ public class DevGzbxServiceImpl implements DevGzbxService {
|
|||||||
@Resource
|
@Resource
|
||||||
private DevGzbxMapper devGzbxMapper;
|
private DevGzbxMapper devGzbxMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DevGzbxWxgdMapper devGzbxWxgdMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateDevgGzbx(DevGzbxDO devGzbxDO) {
|
public void auditNotPass(Long id) {
|
||||||
devGzbxDO.setDevStatus(1);
|
DevGzbxDO gzbx = new DevGzbxDO();
|
||||||
devGzbxMapper.updateById(devGzbxDO);
|
gzbx.setId(id);
|
||||||
|
gzbx.setProcessingStatus(AcceptanceStatusEnum.REJECTED.getType());
|
||||||
|
devGzbxMapper.updateById(gzbx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void orderAuditNotPass(Long id) {
|
||||||
|
DevGzbxWxgdDO wxgd = new DevGzbxWxgdDO();
|
||||||
|
wxgd.setId(id);
|
||||||
|
wxgd.setProcessingStatus(AcceptanceStatusEnum.YSREJECTED.getType());
|
||||||
|
devGzbxWxgdMapper.updateById(wxgd);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,11 @@ package com.lideeyunji.tool.framework.yunji.enums;
|
|||||||
public enum AcceptanceStatusEnum {
|
public enum AcceptanceStatusEnum {
|
||||||
|
|
||||||
|
|
||||||
UNTREATED(0, "未处理"),
|
UNTREATED(0, "待处理"),
|
||||||
TREATED(1, "已处理"),
|
TREATED(1, "处理中"),
|
||||||
PENDING(2, "待验收"),
|
COMPLETED(2, "已完成"),
|
||||||
COMPLETED(3, "已完成"),
|
REJECTED(3, "不通过"),
|
||||||
|
YSREJECTED(4, "验收不通过"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final Integer type;
|
private final Integer type;
|
||||||
|
|||||||
Reference in New Issue
Block a user