合并第一版
This commit is contained in:
parent
4baec85078
commit
f0e5fcbae8
@ -0,0 +1,91 @@
|
|||||||
|
package com.xdap.self_development.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.common.http.Response;
|
||||||
|
import com.xdap.self_development.controller.request.ApprovalNodeRequest;
|
||||||
|
import com.xdap.self_development.pojo.dto.*;
|
||||||
|
import com.xdap.self_development.service.ActivitiProcessService;
|
||||||
|
import com.xdap.self_development.service.EngineReviewListService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 参数详情 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-13
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/custom/activiti")
|
||||||
|
public class ActivitiProcessController {
|
||||||
|
@Autowired
|
||||||
|
private ActivitiProcessService activitiProcessService;
|
||||||
|
@Autowired
|
||||||
|
private EngineReviewListService engineReviewListService;
|
||||||
|
|
||||||
|
//审批前查看1.存入变更说明到DB,返回变更说明
|
||||||
|
@GetMapping(value = "/initiateApproval")
|
||||||
|
public Response initiateApproval(@RequestParam(value = "modelID") String modelID , @RequestParam(value = "userID") String userID) {
|
||||||
|
List<ActivitiDataDTO> msg = activitiProcessService.initiateApproval(modelID,userID);
|
||||||
|
return Response.ok().data(msg);
|
||||||
|
};
|
||||||
|
//正式发起审批
|
||||||
|
@PostMapping(value = "/startActiviti")
|
||||||
|
public Response startActiviti(@RequestBody ApprovalNodeRequest approvalNodeRequest) {
|
||||||
|
activitiProcessService.startActiviti(approvalNodeRequest);
|
||||||
|
return Response.ok();
|
||||||
|
}
|
||||||
|
//查看审批详情
|
||||||
|
@PostMapping(value = "/showActiviti")
|
||||||
|
public Response showActiviti(@RequestBody ShowActivitiDTO showActivitiDTO) {
|
||||||
|
ActivitiDataAndRecordDTO activitiDataAndRecordDTO = activitiProcessService.showActivitiData(showActivitiDTO);
|
||||||
|
return Response.ok().data(activitiDataAndRecordDTO);
|
||||||
|
}
|
||||||
|
//操作审批
|
||||||
|
@PostMapping(value = "/handleApproval")
|
||||||
|
public Response handleApproval(@RequestBody HandleApprovalDTO handleApprovalDTO) {
|
||||||
|
String msg = activitiProcessService.handleApproval(handleApprovalDTO);
|
||||||
|
return Response.ok().data(msg);
|
||||||
|
};
|
||||||
|
//查看审批
|
||||||
|
@GetMapping(value = "/showEngReview")
|
||||||
|
public Response showEngReview(@RequestParam(value = "userID") String userID,
|
||||||
|
@RequestParam(value = "page") Integer page,@RequestParam(value = "size") Integer size
|
||||||
|
,@RequestParam(value = "ycOrOth") String ycOrOth) {
|
||||||
|
PageResultDTO msg = engineReviewListService.selectEngineReviewListByUserId(userID,page,size,ycOrOth);
|
||||||
|
return Response.ok().data(msg);
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// //查询删除所有部署信息(谨慎使用)
|
||||||
|
// @GetMapping(value = "/deleteDeployment")
|
||||||
|
// public void deleteDeployment() {
|
||||||
|
//
|
||||||
|
// List<Deployment> deployments = repositoryService.createDeploymentQuery().list();
|
||||||
|
// for (Deployment deployment : deployments) {
|
||||||
|
// System.out.println("--------" + deployment);
|
||||||
|
// repositoryService.deleteDeployment(deployment.getId());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// //查询删除所有流程信息(谨慎使用)
|
||||||
|
// @GetMapping(value = "/deleteProcessInstances")
|
||||||
|
// public void deleteProcessInstances(@RequestParam(value = "processkey")String processDefinitionKey) {
|
||||||
|
// // 1. 查询该流程定义下的所有流程实例ID
|
||||||
|
// List<ProcessInstance> instances = runtimeService.createProcessInstanceQuery()
|
||||||
|
// .processDefinitionKey(processDefinitionKey)
|
||||||
|
// .list();
|
||||||
|
//
|
||||||
|
// // 2. 逐个删除流程实例(级联删除任务、变量等)
|
||||||
|
// for (ProcessInstance instance : instances) {
|
||||||
|
// // 删除流程实例(true表示级联删除所有关联数据)
|
||||||
|
// runtimeService.deleteProcessInstance(instance.getId(), "删除原因:清理测试数据");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,90 @@
|
|||||||
|
package com.xdap.self_development.controller;
|
||||||
|
|
||||||
|
import com.definesys.mpaas.common.http.Response;
|
||||||
|
import com.xdap.runtime.service.RuntimeAppContextService;
|
||||||
|
import com.xdap.runtime.service.RuntimeDatasourceService;
|
||||||
|
import com.xdap.runtime.service.RuntimeUserService;
|
||||||
|
import com.xdap.self_development.controller.form.OptionForm;
|
||||||
|
import com.xdap.self_development.controller.form.TemplateForm;
|
||||||
|
import com.xdap.self_development.pojo.Parameter;
|
||||||
|
import com.xdap.self_development.pojo.Template;
|
||||||
|
import com.xdap.self_development.service.DataEntryService;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据录入
|
||||||
|
* 列表为管理模板的列表,其中功能有筛选条件、列表显示、添加模板、导入模板、查看、下载、版本、修改。
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/custom/dataEntry")
|
||||||
|
public class DataEntryController {
|
||||||
|
@Resource
|
||||||
|
private DataEntryService dataEntryService;
|
||||||
|
@Resource
|
||||||
|
private RuntimeAppContextService runtimeAppContextService;
|
||||||
|
@Resource
|
||||||
|
private RuntimeUserService runtimeUserService;
|
||||||
|
@Resource
|
||||||
|
private RuntimeDatasourceService runtimeDatasourceService;
|
||||||
|
|
||||||
|
// 测试接口
|
||||||
|
@GetMapping("/test")
|
||||||
|
public Response getTest() {
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
String currentAppId = runtimeAppContextService.getCurrentAppId();
|
||||||
|
String currentTenantId = runtimeAppContextService.getCurrentTenantId();
|
||||||
|
String currentToken = runtimeAppContextService.getCurrentToken();
|
||||||
|
String currentUserId = runtimeAppContextService.getCurrentUserId();
|
||||||
|
|
||||||
|
map.put("currentAppId", currentAppId);
|
||||||
|
map.put("currentTenantId", currentTenantId);
|
||||||
|
map.put("currentToken", currentToken);
|
||||||
|
map.put("currentUserId", currentUserId);
|
||||||
|
return Response.ok().data(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 筛选条件 模板的模糊搜索
|
||||||
|
@GetMapping("/getTemplateByCondition")
|
||||||
|
public Response getTemplateByCondition(@RequestParam("templateName") String templateName) {
|
||||||
|
List<Template> templates = dataEntryService.getTemplateByCondition(templateName);
|
||||||
|
return Response.ok().data(templates);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 筛选条件 参数的模糊搜索
|
||||||
|
@GetMapping("/getParameterByCondition")
|
||||||
|
public Response getParameterByCondition(OptionForm form) {
|
||||||
|
List<Parameter> parameters = dataEntryService.getParameterByCondition(form);
|
||||||
|
return Response.ok().data(parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加模板参数 (form需指定模板名称)
|
||||||
|
@PostMapping("/insertParameter")
|
||||||
|
public Response insertParameter(@RequestBody TemplateForm form) {
|
||||||
|
dataEntryService.insertParameter(form);
|
||||||
|
return Response.ok().setMessage("添加成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导入模板 导入全部模板参数
|
||||||
|
@PostMapping("/import")
|
||||||
|
public Response importTemplate(@RequestParam("file") MultipartFile file) {
|
||||||
|
dataEntryService.readExcel(file);
|
||||||
|
return Response.ok().setMessage("导入成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载 导出全部模板参数 (可选导出全部、导出指定名称模板、导出空参数模板、可以指定导出某些参数或者不导出某些参数)
|
||||||
|
@GetMapping("/export")
|
||||||
|
public void exportTemplate(
|
||||||
|
@RequestBody OptionForm form,
|
||||||
|
HttpServletResponse response
|
||||||
|
) {
|
||||||
|
dataEntryService.writeExcel(form, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,79 @@
|
|||||||
|
package com.xdap.self_development.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.common.http.Response;
|
||||||
|
import com.xdap.self_development.controller.request.DataEntryEngineModelPageRequest;
|
||||||
|
import com.xdap.self_development.pojo.dto.DataEntryEngineModelDto;
|
||||||
|
import com.xdap.self_development.pojo.dto.PageResultDTO;
|
||||||
|
import com.xdap.self_development.service.DataEntryEngineModelService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 发动机型号数据表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-12
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/custom/dataEntryEngineModel")
|
||||||
|
public class DataEntryEngineModelController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataEntryEngineModelService entryEngineModelService;
|
||||||
|
|
||||||
|
//Excel导入
|
||||||
|
@PostMapping("/excelImport")
|
||||||
|
public Response excelImport(@RequestParam(value = "file") MultipartFile file
|
||||||
|
,String userId,String ycOrOt) {
|
||||||
|
if (file == null || file.isEmpty()) {
|
||||||
|
return Response.error("请选择要导入的文件");
|
||||||
|
}
|
||||||
|
// 文件类型校验
|
||||||
|
String filename = file.getOriginalFilename();
|
||||||
|
if (filename == null || (!filename.endsWith(".xlsx") && !filename.endsWith(".xls"))) {
|
||||||
|
return Response.error("只支持.xlsx或.xls格式的Excel文件");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
entryEngineModelService.excelImport(file,userId,ycOrOt);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return Response.error("导入失败"+e.getMessage());
|
||||||
|
}
|
||||||
|
return Response.ok().data("导入成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
//添加-单条写入
|
||||||
|
@PostMapping("/insert")
|
||||||
|
public Response insert(@RequestBody DataEntryEngineModelPageRequest pageRequest) {
|
||||||
|
entryEngineModelService.insert(pageRequest,pageRequest.getLoginUserId());
|
||||||
|
return Response.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
//分页查询
|
||||||
|
@PostMapping("/selectByPage")
|
||||||
|
public Response selectByConditionPage(@RequestBody DataEntryEngineModelPageRequest pageRequest) {
|
||||||
|
PageResultDTO<DataEntryEngineModelDto> tPageResultDTO = entryEngineModelService.selectByConditionPage(pageRequest);
|
||||||
|
System.out.println("进入方法");
|
||||||
|
return Response.ok().data(tPageResultDTO);
|
||||||
|
}
|
||||||
|
//模板更新审核通过同步机型参数
|
||||||
|
@GetMapping("/updateModelForNewVersion")
|
||||||
|
public Response updateModelForNewVersion() {
|
||||||
|
entryEngineModelService.updateModelForNewVersion();
|
||||||
|
return Response.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Excel导出
|
||||||
|
// @GetMapping("/excelExport")
|
||||||
|
// public Response excelExport(HttpServletResponse response){
|
||||||
|
// entryEngineModelService.excelExport(response);
|
||||||
|
// return Response.ok().data("导入成功");
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,125 @@
|
|||||||
|
package com.xdap.self_development.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.common.http.Response;
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
import com.xdap.self_development.controller.request.EngineParamDetailRequest;
|
||||||
|
import com.xdap.self_development.pojo.EngineParamDetailPojo;
|
||||||
|
import com.xdap.self_development.pojo.dto.EngineParamDetailDTO;
|
||||||
|
import com.xdap.self_development.service.EngineParamDetailService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 参数详情 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-13
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/custom/engineParamDetailPojo")
|
||||||
|
public class EngineParamDetailController {
|
||||||
|
@Autowired
|
||||||
|
private EngineParamDetailService engineParamDetailService;
|
||||||
|
|
||||||
|
|
||||||
|
//参数列表查询
|
||||||
|
@GetMapping("/selectParamList")
|
||||||
|
public Response selectParamList(@RequestParam(value = "modelProName", required = false) String modelProName) {
|
||||||
|
Map<String, List<String>> list = engineParamDetailService.selectParamList(modelProName);
|
||||||
|
return Response.ok().data(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
//参数值查询 一般不用
|
||||||
|
@PostMapping("/selectValueByParam")
|
||||||
|
public Response selectValueByParam(@RequestBody EngineParamDetailRequest engineParamDetailRequest) {
|
||||||
|
List<EngineParamDetailDTO> dtoList = engineParamDetailService.selectValueByParam(engineParamDetailRequest);
|
||||||
|
return Response.ok().data(dtoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
//参数值多项查询(待办点进来和机型查看点进来都要传入机型ID)
|
||||||
|
@PostMapping("/selectValueByMoreParam")
|
||||||
|
public Response selectValueByMoreParam(@RequestBody EngineParamDetailRequest engineParamDetailRequest) {
|
||||||
|
Map<String, List<EngineParamDetailDTO>> stringListMap = engineParamDetailService.selectValueByMoreParam(engineParamDetailRequest);
|
||||||
|
return Response.ok().data(stringListMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Excel导入
|
||||||
|
@PostMapping("/excelImport")
|
||||||
|
public Response excelImport(@RequestParam(value = "file") MultipartFile file,
|
||||||
|
@RequestParam(value = "modelId") String modelId) {
|
||||||
|
if (file == null || file.isEmpty()) {
|
||||||
|
return Response.error("请选择要导入的文件");
|
||||||
|
}
|
||||||
|
// 文件类型校验
|
||||||
|
String filename = file.getOriginalFilename();
|
||||||
|
if (filename == null || (!filename.endsWith(".xlsx") && !filename.endsWith(".xls"))) {
|
||||||
|
return Response.error("只支持.xlsx或.xls格式的Excel文件");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
engineParamDetailService.excelImport(file, modelId);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return Response.error("导入失败" + e.getMessage());
|
||||||
|
}
|
||||||
|
return Response.ok().data("导入成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
//导出模板
|
||||||
|
@GetMapping("/excelExport")
|
||||||
|
public Response excelExport(HttpServletResponse response) {
|
||||||
|
try {
|
||||||
|
engineParamDetailService.excelExport(response);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return Response.error("导出失败" + e.getMessage());
|
||||||
|
}
|
||||||
|
return Response.ok().data("导出成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改
|
||||||
|
@PostMapping(value = "/updateParamValue")
|
||||||
|
public Response updateParamValue(@RequestBody List<EngineParamDetailPojo> engineParamDetailPojos) {
|
||||||
|
try {
|
||||||
|
engineParamDetailService.updateParamValue(engineParamDetailPojos);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
return Response.ok().data("修改成功,保存草稿,准备进入审批");
|
||||||
|
}
|
||||||
|
|
||||||
|
//分解任务
|
||||||
|
@PostMapping(value = "/updateToInsertFiledBy")
|
||||||
|
public Response updateToInsertFiledBy(@RequestBody List<EngineParamDetailPojo> engineParamDetailPojos,
|
||||||
|
@RequestParam(value = "userID") String userID) {
|
||||||
|
try {
|
||||||
|
engineParamDetailService.updateToInsertFiledBy(engineParamDetailPojos, userID);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
return Response.ok().data("修改成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/selectVersionList")
|
||||||
|
public Response selectVersionList(@RequestParam(value = "modelId") String modelId) {
|
||||||
|
List<Integer> versionNumList = engineParamDetailService.selectVersionList(modelId);
|
||||||
|
return Response.ok().data(versionNumList);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查找责任人或填写人列表
|
||||||
|
@GetMapping(value = "/selectPersonoByType")
|
||||||
|
public Response selectPersonoByType(@RequestParam(value = "subSystem") String subSystem,@RequestParam(value = "dept") String dept
|
||||||
|
,@RequestParam(value = "type") Integer type) {
|
||||||
|
List<XdapUsers> xdapUsersPojos = engineParamDetailService.selectPersonoByType(subSystem,dept,type);
|
||||||
|
return Response.ok().data(xdapUsersPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,66 @@
|
|||||||
|
package com.xdap.self_development.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.common.http.Response;
|
||||||
|
import com.xdap.self_development.controller.request.TodoReturnRequest;
|
||||||
|
import com.xdap.self_development.controller.request.TodoTaskRequest;
|
||||||
|
import com.xdap.self_development.pojo.TodoTaskPojo;
|
||||||
|
import com.xdap.self_development.pojo.dto.EngineParamDetailDTO;
|
||||||
|
import com.xdap.self_development.pojo.dto.PageResultDTO;
|
||||||
|
import com.xdap.self_development.service.TodoTaskService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 待办事项表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-18
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/custom/todoTaskPojo")
|
||||||
|
public class TodoTaskController {
|
||||||
|
@Autowired
|
||||||
|
private TodoTaskService todoTaskService;
|
||||||
|
/**
|
||||||
|
* 通过创建人查询待办
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectByPage")
|
||||||
|
public Response selectByPage(@RequestBody TodoTaskRequest todoTaskRequest){
|
||||||
|
List<TodoTaskPojo> todoTaskPojos = todoTaskService.selectByPage(todoTaskRequest);
|
||||||
|
return Response.ok().data(todoTaskPojos);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 通过责任人或填写人查询待办
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectByresPersonPage")
|
||||||
|
public Response selectByresPersonPage(@RequestBody TodoTaskRequest todoTaskRequest){
|
||||||
|
PageResultDTO<TodoTaskPojo> todoTaskPojos = todoTaskService.selectByresPersonPage(todoTaskRequest);
|
||||||
|
return Response.ok().data(todoTaskPojos);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 通过管理员或分解待办任务创建责任人
|
||||||
|
*/
|
||||||
|
@PostMapping("/createResPerson")
|
||||||
|
public Response createResPerson(@RequestBody List<EngineParamDetailDTO> paramDetailPojos
|
||||||
|
, @RequestParam String userID){
|
||||||
|
todoTaskService.createResPerson(paramDetailPojos,userID);
|
||||||
|
return Response.ok();
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 退回单据
|
||||||
|
*/
|
||||||
|
@PostMapping("/todoReturn")
|
||||||
|
public Response todoReturn( @RequestBody TodoReturnRequest todoReturnRequest){
|
||||||
|
todoTaskService.todoReturn(todoReturnRequest);
|
||||||
|
return Response.ok();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
package com.xdap.self_development.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.common.http.Response;
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
import com.xdap.self_development.service.XdapDeptUsersService;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 部门成员关系表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-19
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/custom/xdapDeptUsersPojo")
|
||||||
|
public class XdapDeptUsersController {
|
||||||
|
@Autowired
|
||||||
|
private XdapDeptUsersService xdapDeptUsersService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询部门下的人 用于选择参数填写人
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectUsersByDept")
|
||||||
|
public Response selectUsersByDept(@RequestParam("deptName") String deptName) {
|
||||||
|
List<XdapUsers> xdapUsersPojos = xdapDeptUsersService.selectUserByName(deptName);
|
||||||
|
if (ObjectUtils.isNotEmpty(xdapUsersPojos)) {
|
||||||
|
return Response.ok().data(xdapUsersPojos);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.xdap.self_development.controller.form;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class OptionForm {
|
||||||
|
private String templateName;
|
||||||
|
private Boolean templateEmpty;
|
||||||
|
|
||||||
|
private String parameterType;
|
||||||
|
private String partsName;
|
||||||
|
private String parameterName;
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package com.xdap.self_development.controller.form;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TemplateForm {
|
||||||
|
// 通用
|
||||||
|
private String subsystemName;
|
||||||
|
private String parameterType;
|
||||||
|
private String partsName;
|
||||||
|
private String parameterName;
|
||||||
|
private String unit;
|
||||||
|
private String parameterSource;
|
||||||
|
private String calculationFormula;
|
||||||
|
private String department;
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
// 额外
|
||||||
|
private String parameterTemplateName;
|
||||||
|
private String dataSource;
|
||||||
|
private Long classificationNumber;
|
||||||
|
private String isAnnouncementParameters;
|
||||||
|
private String type;
|
||||||
|
private String numberOrFormula;
|
||||||
|
|
||||||
|
// 模板名称,暂时为sheet页名称
|
||||||
|
private String templateName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
package com.xdap.self_development.controller.request;
|
||||||
|
|
||||||
|
import com.xdap.self_development.pojo.EngineParamDetailPojo;
|
||||||
|
import com.xdap.self_development.pojo.dto.ApprovalNodeDTO;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ApprovalNodeRequest {
|
||||||
|
// 机型基础信息
|
||||||
|
private String modelId;
|
||||||
|
|
||||||
|
// 参数列表(批量参数)
|
||||||
|
private List<EngineParamDetailPojo> paramList;
|
||||||
|
|
||||||
|
// 审批环节配置列表
|
||||||
|
private List<ApprovalNodeDTO> nodeList;
|
||||||
|
|
||||||
|
//审批发起人
|
||||||
|
private String userId;
|
||||||
|
//审批发起说明
|
||||||
|
private String comment;
|
||||||
|
}
|
||||||
@ -0,0 +1,117 @@
|
|||||||
|
package com.xdap.self_development.controller.request;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||||
|
import com.definesys.mpaas.query.model.MpaasBasePojo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 发动机型号数据表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DataEntryEngineModelExcel extends MpaasBasePojo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品型号(全称)
|
||||||
|
*/
|
||||||
|
@ExcelProperty("产品型号(全称)")
|
||||||
|
private String modelName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品简称
|
||||||
|
*/
|
||||||
|
@ExcelProperty("产品简称")
|
||||||
|
private String modelNameSimple;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品编号
|
||||||
|
*/
|
||||||
|
@ExcelProperty("产品编号")
|
||||||
|
private String productNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板块
|
||||||
|
*/
|
||||||
|
@ExcelProperty("板块")
|
||||||
|
private String plate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台
|
||||||
|
*/
|
||||||
|
@ExcelProperty("平台")
|
||||||
|
private String platform;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系列
|
||||||
|
*/
|
||||||
|
@ExcelProperty("系列")
|
||||||
|
private String series;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 细分市场
|
||||||
|
*/
|
||||||
|
@ExcelProperty("细分市场")
|
||||||
|
private String marketSegment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目编号
|
||||||
|
*/
|
||||||
|
@ExcelProperty("项目编号")
|
||||||
|
private String projectNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌
|
||||||
|
*/
|
||||||
|
@ExcelProperty("品牌")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产日期
|
||||||
|
*/
|
||||||
|
@ExcelProperty("生产日期")
|
||||||
|
@DateTimeFormat("yyyy-MM-dd")
|
||||||
|
private Date productionDate;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 填写部门
|
||||||
|
// */
|
||||||
|
// @ExcelProperty("填写部门")
|
||||||
|
// private String dept;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 责任人
|
||||||
|
// */
|
||||||
|
// @ExcelProperty("责任人")
|
||||||
|
// private String resPerson;
|
||||||
|
// /**
|
||||||
|
// * 责任人ID
|
||||||
|
// */
|
||||||
|
// @ExcelIgnore
|
||||||
|
// private String resPersonId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sheetName
|
||||||
|
*/
|
||||||
|
@ExcelIgnore
|
||||||
|
private String sheetName;
|
||||||
|
/**
|
||||||
|
* rowIndex
|
||||||
|
*/
|
||||||
|
@ExcelIgnore
|
||||||
|
private Integer rowIndex;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,37 @@
|
|||||||
|
package com.xdap.self_development.controller.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DataEntryEngineModelPageRequest {
|
||||||
|
//型号,产品编号,板块,平台,系列,细分市场,项目名称,项目编号,品牌,填写部门,责任人,任务分发状态
|
||||||
|
private String loginUserId;
|
||||||
|
private String modelName;
|
||||||
|
private String productNumber;
|
||||||
|
private String plate;
|
||||||
|
private String platform;
|
||||||
|
private String series;
|
||||||
|
private String marketSegment;
|
||||||
|
private String projectName;
|
||||||
|
private String projectNumber;
|
||||||
|
private String brand;
|
||||||
|
private String department;
|
||||||
|
private String resPerson;
|
||||||
|
private String distributeStatus;
|
||||||
|
private String ycOrOth;
|
||||||
|
private String modelNameSimple;
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date productionDate;
|
||||||
|
/**
|
||||||
|
* 第几页
|
||||||
|
*/
|
||||||
|
private int page;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每页多少条
|
||||||
|
*/
|
||||||
|
private int size;
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
package com.xdap.self_development.controller.request;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 参数详情
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EngineParamDetailExcel {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty("ID")
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 子系统
|
||||||
|
*/
|
||||||
|
@ExcelProperty("子系统")
|
||||||
|
private String subsystemName;
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty("类型")
|
||||||
|
private String parameterType;
|
||||||
|
/**
|
||||||
|
* 零部件名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty("零部件名称")
|
||||||
|
private String partsName;
|
||||||
|
/**
|
||||||
|
* 参数名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty("参数名称")
|
||||||
|
private String parameterName;
|
||||||
|
/**
|
||||||
|
* 参数值
|
||||||
|
*/
|
||||||
|
@ExcelProperty("参数值")
|
||||||
|
private String parameterValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
@ExcelProperty("单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数来源
|
||||||
|
*/
|
||||||
|
@ExcelProperty("参数来源")
|
||||||
|
private String parameterSource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填写部门
|
||||||
|
*/
|
||||||
|
@ExcelProperty("填写部门")
|
||||||
|
private String department;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填写人
|
||||||
|
*/
|
||||||
|
@ExcelProperty("填写人")
|
||||||
|
private String filledBy;
|
||||||
|
/**
|
||||||
|
* sheetName
|
||||||
|
*/
|
||||||
|
@ExcelIgnore
|
||||||
|
private String sheetName;
|
||||||
|
/**
|
||||||
|
* rowIndex
|
||||||
|
*/
|
||||||
|
@ExcelIgnore
|
||||||
|
private Integer rowIndex;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
package com.xdap.self_development.controller.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 参数详情
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class EngineParamDetailRequest {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 责任人ID
|
||||||
|
*/
|
||||||
|
private String responsiblePersonId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发动机型号ID
|
||||||
|
*/
|
||||||
|
private String engineModelID;
|
||||||
|
/**
|
||||||
|
* 发动机型号+产品编号
|
||||||
|
*/
|
||||||
|
private String modelProdName;
|
||||||
|
/**
|
||||||
|
* 子系统
|
||||||
|
*/
|
||||||
|
private String subsystemName;
|
||||||
|
/**
|
||||||
|
* 子系统多选
|
||||||
|
*/
|
||||||
|
private List<String> subsystemNames;
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String parameterType;
|
||||||
|
/**
|
||||||
|
* 类型多选
|
||||||
|
*/
|
||||||
|
private List<String> parameterTypes;
|
||||||
|
/**
|
||||||
|
* 大版本(审核通过后变更的)
|
||||||
|
*/
|
||||||
|
private Integer majorVersion;
|
||||||
|
/**
|
||||||
|
* 小版本(控制是否可以审核)
|
||||||
|
*/
|
||||||
|
private String minorVersion;
|
||||||
|
/**
|
||||||
|
* 版本状态(0已通过,1草稿,审核中,3已撤回,4拒绝)
|
||||||
|
*/
|
||||||
|
private String versionStatus;
|
||||||
|
/**
|
||||||
|
* 填写人
|
||||||
|
*/
|
||||||
|
private String filledById;
|
||||||
|
/**
|
||||||
|
* 参数操作
|
||||||
|
*/
|
||||||
|
private String operation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.xdap.self_development.controller.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TodoReturnRequest {
|
||||||
|
//退回人
|
||||||
|
private String userID;
|
||||||
|
//退回的步骤
|
||||||
|
private String steps;
|
||||||
|
//退回的待办ID
|
||||||
|
private String todoTaskId;
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
package com.xdap.self_development.controller.request;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.query.annotation.Table;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 待办事项表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table("todo_task")
|
||||||
|
public class TodoTaskRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据编号
|
||||||
|
*/
|
||||||
|
private String documentNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程主题
|
||||||
|
*/
|
||||||
|
private String processTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前环节
|
||||||
|
*/
|
||||||
|
private String currentNode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态代号
|
||||||
|
*/
|
||||||
|
private String statusCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品型号名称
|
||||||
|
*/
|
||||||
|
private String modelName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(如玉柴)
|
||||||
|
*/
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
private Integer versionNumber;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人ID
|
||||||
|
*/
|
||||||
|
private String createdById;
|
||||||
|
/**
|
||||||
|
* 责任人或责任人ID
|
||||||
|
*/
|
||||||
|
private String personId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 第几页
|
||||||
|
*/
|
||||||
|
private int page;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每页多少条
|
||||||
|
*/
|
||||||
|
private int size;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
package com.xdap.self_development.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum ApprovalOrderEnum {
|
||||||
|
|
||||||
|
PROOFREAD(0,"校对"),
|
||||||
|
REVIEW(1,"审核"),
|
||||||
|
COUNTERSIGN(2,"会签"),
|
||||||
|
APPROVE(3,"批准");
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
ApprovalOrderEnum(Integer code, String desc) {
|
||||||
|
this.code = code;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static ApprovalOrderEnum getByCode(Integer code) {
|
||||||
|
if (code == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (ApprovalOrderEnum status : values()) {
|
||||||
|
if (status.code.equals(code)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ApprovalOrderEnum getByDesc(String desc) {
|
||||||
|
if (desc == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (ApprovalOrderEnum status : values()) {
|
||||||
|
if (status.desc.equals(desc)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
package com.xdap.self_development.enums;
|
||||||
|
|
||||||
|
public enum CurrentNodeEnum {
|
||||||
|
|
||||||
|
REPAIR("数据维护"),
|
||||||
|
JOBSPLIT("任务分解"),
|
||||||
|
DATAAPPROVAL("数据审批");
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
CurrentNodeEnum(String desc) {
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
package com.xdap.self_development.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum DistributeStatusEnum {
|
||||||
|
|
||||||
|
DISTRIBUTED(1, "已分发"),
|
||||||
|
UNDISTRIBUTED(2, "未分发");
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
DistributeStatusEnum(Integer code, String desc) {
|
||||||
|
this.code = code;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DistributeStatusEnum getByCode(Integer code) {
|
||||||
|
if (code == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (DistributeStatusEnum status : values()) {
|
||||||
|
if (status.code.equals(code)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DistributeStatusEnum getByDesc(String desc) {
|
||||||
|
if (desc == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (DistributeStatusEnum status : values()) {
|
||||||
|
if (status.desc.equals(desc)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
package com.xdap.self_development.enums;
|
||||||
|
|
||||||
|
public enum IsDeleteEnum {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已删除
|
||||||
|
*/
|
||||||
|
DELETED,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未删除
|
||||||
|
*/
|
||||||
|
NOT_DELETED,
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.xdap.self_development.enums;
|
||||||
|
|
||||||
|
public enum ParamOperation {
|
||||||
|
//新增
|
||||||
|
INSERT,
|
||||||
|
//修改
|
||||||
|
UPDATE,
|
||||||
|
//删除
|
||||||
|
DELETE;
|
||||||
|
}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
package com.xdap.self_development.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
public enum ParamValueVersionEnum {
|
||||||
|
|
||||||
|
PASSED(0,"已通过"),
|
||||||
|
DRAFT(1,"草稿"),
|
||||||
|
UNDER(2,"审核中"),
|
||||||
|
WITHDRAWN(3,"已撤回"),
|
||||||
|
REFUSE(4,"已拒绝)");
|
||||||
|
|
||||||
|
private final Integer code;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
ParamValueVersionEnum(Integer code, String desc) {
|
||||||
|
this.code = code;
|
||||||
|
this.desc = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static ParamValueVersionEnum getByCode(Integer code) {
|
||||||
|
if (code == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (ParamValueVersionEnum status : values()) {
|
||||||
|
if (status.code.equals(code)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ParamValueVersionEnum getByDesc(String desc) {
|
||||||
|
if (desc == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (ParamValueVersionEnum status : values()) {
|
||||||
|
if (status.desc.equals(desc)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package com.xdap.self_development.exception;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ExcelImportException extends RuntimeException{
|
||||||
|
private String sheetName;
|
||||||
|
private Integer rowIndex;
|
||||||
|
private String fieldName;
|
||||||
|
private String originalValue;
|
||||||
|
|
||||||
|
|
||||||
|
public ExcelImportException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExcelImportException(String message, String sheetName, Integer rowIndex, String fieldName) {
|
||||||
|
super(message);
|
||||||
|
this.sheetName = sheetName;
|
||||||
|
this.rowIndex = rowIndex;
|
||||||
|
this.fieldName = fieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExcelImportException(String message, String sheetName, Integer rowIndex, String fieldName, String originalValue) {
|
||||||
|
super(message);
|
||||||
|
this.sheetName = sheetName;
|
||||||
|
this.rowIndex = rowIndex;
|
||||||
|
this.fieldName = fieldName;
|
||||||
|
this.originalValue = originalValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,254 @@
|
|||||||
|
package com.xdap.self_development.listener;
|
||||||
|
|
||||||
|
import com.alibaba.excel.context.AnalysisContext;
|
||||||
|
import com.alibaba.excel.exception.ExcelAnalysisException;
|
||||||
|
import com.alibaba.excel.read.listener.ReadListener;
|
||||||
|
import com.alibaba.excel.util.ListUtils;
|
||||||
|
import com.definesys.mpaas.query.MpaasQueryFactory;
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
import com.xdap.self_development.controller.request.DataEntryEngineModelExcel;
|
||||||
|
import com.xdap.self_development.enums.DistributeStatusEnum;
|
||||||
|
import com.xdap.self_development.enums.ParamValueVersionEnum;
|
||||||
|
import com.xdap.self_development.exception.ExcelImportException;
|
||||||
|
import com.xdap.self_development.pojo.*;
|
||||||
|
import com.xdap.self_development.service.EngineParamDetailService;
|
||||||
|
import com.xdap.self_development.service.ResponsiblePerService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
//@Component
|
||||||
|
//@Scope("prototype")
|
||||||
|
public class EngineModelListener implements ReadListener<DataEntryEngineModelExcel> {
|
||||||
|
private final MpaasQueryFactory sw;
|
||||||
|
private final ResponsiblePerService responsiblePerService;
|
||||||
|
private final EngineParamDetailService engineParamDetailService;
|
||||||
|
private static final int BATCH_COUNT = 1000;
|
||||||
|
private final String ycOrOt;
|
||||||
|
private Integer versionNumber = 0;
|
||||||
|
private Date date = new Date();
|
||||||
|
private String createdBy = "Excel导入";
|
||||||
|
private Date createdDate = date;
|
||||||
|
private String lastModifiedBy = "";
|
||||||
|
private Date lastModifiedDate = date;
|
||||||
|
private XdapUsers usersPojo;
|
||||||
|
|
||||||
|
|
||||||
|
private List<DataEntryEngineModelExcel> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
|
||||||
|
|
||||||
|
public EngineModelListener(MpaasQueryFactory sw, ResponsiblePerService responsiblePerService, EngineParamDetailService engineParamDetailService, String ycOrOt, XdapUsers usersPojo) {
|
||||||
|
this.sw = sw;
|
||||||
|
this.responsiblePerService = responsiblePerService;
|
||||||
|
this.engineParamDetailService = engineParamDetailService;
|
||||||
|
this.usersPojo = usersPojo;
|
||||||
|
this.ycOrOt = ycOrOt;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void invoke(DataEntryEngineModelExcel engineModelPojo, AnalysisContext analysisContext) throws ExcelAnalysisException {
|
||||||
|
engineModelPojo.setSheetName(analysisContext.readSheetHolder().getSheetName());
|
||||||
|
engineModelPojo.setRowIndex(analysisContext.readRowHolder().getRowIndex() + 1);
|
||||||
|
//
|
||||||
|
// 去掉责任人 List<ResponsiblePersonPojo> personPojos = responsiblePersonService.selectByDepName(engineModelPojo.getDept());
|
||||||
|
// if (ObjectUtils.isEmpty(personPojos)) {
|
||||||
|
// throw new ExcelImportException(
|
||||||
|
// String.format("请检查该部门是否有责任人,%s页第%d行", analysisContext.readSheetHolder().getSheetName(), analysisContext.readRowHolder().getRowIndex() + 1)
|
||||||
|
// );
|
||||||
|
// } else {
|
||||||
|
// engineModelPojo.setResPersonId(personPojos.get(0).getId());
|
||||||
|
// }
|
||||||
|
|
||||||
|
cachedDataList.add(engineModelPojo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验逻辑
|
||||||
|
*
|
||||||
|
* @param cachedDataList
|
||||||
|
*/
|
||||||
|
private void dataStrictly(List<DataEntryEngineModelExcel> cachedDataList) {
|
||||||
|
|
||||||
|
if (ObjectUtils.isEmpty(cachedDataList)) {
|
||||||
|
log.error("机型数据为空");
|
||||||
|
throw new ExcelImportException(
|
||||||
|
String.format("Excel无数据")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (DataEntryEngineModelExcel data : cachedDataList) {
|
||||||
|
String sheetName = data.getSheetName();
|
||||||
|
Integer rowIndex = data.getRowIndex();
|
||||||
|
//productNumber,modelName,brand
|
||||||
|
List<DataEntryEngineModelPojo> modelPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("product_number", data.getProductNumber())
|
||||||
|
.eq("model_name", data.getModelName())
|
||||||
|
.eq("brand", data.getBrand()).doQuery(DataEntryEngineModelPojo.class);
|
||||||
|
if (ObjectUtils.isNotEmpty(modelPojos)) {
|
||||||
|
throw new ExcelImportException(
|
||||||
|
String.format("请检查该型号是否已经存在,%s页第%d行", sheetName, rowIndex)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
//空值校验
|
||||||
|
// 去掉责任人 if (StrUtil.isBlank(data.getModelName()) || StrUtil.isBlank(data.getDept())) {
|
||||||
|
// throw new ExcelImportException(
|
||||||
|
// String.format("请检查必要字段(发动机型号,部门)是否漏填,%s页第%d行", sheetName, rowIndex)
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||||
|
|
||||||
|
dataStrictly(cachedDataList);
|
||||||
|
// 存储到数据库
|
||||||
|
if (!ObjectUtils.isEmpty(cachedDataList)) {
|
||||||
|
saveData();
|
||||||
|
}
|
||||||
|
log.info("所有数据解析完成!");
|
||||||
|
}
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void saveData() {
|
||||||
|
|
||||||
|
ArrayList<DataEntryEngineModelPojo> modelPojos = new ArrayList<>();
|
||||||
|
|
||||||
|
List<Parameter> parameters = engineParamDetailService.selectAllByNewVersion();
|
||||||
|
//写入机型
|
||||||
|
for (DataEntryEngineModelExcel modelExcel : cachedDataList) {
|
||||||
|
DataEntryEngineModelPojo modelPojo = new DataEntryEngineModelPojo();
|
||||||
|
BeanUtils.copyProperties(modelExcel, modelPojo, "status");
|
||||||
|
// 去掉责任人 modelPojo.setResponsiblePersonId(modelExcel.getResPersonId());
|
||||||
|
//获取状态码
|
||||||
|
DistributeStatusEnum byDesc = DistributeStatusEnum.getByDesc("未分发");
|
||||||
|
modelPojo.setDistributeStatus(byDesc != null ? byDesc.getCode() : null);
|
||||||
|
modelPojo.setYcOrOth(ycOrOt);
|
||||||
|
modelPojo.setParameterNum(parameters.toArray().length);
|
||||||
|
modelPojo.setMaintainedParameterNum(0);
|
||||||
|
modelPojo.setVersionNumber(versionNumber);
|
||||||
|
modelPojo.setIsDelete(0);
|
||||||
|
modelPojo.setCreatedBy(usersPojo.getId());
|
||||||
|
modelPojo.setLastUpdatedBy(lastModifiedBy);
|
||||||
|
modelPojo.setLastUpdateDate(lastModifiedDate);
|
||||||
|
modelPojo.setCreationDate(createdDate);
|
||||||
|
modelPojo.setId(UUID.randomUUID().toString());
|
||||||
|
modelPojos.add(modelPojo);
|
||||||
|
// sw.buildFromDatasource("test_demo").doInsert(modelPojo);
|
||||||
|
|
||||||
|
}
|
||||||
|
batchInsert(modelPojos);
|
||||||
|
|
||||||
|
saveDataParamDetail(modelPojos, parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
//为每个机型绑定参数
|
||||||
|
private void saveDataParamDetail(ArrayList<DataEntryEngineModelPojo> modelPojos, List<Parameter> parameters) {
|
||||||
|
/**
|
||||||
|
* 遍历机型
|
||||||
|
* 查找参数 将每个机型都把参数,和参数所属的填写部门关联上
|
||||||
|
* 参数值暂时放空
|
||||||
|
*/
|
||||||
|
List<EngineParamDetailPojo> engineParamDetailPojos = new ArrayList<>();
|
||||||
|
for (DataEntryEngineModelPojo modelPojo : modelPojos) {
|
||||||
|
for (Parameter parameter : parameters) {
|
||||||
|
|
||||||
|
EngineParamDetailPojo engineParamDetailPojo = new EngineParamDetailPojo();
|
||||||
|
engineParamDetailPojo.setEngineModelId(modelPojo.getId());
|
||||||
|
engineParamDetailPojo.setParameterId(parameter.getId());
|
||||||
|
engineParamDetailPojo.setSubsystemName(parameter.getSubsystemName());
|
||||||
|
engineParamDetailPojo.setParameterType(parameter.getParameterType());
|
||||||
|
engineParamDetailPojo.setParameterName(parameter.getParameterName());
|
||||||
|
engineParamDetailPojo.setDepartment(parameter.getDepartment());
|
||||||
|
engineParamDetailPojo.setMajorVersion(versionNumber);
|
||||||
|
engineParamDetailPojo.setVersionStatus(ParamValueVersionEnum.DRAFT.getCode());
|
||||||
|
engineParamDetailPojo.setCreatedBy(usersPojo.getId());
|
||||||
|
engineParamDetailPojo.setLastUpdatedBy(lastModifiedBy);
|
||||||
|
engineParamDetailPojo.setLastUpdateDate(lastModifiedDate);
|
||||||
|
engineParamDetailPojo.setCreationDate(createdDate);
|
||||||
|
engineParamDetailPojos.add(engineParamDetailPojo);
|
||||||
|
//为每个参数生成默认责任人
|
||||||
|
List<ResponsiblePerson> personPojos = responsiblePerService.selectByDepName(parameter.getDepartment());
|
||||||
|
if (ObjectUtils.isNotEmpty(personPojos)) {
|
||||||
|
// 不再默认生成责任人 engineParamDetailPojo.setResponsiblePersonId(personPojos.get(0).getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
batchInsertParamDetail(engineParamDetailPojos);
|
||||||
|
//
|
||||||
|
// //生成分解任务给责任人 参数根据机型+责任人分组 生成数据
|
||||||
|
// List<EngineParamDetailPojo> paramDetailPojos = engineParamDetailPojos.stream()
|
||||||
|
// // 以engineModelId和responsiblePersonId组合作为key,元素本身作为value
|
||||||
|
// .collect(Collectors.toMap(pojo -> pojo.getEngineModelId() + "_" + pojo.getResponsiblePersonId(),
|
||||||
|
// pojo -> pojo,
|
||||||
|
// (existing, replacement) -> existing
|
||||||
|
// ))
|
||||||
|
// // 提取去重后的value集合
|
||||||
|
// .values()
|
||||||
|
// .stream()
|
||||||
|
// .collect(Collectors.toList());
|
||||||
|
// ArrayList<TodoTaskPojo> todoTaskPojos = new ArrayList<>();
|
||||||
|
// for (EngineParamDetailPojo paramDetailPojo : paramDetailPojos) {
|
||||||
|
// //查找参数对应的机型
|
||||||
|
// DataEntryEngineModelPojo modelPojo = new DataEntryEngineModelPojo();
|
||||||
|
// if (ObjectUtils.isNotEmpty(paramDetailPojo.getEngineModelId())) {
|
||||||
|
// List<DataEntryEngineModelPojo> modelPojos2 = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
// .eq("id", paramDetailPojo.getEngineModelId()).doQuery(DataEntryEngineModelPojo.class);
|
||||||
|
// if (ObjectUtils.isNotEmpty(modelPojos2)) {
|
||||||
|
// modelPojo = modelPojos2.get(0);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// //组装待办
|
||||||
|
// TodoTaskPojo todoTaskPojo = new TodoTaskPojo();
|
||||||
|
// todoTaskPojo.setCreatedById(usersPojo.getId());
|
||||||
|
// todoTaskPojo.setDocumentNo(UUID.randomUUID().toString());
|
||||||
|
// todoTaskPojo.setProcessTitle("新增发动机型号流程");
|
||||||
|
// todoTaskPojo.setCurrentNode(CurrentNodeEnum.JOBSPLIT.getDesc());
|
||||||
|
// todoTaskPojo.setStatusCode(String.valueOf(ParamValueVersionEnum.DRAFT.getCode()));
|
||||||
|
// todoTaskPojo.setModelName(modelPojo.getModelName());
|
||||||
|
// todoTaskPojo.setModelId(paramDetailPojo.getEngineModelId());
|
||||||
|
// todoTaskPojo.setCreationDate(createdDate);
|
||||||
|
// todoTaskPojo.setDataType("玉柴");
|
||||||
|
// todoTaskPojo.setVersionNumber(versionNumber);
|
||||||
|
// todoTaskPojo.setIsDelete(0);
|
||||||
|
// if (ObjectUtils.isNotEmpty(paramDetailPojo.getResponsiblePersonId())) {
|
||||||
|
// ResponsiblePersonPojo responsiblePersonPojo = responsiblePerService.selectById(paramDetailPojo.getResponsiblePersonId());
|
||||||
|
// todoTaskPojo.setOwnerId(ObjectUtils.isNotEmpty(responsiblePersonPojo) ? responsiblePersonPojo.getUserId() : null);
|
||||||
|
// }
|
||||||
|
// todoTaskPojo.setCreatedBy(usersPojo.getUsername());
|
||||||
|
// todoTaskPojos.add(todoTaskPojo);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 又不在这生成待办了 改为管理员进去选择责任人后待办 batchInsertTodoTask(todoTaskPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void batchInsertTodoTask(List<TodoTaskPojo> todoTaskPojos) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(todoTaskPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void batchInsertParamDetail(List<EngineParamDetailPojo> engineParamDetailPojos) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(engineParamDetailPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void batchInsert(List<DataEntryEngineModelPojo> modelPojos) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(modelPojos);
|
||||||
|
// 分批插入(如每1000条一批,但整体在一个事务中)
|
||||||
|
// int batchSize = 1000;
|
||||||
|
// for (int i = 0; i < modelPojos.size(); i += batchSize) {
|
||||||
|
// int end = Math.min(i + batchSize, modelPojos.size());
|
||||||
|
// List<DataEntryEngineModelPojo> batch = modelPojos.subList(i, end);
|
||||||
|
// sw.buildFromDatasource("test_demo").doBatchInsert(modelPojos);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,175 @@
|
|||||||
|
package com.xdap.self_development.listener;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.excel.context.AnalysisContext;
|
||||||
|
import com.alibaba.excel.read.listener.ReadListener;
|
||||||
|
import com.alibaba.excel.util.ListUtils;
|
||||||
|
import com.definesys.mpaas.query.MpaasQueryFactory;
|
||||||
|
import com.xdap.self_development.controller.request.EngineParamDetailExcel;
|
||||||
|
import com.xdap.self_development.enums.ParamOperation;
|
||||||
|
import com.xdap.self_development.enums.ParamValueVersionEnum;
|
||||||
|
import com.xdap.self_development.pojo.*;
|
||||||
|
import com.xdap.self_development.service.DataEntryEngineModelService;
|
||||||
|
import com.xdap.self_development.service.DataEntryService;
|
||||||
|
import com.xdap.self_development.service.ResponsiblePerService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
//@Component 暂时不交给spring管理
|
||||||
|
//@Scope("prototype")
|
||||||
|
public class EngineParamDetailListener implements ReadListener<EngineParamDetailExcel> {
|
||||||
|
private final MpaasQueryFactory sw;
|
||||||
|
private final DataEntryEngineModelPojo modelPojo;
|
||||||
|
private final DataEntryEngineModelService dataEntryEngineModelService;
|
||||||
|
private final ResponsiblePerService responsiblePerService;
|
||||||
|
private final DataEntryService dataEntryService;
|
||||||
|
private static final int BATCH_COUNT = 1000;
|
||||||
|
private Integer versionNumber = 1;
|
||||||
|
private Date date = new Date();
|
||||||
|
private String createdBy = "Excel导入";
|
||||||
|
private Date createdDate = date;
|
||||||
|
private String lastModifiedBy = "";
|
||||||
|
private Date lastModifiedDate = date;
|
||||||
|
Map<String, String> stringParameterMap;
|
||||||
|
private RuntimeException importException = null;
|
||||||
|
private ArrayList<String> successSheetName = null;
|
||||||
|
|
||||||
|
private List<EngineParamDetailExcel> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
|
||||||
|
|
||||||
|
public EngineParamDetailListener(MpaasQueryFactory sw, DataEntryEngineModelPojo modelPojo, DataEntryEngineModelService dataEntryEngineModelService, ResponsiblePerService responsiblePerService, DataEntryService dataEntryService) {
|
||||||
|
this.sw = sw;
|
||||||
|
this.modelPojo = modelPojo;
|
||||||
|
this.dataEntryEngineModelService = dataEntryEngineModelService;
|
||||||
|
this.responsiblePerService = responsiblePerService;
|
||||||
|
this.dataEntryService = dataEntryService;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void invoke(EngineParamDetailExcel engineModelDetailPojo, AnalysisContext analysisContext) {
|
||||||
|
|
||||||
|
engineModelDetailPojo.setSheetName(analysisContext.readSheetHolder().getSheetName());
|
||||||
|
engineModelDetailPojo.setRowIndex(analysisContext.readRowHolder().getRowIndex() + 1);
|
||||||
|
// 数据校验
|
||||||
|
cachedDataList.add(engineModelDetailPojo);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验逻辑
|
||||||
|
*
|
||||||
|
* @param cachedDataList
|
||||||
|
*/
|
||||||
|
private void dataStrictly(List<EngineParamDetailExcel> cachedDataList) {
|
||||||
|
|
||||||
|
// if (ObjectUtils.isEmpty(cachedDataList)) {
|
||||||
|
// log.error("数据为空");
|
||||||
|
// throw new ExcelImportException(
|
||||||
|
// String.format("请检查是否有空数据sheet页或联系管理员")
|
||||||
|
//// String.format("检查无数据sheet页,导入成功的sheet页有%s",successSheetName)
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// for (EngineParamDetailExcel data : cachedDataList) {
|
||||||
|
// String sheetName = data.getSheetName();
|
||||||
|
// Integer rowIndex = data.getRowIndex();
|
||||||
|
// //空值校验
|
||||||
|
// if (ObjectUtils.isBlank(data.getParameterValue())) {
|
||||||
|
// throw new ExcelImportException(
|
||||||
|
// String.format("请检查必要字段(参数值)是否漏填,%s页第%d行", sheetName, rowIndex)
|
||||||
|
//// String.format("请检查必要字段(参数值)是否漏填,%s页第%d行,导入成功的sheet页有%s", sheetName, rowIndex,successSheetName)
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterAllAnalysed(AnalysisContext analysisContext) {
|
||||||
|
|
||||||
|
dataStrictly(cachedDataList);
|
||||||
|
// 存储到数据库
|
||||||
|
saveData();
|
||||||
|
cachedDataList = new ArrayList<>();
|
||||||
|
log.info("所有数据解析完成!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void saveData() {
|
||||||
|
|
||||||
|
log.info("开始处理 处理数据条数{}", cachedDataList.size());
|
||||||
|
|
||||||
|
ArrayList<EngineParamDetailPojo> engineParamDetailPojos = new ArrayList<>();
|
||||||
|
for (EngineParamDetailExcel paramDetailExcel : cachedDataList) {
|
||||||
|
if (ObjectUtils.isEmpty(paramDetailExcel.getParameterValue())) {
|
||||||
|
//如果参数值为空直接返回
|
||||||
|
log.warn("%s页第%d行参数值为空",paramDetailExcel.getSheetName(),paramDetailExcel.getRowIndex());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
EngineParamDetailPojo engineParamDetailPojo = new EngineParamDetailPojo();
|
||||||
|
|
||||||
|
List<EngineParamDetailPojo> detailPojos =
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("parameter_id",paramDetailExcel.getId())
|
||||||
|
.eq("engine_model_id",modelPojo.getId())
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
//如果这个ID有数据则更新小版本为草稿
|
||||||
|
if (ObjectUtils.isNotEmpty(detailPojos)) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("minor_version", paramDetailExcel.getParameterValue())
|
||||||
|
.update("version_status",ParamValueVersionEnum.DRAFT.getCode())
|
||||||
|
.update("operation",String.valueOf(ParamOperation.UPDATE))
|
||||||
|
.rowid("id", detailPojos.get(0).getId())
|
||||||
|
.doUpdate(EngineParamDetailPojo.class);
|
||||||
|
} else if(ObjectUtils.isEmpty(detailPojos)&&ObjectUtils.isNotEmpty(paramDetailExcel.getId())){
|
||||||
|
//如果ID匹配不上说明ID被动了 并且ID不为空 说明不是新增的参数 直接返回
|
||||||
|
log.warn("%s页第%d行ID匹配不上",paramDetailExcel.getSheetName(),paramDetailExcel.getRowIndex());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(ObjectUtils.isEmpty(paramDetailExcel.getId())){
|
||||||
|
log.warn("%s页第%d行非最新模板参数或者该参数未维护",paramDetailExcel.getSheetName(),paramDetailExcel.getRowIndex());
|
||||||
|
// //todo查找新增参数的对应的参数模板ID
|
||||||
|
// String parameterName = paramDetailExcel.getParameterName();
|
||||||
|
// String subsystemName = paramDetailExcel.getSubsystemName();
|
||||||
|
// String parameterType = paramDetailExcel.getParameterType();
|
||||||
|
// //组装参数
|
||||||
|
// engineParamDetailPojo.setMajorVersion(0);
|
||||||
|
// engineParamDetailPojo.setEngineModelId(modelPojo.getId());
|
||||||
|
// engineParamDetailPojo.setParameterName(parameterName);
|
||||||
|
// engineParamDetailPojo.setSubsystemName(subsystemName);
|
||||||
|
// engineParamDetailPojo.setParameterType(parameterType);
|
||||||
|
// engineParamDetailPojo.setMinorVersion(paramDetailExcel.getParameterValue());
|
||||||
|
//// 刚上传的参数值存放在小版本值里 engineParamDetailPojo.setParameterValue(paramDetailExcel.getParameterValue());
|
||||||
|
// engineParamDetailPojo.setDepartment(paramDetailExcel.getDepartment());
|
||||||
|
// List<ResponsiblePersonPojo> personPojos = responsiblePersonService.selectByDepName(paramDetailExcel.getDepartment());
|
||||||
|
// if (ObjectUtils.isNotEmpty(personPojos)) {
|
||||||
|
// engineParamDetailPojo.setResponsiblePersonId(personPojos.get(0).getId());
|
||||||
|
// }
|
||||||
|
// //todo通过部门+姓名存入填写人 最好根据工号
|
||||||
|
// engineParamDetailPojo.setFilledBy();
|
||||||
|
// engineParamDetailPojo.setVersionStatus(ParamValueVersionEnum.DRAFT.getCode());
|
||||||
|
// engineParamDetailPojo.setOperation(String.valueOf(ParamOperation.INSERT));
|
||||||
|
// engineParamDetailPojo.setCreatedBy(createdBy);
|
||||||
|
// engineParamDetailPojo.setCreatedDate(createdDate);
|
||||||
|
// engineParamDetailPojo.setLastUpdatedBy(lastModifiedBy);
|
||||||
|
// engineParamDetailPojo.setLastUpdatedDate(lastModifiedDate);
|
||||||
|
// engineParamDetailPojos.add(engineParamDetailPojo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// batchInsert(engineParamDetailPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class) // 发生任何异常都回滚
|
||||||
|
public void batchInsert(List<EngineParamDetailPojo> engineParamDetailPojos) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(engineParamDetailPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
package com.xdap.self_development.pojo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.query.annotation.RowID;
|
||||||
|
import com.definesys.mpaas.query.annotation.RowIDType;
|
||||||
|
import com.definesys.mpaas.query.annotation.Table;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 流程配置表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table("approval_config")
|
||||||
|
public class ApprovalConfigPojo implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@RowID(sequence = "approval_config_s", type = RowIDType.UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程ID
|
||||||
|
*/
|
||||||
|
private String approvalId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环节
|
||||||
|
*/
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理人列表
|
||||||
|
*/
|
||||||
|
private String assignees;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环节顺序
|
||||||
|
*/
|
||||||
|
private Integer nodeOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date creationDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新人
|
||||||
|
*/
|
||||||
|
private String lastUpdatedBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新时间
|
||||||
|
*/
|
||||||
|
private Date lastUpdateDate;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
package com.xdap.self_development.pojo;
|
||||||
|
|
||||||
|
import com.definesys.mpaas.query.annotation.RowID;
|
||||||
|
import com.definesys.mpaas.query.annotation.RowIDType;
|
||||||
|
import com.definesys.mpaas.query.annotation.Table;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 数据变动说明表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table("data_change_comment")
|
||||||
|
public class DataChangeCommentPojo implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@RowID(sequence = "data_change_comment_s", type = RowIDType.UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
|
||||||
|
private String paramDetailId;
|
||||||
|
private String engineModelId;
|
||||||
|
private String subsystemName;
|
||||||
|
private String parameterType;
|
||||||
|
//零部件
|
||||||
|
private String partsName;
|
||||||
|
private String parameterName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批中的值
|
||||||
|
*/
|
||||||
|
private String parameterValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变动说明
|
||||||
|
*/
|
||||||
|
private String changeComment;
|
||||||
|
/**
|
||||||
|
* 变动说明
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date creationDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新人
|
||||||
|
*/
|
||||||
|
private String lastUpdatedBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新时间
|
||||||
|
*/
|
||||||
|
private Date lastUpdateDate;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,168 @@
|
|||||||
|
package com.xdap.self_development.pojo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||||
|
import com.definesys.mpaas.query.annotation.RowID;
|
||||||
|
import com.definesys.mpaas.query.annotation.RowIDType;
|
||||||
|
import com.definesys.mpaas.query.annotation.Table;
|
||||||
|
import com.definesys.mpaas.query.model.MpaasBasePojo;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 发动机型号数据表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table("data_entry_engine_model")
|
||||||
|
public class DataEntryEngineModelPojo extends MpaasBasePojo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@RowID(sequence = "data_entry_engine_model_s", type = RowIDType.UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品型号(全称)
|
||||||
|
*/
|
||||||
|
@ExcelProperty("产品型号(全称)")
|
||||||
|
private String modelName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本品或竞品
|
||||||
|
*/
|
||||||
|
@ExcelProperty("本品或竞品")
|
||||||
|
private String ycOrOth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品简称
|
||||||
|
*/
|
||||||
|
@ExcelProperty("产品简称")
|
||||||
|
private String modelNameSimple;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品编号
|
||||||
|
*/
|
||||||
|
@ExcelProperty("产品编号")
|
||||||
|
private String productNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板块
|
||||||
|
*/
|
||||||
|
@ExcelProperty("板块")
|
||||||
|
private String plate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台
|
||||||
|
*/
|
||||||
|
@ExcelProperty("平台")
|
||||||
|
private String platform;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系列
|
||||||
|
*/
|
||||||
|
@ExcelProperty("系列")
|
||||||
|
private String series;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 细分市场
|
||||||
|
*/
|
||||||
|
@ExcelProperty("细分市场")
|
||||||
|
private String marketSegment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty("项目名称")
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目编号
|
||||||
|
*/
|
||||||
|
@ExcelProperty("项目编号")
|
||||||
|
private String projectNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌
|
||||||
|
*/
|
||||||
|
@ExcelProperty("品牌")
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产日期
|
||||||
|
*/
|
||||||
|
@ExcelProperty("生产日期")
|
||||||
|
@DateTimeFormat("yyyy-MM-dd")
|
||||||
|
private Date productionDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准参数数量
|
||||||
|
*/
|
||||||
|
@ExcelProperty("标准参数数量")
|
||||||
|
private Integer parameterNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已维护参数数量
|
||||||
|
*/
|
||||||
|
@ExcelProperty("已维护参数数量")
|
||||||
|
private Integer maintainedParameterNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 责任人表ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty("责任人表ID")
|
||||||
|
private String responsiblePersonId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分发状态
|
||||||
|
*/
|
||||||
|
@ExcelProperty("分发状态")
|
||||||
|
private Integer distributeStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
@ExcelProperty("版本")
|
||||||
|
private Integer versionNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
@ExcelProperty("是否删除")
|
||||||
|
private Integer isDelete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@ExcelProperty("创建人")
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date creationDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新人
|
||||||
|
*/
|
||||||
|
@ExcelProperty("最后更新人")
|
||||||
|
private String lastUpdatedBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新时间
|
||||||
|
*/
|
||||||
|
@ExcelProperty("最后更新时间")
|
||||||
|
@DateTimeFormat("yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date lastUpdateDate;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,125 @@
|
|||||||
|
package com.xdap.self_development.pojo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.query.annotation.RowID;
|
||||||
|
import com.definesys.mpaas.query.annotation.RowIDType;
|
||||||
|
import com.definesys.mpaas.query.annotation.Table;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 参数详情
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-13
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table("engine_param_detail")
|
||||||
|
public class EngineParamDetailPojo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@RowID(sequence = "engine_param_detail_s", type = RowIDType.UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数模板表id
|
||||||
|
*/
|
||||||
|
private String parameterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发动机型号表id
|
||||||
|
*/
|
||||||
|
private String engineModelId;
|
||||||
|
/**
|
||||||
|
* 子系统
|
||||||
|
*/
|
||||||
|
private String subsystemName;
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String parameterType;
|
||||||
|
/**
|
||||||
|
* 参数名称
|
||||||
|
*/
|
||||||
|
private String parameterName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数值
|
||||||
|
*/
|
||||||
|
private String parameterValue;
|
||||||
|
/**
|
||||||
|
* 责任人表ID
|
||||||
|
*/
|
||||||
|
private String responsiblePersonId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填写部门
|
||||||
|
*/
|
||||||
|
private String department;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填写人
|
||||||
|
*/
|
||||||
|
private String filledBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大版本(审核通过后变更的)
|
||||||
|
*/
|
||||||
|
private Integer majorVersion;
|
||||||
|
/**
|
||||||
|
* 小版本(控制是否可以审核)
|
||||||
|
*/
|
||||||
|
private String minorVersion;
|
||||||
|
/**
|
||||||
|
* 版本状态(0已通过,1草稿,审核中,3已撤回,4拒绝)
|
||||||
|
*/
|
||||||
|
private Integer versionStatus;
|
||||||
|
/**
|
||||||
|
* 流程ID
|
||||||
|
*/
|
||||||
|
private String approvalId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
private String isDelete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* shangge banben ID
|
||||||
|
*/
|
||||||
|
private String beforeParamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数操作
|
||||||
|
*/
|
||||||
|
private String operation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date creationDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新人
|
||||||
|
*/
|
||||||
|
private String lastUpdatedBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新时间
|
||||||
|
*/
|
||||||
|
private Date lastUpdateDate;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,107 @@
|
|||||||
|
package com.xdap.self_development.pojo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.definesys.mpaas.query.annotation.RowID;
|
||||||
|
import com.definesys.mpaas.query.annotation.RowIDType;
|
||||||
|
import com.definesys.mpaas.query.annotation.Table;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 发动机审核列表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table("engine_review_list")
|
||||||
|
public class EngineReviewListPojo implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@RowID(sequence = "engine_review_list_s", type = RowIDType.UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程主题
|
||||||
|
*/
|
||||||
|
private String processTopic;
|
||||||
|
/**
|
||||||
|
* 本品或竞品
|
||||||
|
*/
|
||||||
|
@ExcelProperty("本品或竞品")
|
||||||
|
private String ycOrOth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机型ID
|
||||||
|
*/
|
||||||
|
private String modelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品型号
|
||||||
|
*/
|
||||||
|
private String modelName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态代号
|
||||||
|
*/
|
||||||
|
private Integer statusCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子系统
|
||||||
|
*/
|
||||||
|
private String subsystemName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人ID
|
||||||
|
*/
|
||||||
|
private String applicant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前状态
|
||||||
|
*/
|
||||||
|
private String statusDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前审批人
|
||||||
|
*/
|
||||||
|
private String approverPersons;
|
||||||
|
/**
|
||||||
|
* 当前节点
|
||||||
|
*/
|
||||||
|
private String nodeName;
|
||||||
|
/**
|
||||||
|
* 提交说明
|
||||||
|
*/
|
||||||
|
private String reviewComment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date creationDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新人
|
||||||
|
*/
|
||||||
|
private String lastUpdatedBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新时间
|
||||||
|
*/
|
||||||
|
private Date lastUpdateDate;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
package com.xdap.self_development.pojo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.query.annotation.RowID;
|
||||||
|
import com.definesys.mpaas.query.annotation.RowIDType;
|
||||||
|
import com.definesys.mpaas.query.annotation.Table;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 参数流程记录
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table("param_approval_record")
|
||||||
|
public class ParamApprovalRecordPojo implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@RowID(sequence = "param_approval_record_s", type = RowIDType.UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程ID
|
||||||
|
*/
|
||||||
|
private String approvalId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环节名称
|
||||||
|
*/
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理人
|
||||||
|
*/
|
||||||
|
private String assignee;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作
|
||||||
|
*/
|
||||||
|
private String operator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作时间
|
||||||
|
*/
|
||||||
|
private Date operateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批说明
|
||||||
|
*/
|
||||||
|
private String approvalComment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 环节顺序
|
||||||
|
*/
|
||||||
|
private Integer nodeOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date createdDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新人
|
||||||
|
*/
|
||||||
|
private String lastUpdatedBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新时间
|
||||||
|
*/
|
||||||
|
private Date lastUpdatedDate;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
103
src/main/java/com/xdap/self_development/pojo/TodoTaskPojo.java
Normal file
103
src/main/java/com/xdap/self_development/pojo/TodoTaskPojo.java
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
package com.xdap.self_development.pojo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.query.annotation.RowID;
|
||||||
|
import com.definesys.mpaas.query.annotation.RowIDType;
|
||||||
|
import com.definesys.mpaas.query.annotation.Table;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 待办事项表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table("todo_task")
|
||||||
|
public class TodoTaskPojo implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@RowID(sequence = "todo_task_s", type = RowIDType.UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据编号
|
||||||
|
*/
|
||||||
|
private String documentNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 流程主题
|
||||||
|
*/
|
||||||
|
private String processTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前环节
|
||||||
|
*/
|
||||||
|
private String currentNode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态代号
|
||||||
|
*/
|
||||||
|
private String statusCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品型号名称
|
||||||
|
*/
|
||||||
|
private String modelName;
|
||||||
|
/**
|
||||||
|
* 产品型号ID
|
||||||
|
*/
|
||||||
|
private String modelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据类型(如玉柴)
|
||||||
|
*/
|
||||||
|
private String dataType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
private Integer versionNumber;
|
||||||
|
/**
|
||||||
|
* 所属人ID
|
||||||
|
*/
|
||||||
|
private String OwnerId;
|
||||||
|
/**
|
||||||
|
* 所属人ID
|
||||||
|
*/
|
||||||
|
private Integer isDelete;
|
||||||
|
/**
|
||||||
|
* 创建人ID
|
||||||
|
*/
|
||||||
|
private String createdById;
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createdBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private Date creationDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新人
|
||||||
|
*/
|
||||||
|
private String lastUpdatedBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最后更新时间
|
||||||
|
*/
|
||||||
|
private Date lastUpdateDate;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.xdap.self_development.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ActivitiDataAndRecordDTO {
|
||||||
|
|
||||||
|
private ArrayList<ActivitiDataDTO> activitiDataDTOS;
|
||||||
|
private ArrayList<ActivitiRecordDTO> activitiRecordDTOS;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
package com.xdap.self_development.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ActivitiDataDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品型号(全称)
|
||||||
|
*/
|
||||||
|
private String engineModelName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子系统
|
||||||
|
*/
|
||||||
|
private String subsystemName;
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String parameterType;
|
||||||
|
//零部件
|
||||||
|
private String partsName;
|
||||||
|
/**
|
||||||
|
* 参数名称
|
||||||
|
*/
|
||||||
|
private String parameterName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数值
|
||||||
|
*/
|
||||||
|
private String parameterValue;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 说明
|
||||||
|
*/
|
||||||
|
private String changeComment;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.xdap.self_development.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ActivitiRecordDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 节点
|
||||||
|
*/
|
||||||
|
private String node;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审批人
|
||||||
|
*/
|
||||||
|
private String approverPersons;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 说明
|
||||||
|
*/
|
||||||
|
private String common;
|
||||||
|
/**
|
||||||
|
* 节点顺序
|
||||||
|
*/
|
||||||
|
private Integer nodeOrder;
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.xdap.self_development.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ApprovalNodeDTO {
|
||||||
|
private String nodeName;
|
||||||
|
private List<String> assignees;
|
||||||
|
private Integer nodeOrder;
|
||||||
|
}
|
||||||
@ -0,0 +1,116 @@
|
|||||||
|
package com.xdap.self_development.pojo.dto;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||||
|
import com.definesys.mpaas.query.model.MpaasBasePojo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 发动机型号数据表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-12
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DataEntryEngineModelDto extends MpaasBasePojo {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品型号(全称)
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品型号(全称)
|
||||||
|
*/
|
||||||
|
private String modelName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品编号
|
||||||
|
*/
|
||||||
|
private String productNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 板块
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String plate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String platform;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系列
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String series;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 细分市场
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String marketSegment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名称
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String projectName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目编号
|
||||||
|
*/
|
||||||
|
private String projectNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品牌
|
||||||
|
*/
|
||||||
|
private String brand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产日期
|
||||||
|
*/
|
||||||
|
@DateTimeFormat("yyyy-MM-dd")
|
||||||
|
private Date productionDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标准参数数量
|
||||||
|
*/
|
||||||
|
@ExcelProperty("标准参数数量")
|
||||||
|
private Integer parameterNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已维护参数数量
|
||||||
|
*/
|
||||||
|
@ExcelProperty("已维护参数数量")
|
||||||
|
private Integer maintainedParameterNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填写部门
|
||||||
|
*/
|
||||||
|
private String dept;
|
||||||
|
/**
|
||||||
|
* 责任人
|
||||||
|
*/
|
||||||
|
private String resPerson;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分发状态
|
||||||
|
*/
|
||||||
|
private String distributeStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
private Integer versionNumber;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
package com.xdap.self_development.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EngineParamDTO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数名称
|
||||||
|
*/
|
||||||
|
private String parameterName;
|
||||||
|
|
||||||
|
private List<EngineParamDTO> engineParamDTOList;
|
||||||
|
}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
package com.xdap.self_development.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class EngineParamDetailDTO {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 责任人ID
|
||||||
|
*/
|
||||||
|
private String resPersonId;
|
||||||
|
/**
|
||||||
|
* 参数模板表id
|
||||||
|
*/
|
||||||
|
private String parameterId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发动机型号表id
|
||||||
|
*/
|
||||||
|
private String engineModelId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 子系统
|
||||||
|
*/
|
||||||
|
private String subsystemName;
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String parameterType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数名称
|
||||||
|
*/
|
||||||
|
private String parameterName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数值
|
||||||
|
*/
|
||||||
|
private String parameterValue;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 填写部门
|
||||||
|
*/
|
||||||
|
private String department;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 填写人
|
||||||
|
*/
|
||||||
|
private String filledBy;
|
||||||
|
/**
|
||||||
|
* 大版本(审核通过后变更的)
|
||||||
|
*/
|
||||||
|
private Integer majorVersion;
|
||||||
|
/**
|
||||||
|
* 小版本(控制是否可以审核)
|
||||||
|
*/
|
||||||
|
private String minorVersion;
|
||||||
|
/**
|
||||||
|
* 版本状态(0已通过,1草稿,审核中,3已撤回,4拒绝)
|
||||||
|
*/
|
||||||
|
private String versionStatus;
|
||||||
|
/**
|
||||||
|
* 流程ID
|
||||||
|
*/
|
||||||
|
private String approvalId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.xdap.self_development.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class HandleApprovalDTO {
|
||||||
|
private String approvalId;
|
||||||
|
private String userId;
|
||||||
|
private String operator;
|
||||||
|
private String comment;
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
package com.xdap.self_development.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
|
||||||
|
public class PageResultDTO<T> {
|
||||||
|
private List<T> list; // 数据列表
|
||||||
|
private long totalCount; // 总记录数
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package com.xdap.self_development.pojo.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ShowActivitiDTO {
|
||||||
|
private String userID;
|
||||||
|
private String approvalId;
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package com.xdap.self_development.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xdap.self_development.controller.request.ApprovalNodeRequest;
|
||||||
|
import com.xdap.self_development.pojo.dto.ActivitiDataAndRecordDTO;
|
||||||
|
import com.xdap.self_development.pojo.dto.ActivitiDataDTO;
|
||||||
|
import com.xdap.self_development.pojo.dto.HandleApprovalDTO;
|
||||||
|
import com.xdap.self_development.pojo.dto.ShowActivitiDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ActivitiProcessService {
|
||||||
|
List<ActivitiDataDTO> initiateApproval(String modelID, String userID);
|
||||||
|
//开始审批
|
||||||
|
void startActiviti(ApprovalNodeRequest approvalNodeRequest);
|
||||||
|
//查看
|
||||||
|
ActivitiDataAndRecordDTO showActivitiData(ShowActivitiDTO showActivitiDTO);
|
||||||
|
//操作
|
||||||
|
String handleApproval(HandleApprovalDTO handleApprovalDTO);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
package com.xdap.self_development.service;
|
||||||
|
|
||||||
|
import com.xdap.self_development.controller.request.DataEntryEngineModelPageRequest;
|
||||||
|
import com.xdap.self_development.pojo.DataEntryEngineModelPojo;
|
||||||
|
import com.xdap.self_development.pojo.dto.DataEntryEngineModelDto;
|
||||||
|
import com.xdap.self_development.pojo.dto.PageResultDTO;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 发动机型号数据表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-12
|
||||||
|
*/
|
||||||
|
public interface DataEntryEngineModelService {
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<DataEntryEngineModelPojo> selectAll();
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageResultDTO<DataEntryEngineModelDto> selectByConditionPage(DataEntryEngineModelPageRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* excel导入
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void excelImport(MultipartFile file, String userId, String ycOrOt);
|
||||||
|
/**
|
||||||
|
* 单条写入
|
||||||
|
*/
|
||||||
|
int insert(DataEntryEngineModelPageRequest request, String userId);
|
||||||
|
|
||||||
|
void updateModelForNewVersion();
|
||||||
|
|
||||||
|
void excelExport(HttpServletResponse response);
|
||||||
|
|
||||||
|
DataEntryEngineModelPojo selectBymodelId(String modelID);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
package com.xdap.self_development.service;
|
||||||
|
|
||||||
|
import com.xdap.self_development.controller.form.OptionForm;
|
||||||
|
import com.xdap.self_development.controller.form.TemplateForm;
|
||||||
|
import com.xdap.self_development.pojo.Parameter;
|
||||||
|
import com.xdap.self_development.pojo.Template;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface DataEntryService {
|
||||||
|
void readExcel(MultipartFile file);
|
||||||
|
|
||||||
|
void writeExcel(OptionForm form, HttpServletResponse response);
|
||||||
|
|
||||||
|
void insertParameter(TemplateForm form);
|
||||||
|
|
||||||
|
List<Parameter> getParameterByCondition(OptionForm form);
|
||||||
|
|
||||||
|
List<Template> getTemplateByCondition(String templateName);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
package com.xdap.self_development.service;
|
||||||
|
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
import com.xdap.self_development.controller.request.EngineParamDetailRequest;
|
||||||
|
import com.xdap.self_development.pojo.EngineParamDetailPojo;
|
||||||
|
import com.xdap.self_development.pojo.Parameter;
|
||||||
|
import com.xdap.self_development.pojo.dto.EngineParamDetailDTO;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 参数详情 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-13
|
||||||
|
*/
|
||||||
|
public interface EngineParamDetailService {
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, List<String>> selectParamList(String modelProName);
|
||||||
|
|
||||||
|
void excelImport(MultipartFile file,String modelId);
|
||||||
|
|
||||||
|
void excelExport(HttpServletResponse response);
|
||||||
|
|
||||||
|
List<EngineParamDetailDTO> selectValueByParam(EngineParamDetailRequest engineParamDetailRequest);
|
||||||
|
|
||||||
|
Map<String, List<EngineParamDetailDTO>> selectValueByMoreParam(EngineParamDetailRequest engineParamDetailRequest);
|
||||||
|
|
||||||
|
void updateParamValue(List<EngineParamDetailPojo> engineParamDetailPojos);
|
||||||
|
void updateToInsertFiledBy(List<EngineParamDetailPojo> engineParamDetailPojos, String userID);
|
||||||
|
|
||||||
|
List<Parameter> selectAllByNewVersion();
|
||||||
|
List<EngineParamDetailPojo> selectByModelNewVersion(String model);
|
||||||
|
|
||||||
|
//根据责任人查询最新发版的参数详情
|
||||||
|
List<EngineParamDetailPojo> selectByResId(String resId);
|
||||||
|
//根据填写人查询最新发版的参数详情
|
||||||
|
List<EngineParamDetailPojo> selectByfiledId(String filledId);
|
||||||
|
//根据流程ID查数据
|
||||||
|
List<EngineParamDetailPojo> selectByapprovalId(String approvalId);
|
||||||
|
//根据ID查询数据
|
||||||
|
EngineParamDetailPojo selectById(String id);
|
||||||
|
|
||||||
|
|
||||||
|
List<Integer> selectVersionList(String modelId);
|
||||||
|
|
||||||
|
List<XdapUsers> selectPersonoByType(String subSystem, String dept, Integer type);
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.xdap.self_development.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xdap.self_development.pojo.EngineReviewListPojo;
|
||||||
|
import com.xdap.self_development.pojo.dto.PageResultDTO;
|
||||||
|
|
||||||
|
public interface EngineReviewListService {
|
||||||
|
//查看机型审批列表
|
||||||
|
PageResultDTO<EngineReviewListPojo> selectEngineReviewListByUserId(String userId,Integer page,Integer size,String ycOrOth);
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package com.xdap.self_development.service;
|
||||||
|
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
import com.xdap.self_development.pojo.ResponsiblePerson;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 责任人表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-13
|
||||||
|
*/
|
||||||
|
public interface ResponsiblePerService {
|
||||||
|
|
||||||
|
ResponsiblePerson selectByDepAndPer(String department, String resPerson);
|
||||||
|
ResponsiblePerson selectByDep(String departmentId);
|
||||||
|
List<ResponsiblePerson> selectByUserId(List<XdapUsers> userIds);
|
||||||
|
List<ResponsiblePerson> selectByDepName(String departmentName);
|
||||||
|
|
||||||
|
Object insert(ResponsiblePerson responsiblePerson);
|
||||||
|
|
||||||
|
List<ResponsiblePerson> seelctAll();
|
||||||
|
|
||||||
|
ResponsiblePerson selectById(String responsiblePersonId);
|
||||||
|
|
||||||
|
List<ResponsiblePerson> selectBysubSystemDept(String subSystem, String dept);
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.xdap.self_development.service;
|
||||||
|
|
||||||
|
import com.xdap.self_development.controller.request.TodoReturnRequest;
|
||||||
|
import com.xdap.self_development.controller.request.TodoTaskRequest;
|
||||||
|
import com.xdap.self_development.pojo.TodoTaskPojo;
|
||||||
|
import com.xdap.self_development.pojo.dto.EngineParamDetailDTO;
|
||||||
|
import com.xdap.self_development.pojo.dto.PageResultDTO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 待办事项表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-18
|
||||||
|
*/
|
||||||
|
public interface TodoTaskService {
|
||||||
|
void batchInsert(List<TodoTaskPojo> taskPojo);
|
||||||
|
|
||||||
|
List<TodoTaskPojo> selectByPage(TodoTaskRequest todoTaskRequest);
|
||||||
|
PageResultDTO<TodoTaskPojo> selectByresPersonPage(TodoTaskRequest todoTaskRequest);
|
||||||
|
void createResPerson(List<EngineParamDetailDTO> paramDetailPojos, String userID);
|
||||||
|
|
||||||
|
void todoReturn(TodoReturnRequest todoReturnRequest);
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package com.xdap.self_development.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xdap.api.moudle.department.pojo.entity.XdapDepartments;
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 部门成员关系表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-19
|
||||||
|
*/
|
||||||
|
public interface XdapDeptUsersService {
|
||||||
|
|
||||||
|
//通过部门ID查找部门
|
||||||
|
XdapDepartments selectDeptByID(String deptId);
|
||||||
|
//通过部门名称查找部门
|
||||||
|
XdapDepartments selectDeptByName(String deptName);
|
||||||
|
//通过部门名称查找其下所属的人员
|
||||||
|
List<XdapUsers> selectUserByName(String deptName);
|
||||||
|
//通过人员名称查找人员
|
||||||
|
List<XdapUsers> selectUserByPersonName(String personName);
|
||||||
|
//查找人员集合中数据该部门的人
|
||||||
|
XdapUsers selectUserByUserListAndDeptName(List<XdapUsers> xdapUsersPojos, XdapDepartments dpName);
|
||||||
|
//通过人员ID查找人员
|
||||||
|
XdapUsers selectUserByID(String userId);
|
||||||
|
}
|
||||||
@ -0,0 +1,541 @@
|
|||||||
|
package com.xdap.self_development.service.impl;
|
||||||
|
|
||||||
|
import com.definesys.mpaas.query.MpaasQueryFactory;
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
import com.xdap.self_development.controller.request.ApprovalNodeRequest;
|
||||||
|
import com.xdap.self_development.enums.CurrentNodeEnum;
|
||||||
|
import com.xdap.self_development.enums.ParamOperation;
|
||||||
|
import com.xdap.self_development.enums.ParamValueVersionEnum;
|
||||||
|
import com.xdap.self_development.pojo.*;
|
||||||
|
import com.xdap.self_development.pojo.dto.*;
|
||||||
|
import com.xdap.self_development.service.*;
|
||||||
|
import groovy.util.logging.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@lombok.extern.slf4j.Slf4j
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class ActivitiProcessServiceImpl implements ActivitiProcessService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataEntryEngineModelService dataEntryEngineModelService;
|
||||||
|
@Autowired
|
||||||
|
private EngineParamDetailService engineParamDetailService;
|
||||||
|
@Autowired
|
||||||
|
private XdapDeptUsersService xdapDeptUsersService;
|
||||||
|
|
||||||
|
|
||||||
|
private String processTopic = "参数审批";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MpaasQueryFactory sw;
|
||||||
|
|
||||||
|
|
||||||
|
//保存编辑之后 审批前的界面初始化1.生成审批修改数据的修改说明,返回给前端看,并存入表里
|
||||||
|
@Override
|
||||||
|
public List<ActivitiDataDTO> initiateApproval(String modelID, String userID) {
|
||||||
|
//通过机型ID查找参数过滤更新的
|
||||||
|
List<EngineParamDetailPojo> engineParamDetailPojos = null;
|
||||||
|
try {
|
||||||
|
engineParamDetailPojos = engineParamDetailService.selectByModelNewVersion(modelID)
|
||||||
|
.stream()
|
||||||
|
.filter(x -> ParamOperation.UPDATE.toString()
|
||||||
|
.equals(x.getOperation())).collect(Collectors.toList());
|
||||||
|
if (ObjectUtils.isEmpty(engineParamDetailPojos)) {
|
||||||
|
throw new RuntimeException();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("找不到机型ID对应的参数或机型参数里最新版本没有UPDATE的数据");
|
||||||
|
}
|
||||||
|
ArrayList<ActivitiDataDTO> activitiDataDTOS = new ArrayList<>();
|
||||||
|
ArrayList<DataChangeCommentPojo> das = new ArrayList<>();
|
||||||
|
for (EngineParamDetailPojo engineParamDetailPojo : engineParamDetailPojos) {
|
||||||
|
String parameterId = engineParamDetailPojo.getParameterId();
|
||||||
|
List<Parameter> parameters = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("id", parameterId).doQuery(Parameter.class);
|
||||||
|
if (ObjectUtils.isEmpty(parameters)) {
|
||||||
|
throw new RuntimeException("未找到对应参数模板中的参数");
|
||||||
|
}
|
||||||
|
Parameter parameter = parameters.get(0);
|
||||||
|
String com = "";
|
||||||
|
String operation = engineParamDetailPojo.getOperation();
|
||||||
|
if (ParamOperation.UPDATE.toString().equals(operation)) {
|
||||||
|
String parameterValue = StringUtils.isEmpty(engineParamDetailPojo.getParameterValue()) ?
|
||||||
|
"" : engineParamDetailPojo.getParameterValue();
|
||||||
|
com = "修改:" + parameterValue + "改为" + engineParamDetailPojo.getMinorVersion();
|
||||||
|
}
|
||||||
|
if (ParamOperation.INSERT.toString().equals(operation)) {
|
||||||
|
com = "新增";
|
||||||
|
}
|
||||||
|
if (ParamOperation.DELETE.toString().equals(operation)) {
|
||||||
|
com = "删除";
|
||||||
|
}
|
||||||
|
DataEntryEngineModelPojo modelPojo = dataEntryEngineModelService.selectBymodelId(engineParamDetailPojo.getEngineModelId());
|
||||||
|
if (ObjectUtils.isEmpty(modelPojo)) {
|
||||||
|
throw new RuntimeException("该发动机型号不存在");
|
||||||
|
}
|
||||||
|
ActivitiDataDTO activitiDataDTO = new ActivitiDataDTO();
|
||||||
|
BeanUtils.copyProperties(engineParamDetailPojo, activitiDataDTO);
|
||||||
|
activitiDataDTO.setParameterValue(engineParamDetailPojo.getMinorVersion());
|
||||||
|
activitiDataDTO.setChangeComment(com);
|
||||||
|
activitiDataDTO.setEngineModelName(modelPojo.getModelName());
|
||||||
|
activitiDataDTO.setPartsName(parameter.getPartsName());
|
||||||
|
|
||||||
|
DataChangeCommentPojo dataChangeCommentPojo = new DataChangeCommentPojo();
|
||||||
|
BeanUtils.copyProperties(engineParamDetailPojo, dataChangeCommentPojo, "id");
|
||||||
|
dataChangeCommentPojo.setPartsName(parameter.getPartsName());
|
||||||
|
dataChangeCommentPojo.setParamDetailId(engineParamDetailPojo.getId());
|
||||||
|
dataChangeCommentPojo.setChangeComment(com);
|
||||||
|
dataChangeCommentPojo.setUnit(parameter.getUnit());
|
||||||
|
dataChangeCommentPojo.setParameterValue(engineParamDetailPojo.getMinorVersion());
|
||||||
|
dataChangeCommentPojo.setCreatedBy(userID);
|
||||||
|
dataChangeCommentPojo.setCreationDate(new Date());
|
||||||
|
|
||||||
|
activitiDataDTOS.add(activitiDataDTO);
|
||||||
|
das.add(dataChangeCommentPojo);
|
||||||
|
}
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.doBatchInsert(das);
|
||||||
|
return activitiDataDTOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void startActiviti(ApprovalNodeRequest approvalNodeRequest) {
|
||||||
|
|
||||||
|
//新增审批数据
|
||||||
|
if (ObjectUtils.isEmpty(approvalNodeRequest)) {
|
||||||
|
log.info("参与审批的数据为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1. 获取第一个审批环节(按nodeOrder排序取最小)
|
||||||
|
ApprovalNodeDTO firstNode = approvalNodeRequest.getNodeList().stream()
|
||||||
|
.min(Comparator.comparingInt(ApprovalNodeDTO::getNodeOrder))
|
||||||
|
.orElseThrow(() -> new RuntimeException("审批环节配置不能为空"));
|
||||||
|
//获取参数列表
|
||||||
|
List<EngineParamDetailPojo> paramList = approvalNodeRequest.getParamList();
|
||||||
|
String modelId = approvalNodeRequest.getModelId();
|
||||||
|
//通过机型ID查找参数过滤更新的
|
||||||
|
try {
|
||||||
|
paramList = engineParamDetailService.selectByModelNewVersion(modelId)
|
||||||
|
.stream()
|
||||||
|
.filter(x -> ParamOperation.UPDATE.toString()
|
||||||
|
.equals(x.getOperation())).collect(Collectors.toList());
|
||||||
|
if (ObjectUtils.isEmpty(paramList)) {
|
||||||
|
throw new RuntimeException();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("找不到机型ID对应的参数或机型参数里最新版本没有UPDATE的数据");
|
||||||
|
}
|
||||||
|
//获取机型
|
||||||
|
String engineModelId = approvalNodeRequest.getModelId();
|
||||||
|
DataEntryEngineModelPojo modelPojoOld = dataEntryEngineModelService.selectBymodelId(engineModelId);
|
||||||
|
//获取提交人
|
||||||
|
String userId = approvalNodeRequest.getUserId();
|
||||||
|
XdapUsers XdapUsers = xdapDeptUsersService.selectUserByID(userId);
|
||||||
|
String createBy = ObjectUtils.isNotEmpty(XdapUsers) ? XdapUsers.getUsername() : null;
|
||||||
|
//根据子系统分别创建审批流
|
||||||
|
Map<String, List<EngineParamDetailPojo>> listBySubSystem = paramList.stream().collect(Collectors.groupingBy(EngineParamDetailPojo::getSubsystemName));
|
||||||
|
for (Map.Entry<String, List<EngineParamDetailPojo>> stringListEntry : listBySubSystem.entrySet()) {
|
||||||
|
String approvalId = UUID.randomUUID().toString();
|
||||||
|
//子系统
|
||||||
|
String subSystem = stringListEntry.getKey();
|
||||||
|
|
||||||
|
|
||||||
|
EngineReviewListPojo engineReviewListPojo = new EngineReviewListPojo();
|
||||||
|
engineReviewListPojo.setId(approvalId);
|
||||||
|
engineReviewListPojo.setModelId(engineModelId);
|
||||||
|
engineReviewListPojo.setModelName(modelPojoOld.getModelName());
|
||||||
|
engineReviewListPojo.setYcOrOth(modelPojoOld.getYcOrOth());
|
||||||
|
engineReviewListPojo.setProcessTopic(processTopic);
|
||||||
|
engineReviewListPojo.setSubsystemName(subSystem);
|
||||||
|
engineReviewListPojo.setStatusCode(ParamValueVersionEnum.UNDER.getCode());
|
||||||
|
engineReviewListPojo.setApplicant(userId);
|
||||||
|
engineReviewListPojo.setStatusDesc(ParamValueVersionEnum.UNDER.getDesc());
|
||||||
|
engineReviewListPojo.setNodeName(firstNode.getNodeName());
|
||||||
|
engineReviewListPojo.setApproverPersons(String.join(",", firstNode.getAssignees()));
|
||||||
|
engineReviewListPojo.setReviewComment(approvalNodeRequest.getComment());
|
||||||
|
engineReviewListPojo.setCreationDate(new Date());
|
||||||
|
engineReviewListPojo.setCreatedBy(userId);
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(engineReviewListPojo);
|
||||||
|
|
||||||
|
//根据子系统分发待办
|
||||||
|
for (String assigneeId : firstNode.getAssignees()) {
|
||||||
|
|
||||||
|
TodoTaskPojo todoTaskPojo = new TodoTaskPojo();
|
||||||
|
todoTaskPojo.setDocumentNo(approvalId);
|
||||||
|
todoTaskPojo.setProcessTitle(subSystem);
|
||||||
|
todoTaskPojo.setCurrentNode(CurrentNodeEnum.DATAAPPROVAL.getDesc());
|
||||||
|
todoTaskPojo.setModelId(engineModelId);
|
||||||
|
todoTaskPojo.setVersionNumber(modelPojoOld.getVersionNumber());
|
||||||
|
todoTaskPojo.setOwnerId(assigneeId);
|
||||||
|
todoTaskPojo.setDataType(modelPojoOld.getYcOrOth());
|
||||||
|
todoTaskPojo.setModelName(modelPojoOld.getModelName());
|
||||||
|
todoTaskPojo.setCreatedById(userId);
|
||||||
|
todoTaskPojo.setCreatedBy(createBy);
|
||||||
|
todoTaskPojo.setCreationDate(new Date());
|
||||||
|
todoTaskPojo.setIsDelete(0);
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(todoTaskPojo);
|
||||||
|
|
||||||
|
}
|
||||||
|
//将参数绑定到该机型审批流程中
|
||||||
|
for (EngineParamDetailPojo engineParamDetailPojo : stringListEntry.getValue()) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("version_status", ParamValueVersionEnum.UNDER.getCode())
|
||||||
|
.update("approval_id", approvalId)
|
||||||
|
.update("last_update_date", new Date())
|
||||||
|
.eq("id", engineParamDetailPojo.getId())
|
||||||
|
.doUpdate(EngineParamDetailPojo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存审批环节配置
|
||||||
|
for (ApprovalNodeDTO nodeDTO : approvalNodeRequest.getNodeList()) {
|
||||||
|
ApprovalConfigPojo config = new ApprovalConfigPojo();
|
||||||
|
config.setApprovalId(approvalId);
|
||||||
|
config.setNodeName(nodeDTO.getNodeName());
|
||||||
|
config.setAssignees(String.join(",", nodeDTO.getAssignees()));
|
||||||
|
config.setNodeOrder(nodeDTO.getNodeOrder());
|
||||||
|
config.setCreatedBy(userId);
|
||||||
|
config.setCreationDate(new Date());
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(config);
|
||||||
|
}
|
||||||
|
//记录审批提交操作
|
||||||
|
ParamApprovalRecordPojo record = new ParamApprovalRecordPojo();
|
||||||
|
record.setApprovalId(approvalId);
|
||||||
|
record.setAssignee(userId);
|
||||||
|
record.setOperator("提交");
|
||||||
|
record.setNodeName("提交");
|
||||||
|
record.setNodeOrder(0);
|
||||||
|
record.setOperateTime(new Date());
|
||||||
|
record.setCreatedDate(new Date());
|
||||||
|
record.setApprovalComment("提交流程");
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(record);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//完成我的任务
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String handleApproval(HandleApprovalDTO handleApprovalDTO) {
|
||||||
|
String approvalId = handleApprovalDTO.getApprovalId(); //流程ID
|
||||||
|
String approver = handleApprovalDTO.getUserId(); //审批人
|
||||||
|
String operator = handleApprovalDTO.getOperator(); //操作
|
||||||
|
String comment = handleApprovalDTO.getComment(); //审批意见
|
||||||
|
ArrayList<EngineParamDetailPojo> list = new ArrayList<>(); //审批通过后准备升版的数据
|
||||||
|
//不是会签
|
||||||
|
boolean notAll = true;
|
||||||
|
|
||||||
|
EngineReviewListPojo reviewListPojo = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("id", approvalId).doQuery(EngineReviewListPojo.class).get(0);
|
||||||
|
if (reviewListPojo == null || reviewListPojo.getStatusCode() == ParamValueVersionEnum.REFUSE.getCode()) {
|
||||||
|
throw new RuntimeException("无效的审批记录");
|
||||||
|
}
|
||||||
|
//查看当前人是否有权限审批
|
||||||
|
String currentAssignees = reviewListPojo.getApproverPersons();
|
||||||
|
List<String> assigneeList = Arrays.asList(currentAssignees.split(","));
|
||||||
|
if (!assigneeList.contains(approver)) {
|
||||||
|
throw new RuntimeException("当前用户无权限处理此审批环节");
|
||||||
|
}
|
||||||
|
if (reviewListPojo.getNodeName().equals("会签")) {
|
||||||
|
notAll = false;
|
||||||
|
}
|
||||||
|
//找到当前机型
|
||||||
|
DataEntryEngineModelPojo modelPojo = dataEntryEngineModelService.selectBymodelId(reviewListPojo.getModelId());
|
||||||
|
//找到当前节点的配置
|
||||||
|
ApprovalConfigPojo approvalConfigPojo = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("approval_id", approvalId)
|
||||||
|
.eq("node_name", reviewListPojo.getNodeName())
|
||||||
|
.doQuery(ApprovalConfigPojo.class).get(0);
|
||||||
|
Integer nodeOrder = approvalConfigPojo.getNodeOrder();
|
||||||
|
|
||||||
|
XdapUsers XdapUsers = xdapDeptUsersService.selectUserByID(approvalConfigPojo.getCreatedBy());
|
||||||
|
String createBy = ObjectUtils.isNotEmpty(XdapUsers) ? XdapUsers.getUsername() : null;
|
||||||
|
//记录审批操作
|
||||||
|
ParamApprovalRecordPojo record = new ParamApprovalRecordPojo();
|
||||||
|
record.setApprovalId(approvalId);
|
||||||
|
record.setAssignee(approver);
|
||||||
|
record.setOperator(operator);
|
||||||
|
record.setNodeName(reviewListPojo.getNodeName());
|
||||||
|
record.setNodeOrder(nodeOrder);
|
||||||
|
record.setOperateTime(new Date());
|
||||||
|
record.setCreatedDate(new Date());
|
||||||
|
record.setApprovalComment(comment);
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(record);
|
||||||
|
|
||||||
|
if (!"拒绝".equals(operator) && !"同意".equals(operator)) {
|
||||||
|
throw new RuntimeException("无法识别的操作");
|
||||||
|
}
|
||||||
|
//驳回处理
|
||||||
|
if ("拒绝".equals(operator)) {
|
||||||
|
//更改参数状态
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("version_status", ParamValueVersionEnum.REFUSE.getCode())//改为已拒绝
|
||||||
|
.update("operation", "")//清空操作状态
|
||||||
|
.update("minor_version", "")//小版本清空
|
||||||
|
.update("approval_id", "")//关联的审批流清空
|
||||||
|
.update("last_update_date", new Date())
|
||||||
|
.eq("approval_id", approvalId).doUpdate(EngineParamDetailPojo.class);
|
||||||
|
//审批流改为已拒绝
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("status_code", ParamValueVersionEnum.REFUSE.getCode())
|
||||||
|
.update("status_desc", ParamValueVersionEnum.REFUSE.getDesc())
|
||||||
|
.update("approver_persons", "")
|
||||||
|
.update("last_update_date", new Date())
|
||||||
|
.eq("id", approvalId).doUpdate(EngineReviewListPojo.class);
|
||||||
|
//审批流的待办全部is_delete=1
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("is_delete", 1)
|
||||||
|
.update("last_update_date", new Date())
|
||||||
|
.eq("document_no", approvalId).doUpdate(TodoTaskPojo.class);
|
||||||
|
return "已拒绝";
|
||||||
|
}
|
||||||
|
//通过处理
|
||||||
|
//检查当前环节所有处理人是否已操作
|
||||||
|
List<ParamApprovalRecordPojo> nodeRecords =
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("approval_id", approvalId)
|
||||||
|
.eq("node_name", reviewListPojo.getNodeName()).doQuery(ParamApprovalRecordPojo.class);
|
||||||
|
|
||||||
|
Set<String> operatedUsers = nodeRecords.stream()
|
||||||
|
.map(ParamApprovalRecordPojo::getAssignee)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
|
//必须已经全部通过 不是会签的话例外
|
||||||
|
if (operatedUsers.containsAll(assigneeList) || notAll) {
|
||||||
|
// 获取下一个环节
|
||||||
|
List<ApprovalConfigPojo> approvalConfigPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("approval_id", approvalId)
|
||||||
|
.eq("node_order", (nodeOrder + 1))
|
||||||
|
.doQuery(ApprovalConfigPojo.class);
|
||||||
|
|
||||||
|
if (ObjectUtils.isNotEmpty(approvalConfigPojos)) {
|
||||||
|
//当前环节审批人 用来完成当前环节审批人的待办
|
||||||
|
String assignees = approvalConfigPojo.getAssignees();
|
||||||
|
for (String assID : Arrays.asList(assignees.split(","))) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("is_delete", 1)
|
||||||
|
.update("last_update_date", new Date())
|
||||||
|
.eq("document_no", approvalId)
|
||||||
|
.doUpdate(TodoTaskPojo.class);
|
||||||
|
}
|
||||||
|
ApprovalConfigPojo approvalConfigPojo1 = approvalConfigPojos.get(0);
|
||||||
|
for (String nextAssId : Arrays.asList(approvalConfigPojo1.getAssignees().split(","))) {
|
||||||
|
TodoTaskPojo todoTaskPojo = new TodoTaskPojo();
|
||||||
|
todoTaskPojo.setDocumentNo(approvalId);
|
||||||
|
todoTaskPojo.setProcessTitle(reviewListPojo.getSubsystemName());
|
||||||
|
todoTaskPojo.setCurrentNode(CurrentNodeEnum.DATAAPPROVAL.getDesc());
|
||||||
|
todoTaskPojo.setModelId(reviewListPojo.getModelId());
|
||||||
|
todoTaskPojo.setVersionNumber(modelPojo.getVersionNumber());
|
||||||
|
todoTaskPojo.setOwnerId(nextAssId);
|
||||||
|
todoTaskPojo.setDataType(modelPojo.getYcOrOth());
|
||||||
|
todoTaskPojo.setModelName(modelPojo.getModelName());
|
||||||
|
todoTaskPojo.setCreatedById(approvalConfigPojo.getCreatedBy());
|
||||||
|
todoTaskPojo.setCreatedBy(createBy);
|
||||||
|
todoTaskPojo.setCreationDate(new Date());
|
||||||
|
todoTaskPojo.setIsDelete(0);
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(todoTaskPojo);
|
||||||
|
|
||||||
|
}
|
||||||
|
//更新审批流到下个审批节点
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("approver_persons", approvalConfigPojo1.getAssignees())
|
||||||
|
.update("node_name", approvalConfigPojo1.getNodeName())
|
||||||
|
.update("last_update_date", new Date())
|
||||||
|
.eq("id", approvalId).doUpdate(EngineReviewListPojo.class);
|
||||||
|
} else {
|
||||||
|
// 所有环节完成
|
||||||
|
DataEntryEngineModelPojo modelPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("id", reviewListPojo.getModelId()).doQuery(DataEntryEngineModelPojo.class).get(0);
|
||||||
|
Integer versionNumber = modelPojos.getVersionNumber();
|
||||||
|
// 这个机型下所有参数都全部写入一版且版本加一 没有参与审批的参数时原来的值,参与审批的参数值要取小版本值作为大版本
|
||||||
|
List<EngineParamDetailPojo> oldDetails = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("engine_model_id", reviewListPojo.getModelId())
|
||||||
|
.eq("major_version", versionNumber)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
List<EngineParamDetailPojo> passDetail = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("approval_id", approvalId)
|
||||||
|
.eq("operation", ParamOperation.UPDATE)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
List<String> ids = passDetail.stream().map(x -> x.getId()).collect(Collectors.toList());
|
||||||
|
for (EngineParamDetailPojo oldDetail : oldDetails) {
|
||||||
|
EngineParamDetailPojo engineParamDetailPojo = new EngineParamDetailPojo();
|
||||||
|
BeanUtils.copyProperties(oldDetail, engineParamDetailPojo
|
||||||
|
, "id"
|
||||||
|
, "majorVersion"
|
||||||
|
, "minorVersion"
|
||||||
|
, "versionStatus"
|
||||||
|
, "approvalId"
|
||||||
|
, "isDelete"
|
||||||
|
, "operation");
|
||||||
|
if (ids.contains(oldDetail.getId())) {
|
||||||
|
engineParamDetailPojo.setParameterValue(oldDetail.getMinorVersion());
|
||||||
|
}
|
||||||
|
engineParamDetailPojo.setMajorVersion(versionNumber + 1);
|
||||||
|
list.add(engineParamDetailPojo);
|
||||||
|
}
|
||||||
|
// 这一批数据改成审核通过,
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("version_status", ParamValueVersionEnum.PASSED.getCode())
|
||||||
|
.update("last_update_date", new Date())
|
||||||
|
.eq("approval_id", approvalId).doUpdate(EngineParamDetailPojo.class);
|
||||||
|
// 这个机型版本加一,
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("version_number", (versionNumber + 1))
|
||||||
|
.eq("id", reviewListPojo.getModelId())
|
||||||
|
.doUpdate(DataEntryEngineModelPojo.class);
|
||||||
|
//审批流改为已通过
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("status_code", ParamValueVersionEnum.PASSED.getCode())
|
||||||
|
.update("status_desc", ParamValueVersionEnum.PASSED.getDesc())
|
||||||
|
.update("approver_persons", "")
|
||||||
|
.update("last_update_date", new Date())
|
||||||
|
.eq("id", approvalId).doUpdate(EngineReviewListPojo.class);
|
||||||
|
//审批流所有的待办完成处理
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("is_delete", 1)
|
||||||
|
.update("last_update_date", new Date())
|
||||||
|
.eq("document_no", approvalId)
|
||||||
|
.doUpdate(TodoTaskPojo.class);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//如果还有未通过的 找到未通过的
|
||||||
|
List<String> remainingAssignees = assigneeList.stream()
|
||||||
|
.filter(assignee -> !operatedUsers.contains(assignee))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
//已完成人的待办is_delete=1
|
||||||
|
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("is_delete", 1)
|
||||||
|
.update("last_update_date", new Date())
|
||||||
|
.eq("document_no", approvalId)
|
||||||
|
.doUpdate(TodoTaskPojo.class);
|
||||||
|
|
||||||
|
for (String remainingAssignee : remainingAssignees) {
|
||||||
|
TodoTaskPojo todoTaskPojo = new TodoTaskPojo();
|
||||||
|
todoTaskPojo.setDocumentNo(approvalId);
|
||||||
|
todoTaskPojo.setProcessTitle(reviewListPojo.getSubsystemName());
|
||||||
|
todoTaskPojo.setCurrentNode(CurrentNodeEnum.DATAAPPROVAL.getDesc());
|
||||||
|
todoTaskPojo.setModelId(reviewListPojo.getModelId());
|
||||||
|
todoTaskPojo.setVersionNumber(modelPojo.getVersionNumber());
|
||||||
|
todoTaskPojo.setOwnerId(remainingAssignee);
|
||||||
|
todoTaskPojo.setDataType(modelPojo.getYcOrOth());
|
||||||
|
todoTaskPojo.setModelName(modelPojo.getModelName());
|
||||||
|
todoTaskPojo.setCreatedById(approvalConfigPojo.getCreatedBy());
|
||||||
|
todoTaskPojo.setCreatedBy(createBy);
|
||||||
|
todoTaskPojo.setCreationDate(new Date());
|
||||||
|
todoTaskPojo.setIsDelete(0);
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(todoTaskPojo);
|
||||||
|
|
||||||
|
}
|
||||||
|
//更新机型审批数据的当前审批人去掉已经审批通过的那个人
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("approver_persons", String.join(",", remainingAssignees))
|
||||||
|
.eq("id", approvalId).doUpdate(EngineReviewListPojo.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (ObjectUtils.isNotEmpty(list)) {
|
||||||
|
batchInsertParamDetail(list);
|
||||||
|
}
|
||||||
|
return "已审批";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class) // 发生任何异常都回滚
|
||||||
|
public void batchInsertParamDetail(List<EngineParamDetailPojo> engineParamDetailPojos) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(engineParamDetailPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
//查看审批
|
||||||
|
@Override
|
||||||
|
public ActivitiDataAndRecordDTO showActivitiData(ShowActivitiDTO showActivitiDTO) {
|
||||||
|
String approvalId = showActivitiDTO.getApprovalId();
|
||||||
|
String userID = showActivitiDTO.getUserID();
|
||||||
|
EngineReviewListPojo reviewListPojo = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("id", approvalId).doQuery(EngineReviewListPojo.class).get(0);
|
||||||
|
if (reviewListPojo == null) {
|
||||||
|
throw new RuntimeException("无效的审批记录");
|
||||||
|
}
|
||||||
|
ActivitiDataAndRecordDTO activitiDataAndRecordDTO = new ActivitiDataAndRecordDTO();
|
||||||
|
//查找审批数据
|
||||||
|
ArrayList<ActivitiDataDTO> activitiDataDTOS = new ArrayList<>();
|
||||||
|
|
||||||
|
//通过审批ID找到审批中的参数 通过参数ID匹配参数变动说明
|
||||||
|
List<EngineParamDetailPojo> detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("approval_id", approvalId)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
List<String> ids = detailPojos.stream().map(x -> x.getId()).collect(Collectors.toList());
|
||||||
|
List<DataChangeCommentPojo> dataChangeCommentPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.in("param_detail_id", ids)
|
||||||
|
.doQuery(DataChangeCommentPojo.class);
|
||||||
|
for (DataChangeCommentPojo dataChangeCommentPojo : dataChangeCommentPojos) {
|
||||||
|
ActivitiDataDTO activitiDataDTO = new ActivitiDataDTO();
|
||||||
|
DataEntryEngineModelPojo modelPojo = dataEntryEngineModelService.selectBymodelId(dataChangeCommentPojo.getEngineModelId());
|
||||||
|
BeanUtils.copyProperties(dataChangeCommentPojo, activitiDataDTO);
|
||||||
|
activitiDataDTO.setEngineModelName(modelPojo.getModelName());
|
||||||
|
activitiDataDTO.setChangeComment(dataChangeCommentPojo.getChangeComment());
|
||||||
|
activitiDataDTOS.add(activitiDataDTO);
|
||||||
|
}
|
||||||
|
activitiDataAndRecordDTO.setActivitiDataDTOS(activitiDataDTOS);
|
||||||
|
|
||||||
|
//查找审批记录
|
||||||
|
ArrayList<ActivitiRecordDTO> activitiRecordDTOS = new ArrayList<>();
|
||||||
|
List<ParamApprovalRecordPojo> paramApprovalRecordPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("approval_id", approvalId)
|
||||||
|
.doQuery(ParamApprovalRecordPojo.class);
|
||||||
|
for (ParamApprovalRecordPojo paramApprovalRecordPojo : paramApprovalRecordPojos) {
|
||||||
|
String approverPerson = paramApprovalRecordPojo.getAssignee();
|
||||||
|
ActivitiRecordDTO activitiRecordDTO = new ActivitiRecordDTO();
|
||||||
|
activitiRecordDTO.setNode(paramApprovalRecordPojo.getNodeName());
|
||||||
|
activitiRecordDTO.setApproverPersons(approverPerson);
|
||||||
|
activitiRecordDTO.setCommon(paramApprovalRecordPojo.getApprovalComment());
|
||||||
|
activitiRecordDTO.setNodeOrder(paramApprovalRecordPojo.getNodeOrder());
|
||||||
|
activitiRecordDTOS.add(activitiRecordDTO);
|
||||||
|
}
|
||||||
|
//找到下一级审批人
|
||||||
|
List<EngineReviewListPojo> engineReviewListPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("id", approvalId).doQuery(EngineReviewListPojo.class);
|
||||||
|
if (ObjectUtils.isNotEmpty(engineReviewListPojos)) {
|
||||||
|
EngineReviewListPojo engineReviewListPojo = engineReviewListPojos.get(0);
|
||||||
|
if (StringUtils.isNotEmpty(engineReviewListPojo.getApproverPersons())) {
|
||||||
|
ActivitiRecordDTO recordNextApprover = new ActivitiRecordDTO();
|
||||||
|
recordNextApprover.setApproverPersons(engineReviewListPojo.getApproverPersons());
|
||||||
|
recordNextApprover.setCommon("");
|
||||||
|
recordNextApprover.setNode("待审批");
|
||||||
|
recordNextApprover.setNodeOrder(999);
|
||||||
|
activitiRecordDTOS.add(recordNextApprover);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ArrayList<ActivitiRecordDTO> activitiRecordDTOS1 = new ArrayList<>();
|
||||||
|
//将activitiRecordDTOS数据的ID改为姓名
|
||||||
|
for (ActivitiRecordDTO activitiRecordDTO : activitiRecordDTOS) {
|
||||||
|
ArrayList<String> strings = new ArrayList<>();
|
||||||
|
for (String id : Arrays.stream(activitiRecordDTO.getApproverPersons().split(",")).collect(Collectors.toList())) {
|
||||||
|
XdapUsers XdapUsers = xdapDeptUsersService.selectUserByID(id);
|
||||||
|
if (ObjectUtils.isNotEmpty(XdapUsers)) {
|
||||||
|
String username = XdapUsers.getUsername();
|
||||||
|
strings.add(username);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ActivitiRecordDTO activitiRecordDTO1 = new ActivitiRecordDTO();
|
||||||
|
BeanUtils.copyProperties(activitiRecordDTO, activitiRecordDTO1);
|
||||||
|
activitiRecordDTO1.setApproverPersons(String.join(",", strings));
|
||||||
|
activitiRecordDTOS1.add(activitiRecordDTO1);
|
||||||
|
}
|
||||||
|
|
||||||
|
activitiDataAndRecordDTO.setActivitiRecordDTOS(activitiRecordDTOS1);
|
||||||
|
|
||||||
|
return activitiDataAndRecordDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,409 @@
|
|||||||
|
package com.xdap.self_development.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.excel.EasyExcel;
|
||||||
|
import com.definesys.mpaas.query.MpaasQueryFactory;
|
||||||
|
import com.definesys.mpaas.query.db.PageQueryResult;
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
import com.xdap.runtime.service.RuntimeDatasourceService;
|
||||||
|
import com.xdap.self_development.controller.request.DataEntryEngineModelExcel;
|
||||||
|
import com.xdap.self_development.controller.request.DataEntryEngineModelPageRequest;
|
||||||
|
import com.xdap.self_development.enums.DistributeStatusEnum;
|
||||||
|
import com.xdap.self_development.enums.ParamValueVersionEnum;
|
||||||
|
import com.xdap.self_development.exception.ExcelImportException;
|
||||||
|
import com.xdap.self_development.listener.EngineModelListener;
|
||||||
|
import com.xdap.self_development.pojo.*;
|
||||||
|
import com.xdap.self_development.pojo.dto.DataEntryEngineModelDto;
|
||||||
|
import com.xdap.self_development.pojo.dto.PageResultDTO;
|
||||||
|
import com.xdap.self_development.service.DataEntryEngineModelService;
|
||||||
|
import com.xdap.self_development.service.EngineParamDetailService;
|
||||||
|
import com.xdap.self_development.service.ResponsiblePerService;
|
||||||
|
import com.xdap.self_development.service.XdapDeptUsersService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 发动机型号数据表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-12
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class DataEntryEngineModelServiceImpl implements DataEntryEngineModelService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MpaasQueryFactory sw;
|
||||||
|
@Autowired
|
||||||
|
private ResponsiblePerService responsiblePerService;
|
||||||
|
@Resource
|
||||||
|
private RuntimeDatasourceService runtimeDatasourceService;
|
||||||
|
@Autowired
|
||||||
|
private XdapDeptUsersService xdapDeptUsersService;
|
||||||
|
@Autowired
|
||||||
|
private EngineParamDetailService engineParamDetailService;
|
||||||
|
|
||||||
|
private int page = 1;
|
||||||
|
private int size = 10;
|
||||||
|
|
||||||
|
private Integer versionNumber = 0;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DataEntryEngineModelPojo> selectAll() {
|
||||||
|
List<DataEntryEngineModelPojo> modelPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
.doQuery(DataEntryEngineModelPojo.class);
|
||||||
|
return modelPojos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResultDTO<DataEntryEngineModelDto> selectByConditionPage(DataEntryEngineModelPageRequest request) {
|
||||||
|
//责任人ID
|
||||||
|
ResponsiblePerson responsiblePersonPojo;
|
||||||
|
List<String> resPerIds = new ArrayList<>();
|
||||||
|
List<DataEntryEngineModelDto> dataEntryEngineModelDtos = new ArrayList<>();
|
||||||
|
PageResultDTO<DataEntryEngineModelDto> tPageResultDTO = new PageResultDTO<>();
|
||||||
|
if (!Objects.isNull(request)) {
|
||||||
|
page = request.getPage();
|
||||||
|
size = request.getSize();
|
||||||
|
String department = request.getDepartment();
|
||||||
|
String resPerson = request.getResPerson();
|
||||||
|
//部门和人员筛选
|
||||||
|
if (ObjectUtils.isNotEmpty(department) && ObjectUtils.isNotEmpty(resPerson)) {
|
||||||
|
responsiblePersonPojo = responsiblePerService.selectByDepAndPer(department, resPerson);
|
||||||
|
if (!ObjectUtils.isEmpty(responsiblePersonPojo)) {
|
||||||
|
resPerIds.add(responsiblePersonPojo.getId());
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("没有找到该责任人");
|
||||||
|
}
|
||||||
|
//部门筛选
|
||||||
|
} else if (ObjectUtils.isNotEmpty(department) && ObjectUtils.isEmpty(resPerson)) {
|
||||||
|
List<String> strings = responsiblePerService.selectByDepName(department).stream()
|
||||||
|
.map(x -> x.getId()).collect(Collectors.toList());
|
||||||
|
if (ObjectUtils.isNotEmpty(strings)) {
|
||||||
|
resPerIds.addAll(strings);
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("没有找到该部门下责任人");
|
||||||
|
}
|
||||||
|
//人员筛选
|
||||||
|
} else if (ObjectUtils.isEmpty(department) && ObjectUtils.isNotEmpty(resPerson)) {
|
||||||
|
List<XdapUsers> userByName = xdapDeptUsersService.selectUserByPersonName(resPerson);
|
||||||
|
List<String> strings = responsiblePerService.selectByUserId(userByName).stream().map(x -> x.getId()).collect(Collectors.toList());
|
||||||
|
if (ObjectUtils.isNotEmpty(strings)) {
|
||||||
|
resPerIds.addAll(strings);
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("没有找到该责任人");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
request = new DataEntryEngineModelPageRequest();
|
||||||
|
log.warn("注意:传入参数为空默认无条件首页十条");
|
||||||
|
}
|
||||||
|
log.info("查找到的责任人:{}", resPerIds);
|
||||||
|
|
||||||
|
List<DataEntryEngineModelPojo> modelPojos = sw
|
||||||
|
.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("yc_or_oth", request.getYcOrOth())
|
||||||
|
.like("model_name", request.getModelName())
|
||||||
|
.like("product_number", request.getProductNumber())
|
||||||
|
.like("plate", request.getPlate())
|
||||||
|
.like("platform", request.getPlatform())
|
||||||
|
.like("series", request.getSeries())
|
||||||
|
.like("market_segment", request.getMarketSegment())
|
||||||
|
.like("project_name", request.getProjectName())
|
||||||
|
.like("project_number", request.getProjectNumber())
|
||||||
|
.like("brand", request.getBrand())
|
||||||
|
.in("responsible_person_id", resPerIds)
|
||||||
|
.like("distribute_status", request.getDistributeStatus())
|
||||||
|
.doQuery(DataEntryEngineModelPojo.class);
|
||||||
|
PageQueryResult<DataEntryEngineModelPojo> pageQueryResult = sw
|
||||||
|
.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("yc_or_oth", request.getYcOrOth())
|
||||||
|
.like("model_name", request.getModelName())
|
||||||
|
.like("product_number", request.getProductNumber())
|
||||||
|
.like("plate", request.getPlate())
|
||||||
|
.like("platform", request.getPlatform())
|
||||||
|
.like("series", request.getSeries())
|
||||||
|
.like("market_segment", request.getMarketSegment())
|
||||||
|
.like("project_name", request.getProjectName())
|
||||||
|
.like("project_number", request.getProjectNumber())
|
||||||
|
.like("brand", request.getBrand())
|
||||||
|
.in("responsible_person_id", resPerIds)
|
||||||
|
.like("distribute_status", request.getDistributeStatus())
|
||||||
|
.doPageQuery(page, size, DataEntryEngineModelPojo.class);
|
||||||
|
for (DataEntryEngineModelPojo modelPojo : pageQueryResult.getResult()) {
|
||||||
|
DataEntryEngineModelDto dataEntryEngineModelDto = new DataEntryEngineModelDto();
|
||||||
|
BeanUtils.copyProperties(modelPojo, dataEntryEngineModelDto);
|
||||||
|
dataEntryEngineModelDto.setId(modelPojo.getId());
|
||||||
|
//部门,责任人,状态
|
||||||
|
// 去掉责任人和部门 ResponsiblePersonPojo responsiblePersonPojo1 = responsiblePersonService.selectById(modelPojo.getResponsiblePersonId());
|
||||||
|
// XdapDepartmentsPojo deptByID = xdapDeptUsersService.selectDeptByID(responsiblePersonPojo1.getXdapDepartmentId());
|
||||||
|
// XdapUsersPojo xdapUsersPojo = xdapDeptUsersService.selectUserByID(responsiblePersonPojo1.getXdapUserId());
|
||||||
|
// if (ObjectUtils.isNotEmpty(deptByID)) {
|
||||||
|
// dataEntryEngineModelDto.setDept(deptByID.getName());
|
||||||
|
// }
|
||||||
|
// if (ObjectUtils.isNotEmpty(xdapUsersPojo)) {
|
||||||
|
// dataEntryEngineModelDto.setResPerson(xdapUsersPojo.getUsername());
|
||||||
|
// }
|
||||||
|
DistributeStatusEnum byDesc = DistributeStatusEnum.getByCode(modelPojo.getDistributeStatus());
|
||||||
|
dataEntryEngineModelDto.setDistributeStatus(byDesc != null ? byDesc.getDesc() : null);
|
||||||
|
dataEntryEngineModelDtos.add(dataEntryEngineModelDto);
|
||||||
|
}
|
||||||
|
tPageResultDTO.setList(dataEntryEngineModelDtos);
|
||||||
|
tPageResultDTO.setTotalCount(modelPojos.size());
|
||||||
|
return tPageResultDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
// @Transactional(rollbackFor = Exception.class)
|
||||||
|
public void excelImport(MultipartFile file, String userId, String ycOrOt) {
|
||||||
|
if (ObjectUtils.isEmpty(userId)) {
|
||||||
|
throw new ExcelImportException("执行上传操作的用户查不到,无法上传");
|
||||||
|
}
|
||||||
|
List<XdapUsers> users = runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
||||||
|
.eq("id", userId)
|
||||||
|
.doQuery(XdapUsers.class);
|
||||||
|
if (ObjectUtils.isEmpty(users)) {
|
||||||
|
throw new ExcelImportException("执行上传操作的用户查不到,无法上传");
|
||||||
|
}
|
||||||
|
XdapUsers xdapUsersPojo = users.get(0);
|
||||||
|
try {
|
||||||
|
EasyExcel.read(file.getInputStream(), DataEntryEngineModelExcel.class, new EngineModelListener(sw, responsiblePerService, engineParamDetailService, ycOrOt, xdapUsersPojo))
|
||||||
|
.sheet()
|
||||||
|
.doRead();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("读取文件异常");
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
throw new ExcelImportException(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public int insert(DataEntryEngineModelPageRequest request, String userId) {/*
|
||||||
|
DateTime date = DateUtil.date();
|
||||||
|
String createdBy = "添加机型";
|
||||||
|
Date createdDate = date;
|
||||||
|
String lastModifiedBy = "";
|
||||||
|
Date lastModifiedDate = date;
|
||||||
|
|
||||||
|
DataEntryEngineModelPojo modelPojo = new DataEntryEngineModelPojo();
|
||||||
|
BeanUtils.copyProperties(request, modelPojo, "status", "lastModifiedDate", "lastModifiedBy", "createdBy", "createdDate");
|
||||||
|
modelPojo.setCreatedBy(createdBy);
|
||||||
|
modelPojo.setCreatedDate(createdDate);
|
||||||
|
modelPojo.setLastUpdatedBy(lastModifiedBy);
|
||||||
|
modelPojo.setLastUpdatedDate(lastModifiedDate);
|
||||||
|
log.info(request.toString());
|
||||||
|
String depId;
|
||||||
|
request.getDepartment(), request.getResPerson()
|
||||||
|
List<XdapUsersPojo> users = runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
||||||
|
.eq("id", userId)
|
||||||
|
.doQuery(XdapUsersPojo.class);
|
||||||
|
ResponsiblePersonPojo personPojo = responsiblePersonService.selectByDep(depId);
|
||||||
|
if (ObjectUtils.isNotNull(personPojo)) {
|
||||||
|
modelPojo.setResponsiblePersonId(personPojo.getId());
|
||||||
|
} else {
|
||||||
|
personPojo = new ResponsiblePersonPojo();
|
||||||
|
personPojo.setCreatedBy(createdBy);
|
||||||
|
personPojo.setLastUpdatedBy(lastModifiedBy);
|
||||||
|
personPojo.setLastUpdatedDate(lastModifiedDate);
|
||||||
|
personPojo.setCreatedDate(createdDate);
|
||||||
|
personPojo.setResponsiblePerson(request.getResPerson());
|
||||||
|
personPojo.setDepartment(request.getDepartment());
|
||||||
|
log.info(personPojo.getRowId());
|
||||||
|
Object id = responsiblePersonService.insert(personPojo);
|
||||||
|
modelPojo.setResponsiblePersonId((String) id);
|
||||||
|
}
|
||||||
|
DistributeStatusEnum byDesc = DistributeStatusEnum.getByDesc(StrUtil.isEmpty(request.getStatus()) ? "" : request.getStatus());
|
||||||
|
modelPojo.setStatus(byDesc != null ? byDesc.getCode() : null);
|
||||||
|
modelPojo.setVersionNumber(versionNumber);
|
||||||
|
modelPojo.setIsDelete(0);
|
||||||
|
Object testDemo = null;
|
||||||
|
try {
|
||||||
|
testDemo = sw.buildFromDatasource("test_demo")
|
||||||
|
.doInsert(modelPojo);
|
||||||
|
log.info("发动机型号数据写入成功,{}", testDemo.toString());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("发动机型号数据写入失败");
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;*/
|
||||||
|
List<Parameter> parameters = engineParamDetailService.selectAllByNewVersion();
|
||||||
|
DataEntryEngineModelPojo modelPojo = new DataEntryEngineModelPojo();
|
||||||
|
BeanUtils.copyProperties(request, modelPojo, "status");
|
||||||
|
List<ResponsiblePerson> personPojos = responsiblePerService.selectByDepName(request.getDepartment());
|
||||||
|
// 去掉责任人 if (ObjectUtils.isEmpty(personPojos)) {
|
||||||
|
// throw new ExcelImportException(
|
||||||
|
// String.format("请检查该部门是否有责任人,部门:%s", request.getDepartment())
|
||||||
|
// );
|
||||||
|
// } else {
|
||||||
|
// modelPojo.setResponsiblePersonId(personPojos.get(0).getId());
|
||||||
|
// }
|
||||||
|
List<XdapUsers> users = runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
||||||
|
.eq("id", userId)
|
||||||
|
.doQuery(XdapUsers.class);
|
||||||
|
if (ObjectUtils.isEmpty(users)) {
|
||||||
|
throw new ExcelImportException("执行上传操作的用户查不到,无法上传");
|
||||||
|
}
|
||||||
|
XdapUsers xdapUsersPojo = users.get(0);
|
||||||
|
|
||||||
|
//获取状态码
|
||||||
|
DistributeStatusEnum byDesc = DistributeStatusEnum.getByDesc(request.getDistributeStatus());
|
||||||
|
modelPojo.setDistributeStatus(byDesc != null ? byDesc.getCode() : null);
|
||||||
|
modelPojo.setParameterNum(parameters.toArray().length);
|
||||||
|
modelPojo.setMaintainedParameterNum(0);
|
||||||
|
modelPojo.setVersionNumber(versionNumber);
|
||||||
|
modelPojo.setIsDelete(0);
|
||||||
|
modelPojo.setCreatedBy(userId);
|
||||||
|
modelPojo.setLastUpdatedBy("");
|
||||||
|
modelPojo.setLastUpdateDate(new Date());
|
||||||
|
modelPojo.setCreationDate(new Date());
|
||||||
|
modelPojo.setId(UUID.randomUUID().toString());
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(modelPojo);
|
||||||
|
|
||||||
|
saveDataParamDetail(modelPojo, parameters, xdapUsersPojo);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//模板管理审批完成触发更新 参数版本
|
||||||
|
//遍历所有机型 把所有机型的版本加一 状态为未分发 绑定新版参数新版参数版本加一 所有新参数值为空 重新走分发
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void updateModelForNewVersion() {
|
||||||
|
List<Parameter> parameters = engineParamDetailService.selectAllByNewVersion();
|
||||||
|
DistributeStatusEnum byDesc = DistributeStatusEnum.getByDesc("未分发");
|
||||||
|
Integer distribute_status = byDesc != null ? byDesc.getCode() : null;
|
||||||
|
List<DataEntryEngineModelPojo> entryEngineModelPojos = selectAll();
|
||||||
|
|
||||||
|
for (DataEntryEngineModelPojo entryEngineModelPojo : entryEngineModelPojos) {
|
||||||
|
Integer oldVersionNum = entryEngineModelPojo.getVersionNumber();
|
||||||
|
Integer newVersionNum = oldVersionNum + 1;
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("distribute_status", distribute_status)
|
||||||
|
.update("version_number", newVersionNum)
|
||||||
|
.update("last_updated_by", "模板审核完成触发")
|
||||||
|
.update("last_update_date", new Date())
|
||||||
|
.rowid("id", entryEngineModelPojo.getId())
|
||||||
|
.doUpdate(EngineParamDetailPojo.class);
|
||||||
|
//绑定参数准备重新走分发
|
||||||
|
saveDataParamDetail(entryEngineModelPojo, parameters, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//为每个机型绑定参数
|
||||||
|
public void saveDataParamDetail(DataEntryEngineModelPojo modelPojo, List<Parameter> parameters, XdapUsers xdapUsersPojo) {
|
||||||
|
/**
|
||||||
|
* 遍历机型
|
||||||
|
* 查找参数 将每个机型都把参数,和参数所属的填写部门关联上
|
||||||
|
* 参数值暂时放空
|
||||||
|
*/
|
||||||
|
List<EngineParamDetailPojo> engineParamDetailPojos = new ArrayList<>();
|
||||||
|
|
||||||
|
for (Parameter parameter : parameters) {
|
||||||
|
EngineParamDetailPojo engineParamDetailPojo = new EngineParamDetailPojo();
|
||||||
|
engineParamDetailPojo.setEngineModelId(modelPojo.getId());
|
||||||
|
engineParamDetailPojo.setParameterId(parameter.getId());
|
||||||
|
engineParamDetailPojo.setSubsystemName(parameter.getSubsystemName());
|
||||||
|
engineParamDetailPojo.setParameterType(parameter.getParameterType());
|
||||||
|
engineParamDetailPojo.setParameterName(parameter.getParameterName());
|
||||||
|
engineParamDetailPojo.setDepartment(parameter.getDepartment());
|
||||||
|
engineParamDetailPojo.setMajorVersion(versionNumber);
|
||||||
|
engineParamDetailPojo.setVersionStatus(ParamValueVersionEnum.DRAFT.getCode());
|
||||||
|
engineParamDetailPojo.setCreatedBy(ObjectUtils.isNotEmpty(xdapUsersPojo) ? xdapUsersPojo.getId() : null);
|
||||||
|
engineParamDetailPojo.setLastUpdatedBy("");
|
||||||
|
engineParamDetailPojo.setLastUpdateDate(new Date());
|
||||||
|
engineParamDetailPojo.setCreationDate(new Date());
|
||||||
|
//为每个参数生成默认责任人
|
||||||
|
List<ResponsiblePerson> personPojos = responsiblePerService.selectByDepName(parameter.getDepartment());
|
||||||
|
if (ObjectUtils.isNotEmpty(personPojos)) {
|
||||||
|
// 不再默认生成责任人 engineParamDetailPojo.setResponsiblePersonId(personPojos.get(0).getId());
|
||||||
|
}
|
||||||
|
engineParamDetailPojos.add(engineParamDetailPojo);
|
||||||
|
|
||||||
|
}
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(engineParamDetailPojos);
|
||||||
|
|
||||||
|
//
|
||||||
|
// //生成分解任务给责任人 参数根据机型+责任人分组 生成数据
|
||||||
|
// List<EngineParamDetailPojo> paramDetailPojos = engineParamDetailPojos.stream()
|
||||||
|
// // 以engineModelId和responsiblePersonId组合作为key,元素本身作为value
|
||||||
|
// .collect(Collectors.toMap(pojo -> pojo.getEngineModelId() + "_" + pojo.getResponsiblePersonId(),
|
||||||
|
// pojo -> pojo,
|
||||||
|
// (existing, replacement) -> existing
|
||||||
|
// ))
|
||||||
|
// // 提取去重后的value集合
|
||||||
|
// .values()
|
||||||
|
// .stream()
|
||||||
|
// .collect(Collectors.toList());
|
||||||
|
// ArrayList<TodoTaskPojo> todoTaskPojos = new ArrayList<>();
|
||||||
|
// for (EngineParamDetailPojo paramDetailPojo : paramDetailPojos) {
|
||||||
|
// //组装待办
|
||||||
|
// TodoTaskPojo todoTaskPojo = new TodoTaskPojo();
|
||||||
|
// todoTaskPojo.setCreatedById(xdapUsersPojo.getId());
|
||||||
|
// todoTaskPojo.setDocumentNo(UUID.randomUUID().toString());
|
||||||
|
// todoTaskPojo.setProcessTitle("新增发动机型号流程");
|
||||||
|
// todoTaskPojo.setCurrentNode(CurrentNodeEnum.JOBSPLIT.getDesc());
|
||||||
|
// todoTaskPojo.setStatusCode(String.valueOf(ParamValueVersionEnum.DRAFT.getCode()));
|
||||||
|
// todoTaskPojo.setModelName(modelPojo.getModelName());
|
||||||
|
// todoTaskPojo.setModelId(modelPojo.getId());
|
||||||
|
// todoTaskPojo.setCreationDate(new Date());
|
||||||
|
// todoTaskPojo.setDataType("玉柴");
|
||||||
|
// todoTaskPojo.setVersionNumber(versionNumber);
|
||||||
|
// todoTaskPojo.setIsDelete(0);
|
||||||
|
// if (ObjectUtils.isNotEmpty(paramDetailPojo.getResponsiblePersonId())) {
|
||||||
|
// ResponsiblePersonPojo responsiblePersonPojo = responsiblePerService.selectById(paramDetailPojo.getResponsiblePersonId());
|
||||||
|
// todoTaskPojo.setOwnerId(ObjectUtils.isNotEmpty(responsiblePersonPojo) ? responsiblePersonPojo.getUserId() : null);
|
||||||
|
// }
|
||||||
|
// todoTaskPojo.setCreatedBy(xdapUsersPojo.getUsername());
|
||||||
|
// todoTaskPojos.add(todoTaskPojo);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 又不在这生成待办了 改为管理员进去选择责任人后待办 batchInsertTodoTask(todoTaskPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void batchInsertTodoTask(List<TodoTaskPojo> todoTaskPojos) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(todoTaskPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void excelExport(HttpServletResponse response) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DataEntryEngineModelPojo selectBymodelId(String modelId) {
|
||||||
|
if (ObjectUtils.isNotEmpty(modelId)) {
|
||||||
|
List<DataEntryEngineModelPojo> modelPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("id", modelId).doQuery(DataEntryEngineModelPojo.class);
|
||||||
|
if (ObjectUtils.isNotEmpty(modelPojos)) {
|
||||||
|
return modelPojos.get(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.error("该发动机不存在");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,216 @@
|
|||||||
|
package com.xdap.self_development.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.query.MpaasQueryFactory;
|
||||||
|
import com.xdap.self_development.controller.form.OptionForm;
|
||||||
|
import com.xdap.self_development.controller.form.TemplateForm;
|
||||||
|
import com.xdap.self_development.pojo.Parameter;
|
||||||
|
import com.xdap.self_development.pojo.Template;
|
||||||
|
import com.xdap.self_development.service.DataEntryService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class DataEntryServiceImpl implements DataEntryService {
|
||||||
|
@Resource
|
||||||
|
private MpaasQueryFactory sw;
|
||||||
|
@Override
|
||||||
|
public void readExcel(MultipartFile file) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeExcel(OptionForm form, HttpServletResponse response) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertParameter(TemplateForm form) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Parameter> getParameterByCondition(OptionForm form) {
|
||||||
|
List<Parameter> parameters = sw.buildFromDatasource("xdap_app_223770822127386625").doQuery(Parameter.class);
|
||||||
|
return parameters;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Template> getTemplateByCondition(String templateName) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void readExcel(MultipartFile file) {
|
||||||
|
// try (InputStream inputStream = file.getInputStream()){
|
||||||
|
// EasyExcel.read(inputStream, Parameter.class, new SheetDataListener(sw)).doReadAll();
|
||||||
|
// } catch (IOException e) {
|
||||||
|
// throw new RuntimeException("读取文件失败", e);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void writeExcel(OptionForm form, HttpServletResponse response) {
|
||||||
|
// String fileName = form.getTemplateName() +
|
||||||
|
// (form.getTemplateEmpty() ? "空模板_" : "参数模板_") +
|
||||||
|
// LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss"));
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// setupResponse(response, fileName);
|
||||||
|
//
|
||||||
|
// if (form.getTemplateName() == null || form.getTemplateName().trim().isEmpty()) {
|
||||||
|
// throw new RuntimeException("未指定模板名称");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// String templateName = form.getTemplateName().trim();
|
||||||
|
// List<Template> templates = sw.buildFromDatasource("template_db2")
|
||||||
|
// .eq("template_name", templateName)
|
||||||
|
// .doQuery(Template.class);
|
||||||
|
// if (templates.size() != 1) {
|
||||||
|
// throw new RuntimeException("查找模板异常");
|
||||||
|
// }
|
||||||
|
// Template template = templates.get(0);
|
||||||
|
//
|
||||||
|
// Set<String> fieldList = getIncludeColumnFieldNames(form);
|
||||||
|
// List<Parameter> list;
|
||||||
|
// if (form.getTemplateEmpty()) {
|
||||||
|
// list = new ArrayList<>();
|
||||||
|
// list.add(new Parameter());
|
||||||
|
// } else {
|
||||||
|
// list = sw.buildFromDatasource("template_db2")
|
||||||
|
// .viewQueryMode(true)
|
||||||
|
// .view("selectParametersByTemplateId")
|
||||||
|
// .setVar("templateId", template.getId())
|
||||||
|
// .like("parts_name", form.getPartsName())
|
||||||
|
// .like("parameter_type", form.getParameterType())
|
||||||
|
// .like("parameter_name", form.getParameterName())
|
||||||
|
// .doQuery(Parameter.class);
|
||||||
|
// }
|
||||||
|
// EasyExcel.write(response.getOutputStream(), Parameter.class)
|
||||||
|
// .includeColumnFieldNames(fieldList)
|
||||||
|
// .sheet(form.getTemplateName())
|
||||||
|
// .doWrite(list);
|
||||||
|
//
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// throw new RuntimeException("导出Excel失败: " + e.getMessage(), e);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// private static Set<String> getIncludeColumnFieldNames(OptionForm form) {
|
||||||
|
// Set<String> includeColumnFieldNames;
|
||||||
|
// if ("公式运算需求汇总".equals(form.getTemplateName())) {
|
||||||
|
// includeColumnFieldNames = new HashSet<>();
|
||||||
|
// includeColumnFieldNames.add("number");
|
||||||
|
// includeColumnFieldNames.add("parameterTemplateName");
|
||||||
|
// includeColumnFieldNames.add("subsystemName");
|
||||||
|
// includeColumnFieldNames.add("parameterType");
|
||||||
|
// includeColumnFieldNames.add("parameterName");
|
||||||
|
// includeColumnFieldNames.add("unit");
|
||||||
|
// includeColumnFieldNames.add("dataSource");
|
||||||
|
// includeColumnFieldNames.add("calculationFormula");
|
||||||
|
// includeColumnFieldNames.add("classificationNumber");
|
||||||
|
// includeColumnFieldNames.add("isAnnouncementParameters");
|
||||||
|
// includeColumnFieldNames.add("remarks");
|
||||||
|
// } else {
|
||||||
|
// includeColumnFieldNames = new HashSet<>();
|
||||||
|
// includeColumnFieldNames.add("number");
|
||||||
|
// includeColumnFieldNames.add("subsystemName");
|
||||||
|
// includeColumnFieldNames.add("type");
|
||||||
|
// includeColumnFieldNames.add("partsName");
|
||||||
|
// includeColumnFieldNames.add("parameterName");
|
||||||
|
// includeColumnFieldNames.add("unit");
|
||||||
|
// includeColumnFieldNames.add("parameterSource");
|
||||||
|
// includeColumnFieldNames.add("numberOrFormula");
|
||||||
|
// includeColumnFieldNames.add("department");
|
||||||
|
// includeColumnFieldNames.add("remarks");
|
||||||
|
// }
|
||||||
|
// return includeColumnFieldNames;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Transactional
|
||||||
|
// @Override
|
||||||
|
// public void insertParameter(TemplateForm form) {
|
||||||
|
// List<Template> templates = sw.buildFromDatasource("template_db2")
|
||||||
|
// .eq("template_name", form.getTemplateName())
|
||||||
|
// .doQuery(Template.class);
|
||||||
|
// if (templates.size() != 1) {
|
||||||
|
// throw new RuntimeException("查找模板错误");
|
||||||
|
// }
|
||||||
|
// Template template = templates.get(0);
|
||||||
|
// Parameter parameter = new Parameter();
|
||||||
|
// parameter.setSubsystemName(form.getSubsystemName() == null ? null:form.getSubsystemName());
|
||||||
|
// parameter.setType(form.getType() == null ? null:form.getType());
|
||||||
|
// parameter.setPartsName(form.getPartsName() == null ? null:form.getPartsName());
|
||||||
|
// parameter.setParameterName(form.getParameterName() == null ? null:form.getParameterName());
|
||||||
|
// parameter.setUnit(form.getUnit() == null ? null:form.getUnit());
|
||||||
|
// parameter.setParameterSource(form.getParameterSource() == null ? null:form.getParameterSource());
|
||||||
|
// parameter.setNumberOrFormula(form.getNumberOrFormula() == null ? null:form.getNumberOrFormula());
|
||||||
|
// parameter.setDepartment(form.getDepartment() == null ? null:form.getDepartment());
|
||||||
|
// parameter.setRemarks(form.getRemarks() == null ? null:form.getRemarks());
|
||||||
|
// parameter.setParameterTemplateName(form.getParameterTemplateName() == null ? null:form.getParameterTemplateName());
|
||||||
|
// parameter.setParameterType(form.getParameterType() == null ? null:form.getParameterType());
|
||||||
|
// parameter.setDataSource(form.getDataSource() == null ? null:form.getDataSource());
|
||||||
|
// parameter.setCalculationFormula(form.getCalculationFormula() == null ? null:form.getCalculationFormula());
|
||||||
|
// parameter.setClassificationNumber(form.getClassificationNumber() == null ? null:form.getClassificationNumber());
|
||||||
|
// parameter.setIsAnnouncementParameters(form.getIsAnnouncementParameters() == null ? null:form.getIsAnnouncementParameters());
|
||||||
|
// sw.buildFromDatasource("template_db2")
|
||||||
|
// .doInsert(parameter);
|
||||||
|
// TemplateAndParameter templateAndParameter = new TemplateAndParameter();
|
||||||
|
// templateAndParameter.setParameterId(parameter.getId());
|
||||||
|
// templateAndParameter.setTemplateId(template.getId());
|
||||||
|
// sw.buildFromDatasource("template_db2")
|
||||||
|
// .doInsert(templateAndParameter);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public List<Parameter> getParameterByCondition(OptionForm form) {
|
||||||
|
// List<Template> templates = sw.buildFromDatasource("template_db2")
|
||||||
|
// .eq("template_name", form.getTemplateName())
|
||||||
|
// .doQuery(Template.class);
|
||||||
|
// if (templates.size() != 1) {
|
||||||
|
// throw new RuntimeException("查找模板错误");
|
||||||
|
// }
|
||||||
|
// Template template = templates.get(0);
|
||||||
|
//
|
||||||
|
// return sw.buildFromDatasource("template_db2")
|
||||||
|
// .viewQueryMode(true)
|
||||||
|
// .view("selectParametersByTemplateId")
|
||||||
|
// .setVar("templateId", template.getId())
|
||||||
|
// .like("parts_name", form.getPartsName())
|
||||||
|
// .like("parameter_type", form.getParameterType())
|
||||||
|
// .like("parameter_name", form.getParameterName())
|
||||||
|
// .doQuery(Parameter.class);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public List<Template> getTemplateByCondition(String templateName) {
|
||||||
|
// return sw.buildFromDatasource("template_db2")
|
||||||
|
// .like("template_name", templateName)
|
||||||
|
// .doQuery(Template.class);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void setupResponse(HttpServletResponse response, String fileName) throws IOException {
|
||||||
|
// String encodedFileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20");
|
||||||
|
//
|
||||||
|
// response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
// response.setCharacterEncoding("UTF-8");
|
||||||
|
// response.setHeader("Content-Disposition", "attachment;filename*=utf-8''" + encodedFileName + ".xlsx");
|
||||||
|
//
|
||||||
|
// // 禁用缓存
|
||||||
|
// response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
|
||||||
|
// response.setHeader("Pragma", "no-cache");
|
||||||
|
// response.setDateHeader("Expires", 0);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,607 @@
|
|||||||
|
package com.xdap.self_development.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.alibaba.excel.EasyExcel;
|
||||||
|
import com.alibaba.excel.ExcelWriter;
|
||||||
|
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||||
|
import com.definesys.mpaas.query.MpaasQueryFactory;
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
import com.xdap.self_development.controller.request.EngineParamDetailExcel;
|
||||||
|
import com.xdap.self_development.controller.request.EngineParamDetailRequest;
|
||||||
|
import com.xdap.self_development.enums.CurrentNodeEnum;
|
||||||
|
import com.xdap.self_development.enums.DistributeStatusEnum;
|
||||||
|
import com.xdap.self_development.enums.ParamOperation;
|
||||||
|
import com.xdap.self_development.enums.ParamValueVersionEnum;
|
||||||
|
import com.xdap.self_development.exception.ExcelImportException;
|
||||||
|
import com.xdap.self_development.listener.EngineParamDetailListener;
|
||||||
|
import com.xdap.self_development.pojo.*;
|
||||||
|
import com.xdap.self_development.pojo.dto.EngineParamDetailDTO;
|
||||||
|
import com.xdap.self_development.service.*;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 参数详情 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-13
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class EngineParamDetailServiceImpl implements EngineParamDetailService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MpaasQueryFactory sw;
|
||||||
|
@Autowired
|
||||||
|
private DataEntryEngineModelService dataEntryEngineModelService;
|
||||||
|
@Autowired
|
||||||
|
private DataEntryService dataEntryService;
|
||||||
|
@Autowired
|
||||||
|
private XdapDeptUsersService xdapDeptUsersService;
|
||||||
|
@Autowired
|
||||||
|
private ResponsiblePerService responsiblePerService;
|
||||||
|
|
||||||
|
private Integer versionNumber = 0;
|
||||||
|
private String createdBy = "Excel导入";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回参数列表
|
||||||
|
*
|
||||||
|
* @param modelProName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String, List<String>> selectParamList(String modelProName) {
|
||||||
|
List<Parameter> parameters = selectAllByNewVersion();
|
||||||
|
Map<String, List<String>> collect = parameters.stream()
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
Parameter::getSubsystemName,
|
||||||
|
Collectors.mapping(
|
||||||
|
Parameter::getParameterType, // 提取 id 字段
|
||||||
|
Collectors.toList()
|
||||||
|
)
|
||||||
|
));
|
||||||
|
return collect;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Excel导入
|
||||||
|
*
|
||||||
|
* @param file
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void excelImport(MultipartFile file, String modelId) {
|
||||||
|
|
||||||
|
DataEntryEngineModelPojo modelPojo =
|
||||||
|
dataEntryEngineModelService.selectBymodelId(modelId);
|
||||||
|
if (ObjectUtils.isEmpty(modelPojo)) {
|
||||||
|
throw new ExcelImportException("发动机型号不存在");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
EasyExcel.read(file.getInputStream(), EngineParamDetailExcel.class,
|
||||||
|
new EngineParamDetailListener(sw, modelPojo, dataEntryEngineModelService, responsiblePerService, dataEntryService))
|
||||||
|
.build()
|
||||||
|
.readAll();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("导入失败IO异常");
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
throw new ExcelImportException(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void excelExport(HttpServletResponse response) {
|
||||||
|
try {
|
||||||
|
setupResponse(response, "参数值导入模板" + (new Date()));
|
||||||
|
} catch (IOException e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
// 定义Sheet名称集合
|
||||||
|
// List<Parameter> parameterByCondition = dataEntryService.getParameterByCondition(new OptionForm());
|
||||||
|
List<Parameter> parameterByCondition = selectAllByNewVersion();
|
||||||
|
if (ObjectUtils.isEmpty(parameterByCondition)) {
|
||||||
|
log.error("模板参数为空");
|
||||||
|
throw new ExcelImportException(
|
||||||
|
String.format("模板参数未配置")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
List<String> sheetNames =
|
||||||
|
parameterByCondition.stream().map(Parameter::getSubsystemName).distinct().collect(Collectors.toList());
|
||||||
|
List<Parameter> parameters = selectAllByNewVersion();
|
||||||
|
try (ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).build()) {
|
||||||
|
// 循环创建Sheet
|
||||||
|
for (int i = 0; i < sheetNames.size(); i++) {
|
||||||
|
String sheetName = sheetNames.get(i);
|
||||||
|
List<Parameter> parameterList = parameters.stream().filter(x -> x.getSubsystemName().equals(sheetName)).collect(Collectors.toList());
|
||||||
|
List<EngineParamDetailExcel> engineParamDetailExcels = new ArrayList<>();
|
||||||
|
for (Parameter parameter : parameterList) {
|
||||||
|
EngineParamDetailExcel engineParamDetailExcel = new EngineParamDetailExcel();
|
||||||
|
BeanUtils.copyProperties(parameter, engineParamDetailExcel);
|
||||||
|
engineParamDetailExcel.setId(parameter.getId());
|
||||||
|
engineParamDetailExcels.add(engineParamDetailExcel);
|
||||||
|
}
|
||||||
|
WriteSheet sheet = EasyExcel.writerSheet(i, sheetNames.get(i))
|
||||||
|
.head(EngineParamDetailExcel.class) // 所有Sheet使用相同的表头
|
||||||
|
.build();
|
||||||
|
excelWriter.write(engineParamDetailExcels, sheet); // 写入数据,只生成表头
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EngineParamDetailDTO> selectValueByParam(EngineParamDetailRequest engineParamDetailRequest) {
|
||||||
|
String engineModelID = engineParamDetailRequest.getEngineModelID();
|
||||||
|
String subsystemName = engineParamDetailRequest.getSubsystemName();
|
||||||
|
String parameterType = engineParamDetailRequest.getParameterType();
|
||||||
|
if (ObjectUtils.isEmpty(engineModelID) || ObjectUtils.isEmpty(subsystemName) || ObjectUtils.isEmpty(parameterType)) {
|
||||||
|
throw new RuntimeException("传入参数为空,请检查");
|
||||||
|
}
|
||||||
|
List<EngineParamDetailPojo> detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("engine_model_id", engineModelID)
|
||||||
|
.eq("subsystem_name", subsystemName)
|
||||||
|
.eq("parameter_type", parameterType)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
ArrayList<EngineParamDetailDTO> engineParamDetailDTOS = new ArrayList<>();
|
||||||
|
for (EngineParamDetailPojo detailPojo : detailPojos) {
|
||||||
|
EngineParamDetailDTO engineParamDetailDTO = new EngineParamDetailDTO();
|
||||||
|
BeanUtils.copyProperties(detailPojo, engineParamDetailDTO);
|
||||||
|
engineParamDetailDTOS.add(engineParamDetailDTO);
|
||||||
|
}
|
||||||
|
return engineParamDetailDTOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, List<EngineParamDetailDTO>> selectValueByMoreParam(EngineParamDetailRequest engineParamDetailRequest) {
|
||||||
|
|
||||||
|
String engineModelID = engineParamDetailRequest.getEngineModelID();
|
||||||
|
List<String> subsystemNames = engineParamDetailRequest.getSubsystemNames();
|
||||||
|
List<String> parameterTypes = engineParamDetailRequest.getParameterTypes();
|
||||||
|
|
||||||
|
if (ObjectUtils.isEmpty(engineModelID) || ObjectUtils.isEmpty(subsystemNames) || ObjectUtils.isEmpty(parameterTypes)) {
|
||||||
|
throw new RuntimeException("传入参数为空,请检查");
|
||||||
|
}
|
||||||
|
List<EngineParamDetailPojo> detailPojos = new ArrayList<>();
|
||||||
|
ArrayList<EngineParamDetailDTO> engineParamDetailDTOS = new ArrayList<>();
|
||||||
|
|
||||||
|
String filledById = engineParamDetailRequest.getFilledById();
|
||||||
|
String resId = engineParamDetailRequest.getResponsiblePersonId();
|
||||||
|
|
||||||
|
//若查看草稿版本需要把版本加上
|
||||||
|
String versionStatus = engineParamDetailRequest.getVersionStatus();
|
||||||
|
Integer code = null;
|
||||||
|
if (ObjectUtils.isNotEmpty(versionStatus)) {
|
||||||
|
code = ParamValueVersionEnum.getByDesc(versionStatus).getCode();
|
||||||
|
}
|
||||||
|
//若传入填写人则查询填写人需要填写的参数
|
||||||
|
if (ObjectUtils.isNotEmpty(filledById)) {
|
||||||
|
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("filled_by", filledById)
|
||||||
|
.eq("engine_model_id", engineModelID)
|
||||||
|
.eq("version_status", code)
|
||||||
|
.in("subsystem_name", subsystemNames)
|
||||||
|
.in("parameter_type", parameterTypes)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
|
||||||
|
if (ObjectUtils.isNotEmpty(engineParamDetailRequest.getMajorVersion()) && engineParamDetailRequest.getMajorVersion() != 0) {
|
||||||
|
detailPojos = detailPojos.stream()
|
||||||
|
.filter(x -> engineParamDetailRequest.getMajorVersion()
|
||||||
|
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
EngineParamDetailPojo engineParamDetailPojo = detailPojos.stream().max(Comparator.comparingInt(x -> x.getMajorVersion())).get();
|
||||||
|
detailPojos = detailPojos.stream()
|
||||||
|
.filter(x -> engineParamDetailPojo.getMajorVersion()
|
||||||
|
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (ObjectUtils.isNotEmpty(resId)) {
|
||||||
|
//若传入责任人则查询责任人需要分发的参数
|
||||||
|
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("engine_model_id", engineModelID)
|
||||||
|
.eq("responsible_person_id", resId)
|
||||||
|
.eq("version_status", code)
|
||||||
|
.in("subsystem_name", subsystemNames)
|
||||||
|
.in("parameter_type", parameterTypes)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
//若传入版本则查询该版本否则查询最新版本
|
||||||
|
if (ObjectUtils.isNotEmpty(engineParamDetailRequest.getMajorVersion()) && engineParamDetailRequest.getMajorVersion() != 0) {
|
||||||
|
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("engine_model_id", engineModelID)
|
||||||
|
.eq("major_version", engineParamDetailRequest.getMajorVersion())
|
||||||
|
.in("subsystem_name", subsystemNames)
|
||||||
|
.in("parameter_type", parameterTypes)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
detailPojos = detailPojos.stream()
|
||||||
|
.filter(x -> engineParamDetailRequest.getMajorVersion()
|
||||||
|
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("engine_model_id", engineModelID)
|
||||||
|
.in("subsystem_name", subsystemNames)
|
||||||
|
.in("parameter_type", parameterTypes)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
EngineParamDetailPojo engineParamDetailPojo = detailPojos.stream().max(Comparator.comparingInt(x -> x.getMajorVersion())).get();
|
||||||
|
detailPojos = detailPojos.stream()
|
||||||
|
.filter(x -> engineParamDetailPojo.getMajorVersion()
|
||||||
|
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
//否则就查询这个机型下所有最新版本参数
|
||||||
|
detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("engine_model_id", engineModelID)
|
||||||
|
.eq("version_status", code)
|
||||||
|
.in("subsystem_name", subsystemNames)
|
||||||
|
.in("parameter_type", parameterTypes)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
//若传入版本则查询该版本否则查询最新版本
|
||||||
|
if (ObjectUtils.isNotEmpty(engineParamDetailRequest.getMajorVersion()) && engineParamDetailRequest.getMajorVersion() != 0) {
|
||||||
|
detailPojos = detailPojos.stream()
|
||||||
|
.filter(x -> engineParamDetailRequest.getMajorVersion()
|
||||||
|
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||||
|
} else {
|
||||||
|
EngineParamDetailPojo engineParamDetailPojo = detailPojos.stream().max(Comparator.comparingInt(x -> x.getMajorVersion())).get();
|
||||||
|
detailPojos = detailPojos.stream()
|
||||||
|
.filter(x -> engineParamDetailPojo.getMajorVersion()
|
||||||
|
.equals(x.getMajorVersion())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//pojo转换dto填写人Id转换为名称
|
||||||
|
log.info("找到数据{}条", detailPojos.size());
|
||||||
|
for (EngineParamDetailPojo detailPojo : detailPojos) {
|
||||||
|
String filledBy = null;
|
||||||
|
if (ObjectUtils.isNotEmpty(detailPojo.getFilledBy())) {
|
||||||
|
XdapUsers XdapUsers =
|
||||||
|
xdapDeptUsersService.selectUserByID(detailPojo.getFilledBy());
|
||||||
|
filledBy = ObjectUtils.isEmpty(XdapUsers) ? "" : XdapUsers.getUsername();
|
||||||
|
}
|
||||||
|
EngineParamDetailDTO engineParamDetailDTO = new EngineParamDetailDTO();
|
||||||
|
BeanUtils.copyProperties(detailPojo, engineParamDetailDTO);
|
||||||
|
String unit = "";
|
||||||
|
if (ObjectUtils.isNotEmpty(detailPojo.getParameterId())) {
|
||||||
|
List<Parameter> parameters = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("id", detailPojo.getParameterId())
|
||||||
|
.doQuery(Parameter.class);
|
||||||
|
unit = parameters.get(0).getUnit();
|
||||||
|
}
|
||||||
|
engineParamDetailDTO.setId(detailPojo.getId());
|
||||||
|
engineParamDetailDTO.setResPersonId(detailPojo.getResponsiblePersonId());
|
||||||
|
engineParamDetailDTO.setUnit(unit);
|
||||||
|
engineParamDetailDTO.setFilledBy(filledBy);
|
||||||
|
engineParamDetailDTO.setApprovalId(detailPojo.getApprovalId());
|
||||||
|
engineParamDetailDTOS.add(engineParamDetailDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, List<EngineParamDetailDTO>> valueBySubSysName =
|
||||||
|
engineParamDetailDTOS.stream().collect(Collectors.groupingBy(EngineParamDetailDTO::getSubsystemName));
|
||||||
|
|
||||||
|
return valueBySubSysName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改数据
|
||||||
|
* 保存编辑 此处不开始审批
|
||||||
|
*
|
||||||
|
* @param engineParamDetailPojos
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void updateParamValue(List<EngineParamDetailPojo> engineParamDetailPojos) {
|
||||||
|
|
||||||
|
|
||||||
|
for (EngineParamDetailPojo engineParamDetailPojo : engineParamDetailPojos) {
|
||||||
|
|
||||||
|
//通过操作状态对应不同操作新增和更新都新增数据为小版本且为草稿状态
|
||||||
|
if (engineParamDetailPojo.getOperation().equals(String.valueOf(ParamOperation.UPDATE))) {
|
||||||
|
String id = engineParamDetailPojo.getId();
|
||||||
|
EngineParamDetailPojo engineParamDetailPojoById = selectById(id);
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("minor_version", engineParamDetailPojo.getParameterValue())
|
||||||
|
.update("version_status", ParamValueVersionEnum.DRAFT.getCode())
|
||||||
|
.update("operation", String.valueOf(ParamOperation.UPDATE))
|
||||||
|
.rowid("id", engineParamDetailPojoById.getId())
|
||||||
|
.doUpdate(EngineParamDetailPojo.class);
|
||||||
|
} else if (engineParamDetailPojo.getOperation().equals(String.valueOf(ParamOperation.DELETE))) {
|
||||||
|
String id = engineParamDetailPojo.getId();
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("is_delete", "1")
|
||||||
|
.update("version_status", ParamValueVersionEnum.DRAFT.getCode())
|
||||||
|
.update("operation", String.valueOf(ParamOperation.DELETE))
|
||||||
|
.rowid("id", id)
|
||||||
|
.doUpdate(EngineParamDetailPojo.class);
|
||||||
|
|
||||||
|
} else if (engineParamDetailPojo.getOperation().equals(String.valueOf(ParamOperation.INSERT))) {
|
||||||
|
//应该不会有新增参数 要不然还要给参数绑定部门,责任人,填写人
|
||||||
|
// EngineParamDetailPojo ei = new EngineParamDetailPojo();
|
||||||
|
//
|
||||||
|
// BeanUtils.copyProperties(engineParamDetailPojo, ei,"id","majorVersion");
|
||||||
|
// ei.setMinorVersion(engineParamDetailPojo.getParameterValue());
|
||||||
|
// ei.setOperation(String.valueOf(ParamOperation.INSERT));
|
||||||
|
// ei.setApprovalId(stringUuid);
|
||||||
|
// ei.setCreatedDate(createdDate);
|
||||||
|
//
|
||||||
|
// insertDetails.add(ei);
|
||||||
|
|
||||||
|
}
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//// -----------------------------------------------------
|
||||||
|
// List<EngineParamDetailPojo> detailPojos =
|
||||||
|
// sw.buildFromDatasource("test_demo")
|
||||||
|
// .eq("parameter_id", engineParamDetailPojo.getParameterId())
|
||||||
|
// .eq("engine_model_id", engineParamDetailPojo.getEngineModelId())
|
||||||
|
// .doQuery(EngineParamDetailPojo.class);
|
||||||
|
// if (ObjectUtils.isEmpty(detailPojos)) {
|
||||||
|
// log.error("查不到数据ID为:{}", engineParamDetailPojo.getId());
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
// //找到最大版本
|
||||||
|
// EngineParamDetailPojo engineParamDetailPojoMaxVersion = detailPojos.stream()
|
||||||
|
// .sorted(Comparator.comparing(EngineParamDetailPojo::getMajorVersion)
|
||||||
|
// .reversed()).collect(Collectors.toList()).get(0);
|
||||||
|
//
|
||||||
|
// //草稿或最新数据 todo先修改小版本参数审批后大版本加一
|
||||||
|
// if (ObjectUtils.isEmpty(engineParamDetailPojo.getId())) {
|
||||||
|
// throw new RuntimeException("数据ID为空,联系管理员检查是否传入ID,");
|
||||||
|
// }
|
||||||
|
// if (engineParamDetailPojo.getVersionStatus().equals(ParamValueVersionEnum.DRAFT.getCode())) {
|
||||||
|
// sw.buildFromDatasource("test_demo")
|
||||||
|
//// .update("parameter_value", engineParamDetailPojo.getParameterValue())
|
||||||
|
// .update("minor_version", engineParamDetailPojo.getParameterValue())
|
||||||
|
// .rowid("id", engineParamDetailPojo.getId())
|
||||||
|
// .doUpdate(EngineParamDetailPojo.class);
|
||||||
|
// } else if (engineParamDetailPojoMaxVersion.getMajorVersion().equals(engineParamDetailPojo.getMajorVersion())) {
|
||||||
|
// sw.buildFromDatasource("test_demo")
|
||||||
|
//// .update("parameter_value", engineParamDetailPojo.getParameterValue())
|
||||||
|
// .update("minor_version", engineParamDetailPojo.getParameterValue())
|
||||||
|
// .rowid("id", engineParamDetailPojo.getId())
|
||||||
|
// .doUpdate(EngineParamDetailPojo.class);
|
||||||
|
// } else {
|
||||||
|
// throw new RuntimeException("有数据并非草稿或最新版本或超出最新版本,请检查后更新");
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//分解任务
|
||||||
|
@Override
|
||||||
|
public void updateToInsertFiledBy(List<EngineParamDetailPojo> engineParamDetailPojos, String userID) {
|
||||||
|
if (ObjectUtils.isEmpty(engineParamDetailPojos)) {
|
||||||
|
log.info("分解时没有传入数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String engineModelId = engineParamDetailPojos.get(0).getEngineModelId();
|
||||||
|
DataEntryEngineModelPojo modelPojo = dataEntryEngineModelService.selectBymodelId(engineModelId);
|
||||||
|
|
||||||
|
XdapUsers XdapUsers = xdapDeptUsersService.selectUserByID(userID);
|
||||||
|
|
||||||
|
|
||||||
|
ArrayList<TodoTaskPojo> todoTaskPojos = new ArrayList<>();
|
||||||
|
|
||||||
|
//分解任务更新填写人
|
||||||
|
for (EngineParamDetailPojo engineParamDetailPojo : engineParamDetailPojos) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("filled_by", engineParamDetailPojo.getFilledBy())
|
||||||
|
.rowid("id", engineParamDetailPojo.getId())
|
||||||
|
.doUpdate(engineParamDetailPojo);
|
||||||
|
}
|
||||||
|
//为每个填写人分配任务
|
||||||
|
Set<String> filledBys = engineParamDetailPojos.stream().map(x -> x.getFilledBy()).collect(Collectors.toSet());
|
||||||
|
for (String filledBy : filledBys) {
|
||||||
|
TodoTaskPojo todoTaskPojo = new TodoTaskPojo();
|
||||||
|
todoTaskPojo.setCreatedById(userID);
|
||||||
|
todoTaskPojo.setDocumentNo(UUID.randomUUID().toString());
|
||||||
|
todoTaskPojo.setProcessTitle("填写发动机参数值");
|
||||||
|
todoTaskPojo.setCurrentNode(CurrentNodeEnum.REPAIR.getDesc());
|
||||||
|
todoTaskPojo.setStatusCode(null);
|
||||||
|
todoTaskPojo.setModelName(modelPojo.getModelName());
|
||||||
|
todoTaskPojo.setModelId(modelPojo.getId());
|
||||||
|
todoTaskPojo.setCreationDate(new Date());
|
||||||
|
todoTaskPojo.setDataType("玉柴");
|
||||||
|
todoTaskPojo.setVersionNumber(modelPojo.getVersionNumber());
|
||||||
|
todoTaskPojo.setOwnerId(filledBy);
|
||||||
|
todoTaskPojo.setIsDelete(0);
|
||||||
|
todoTaskPojo.setCreatedBy(ObjectUtils.isNotEmpty(XdapUsers) ? XdapUsers.getUsername() : "");
|
||||||
|
todoTaskPojos.add(todoTaskPojo);
|
||||||
|
}
|
||||||
|
batchInsertTodoTask(todoTaskPojos);
|
||||||
|
//每次分发填写人时进行检测
|
||||||
|
//这个责任人相关的填写人是否都已经填写完成如果没有则待办不动 如果填写完了待办完成
|
||||||
|
List<EngineParamDetailPojo> detailPojos = selectByResId(userID);
|
||||||
|
List<EngineParamDetailPojo> paramDetailPojos = detailPojos.stream()
|
||||||
|
.filter(x -> x.getEngineModelId().equals(engineModelId) && ObjectUtils.isEmpty(x.getFilledBy())).collect(Collectors.toList());
|
||||||
|
if (ObjectUtils.isNotEmpty(paramDetailPojos)) {
|
||||||
|
//软删除这个代办人的任务
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("owner_id", userID)
|
||||||
|
.eq("model_id", engineModelId)
|
||||||
|
.update("is_delete", 1)
|
||||||
|
.doUpdate(TodoTaskPojo.class);
|
||||||
|
//机型的分发状态改为已分发
|
||||||
|
DistributeStatusEnum byDesc = DistributeStatusEnum.getByDesc("已分发");
|
||||||
|
Integer status = byDesc != null ? byDesc.getCode() : null;
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("id", engineModelId)
|
||||||
|
.update("status", status)
|
||||||
|
.doUpdate(DataEntryEngineModelPojo.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class) // 发生任何异常都回滚
|
||||||
|
public void batchInsertTodoTask(List<TodoTaskPojo> todoTaskPojos) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(todoTaskPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Parameter> selectAllByNewVersion() {
|
||||||
|
//读取已通过审核的版本 DRAFT(草稿)、APPROVING(审批中)、COMPLETE(已完成)、RETURNED(已撤回)、REJECTED(已拒绝)
|
||||||
|
List<Template> templates =
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("status", "COMPLETE")
|
||||||
|
.doQuery(Template.class);
|
||||||
|
if (ObjectUtils.isEmpty(templates)) {
|
||||||
|
throw new RuntimeException("未找到未找到已发布的参数模板");
|
||||||
|
}
|
||||||
|
//查找每个模板最新版本
|
||||||
|
Map<String, Template> latestTemplateMap = templates.stream()
|
||||||
|
// 按模板ID分组
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
|
Template::getTemplateName,
|
||||||
|
// 每组内按版本号降序,取第一个(最新版本)
|
||||||
|
Collectors.collectingAndThen(
|
||||||
|
Collectors.maxBy(Comparator.comparingInt(Template::getVersion)),
|
||||||
|
Optional::get
|
||||||
|
)
|
||||||
|
));
|
||||||
|
ArrayList<Template> templatesMax = new ArrayList<>(latestTemplateMap.values());
|
||||||
|
List<String> strings = templatesMax.stream().map(x -> x.getId()).collect(Collectors.toList());
|
||||||
|
//查找最新模板关联的参数
|
||||||
|
List<TemplateAndParameter> templateAndParameters =
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.in("template_id", strings)
|
||||||
|
.doQuery(TemplateAndParameter.class);
|
||||||
|
List<String> pIds = templateAndParameters.stream().map(x -> x.getParameterId()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<Parameter> parameterList = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.in("id", pIds)
|
||||||
|
.doQuery(Parameter.class);
|
||||||
|
|
||||||
|
return parameterList;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EngineParamDetailPojo> selectByModelNewVersion(String modelId) {
|
||||||
|
|
||||||
|
if (ObjectUtils.isEmpty(modelId)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<EngineParamDetailPojo> engineParamDetailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("engine_model_id", modelId)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
|
||||||
|
EngineParamDetailPojo engineParamDetailPojoMaxVersion = engineParamDetailPojos.stream()
|
||||||
|
.sorted(Comparator.comparing(EngineParamDetailPojo::getMajorVersion)
|
||||||
|
.reversed()).collect(Collectors.toList()).get(0);
|
||||||
|
|
||||||
|
List<EngineParamDetailPojo> paramDetailPojos = engineParamDetailPojos.stream().filter(
|
||||||
|
x -> x.getMajorVersion() == engineParamDetailPojoMaxVersion.getMajorVersion()
|
||||||
|
).collect(Collectors.toList());
|
||||||
|
return paramDetailPojos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EngineParamDetailPojo> selectByResId(String resId) {
|
||||||
|
if (ObjectUtils.isEmpty(resId)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<EngineParamDetailPojo> engineParamDetailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("responsible_person_id", resId)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
if (ObjectUtils.isEmpty(engineParamDetailPojos)) {
|
||||||
|
log.warn("该责任人无待办参数");
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
EngineParamDetailPojo engineParamDetailPojoMaxVersion = engineParamDetailPojos.stream()
|
||||||
|
.sorted(Comparator.comparing(EngineParamDetailPojo::getMajorVersion)
|
||||||
|
.reversed()).collect(Collectors.toList()).get(0);
|
||||||
|
|
||||||
|
List<EngineParamDetailPojo> paramDetailPojos = engineParamDetailPojos.stream().filter(
|
||||||
|
x -> x.getMajorVersion() == engineParamDetailPojoMaxVersion.getMajorVersion()
|
||||||
|
).collect(Collectors.toList());
|
||||||
|
return paramDetailPojos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EngineParamDetailPojo> selectByfiledId(String filledId) {
|
||||||
|
if (ObjectUtils.isEmpty(filledId)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
List<EngineParamDetailPojo> engineParamDetailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("filled_by", filledId)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
|
||||||
|
EngineParamDetailPojo engineParamDetailPojoMaxVersion = engineParamDetailPojos.stream()
|
||||||
|
.sorted(Comparator.comparing(EngineParamDetailPojo::getMajorVersion)
|
||||||
|
.reversed()).collect(Collectors.toList()).get(0);
|
||||||
|
|
||||||
|
List<EngineParamDetailPojo> paramDetailPojos = engineParamDetailPojos.stream().filter(
|
||||||
|
x -> x.getMajorVersion() == engineParamDetailPojoMaxVersion.getMajorVersion()
|
||||||
|
).collect(Collectors.toList());
|
||||||
|
return paramDetailPojos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<EngineParamDetailPojo> selectByapprovalId(String approvalId) {
|
||||||
|
if (ObjectUtils.isNotEmpty(approvalId)) {
|
||||||
|
return sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("approval_id", approvalId)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
}
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EngineParamDetailPojo selectById(String id) {
|
||||||
|
List<EngineParamDetailPojo> engineParamDetailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("id", id)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
if (ObjectUtils.isNotEmpty(engineParamDetailPojos)) {
|
||||||
|
return engineParamDetailPojos.get(0);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Integer> selectVersionList(String modelId) {
|
||||||
|
if (ObjectUtils.isNotEmpty(modelId)) {
|
||||||
|
List<EngineParamDetailPojo> detailPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("engine_model_id", modelId)
|
||||||
|
.doQuery(EngineParamDetailPojo.class);
|
||||||
|
List<Integer> versionNumList = detailPojos.stream().map(x -> x.getMajorVersion())
|
||||||
|
.distinct().collect(Collectors.toList());
|
||||||
|
return versionNumList;
|
||||||
|
}
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<XdapUsers> selectPersonoByType(String subSystem, String dept, Integer type) {
|
||||||
|
List<XdapUsers> xdapUsersPojos = new ArrayList<>();
|
||||||
|
List<ResponsiblePerson> personPojos = responsiblePerService.selectBysubSystemDept(subSystem, dept);
|
||||||
|
if (ObjectUtils.isEmpty(personPojos)) {
|
||||||
|
throw new RuntimeException("该子系统和部门没有查找到相关人子系统:"+subSystem+",部门:"+dept);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
List<ResponsiblePerson> collected = personPojos.stream().filter(x -> x.getPersonLevel() == type).collect(Collectors.toList());
|
||||||
|
List<String> userIds = collected.stream().map(x -> x.getUserId()).collect(Collectors.toList());
|
||||||
|
for (String id : new ArrayList<>(userIds)) {
|
||||||
|
xdapUsersPojos.add(xdapDeptUsersService.selectUserByID(id));
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("根据TYPE查询异常");
|
||||||
|
}
|
||||||
|
|
||||||
|
return xdapUsersPojos;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupResponse(HttpServletResponse response, String fileName) throws IOException {
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
String encodedFileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20");
|
||||||
|
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + encodedFileName + ".xlsx");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
package com.xdap.self_development.service.impl;
|
||||||
|
|
||||||
|
import com.definesys.mpaas.query.MpaasQueryFactory;
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
import com.xdap.self_development.pojo.EngineReviewListPojo;
|
||||||
|
import com.xdap.self_development.pojo.dto.PageResultDTO;
|
||||||
|
import com.xdap.self_development.service.EngineReviewListService;
|
||||||
|
import com.xdap.self_development.service.XdapDeptUsersService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class EngineReviewListServiceImpl implements EngineReviewListService {
|
||||||
|
@Autowired
|
||||||
|
private MpaasQueryFactory sw;
|
||||||
|
@Autowired
|
||||||
|
private XdapDeptUsersService xdapDeptUsersService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResultDTO<EngineReviewListPojo> selectEngineReviewListByUserId(String userId, Integer page, Integer size, String ycOrOth) {
|
||||||
|
if (ObjectUtils.isEmpty(userId)) {
|
||||||
|
throw new RuntimeException("查看用户为空");
|
||||||
|
}
|
||||||
|
//todo 如果user是管理员则全部查看否则只能查看他所提交该他审批的数据
|
||||||
|
Integer totalCount = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("yc_or_oth", ycOrOth)
|
||||||
|
.conjuctionAnd()
|
||||||
|
.eq("applicant", userId)
|
||||||
|
.or()
|
||||||
|
.like("approver_persons", userId)
|
||||||
|
.doQuery(EngineReviewListPojo.class).size();
|
||||||
|
|
||||||
|
List<EngineReviewListPojo> engineReviewListPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("yc_or_oth", ycOrOth)
|
||||||
|
.conjuctionAnd()
|
||||||
|
.eq("applicant", userId)
|
||||||
|
.or()
|
||||||
|
.like("approver_persons", userId)
|
||||||
|
.doPageQuery(page, size, EngineReviewListPojo.class).getResult();
|
||||||
|
|
||||||
|
//将engineReviewListPojosID改为姓名
|
||||||
|
ArrayList<EngineReviewListPojo> engineReviewListPojos1 = new ArrayList<>();
|
||||||
|
for (EngineReviewListPojo engineReviewListPojo : engineReviewListPojos) {
|
||||||
|
EngineReviewListPojo engineReviewListPojo1 = new EngineReviewListPojo();
|
||||||
|
BeanUtils.copyProperties(engineReviewListPojo, engineReviewListPojo1);
|
||||||
|
if (StringUtils.isNotEmpty(engineReviewListPojo.getApproverPersons())) {
|
||||||
|
ArrayList<String> strings = new ArrayList<>();
|
||||||
|
for (String id : Arrays.stream(engineReviewListPojo.getApproverPersons().split(",")).collect(Collectors.toList())) {
|
||||||
|
XdapUsers xdapUsersPojo = xdapDeptUsersService.selectUserByID(id);
|
||||||
|
if (ObjectUtils.isNotEmpty(xdapUsersPojo)) {
|
||||||
|
String username = xdapUsersPojo.getUsername();
|
||||||
|
strings.add(username);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
engineReviewListPojo1.setApproverPersons(String.join(",", strings));
|
||||||
|
}
|
||||||
|
engineReviewListPojos1.add(engineReviewListPojo1);
|
||||||
|
}
|
||||||
|
|
||||||
|
PageResultDTO<EngineReviewListPojo> pageResultDTO = new PageResultDTO();
|
||||||
|
pageResultDTO.setList(engineReviewListPojos1);
|
||||||
|
pageResultDTO.setTotalCount(totalCount);
|
||||||
|
return pageResultDTO;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,141 @@
|
|||||||
|
package com.xdap.self_development.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.common.exception.MpaasRuntimeException;
|
||||||
|
import com.definesys.mpaas.query.MpaasQueryFactory;
|
||||||
|
import com.xdap.api.moudle.department.pojo.entity.XdapDepartments;
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
import com.xdap.self_development.pojo.ResponsiblePerson;
|
||||||
|
import com.xdap.self_development.service.ResponsiblePerService;
|
||||||
|
import com.xdap.self_development.service.XdapDeptUsersService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 责任人表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-13
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class ResponsiblePerServiceImpl implements ResponsiblePerService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MpaasQueryFactory sw;
|
||||||
|
@Autowired
|
||||||
|
private XdapDeptUsersService xdapDeptUsersService;
|
||||||
|
@Override
|
||||||
|
public ResponsiblePerson selectByDepAndPer(String department, String resPerson) {
|
||||||
|
if (ObjectUtils.isEmpty(department) || ObjectUtils.isEmpty(resPerson)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
XdapDepartments deptByName = xdapDeptUsersService.selectDeptByName(department);
|
||||||
|
List<XdapUsers> userByName = xdapDeptUsersService.selectUserByPersonName(resPerson);
|
||||||
|
XdapUsers XdapUsers = xdapDeptUsersService.selectUserByUserListAndDeptName(userByName, deptByName);
|
||||||
|
ResponsiblePerson ResponsiblePerson = null;
|
||||||
|
List<ResponsiblePerson> personPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("department_id", deptByName.getId())
|
||||||
|
.eq("user_id", XdapUsers.getId())
|
||||||
|
.doQuery(ResponsiblePerson.class);
|
||||||
|
|
||||||
|
if (personPojos != null && !personPojos.isEmpty()) {
|
||||||
|
ResponsiblePerson = personPojos.get(0);
|
||||||
|
}
|
||||||
|
return ResponsiblePerson;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponsiblePerson selectByDep(String departmentId) {
|
||||||
|
if (ObjectUtils.isEmpty(departmentId) && ObjectUtils.isEmpty(departmentId)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
ResponsiblePerson ResponsiblePerson = null;
|
||||||
|
List<ResponsiblePerson> personPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("department_id", departmentId)
|
||||||
|
.doQuery(ResponsiblePerson.class);
|
||||||
|
|
||||||
|
if (personPojos != null && !personPojos.isEmpty()) {
|
||||||
|
ResponsiblePerson = personPojos.get(0);
|
||||||
|
}
|
||||||
|
return ResponsiblePerson;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ResponsiblePerson> selectByUserId(List<XdapUsers> userIds) {
|
||||||
|
if (ObjectUtils.isEmpty(userIds)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<String> idlist = new ArrayList<>();
|
||||||
|
for (XdapUsers userId : userIds) {
|
||||||
|
idlist.add(userId.getId());
|
||||||
|
}
|
||||||
|
List<ResponsiblePerson> personPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.in("user_id", idlist)
|
||||||
|
.doQuery(ResponsiblePerson.class);
|
||||||
|
return personPojos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ResponsiblePerson> selectByDepName(String departmentName) {
|
||||||
|
XdapDepartments XdapDepartments = xdapDeptUsersService.selectDeptByName(departmentName);
|
||||||
|
if (ObjectUtils.isEmpty(XdapDepartments)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<ResponsiblePerson> personPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("department_id", XdapDepartments.getId())
|
||||||
|
.doQuery(ResponsiblePerson.class);
|
||||||
|
return personPojos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object insert(ResponsiblePerson ResponsiblePerson) {
|
||||||
|
Object testDemo = null;
|
||||||
|
try {
|
||||||
|
testDemo = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.doInsert(ResponsiblePerson);
|
||||||
|
log.info("责任人数据写入成功={}", testDemo);
|
||||||
|
} catch (MpaasRuntimeException e) {
|
||||||
|
log.warn("唯一索引冲突,跳过插入");
|
||||||
|
}
|
||||||
|
return testDemo;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ResponsiblePerson> seelctAll() {
|
||||||
|
List<ResponsiblePerson> personPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.doQuery(ResponsiblePerson.class);
|
||||||
|
return personPojos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponsiblePerson selectById(String responsiblePersonId) {
|
||||||
|
if (ObjectUtils.isEmpty(responsiblePersonId)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<ResponsiblePerson> personPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.in("id", responsiblePersonId)
|
||||||
|
.doQuery(ResponsiblePerson.class);
|
||||||
|
if (ObjectUtils.isNotEmpty(personPojos)) {
|
||||||
|
return personPojos.get(0);
|
||||||
|
}else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ResponsiblePerson> selectBysubSystemDept(String subSystem, String dept) {
|
||||||
|
List<ResponsiblePerson> personPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.like("subsystem", subSystem)
|
||||||
|
.eq("department", dept)
|
||||||
|
.doQuery(ResponsiblePerson.class);
|
||||||
|
return personPojos;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,216 @@
|
|||||||
|
package com.xdap.self_development.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.query.MpaasQueryFactory;
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
import com.xdap.self_development.controller.request.TodoReturnRequest;
|
||||||
|
import com.xdap.self_development.controller.request.TodoTaskRequest;
|
||||||
|
import com.xdap.self_development.enums.CurrentNodeEnum;
|
||||||
|
import com.xdap.self_development.pojo.*;
|
||||||
|
import com.xdap.self_development.pojo.dto.EngineParamDetailDTO;
|
||||||
|
import com.xdap.self_development.pojo.dto.PageResultDTO;
|
||||||
|
import com.xdap.self_development.service.DataEntryEngineModelService;
|
||||||
|
import com.xdap.self_development.service.EngineParamDetailService;
|
||||||
|
import com.xdap.self_development.service.TodoTaskService;
|
||||||
|
import com.xdap.self_development.service.XdapDeptUsersService;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 待办事项表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-18
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TodoTaskServiceImpl implements TodoTaskService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MpaasQueryFactory sw;
|
||||||
|
@Autowired
|
||||||
|
private EngineParamDetailService engineParamDetailService;
|
||||||
|
@Autowired
|
||||||
|
private XdapDeptUsersService xdapDeptUsersService;
|
||||||
|
@Autowired
|
||||||
|
private DataEntryEngineModelService dataEntryEngineModelService;
|
||||||
|
|
||||||
|
private Integer versionNumber = 0;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void batchInsert(List<TodoTaskPojo> taskPojos) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.doBatchInsert(taskPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TodoTaskPojo> selectByPage(TodoTaskRequest todoTaskRequest) {
|
||||||
|
List<TodoTaskPojo> todoTaskPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("created_by_id", todoTaskRequest.getCreatedById())
|
||||||
|
.doPageQuery(todoTaskRequest.getPage(), todoTaskRequest.getSize(), TodoTaskPojo.class).getResult();
|
||||||
|
return todoTaskPojos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResultDTO<TodoTaskPojo> selectByresPersonPage(TodoTaskRequest todoTaskRequest) {
|
||||||
|
// List<DataEntryEngineModelPojo> modelPojos = sw.buildFromDatasource("test_demo")
|
||||||
|
// .eq("responsible_person_id", todoTaskRequest.getResOrfileByPersonId())
|
||||||
|
// .doQuery(DataEntryEngineModelPojo.class);
|
||||||
|
// List<String> strings = modelPojos.stream().map(x -> x.getId()).collect(Collectors.toList());
|
||||||
|
// ArrayList<TodoTaskPojo> taskPojos = new ArrayList<>();
|
||||||
|
// ArrayList<String> modelIds = new ArrayList<>();
|
||||||
|
// //查询待办 会传入责任人或填写人
|
||||||
|
// String resid = "";
|
||||||
|
// String filedById= "";
|
||||||
|
// resid = todoTaskRequest.getResPersonId();
|
||||||
|
// filedById = todoTaskRequest.getFilledByPersonId();
|
||||||
|
// //如果是填写人传进来
|
||||||
|
// if (StrUtil.isBlank(resid)&&StrUtil.isNotBlank(filedById)){
|
||||||
|
// List<EngineParamDetailPojo> detailPojos = engineParamDetailService.selectByfiledId(filedById);
|
||||||
|
// for (EngineParamDetailPojo detailPojo : detailPojos) {
|
||||||
|
// modelIds.add(detailPojo.getEngineModelId());
|
||||||
|
// }
|
||||||
|
// }else if (StrUtil.isBlank(filedById) && StrUtil.isNotBlank(resid)){
|
||||||
|
// //如果是责任人传过来
|
||||||
|
// List<EngineParamDetailPojo> detailPojos = engineParamDetailService.selectByResId(resid);
|
||||||
|
// for (EngineParamDetailPojo detailPojo : detailPojos) {
|
||||||
|
// modelIds.add(detailPojo.getEngineModelId());
|
||||||
|
// }
|
||||||
|
// } else if (StrUtil.isNotBlank(filedById) && StrUtil.isNotBlank(resid)) {
|
||||||
|
// //如果既是责任人也是填写人
|
||||||
|
// List<EngineParamDetailPojo> detailPojos = engineParamDetailService.selectByfiledId(filedById);
|
||||||
|
// detailPojos.addAll(engineParamDetailService.selectByResId(resid));
|
||||||
|
// for (EngineParamDetailPojo detailPojo : detailPojos) {
|
||||||
|
// modelIds.add(detailPojo.getEngineModelId());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
PageResultDTO<TodoTaskPojo> pageResultDTO = new PageResultDTO<TodoTaskPojo>();
|
||||||
|
List<TodoTaskPojo> todoTaskPojosTotal = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("owner_id", todoTaskRequest.getPersonId())
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
.doQuery(TodoTaskPojo.class);
|
||||||
|
List<TodoTaskPojo> todoTaskPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("owner_id", todoTaskRequest.getPersonId())
|
||||||
|
.eq("is_delete", 0)
|
||||||
|
.doPageQuery(todoTaskRequest.getPage(), todoTaskRequest.getSize(), TodoTaskPojo.class).getResult();
|
||||||
|
pageResultDTO.setList(todoTaskPojos);
|
||||||
|
pageResultDTO.setTotalCount(todoTaskPojosTotal.size());
|
||||||
|
return pageResultDTO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createResPerson(List<EngineParamDetailDTO> paramDetailPojosAll, String userID) {
|
||||||
|
|
||||||
|
if (ObjectUtils.isEmpty(paramDetailPojosAll)) {
|
||||||
|
throw new RuntimeException("未传入要变更的数据数据");
|
||||||
|
}
|
||||||
|
String modelId = paramDetailPojosAll.get(0).getEngineModelId();
|
||||||
|
//为参数更新责任人
|
||||||
|
for (EngineParamDetailDTO engineParamDetailDTO : paramDetailPojosAll) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("responsible_person_id", engineParamDetailDTO.getResPersonId())
|
||||||
|
.rowid("id", engineParamDetailDTO.getId())
|
||||||
|
.doUpdate(EngineParamDetailPojo.class);
|
||||||
|
}
|
||||||
|
//生成分解任务给责任人 参数根据机型+责任人分组 生成数据
|
||||||
|
List<EngineParamDetailDTO> dtoList = paramDetailPojosAll.stream()
|
||||||
|
// 以responsiblePersonId组合作为key,元素本身作为value
|
||||||
|
.collect(Collectors.toMap(dto -> dto.getResPersonId(),
|
||||||
|
pojo -> pojo,
|
||||||
|
(existing, replacement) -> existing
|
||||||
|
))
|
||||||
|
// 提取去重后的value集合
|
||||||
|
.values()
|
||||||
|
.stream()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
ArrayList<TodoTaskPojo> todoTaskPojos = new ArrayList<>();
|
||||||
|
|
||||||
|
XdapUsers xdapUsersPojo = xdapDeptUsersService.selectUserByID(userID);
|
||||||
|
DataEntryEngineModelPojo modelPojo = dataEntryEngineModelService.selectBymodelId(modelId);
|
||||||
|
for (EngineParamDetailDTO engineParamDetailDTO : dtoList) {
|
||||||
|
//组装待办
|
||||||
|
TodoTaskPojo todoTaskPojo = new TodoTaskPojo();
|
||||||
|
todoTaskPojo.setCreatedById(userID);
|
||||||
|
todoTaskPojo.setDocumentNo(UUID.randomUUID().toString());
|
||||||
|
todoTaskPojo.setProcessTitle("管理员分发责任人");
|
||||||
|
todoTaskPojo.setCurrentNode(CurrentNodeEnum.JOBSPLIT.getDesc());
|
||||||
|
todoTaskPojo.setStatusCode(null/*String.valueOf(ParamValueVersionEnum.DRAFT.getCode())*/);
|
||||||
|
todoTaskPojo.setModelName(ObjectUtils.isNotEmpty(modelPojo) ? modelPojo.getModelName() : "");
|
||||||
|
todoTaskPojo.setModelId(modelId);
|
||||||
|
todoTaskPojo.setCreationDate(new Date());
|
||||||
|
todoTaskPojo.setDataType("玉柴");
|
||||||
|
todoTaskPojo.setVersionNumber(ObjectUtils.isNotEmpty(modelPojo) ? modelPojo.getVersionNumber() : 0);
|
||||||
|
todoTaskPojo.setIsDelete(0);
|
||||||
|
todoTaskPojo.setOwnerId(engineParamDetailDTO.getResPersonId());
|
||||||
|
todoTaskPojo.setCreatedBy(ObjectUtils.isNotEmpty(xdapUsersPojo) ? xdapUsersPojo.getUsername() : "");
|
||||||
|
todoTaskPojos.add(todoTaskPojo);
|
||||||
|
}
|
||||||
|
batchInsertTodoTask(todoTaskPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void todoReturn(TodoReturnRequest todoReturnRequest) {
|
||||||
|
String todoTaskId = todoReturnRequest.getTodoTaskId();
|
||||||
|
if (ObjectUtils.isEmpty(todoTaskId)) {
|
||||||
|
throw new RuntimeException("未传入单据");
|
||||||
|
}
|
||||||
|
|
||||||
|
List<TodoTaskPojo> todoTaskPojos = sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.eq("id", todoTaskId)
|
||||||
|
.doQuery(TodoTaskPojo.class);
|
||||||
|
if (ObjectUtils.isEmpty(todoTaskPojos)) {
|
||||||
|
throw new RuntimeException("传入的单据查不到");
|
||||||
|
}
|
||||||
|
TodoTaskPojo todoTaskPojo1 = todoTaskPojos.get(0);
|
||||||
|
//如果是填写人退回 把填写人的待办删除 则为该条责任人添加待办 并且待办创建人改为退回人
|
||||||
|
if ("填写人退回".equals(todoReturnRequest.getSteps())) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
.update("is_delete", 1)
|
||||||
|
.update("last_update_date", new Date())
|
||||||
|
.eq("id", todoTaskId).doUpdate(TodoTaskPojo.class);
|
||||||
|
|
||||||
|
XdapUsers xdapUsersPojo = xdapDeptUsersService.selectUserByID(todoReturnRequest.getUserID());
|
||||||
|
//组装待办
|
||||||
|
TodoTaskPojo todoTaskPojo = new TodoTaskPojo();
|
||||||
|
todoTaskPojo.setCreatedById(todoReturnRequest.getUserID());
|
||||||
|
todoTaskPojo.setDocumentNo(UUID.randomUUID().toString());
|
||||||
|
todoTaskPojo.setProcessTitle("填写人退回");
|
||||||
|
todoTaskPojo.setCurrentNode(CurrentNodeEnum.JOBSPLIT.getDesc());
|
||||||
|
todoTaskPojo.setStatusCode(null/*String.valueOf(ParamValueVersionEnum.DRAFT.getCode())*/);
|
||||||
|
todoTaskPojo.setModelName(todoTaskPojo1.getModelName());
|
||||||
|
todoTaskPojo.setModelId(todoTaskPojo1.getModelId());
|
||||||
|
todoTaskPojo.setCreationDate(new Date());
|
||||||
|
todoTaskPojo.setDataType("玉柴");
|
||||||
|
todoTaskPojo.setVersionNumber(todoTaskPojo1.getVersionNumber());
|
||||||
|
todoTaskPojo.setIsDelete(0);
|
||||||
|
todoTaskPojo.setOwnerId(todoTaskPojo1.getCreatedById());
|
||||||
|
todoTaskPojo.setCreatedBy(ObjectUtils.isNotEmpty(xdapUsersPojo) ? xdapUsersPojo.getUsername() : "");
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doInsert(todoTaskPojo);
|
||||||
|
} else if ("责任人退回".equals(todoReturnRequest.getSteps())) {
|
||||||
|
//如果是责任人退回 则该条数据还是属于未分发状态
|
||||||
|
//暂时先不这么做处理,责任人退回无法记录退回人,容易重复提交分发
|
||||||
|
// DistributeStatusEnum byDesc = DistributeStatusEnum.getByDesc("未分发");
|
||||||
|
// int distribute_status = byDesc != null ? byDesc.getCode() : null;
|
||||||
|
// sw.buildFromDatasource("xdap_app_223770822127386625")
|
||||||
|
// .update("distribute_status", distribute_status)
|
||||||
|
// .eq("id", todoTaskPojo1.getModelId())
|
||||||
|
// .doUpdate(DataEntryEngineModelPojo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class) // 发生任何异常都回滚
|
||||||
|
public void batchInsertTodoTask(List<TodoTaskPojo> todoTaskPojos) {
|
||||||
|
sw.buildFromDatasource("xdap_app_223770822127386625").doBatchInsert(todoTaskPojos);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,144 @@
|
|||||||
|
package com.xdap.self_development.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.definesys.mpaas.query.MpaasQueryFactory;
|
||||||
|
import com.xdap.api.moudle.department.pojo.entity.XdapDepartments;
|
||||||
|
import com.xdap.api.moudle.department.pojo.entity.XdapDeptUsers;
|
||||||
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
|
import com.xdap.runtime.service.RuntimeDatasourceService;
|
||||||
|
|
||||||
|
import com.xdap.self_development.service.XdapDeptUsersService;
|
||||||
|
import groovy.util.logging.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 部门成员关系表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Lys111
|
||||||
|
* @since 2025-11-19
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class XdapDeptUsersServiceImpl implements XdapDeptUsersService {
|
||||||
|
|
||||||
|
private static final Logger log = Logger.getLogger(XdapDeptUsersServiceImpl.class);
|
||||||
|
@Autowired
|
||||||
|
private MpaasQueryFactory sw;
|
||||||
|
@Autowired
|
||||||
|
private RuntimeDatasourceService runtimeDatasourceService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public XdapDepartments selectDeptByID(String deptId) {
|
||||||
|
if (ObjectUtils.isEmpty(deptId)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<XdapDepartments> departmentsPojos = runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
||||||
|
.eq("id", deptId)
|
||||||
|
.doQuery(XdapDepartments.class);
|
||||||
|
if (ObjectUtils.isNotEmpty(departmentsPojos)) {
|
||||||
|
return departmentsPojos.get(0);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public XdapDepartments selectDeptByName(String deptName) {
|
||||||
|
if (ObjectUtils.isEmpty(deptName)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<XdapDepartments> departmentsPojos = runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
||||||
|
.eq("name", deptName)
|
||||||
|
.doQuery(XdapDepartments.class);
|
||||||
|
if (ObjectUtils.isNotEmpty(departmentsPojos)) {
|
||||||
|
return departmentsPojos.get(0);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<XdapUsers> selectUserByName(String deptName) {
|
||||||
|
XdapDepartments xdapDepartmentsPojo = selectDeptByName(deptName);
|
||||||
|
List<XdapUsers> xdapUsersPojos = new ArrayList<>();
|
||||||
|
if (ObjectUtils.isNotEmpty(xdapDepartmentsPojo)) {
|
||||||
|
List<XdapDeptUsers> xdapDeptUsersPojos = runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
||||||
|
.eq("department_id", xdapDepartmentsPojo.getId())
|
||||||
|
.doQuery(XdapDeptUsers.class);
|
||||||
|
if (ObjectUtils.isNotEmpty(xdapDeptUsersPojos)) {
|
||||||
|
for (XdapDeptUsers xdapDeptUsersPojo : xdapDeptUsersPojos) {
|
||||||
|
List<XdapUsers> usersPojos = runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
||||||
|
.eq("id", xdapDeptUsersPojo.getUserId())
|
||||||
|
.doQuery(XdapUsers.class);
|
||||||
|
if (ObjectUtils.isNotEmpty(usersPojos)) {
|
||||||
|
xdapUsersPojos.add(usersPojos.get(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
log.warn("无部门数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
return xdapUsersPojos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<XdapUsers> selectUserByPersonName(String personName) {
|
||||||
|
if (ObjectUtils.isEmpty(personName)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<XdapUsers> departmentsPojos = runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
||||||
|
.eq("username", personName)
|
||||||
|
.doQuery(XdapUsers.class);
|
||||||
|
return departmentsPojos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public XdapUsers selectUserByUserListAndDeptName(List<XdapUsers> xdapUsersPojos, XdapDepartments dpName) {
|
||||||
|
|
||||||
|
if (ObjectUtils.isNotEmpty(xdapUsersPojos) && ObjectUtils.isNotEmpty(dpName)) {
|
||||||
|
//提取用户ID集合
|
||||||
|
List<String> idList = xdapUsersPojos.stream().map(x -> x.getId()).collect(Collectors.toList());
|
||||||
|
//根据用户ID查找对应关系表
|
||||||
|
List<XdapDeptUsers> departmentsPojos = runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
||||||
|
.in("user_id", idList)
|
||||||
|
.doQuery(XdapDeptUsers.class);
|
||||||
|
//关系表筛选部门
|
||||||
|
List<XdapDeptUsers> collect = departmentsPojos.stream().filter(x -> x.getDepartmentId().equals(dpName.getId())).collect(Collectors.toList());
|
||||||
|
//筛选完成后查到对应的人员
|
||||||
|
if (ObjectUtils.isNotEmpty(collect)) {
|
||||||
|
String userId = collect.get(0).getUserId();
|
||||||
|
List<XdapUsers> usersPojo = runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
||||||
|
.eq("id", userId)
|
||||||
|
.doQuery(XdapUsers.class);
|
||||||
|
if (ObjectUtils.isNotEmpty(usersPojo)) {
|
||||||
|
return usersPojo.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public XdapUsers selectUserByID(String userId) {
|
||||||
|
|
||||||
|
if (ObjectUtils.isEmpty(userId)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<XdapUsers> userPojos = runtimeDatasourceService.buildTenantMpaasQuery("xdap_app_223770822127386625")
|
||||||
|
.eq("id", userId)
|
||||||
|
.doQuery(XdapUsers.class);
|
||||||
|
if (ObjectUtils.isNotEmpty(userPojos)) {
|
||||||
|
return userPojos.get(0);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
263
src/main/resources/application-s.properties
Normal file
263
src/main/resources/application-s.properties
Normal file
@ -0,0 +1,263 @@
|
|||||||
|
#xdap.singleAdminAppUrl=http://10.20.52.58:30607/xdap-app
|
||||||
|
aliyun.oss.accessKeyId=LTAI4GEC6ssfFDuVDUL3TbLp
|
||||||
|
aliyun.oss.accessKeySecret=ZpbgWTt2qfK68lQILqj0H3EdIun1Qf
|
||||||
|
aliyun.oss.endpoint=http://oss-cn-shanghai.aliyuncs.com
|
||||||
|
apaas.admin.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
|
apaas.admin.datasource.password=123456
|
||||||
|
apaas.admin.datasource.type=mysql
|
||||||
|
apaas.admin.datasource.url=jdbc:mysql://127.0.0.1:3306/test?serverTimezone=Asia/Shanghai&characterEncoding=utf-8
|
||||||
|
apaas.admin.datasource.username=root
|
||||||
|
apaas.bizevent.async=false
|
||||||
|
apaas.cache.usemq=true
|
||||||
|
apaas.deploy.type=null
|
||||||
|
apaas.hikariConfig.maxLifetimeMs=28800000
|
||||||
|
apaas.oauth.app.appOauthOAuthUserUrl=http://mpaas.app.yuchai.com/oauth2/oauth/user
|
||||||
|
apaas.oauth.app.appOauthTokenUrl=http://mpaas.app.yuchai.com/oauth2/oauth/token
|
||||||
|
apaas.oauth.app.appOauthUserSchemaJsonPath=$.userName
|
||||||
|
apaas.single.app-group-app-ids=2b5b3de8-e7fd-406a-a59a-d5568457b1f4
|
||||||
|
apaas.single.appId=771297120740179968
|
||||||
|
apaas.single.datasource.mongoDbName=mongDB01
|
||||||
|
apaas.single.datasource.mongoPoolConfig.maintenanceFrequency=600
|
||||||
|
apaas.single.datasource.mongoPoolConfig.maintenanceInitialDelay=240
|
||||||
|
apaas.single.datasource.mongoPoolConfig.maxConnectionIdleTime=3600
|
||||||
|
apaas.single.datasource.mongoPoolConfig.maxConnectionLifeTime=3600
|
||||||
|
apaas.single.datasource.mongoPoolConfig.maxSize=100
|
||||||
|
apaas.single.datasource.mongoPoolConfig.maxWaitQueueSize=500
|
||||||
|
apaas.single.datasource.mongoPoolConfig.maxWaitTime=120
|
||||||
|
apaas.single.datasource.mongoPoolConfig.minSize=0
|
||||||
|
apaas.single.datasource.mongoUrl=mongodb://localhost:27017/xdap_app_223770822127386625
|
||||||
|
apaas.single.private=true
|
||||||
|
apaas.single.tenantId=223770822127386625
|
||||||
|
apaas.tenant.init.db.initial-pool-size=30
|
||||||
|
apaas.tenant.init.db.max-pool-size=1000
|
||||||
|
apaas.tenant.initDataModel=true
|
||||||
|
apaasworkwechat.message.workWechatUrlPre=null
|
||||||
|
apaasworkwechat.message.wxOAuth2url=https://open.weixin.qq.com/connect/oauth2/authorize?appid=${CORPID!""}&redirect_uri=${URL!""}callback%2Fwe-com%2Findex.html&response_type=code&scope=snsapi_privateinfo&state=${STATE!""}&agentid=${AGENTID!""}#wechat_redirect
|
||||||
|
baidu.ocr.accessTokenKey=BAIDU_OCR_KEY
|
||||||
|
baidu.ocr.accessTokenUrl=https://aip.baidubce.com/oauth/2.0/token?
|
||||||
|
baidu.ocr.apiKey=HHRFL3VPtnj7Nle60ytbGMls
|
||||||
|
baidu.ocr.appId=23499932
|
||||||
|
baidu.ocr.basicGeneralUrl=https://aip.baidubce.com/rest/2.0/ocr/v1/accurate_basic
|
||||||
|
baidu.ocr.businessCardUrl=https://aip.baidubce.com/rest/2.0/ocr/v1/business_card
|
||||||
|
baidu.ocr.secretKey=VTvrrMjZZC1xtYfu82cfUhjeYgNTRIHe
|
||||||
|
baidu.ocr.vatInvoiceUrl=https://aip.baidubce.com/rest/2.0/ocr/v1/vat_invoice
|
||||||
|
deploy.backend.platform.host=10.20.52.11
|
||||||
|
deploy.backend.platform.port=30607
|
||||||
|
deploy.backend.singleapp.host=apaas-meim.app.yuchai.com
|
||||||
|
deploy.front.platform.host=apaas-meim.app.yuchai.com
|
||||||
|
deploy.front.platform.port=443
|
||||||
|
deploy.front.singleapp.app.prefix=app/a5e8e08/ycgf-yf-rddata
|
||||||
|
deploy.front.singleapp.host=apaas-meim.app.yuchai.com
|
||||||
|
deploy.front.singleapp.m.prefix=m/a5e8e08/ycgf-yf-rddata
|
||||||
|
deploy.front.workbench.host=apaas-meim.app.yuchai.com
|
||||||
|
deploy.front.workbench.port=443
|
||||||
|
deploy.powerjob.address=127.0.0.1:7700
|
||||||
|
deploy.rabbit.host=8.130.180.9
|
||||||
|
deploy.rabbit.password=password
|
||||||
|
deploy.rabbit.port=5672
|
||||||
|
deploy.rabbit.username=admin
|
||||||
|
deploy.redis.host=8.130.180.9
|
||||||
|
deploy.redis.password=lys5132
|
||||||
|
deploy.redis.port=6379
|
||||||
|
dingding.appAccessTokenUrl=https://oapi.dingtalk.com/gettoken
|
||||||
|
dingding.authUrlPre=https://login.dingtalk.com/oauth2/auth?
|
||||||
|
dingding.pageLink=null
|
||||||
|
dingding.redirectUri=redirect_uri=https%3A%2F%2Fapaas-meim.app.yuchai.com%2Fapp%2Fa5e8e08%2Fycgf-yf-rddata%2Fcallback%2Fdingding%2Findex.html&response_type=code&prompt=consent&scope=openid
|
||||||
|
dingding.sendMessageUrl=https://api.dingtalk.com/v1.0/robot/oToMessages/batchSend
|
||||||
|
dingding.userAccessTokenUrl=https://api.dingtalk.com/v1.0/oauth2/userAccessToken
|
||||||
|
dingding.userIdByMobileUrl=https://oapi.dingtalk.com/topapi/v2/user/getbymobile
|
||||||
|
dingding.userInfoUrl=https://api.dingtalk.com/v1.0/contact/users/me
|
||||||
|
download.config.downloadType=PERMANENT
|
||||||
|
download.config.effectiveTime=168
|
||||||
|
download.config.privateKeyHex=4b6b9fa1be0757bf4977344c634c4ac2b0c907cd3b225ea16b674b8348ffdcde
|
||||||
|
download.config.publicKeyHex=04919f2130b035e29f079b4dace907e3cad716556f93574f1f2d61685f6a5ac251cba81822062353a07fd69f2c544f2263f217e04b3af327453c1f9157a434e0de
|
||||||
|
feign.client.config.default.connect-timeout=20000
|
||||||
|
feign.client.config.default.read-timeout=50000
|
||||||
|
feign.hystrix.enabled=false
|
||||||
|
feishu.feiShuRedirectUri=redirect_uri=https%3A%2F%2Fapaas-meim.app.yuchai.com%2Fapp%2Fa5e8e08%2Fycgf-yf-rddata%2Fcallback%2Ffeishu%2Findex.html
|
||||||
|
feishu.feiShuUrlPre=https://open.feishu.cn/open-apis/authen/v1/index?
|
||||||
|
feishu.getOpenIdUrl=https://open.feishu.cn/open-apis/user/v1/batch_get_id?mobiles=
|
||||||
|
feishu.getTokenUrl=https://open.feishu.cn/open-apis/auth/v3/app_access_token/internal/
|
||||||
|
fileformat.whiteList[0]=.jpg
|
||||||
|
fileformat.whiteList[10]=.gif
|
||||||
|
fileformat.whiteList[11]=.pdf
|
||||||
|
fileformat.whiteList[12]=.txt
|
||||||
|
fileformat.whiteList[13]=.zip
|
||||||
|
fileformat.whiteList[14]=.rar
|
||||||
|
fileformat.whiteList[15]=.mp3
|
||||||
|
fileformat.whiteList[16]=.mp4
|
||||||
|
fileformat.whiteList[17]=.avi
|
||||||
|
fileformat.whiteList[18]=.mov
|
||||||
|
fileformat.whiteList[19]=.md
|
||||||
|
fileformat.whiteList[1]=.jpeg
|
||||||
|
fileformat.whiteList[20]=.json
|
||||||
|
fileformat.whiteList[21]=.7z
|
||||||
|
fileformat.whiteList[22]=.tar
|
||||||
|
fileformat.whiteList[23]=.gz
|
||||||
|
fileformat.whiteList[24]=.csv
|
||||||
|
fileformat.whiteList[25]=.xml
|
||||||
|
fileformat.whiteList[26]=.jar
|
||||||
|
fileformat.whiteList[27]=.log
|
||||||
|
fileformat.whiteList[28]=.keystore
|
||||||
|
fileformat.whiteList[29]=.xlsm
|
||||||
|
fileformat.whiteList[2]=.jfif
|
||||||
|
fileformat.whiteList[30]=.yml
|
||||||
|
fileformat.whiteList[31]=.yaml
|
||||||
|
fileformat.whiteList[32]=.properties
|
||||||
|
fileformat.whiteList[33]=.xml
|
||||||
|
fileformat.whiteList[34]=.dfy
|
||||||
|
fileformat.whiteList[35]=.dfyx
|
||||||
|
fileformat.whiteList[36]=.svg
|
||||||
|
fileformat.whiteList[37]=.hex
|
||||||
|
fileformat.whiteList[3]=.png
|
||||||
|
fileformat.whiteList[4]=.xls
|
||||||
|
fileformat.whiteList[5]=.xlsx
|
||||||
|
fileformat.whiteList[6]=.doc
|
||||||
|
fileformat.whiteList[7]=.docx
|
||||||
|
fileformat.whiteList[8]=.ppt
|
||||||
|
fileformat.whiteList[9]=.pptx
|
||||||
|
i18n.backendProjects[0]=app
|
||||||
|
i18n.backendProjects[1]=platform
|
||||||
|
i18n.backendProjects[2]=workbench
|
||||||
|
i18n.frontProjects[0]=app
|
||||||
|
i18n.frontProjects[10]=xui
|
||||||
|
i18n.frontProjects[1]=app-h5
|
||||||
|
i18n.frontProjects[2]=common
|
||||||
|
i18n.frontProjects[3]=platform-admin
|
||||||
|
i18n.frontProjects[4]=workbench
|
||||||
|
i18n.frontProjects[5]=workbench-h5
|
||||||
|
i18n.frontProjects[6]=x-dcloud-business-event
|
||||||
|
i18n.frontProjects[7]=x-dcloud-page-engine
|
||||||
|
i18n.frontProjects[8]=x-dcloud-page-mobile
|
||||||
|
i18n.frontProjects[9]=x-dcloud-page-web
|
||||||
|
license.path=/data/resources/license.lic
|
||||||
|
license.publicKeyStorePath=/data/resources/publicCerts.keystore
|
||||||
|
logging.config=classpath:logback-spring.xml
|
||||||
|
logging.file=log/xdap-app.log
|
||||||
|
management.endpoint.health.show-details=always
|
||||||
|
management.endpoints.web.exposure.include=*
|
||||||
|
management.health.db.enabled=false
|
||||||
|
mpaas.datasource[0].driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
|
mpaas.datasource[0].maxPoolSize=1000
|
||||||
|
mpaas.datasource[0].minPoolSize=50
|
||||||
|
mpaas.datasource[0].name=xdap_app_223770822127386625
|
||||||
|
mpaas.datasource[0].password=123456
|
||||||
|
mpaas.datasource[0].type=mysql
|
||||||
|
mpaas.datasource[0].url=jdbc:mysql://127.0.0.1:3306/yc_datasource_0?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf-8
|
||||||
|
mpaas.datasource[0].username=root
|
||||||
|
mpaas.datasource[1].name=test_demo
|
||||||
|
mpaas.datasource[1].password=123456
|
||||||
|
mpaas.datasource[1].type=mysql
|
||||||
|
mpaas.datasource[1].url=jdbc:mysql://127.0.0.1:3306/yc_datasource_1?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf-8
|
||||||
|
mpaas.datasource[1].username=root
|
||||||
|
mpaas.datasource[2].name=template_db2
|
||||||
|
mpaas.datasource[2].password=123456
|
||||||
|
mpaas.datasource[2].type=mysql
|
||||||
|
mpaas.datasource[2].url=jdbc:mysql://127.0.0.1:3306/yc_datasource_2?useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf-8
|
||||||
|
mpaas.datasource[2].username=root
|
||||||
|
mpaas.query.bigdatathresholdvalue=100000
|
||||||
|
mpaas.query.dbadatper=mysql
|
||||||
|
mpaas.query.dbvendor=mysql
|
||||||
|
mpaas.query.security.mode=custom
|
||||||
|
mpaas.security=false
|
||||||
|
powerjob.akka-port=27777
|
||||||
|
powerjob.app-name=49b90be5-eebe-4359-a
|
||||||
|
powerjob.enable-test-mode=false
|
||||||
|
powerjob.server-address=127.0.0.1:7700
|
||||||
|
powerjob.store-strategy=disk
|
||||||
|
powerjob.worker.akka-port=27777
|
||||||
|
powerjob.worker.app-name=49b90be5-eebe-4359-a
|
||||||
|
powerjob.worker.enable-test-mode=true
|
||||||
|
powerjob.worker.enabled=false
|
||||||
|
powerjob.worker.server-address=127.0.0.1:7700
|
||||||
|
powerjob.worker.store-strategy=disk
|
||||||
|
server.compression.enabled=true
|
||||||
|
server.compression.mime-types=application/json,application/xml,text/html,text/xml,text/plain,application/javascript,text/css
|
||||||
|
server.compression.min-response-size=2048
|
||||||
|
server.port=9091
|
||||||
|
spring.application.name=a5e8e08-ycgf-yf-rddata
|
||||||
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
|
spring.datasource.password=123456
|
||||||
|
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/activiti?serverTimezone=Asia/Shanghai&characterEncoding=utf-8
|
||||||
|
spring.datasource.username=root
|
||||||
|
spring.activiti.database-schema-update = true
|
||||||
|
spring.activiti.do-history-used = true
|
||||||
|
spring.activiti.history-level = full
|
||||||
|
spring.activiti.check-process-definitions = true
|
||||||
|
activiti.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||||
|
activiti.datasource.inIdle=5
|
||||||
|
activiti.datasource.initialSize=5
|
||||||
|
activiti.datasource.maxActive=50
|
||||||
|
activiti.datasource.password=123456
|
||||||
|
activiti.datasource.url=jdbc:mysql://127.0.0.1:3306/activiti_demo?serverTimezone=Asia/Shanghai&characterEncoding=utf-8
|
||||||
|
activiti.datasource.username=root
|
||||||
|
spring.cloud.nacos.config.enabled=false
|
||||||
|
spring.cloud.nacos.config.refresh-enabled=false
|
||||||
|
spring.cloud.nacos.discovery.enabled=false
|
||||||
|
spring.cloud.nacos.discovery.instance-enabled=false
|
||||||
|
spring.jackson.default-property-inclusion=non_null
|
||||||
|
spring.rabbitmq.host=8.130.180.9
|
||||||
|
spring.rabbitmq.password=password
|
||||||
|
spring.rabbitmq.port=5672
|
||||||
|
spring.rabbitmq.username=admin
|
||||||
|
spring.redis.database=0
|
||||||
|
spring.redis.host=8.130.180.9
|
||||||
|
spring.redis.password=lys5132
|
||||||
|
spring.redis.jedis.pool.max-active=20
|
||||||
|
spring.redis.jedis.pool.max-idle=8
|
||||||
|
spring.redis.jedis.pool.max-wait=-1
|
||||||
|
spring.redis.jedis.pool.min-idle=0
|
||||||
|
spring.redis.port=6379
|
||||||
|
spring.redis.timeout=10000
|
||||||
|
spring.servlet.multipart.max-file-size=150MB
|
||||||
|
spring.servlet.multipart.max-request-size=200MB
|
||||||
|
standard.plan.appTtlMillis=3600000
|
||||||
|
standard.plan.userTtlMillis=7200000
|
||||||
|
token.openTokenRefreshTtlMillis=1209600000
|
||||||
|
token.openTokenTtlMillis=7200000
|
||||||
|
token.refreshTtlMillis=1209600000
|
||||||
|
token.ttlMillis=7200000
|
||||||
|
xdap.adminUrl=gateway.yctp.yuchaidev.com/apaas/xdap-admin
|
||||||
|
xdap.apaas.cache.run.init=true
|
||||||
|
xdap.apaas.dbselectPriv=false
|
||||||
|
xdap.apaas.decryptProperties=DO_ENCRYPT
|
||||||
|
xdap.apaas.interface.encrypt.appEncryptionForceOpen=DISABLE
|
||||||
|
xdap.apaas.interface.encrypt.appEncryptionStatus=DISABLE
|
||||||
|
xdap.apaas.interface.encrypt.appEncryptionType=SM2
|
||||||
|
xdap.apaas.interface.encrypt.encryptType=DISABLE
|
||||||
|
xdap.apaas.interface.encrypt.privateKeyHex=4b6b9fa1be0757bf4977344c634c4ac2b0c907cd3b225ea16b674b8348ffdcde
|
||||||
|
xdap.apaas.interface.encrypt.publicKeyHex=04919f2130b035e29f079b4dace907e3cad716556f93574f1f2d61685f6a5ac251cba81822062353a07fd69f2c544f2263f217e04b3af327453c1f9157a434e0de
|
||||||
|
xdap.apaas.private=true
|
||||||
|
xdap.apaas.zuc.iv=null
|
||||||
|
xdap.apaas.zuc.k=null
|
||||||
|
xdap.appUrl=http://127.0.0.1:${server.port:9091}/xdap-app
|
||||||
|
xdap.avatar.adminBucketName=xdap-admin-dev
|
||||||
|
xdap.avatar.adminPrefix=https://apaas-meim.app.yuchai.com/apaas/platform/xdap-admin/attachments/downloadFile?file=
|
||||||
|
xdap.avatar.bucketName=xdap-app-dev
|
||||||
|
xdap.avatar.enableDynamicsPrefix=false
|
||||||
|
xdap.avatar.localPath=/data/resources/attachments/
|
||||||
|
xdap.avatar.path=/resource/head_portrait/
|
||||||
|
xdap.avatar.prefix=/xdap-app/attachments/downloadFile?file=
|
||||||
|
xdap.gatewayUrl=gateway.yctp.yuchaidev.com/apaas/gateway
|
||||||
|
xdap.header.accessControlAllowOrigin[0]=*
|
||||||
|
xdap.invitation.prefix=http://k8s.definesys.com:31005/x-project-app/blank/invite?inviteCode=
|
||||||
|
xdap.jobServerUrl=http://localhost:7700
|
||||||
|
xdap.jobUrl=http://127.0.0.1:${server.port:9091}/xdap-job
|
||||||
|
xdap.openappUrl=http://127.0.0.1:${server.port:9091}/xdap-app
|
||||||
|
xdap.password.forceModify=DISABLE
|
||||||
|
xdap.password.passwordValidateMessage=\u5bc6\u7801\u9700\u5305\u542b\u6570\u5b57\u3001\u5b57\u6bcd\u5927\u5c0f\u5199\u548c\u7279\u6b8a\u5b57\u7b26\uff0c\u4e0d\u5c11\u4e8e8\u4f4d
|
||||||
|
xdap.password.passwordValidateRule=^.*(?=.{8,32})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*?.() +-_~,=]).*$
|
||||||
|
xdap.process.batchOption=20
|
||||||
|
xdap.process.suspendTimeFlag=ENABLE
|
||||||
|
xdap.resource.path=i18n/platform/platform_en_US.properties,i18n/platform/platform_zh_CN.properties,i18n/workbench/workbench_en_US.properties,i18n/workbench/workbench_zh_CN.properties,i18n/app/app_en_US.properties,i18n/app/app_zh_CN.properties,i18n/app/app_ja_JP.properties
|
||||||
|
xdap.share.editAfterShareUrl=/xdap-app/formShareSkip/skip/shareUrl?shareId=
|
||||||
|
xdap.share.frontSingleAppHost=https://apaas-meim.app.yuchai.com/app/a5e8e08/ycgf-yf-rddata/
|
||||||
|
xdap.share.frontSingleMobileHost=https://apaas-meim.app.yuchai.com/m/a5e8e08/ycgf-yf-rddata/
|
||||||
|
xdap.share.mobileSkipUrl=blank/public-form?shareId=
|
||||||
|
xdap.share.pcSkipUrl=blank/public-form?shareId=
|
||||||
|
xdap.skipDetailurl=https://apaas-meim.app.yuchai.com/app/a5e8e08/ycgf-yf-rddata/%s/app/app-page?appId=%s&formId=%s&title=%s¤tMenu=%s&documentId=%s
|
||||||
|
xdap.skipurl=https://apaas-meim.app.yuchai.com/app/a5e8e08/ycgf-yf-rddata/%s/app/app-page?appId=%s&formId=%s&title=%s¤tMenu=%s
|
||||||
|
xdap.snow.data-center-id=0
|
||||||
|
xdap.snow.workId=192
|
||||||
|
xdap.todocenter=https://apaas-meim.app.yuchai.com/workbench/app/%s/todoCenter/myTodo
|
||||||
|
xdap.todourl=https://apaas-meim.app.yuchai.com/workbench/app/%s/todoCenter/myTodo/?formId=%s&documentId=%s&processId=%s
|
||||||
Loading…
x
Reference in New Issue
Block a user