Commit 105086c2 authored by ljh's avatar ljh

new file

parent d9e40b57
......@@ -8,6 +8,7 @@ import com.ebo.mapper.WorkOrderServiceMapper;
import com.ebo.module.fast.common.BtnServerEnhanceJavaInter;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.Serializable;
......@@ -17,7 +18,7 @@ import java.util.Map;
@Service
@Slf4j
public class CloseWorkOrderServiceBtnEnhance implements BtnServerEnhanceJavaInter {
@Resource
@Autowired
private WorkOrderMapper workOrderMapper;
@Resource
private WorkOrderServiceMapper workOrderServiceMapper;
......@@ -38,21 +39,57 @@ public class CloseWorkOrderServiceBtnEnhance implements BtnServerEnhanceJavaInte
@Override
public void executeAfter(String tableName, String buttonCode, Map data) throws ServerException, MalformedURLException {
log.info("-----关单业务增强-----{}", JSON.toJSON(data));
WorkOrderEntity workOrderEntity = workOrderMapper.selectById((Serializable) data.get("id"));
WorkOrderEntity workOrderEntity = workOrderMapper.selectById(data.get("id").toString());
if (workOrderEntity == null) {
throw new ServerException("该工单已失效,请重新刷新页面");
}
// 获取关单类型
String closeType = workOrderEntity.getCloseOrderType();
//等于服务工单
if(workOrderEntity.getWorkOrderType().equals("1")){
/**
* 底层没改完动不了,需要进行workordernum相连,然后更改工单状态
* @TODO
*/
// if(workOrderEntity.getCloseOrderType().equals("1")){
// workOrderServiceMapper.selectById(workOrderEntity.getWorkOrderNumber());
//
// }
}else {
throw new RuntimeException("不是服务工单");
// if(workOrderEntity.getWorkOrderType().equals("1")){
// /**
// * 底层没改完动不了,需要进行workordernum相连,然后更改工单状态
// * @TODO
// */
//// if(workOrderEntity.getCloseOrderType().equals("1")){
//// workOrderServiceMapper.selectById(workOrderEntity.getWorkOrderNumber());
////
//// }
// }else {
// throw new RuntimeException("不是服务工单");
// }
if (data.get("closeOrderType").equals("1")){ // 正常关单
if(workOrderEntity.getStatus().equals("3")){
setMethod(workOrderEntity, data, "1");
log.info("值为:{}",workOrderEntity.getStatus());
}else {
throw new ServerException("工单状态异常");
}
}else if (data.get("closeOrderType").equals("2")){ // 异常关单
if(workOrderEntity.getStatus().equals("3")){
setMethod(workOrderEntity, data, "2");
log.info("值为:{}",workOrderEntity.getStatus());
}else {
throw new ServerException("工单状态异常");
}
}else if (data.get("closeOrderType").equals("3")){ // 转需求关单
if(workOrderEntity.getStatus().equals("3")){
setMethod(workOrderEntity, data,"3");
log.info("值为:{}",workOrderEntity.getStatus());
}else {
throw new ServerException("工单状态异常");
}
}
}
void setMethod(WorkOrderEntity workOrderEntity, Map data,String closeType){
workOrderEntity.setStatus("4");
workOrderEntity.setActualWorkHours((Integer) data.get("actualWorkHours"));
workOrderEntity.setCloseOrderDescription((String) data.get("closeOrderDescription"));
workOrderEntity.setCloseOrderAttachment((String) data.get("closeOrderAttachment"));
workOrderEntity.setCloseOrderType(closeType);
workOrderMapper.updateById(workOrderEntity);
}
}
......@@ -30,13 +30,14 @@ public class NewlyAddedBtnEnhance implements BtnServerEnhanceJavaInter {
log.info("-----调用保存业务增强方法,确保工单为根工单时,根信息保存自己-----");
String idValue = (String) data.get("id");
WorkOrderEntity workOrderEntity = workOrderMapper.selectById(idValue);
// 父工单编号为空时
if(workOrderEntity.getParentWorkOrderNumber() == null || workOrderEntity.getParentWorkOrderNumber().isEmpty()){
// 设置根工单编号为自己
workOrderEntity.setRootWorkOrderNumber(workOrderEntity.getWorkOrderNumber());
// 设置根工单类型为自己
workOrderEntity.setWorkOrderType(workOrderEntity.getWorkOrderType());
}
workOrderMapper.updateById(workOrderEntity);
}
}
......@@ -20,15 +20,18 @@ spring:
master:
# MySQL8
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/fast_order_pt_dev?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
username: root
password: Q23897876p
# url: jdbc:mysql://localhost:3306/fast_order_pt_dev?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
# username: root
# password: 123456
url: jdbc:mysql://120.25.76.111:53306/dcode_dev?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
username: dcode_dev
password: 4nDrYSMZEdWhwh64
oms:
# MySQL8
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/fast_order_pt_dev?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
username: root
password: Q23897876p
url: jdbc:mysql://120.25.76.111:53306/dcode_dev?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
username: dcode_dev
password: 4nDrYSMZEdWhwh64
logging:
level:
org:
......@@ -51,7 +54,7 @@ xxl:
accessToken: Ebo-Token #调度中心通讯TOKEN [选填]:非空时启用
execl:
# outFileTempPath: /Users/gxh/Documents/ybProject/fast-spms3/fast-spms-admin/oms-server/src/main/resources/execlOutTemp
outFileTempPath: D:/HuaweiMoveData/Users/14983/Desktop/gitcode
outFileTempPath: C:/Users/86176/Desktop/itaskTempFile
file:
storage:
......
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