故障保修 功能修改 审批 验收

This commit is contained in:
shih
2026-04-16 16:20:01 +08:00
parent 74c6e749f2
commit f65019927b
12 changed files with 309 additions and 132 deletions

View File

@@ -1,20 +1,20 @@
package com.lideeyunji.module.biz.controller;
import com.lideeyunji.module.biz.entity.DevGzbxDO;
import com.lideeyunji.module.biz.service.DevGzbxService;
import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant;
import com.lideeyunji.tool.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import com.lideeyunji.tool.framework.constants.FrameErrorCodeConstants;
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 org.springframework.stereotype.Component;
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.validation.Valid;
import static com.lideeyunji.tool.framework.common.pojo.CommonResult.success;
import java.util.Map;
/**
* @author DX
@@ -30,11 +30,24 @@ public class DevGzbxController {
@Resource
private DevGzbxService devGzbxService;
@PutMapping("/updateStatus")
@Operation(tags = "故障报修",summary = "故障报修状态修改")
public CommonResult<Boolean> updateConfig(@Valid @RequestBody DevGzbxDO devGzbxDO) {
devGzbxService.updateDevgGzbx(devGzbxDO);
return success(true);
@PostMapping("/auditNotPass")
public BaseWebResult auditNotPass(@RequestBody Map<String,Object> model) {
Long id = lideeYunJiUtils.getMap2Long(model, "id");
if(id == null){
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("审批成功");
}
}

View File

@@ -1,11 +1,15 @@
package com.lideeyunji.module.biz.controller;
import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext;
import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin;
import com.lideeyunji.module.biz.entity.*;
import com.lideeyunji.module.biz.mapper.*;
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.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.ProcessingStatusEnum;
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -32,14 +36,33 @@ public class EquipmentMalfunctionCheck implements AroundAdvicePlugin {
Map<String, Object> params = enhanceContext.getParam().getParams();
Long id = lideeYunJiUtils.getMap2Long(params, "id");
DevGzbxWxgdDO yorn = devGzbxWxgdMapper.selectOne("id",id);
yorn.setProcessingStatus(ProcessingStatusEnum.ACCEPTED.getType());
yorn.setDevStatus(AcceptanceStatusEnum.COMPLETED.getType());
yorn.setCompletionTime(new Date());
yorn.setAcceptanceTime(new Date());
DevGzbxDO devGzbxDO = devGzbxMapper.selectOne("id", yorn.getGzbxId());
devGzbxDO.setProcessingStatus(AcceptanceStatusEnum.COMPLETED.getType());
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
if (loginUser == null) {
return;
}
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);
devGzbxMapper.updateById(devGzbxDO);
}
@Override

View File

@@ -47,10 +47,10 @@ public class EquipmentMalfunctionOrder implements AroundAdvicePlugin {
yorn.setDevStatus(2);
devGzbxWxfaMapper.insertOrUpdate(yorn);
DevGzbxWxgdDO devGzbxWxgdDO = devGzbxWxgdMapper.selectOne("gzbx_id", gzbx_id);
devGzbxWxgdDO.setDevStatus(2);
// devGzbxWxgdDO.setDevStatus(2);
devGzbxWxgdMapper.updateBatch(devGzbxWxgdDO);
DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbx_id);
devGzbxDO.setDevStatus(2);
// devGzbxDO.setDevStatus(2);
devGzbxMapper.insertOrUpdate(devGzbxDO);
}
} else if (status == 0) {
@@ -59,11 +59,11 @@ public class EquipmentMalfunctionOrder implements AroundAdvicePlugin {
devGzbxWxfaDO.setDevStatus(0);
devGzbxWxfaMapper.updateBatch(devGzbxWxfaDO);
DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbx_id);
devGzbxDO.setDevStatus(0);
// devGzbxDO.setDevStatus(0);
devGzbxMapper.insertOrUpdate(devGzbxDO);
} else {
DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbx_id);
devGzbxDO.setDevStatus(0);
// devGzbxDO.setDevStatus(0);
devGzbxMapper.insertOrUpdate(devGzbxDO);
}
}

View File

@@ -55,7 +55,7 @@ public class EquipmentMalfunctionRecord implements AroundAdvicePlugin {
DevGzbxWxgdDO devGzbxWxgdDO = devGzbxWxgdMapper.selectOne("id", gzbxId);
if (devGzbxWxgdDO != null) {
devGzbxWxgdDO.setDevStatus(2);
// devGzbxWxgdDO.setDevStatus(2);
devGzbxWxgdMapper.updateById(devGzbxWxgdDO);
}

View File

@@ -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.plugin.AroundAdvicePlugin;
import com.lideeyunji.core.framework.mapper.AdapterMapper;
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.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.util.SecurityFrameworkUtils;
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 jodd.util.StringUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -22,7 +21,6 @@ import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Map;
import java.util.Objects;
/**
* 设备报修工单-环绕
@@ -37,53 +35,99 @@ public class EquipmentMalfunctionRepair implements AroundAdvicePlugin {
private DevGzbxMapper devGzbxMapper;
@Resource
private AdapterMapper adapterMapper;
private IApiDeptApi apiDeptApi;
@Override
@Transactional
public void beforeExecute(EnhanceContext enhanceContext) {
Map<String, Object> params = enhanceContext.getParam().getParams();
String submitType = lideeYunJiUtils.getMap2Str(params, "submitType");
if (!"ys".equals(submitType)) {
return;
}
Long id = lideeYunJiUtils.getMap2Long(params, "id");
if (id == null) {
return;
}
if ("cl".equals(submitType)) {
DevGzbxWxgdDO existingRecord = devGzbxWxgdMapper.selectOne("gzbx_id", id);
if (existingRecord != null) {
return;
}
DevGzbxWxgdDO existingRecord = devGzbxWxgdMapper.selectOne("gzbx_id", id);
if (existingRecord != null) {
return;
DevGzbxDO gzbxDO = devGzbxMapper.selectOne("id", id);
if (gzbxDO == null) {
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
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");
return "GD" + LocalDateTime.now().format(formatter);
}

View File

@@ -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.mapper.AdapterMapper;
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.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.util.SecurityFrameworkUtils;
import com.lideeyunji.tool.framework.yunji.enums.ProcessingStatusEnum;
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
import jodd.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Map;
import java.util.Objects;
import static com.lideeyunji.tool.framework.security.core.util.SecurityFrameworkUtils.getLoginDeptId;
/**
* 故障报修-新增-java增强
@@ -31,10 +30,12 @@ public class AddFaultReportingFunctionRecord implements AroundAdvicePlugin {
@Resource
private DevGzbxMapper devGzbxMapper;
@Resource
private AdapterMapper adapterMapper;
@Resource
private IApiDeptApi apiDeptApi;
@Override
public void beforeExecute(EnhanceContext enhanceContext) {
@@ -51,10 +52,21 @@ public class AddFaultReportingFunctionRecord implements AroundAdvicePlugin {
return;
}
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.setId(id);
devGzbxDO.setFaultNumber(faultNumber);
devGzbxDO.setLeaderUserId(leaderUserId);
devGzbxDO.setReporter(userId);
devGzbxDO.setCreateUserName(adapterMapper.getNickname(userId));
devGzbxMapper.updateById(devGzbxDO);

View File

@@ -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.plugin.AroundAdvicePlugin;
import com.lideeyunji.module.biz.entity.DevGzbxWxfaDO;
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.tool.framework.yunji.enums.AcceptanceStatusEnum;
import com.lideeyunji.tool.framework.yunji.enums.ProcessingStatusEnum;
import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils;
import jodd.util.StringUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.Map;
@@ -24,19 +19,19 @@ import java.util.Map;
*/
@Component("FaultRepairFunctionRecord")
public class FaultRepairFunctionRecord implements AroundAdvicePlugin {
@Resource
private DevGzbxWxfaMapper devGzbxWxfaMapper;
@Resource
private DevGzbxWxgdMapper devGzbxWxgdMapper;
// @Resource
@Resource
private DevGzbxMapper devGzbxMapper;
@Override
public void beforeExecute(EnhanceContext enhanceContext) {
Map<String, Object> params = enhanceContext.getParam().getParams();
String submitType = lideeYunJiUtils.getMap2Str(params, "submitType");
if (!"ys".equals(submitType)) {
if (!"zdldcl".equals(submitType)) {
return;
}
@@ -45,25 +40,30 @@ public class FaultRepairFunctionRecord implements AroundAdvicePlugin {
return;
}
DevGzbxWxfaDO existingRecord = devGzbxWxfaMapper.selectOne("gzbx_id", id);
if (existingRecord != null) {
return;
}
DevGzbxWxgdDO wxgdDO = devGzbxWxgdMapper.selectOne("id", id);
if (wxgdDO == null) {
return;
}
DevGzbxWxfaDO newRecord = new DevGzbxWxfaDO();
BeanUtils.copyProperties(wxgdDO, newRecord);
newRecord.setId(null);
newRecord.setGzbxId(id);
newRecord.setDevStatus(0);
newRecord.setCreateTime(new Date());
newRecord.setNumber(generateFaultNumber(params));
devGzbxWxfaMapper.insert(newRecord);
wxgdDO.setDevStatus(AcceptanceStatusEnum.TREATED.getType());
wxgdDO.setProcessingStatus(null);
String maintenance_person = lideeYunJiUtils.getMap2Str(params, "maintenance_person");
String accessories = lideeYunJiUtils.getMap2Str(params, "accessories");
String solution = lideeYunJiUtils.getMap2Str(params, "solution");
String repair_date_str = lideeYunJiUtils.getMap2Str(params, "repair_date");
Date repair_date = null;
if (StringUtil.isNotBlank(repair_date_str)) {
try {
repair_date = new java.text.SimpleDateFormat("yyyy-MM-dd").parse(repair_date_str);
} catch (Exception e) {
// 忽略解析异常
}
}
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);
}
@@ -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);
}
}

View File

@@ -1,10 +1,11 @@
package com.lideeyunji.module.biz.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.lideeyunji.tool.framework.tenant.core.db.TenantBaseDO;
import lombok.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
import java.util.Date;
/**
@@ -91,6 +92,45 @@ public class DevGzbxDO {
@TableField("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;
/**
* 设备状态0-正常 1-异常 2-维护中 3-已报废
*/
@TableField("dev_status")
private Integer devStatus;
/**
* 处理状态0-待处理 1-处理中 2-已处理 3-已关闭)
* 处理状态0-待处理 1-处理中 2-已完成
*/
@TableField("processing_status")
private Integer processingStatus;

View File

@@ -80,7 +80,7 @@ public class DevGzbxWxgdDO {
private Long tenantId;
/**
* 处理状态0-待处理 1-处理中 2-已处理 3-已关闭
* 处理状态0-待处理 1-处理中 2-已完成
*/
@TableField("processing_status")
private Integer processingStatus;
@@ -143,7 +143,7 @@ public class DevGzbxWxgdDO {
* 维修人员ID
*/
@TableField("maintenance_person")
private Long maintenancePerson;
private String maintenancePerson;
/**
* 是否停机0-否 1-是)
@@ -163,17 +163,58 @@ public class DevGzbxWxgdDO {
@TableField("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")
private String phoneNumber;
/**
* 设备状态
*/
@TableField("dev_status")
private Integer devStatus;
/**
* 严重级别
*/
@@ -195,5 +236,14 @@ public class DevGzbxWxgdDO {
*/
@TableField("create_user_name")
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;
}

View File

@@ -1,7 +1,4 @@
package com.lideeyunji.module.biz.service;
import com.lideeyunji.module.biz.entity.DevGzbxDO;
import javax.validation.Valid;
/**
* 故障报修 Service 接口
@@ -10,14 +7,8 @@ import javax.validation.Valid;
*/
public interface DevGzbxService {
/**
* 创建故障报修
*
* @param devGzbxDO 修改报修状态
* @return 配置编号
*/
void updateDevgGzbx(@Valid DevGzbxDO devGzbxDO);
void auditNotPass(Long id);
void orderAuditNotPass(Long id);
}

View File

@@ -1,9 +1,11 @@
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.DevGzbxWxgdDO;
import com.lideeyunji.module.biz.mapper.DevGzbxMapper;
import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper;
import com.lideeyunji.module.biz.service.DevGzbxService;
import com.lideeyunji.tool.framework.yunji.enums.AcceptanceStatusEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@@ -20,11 +22,23 @@ public class DevGzbxServiceImpl implements DevGzbxService {
@Resource
private DevGzbxMapper devGzbxMapper;
@Resource
private DevGzbxWxgdMapper devGzbxWxgdMapper;
@Override
public void updateDevgGzbx(DevGzbxDO devGzbxDO) {
devGzbxDO.setDevStatus(1);
devGzbxMapper.updateById(devGzbxDO);
public void auditNotPass(Long id) {
DevGzbxDO gzbx = new 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);
}
}

View File

@@ -7,10 +7,11 @@ package com.lideeyunji.tool.framework.yunji.enums;
public enum AcceptanceStatusEnum {
UNTREATED(0, "处理"),
TREATED(1, "处理"),
PENDING(2, "待验收"),
COMPLETED(3, "已完成"),
UNTREATED(0, "处理"),
TREATED(1, "处理"),
COMPLETED(2, "已完成"),
REJECTED(3, "不通过"),
YSREJECTED(4, "验收不通过"),
;
private final Integer type;