修改:参数变更问题修改
This commit is contained in:
parent
43247d411a
commit
4e342d2417
@ -1,6 +1,5 @@
|
|||||||
package com.xdap.self_development.controller;
|
package com.xdap.self_development.controller;
|
||||||
|
|
||||||
import com.alibaba.excel.EasyExcel;
|
|
||||||
import com.definesys.mpaas.common.http.Response;
|
import com.definesys.mpaas.common.http.Response;
|
||||||
import com.definesys.mpaas.query.MpaasQueryFactory;
|
import com.definesys.mpaas.query.MpaasQueryFactory;
|
||||||
import com.xdap.motor.entity.SnowflakeIdWorker;
|
import com.xdap.motor.entity.SnowflakeIdWorker;
|
||||||
@ -9,17 +8,16 @@ import com.xdap.self_development.common.MyResponse;
|
|||||||
import com.xdap.self_development.common.UserPermissionGetter;
|
import com.xdap.self_development.common.UserPermissionGetter;
|
||||||
import com.xdap.self_development.config.BusinessDatabase;
|
import com.xdap.self_development.config.BusinessDatabase;
|
||||||
import com.xdap.self_development.feign.ApaasMyTokenFeign;
|
import com.xdap.self_development.feign.ApaasMyTokenFeign;
|
||||||
import com.xdap.self_development.pojo.ClassificationAttribute;
|
|
||||||
import com.xdap.self_development.pojo.EnginePartsCollection;
|
|
||||||
import com.xdap.self_development.schedule.ParameterValueCalculationTimer;
|
import com.xdap.self_development.schedule.ParameterValueCalculationTimer;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -48,6 +46,11 @@ public class DeleteController {
|
|||||||
@Value("${apaas.token.clientSecred}")
|
@Value("${apaas.token.clientSecred}")
|
||||||
private String clientSecret;
|
private String clientSecret;
|
||||||
|
|
||||||
|
@GetMapping("/getUserId")
|
||||||
|
public Response getUserId() {
|
||||||
|
return Response.ok().data(runtimeAppContextService.getCurrentUserId());
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/timer")
|
@GetMapping("/timer")
|
||||||
public Response timer() {
|
public Response timer() {
|
||||||
MyResponse myResponse = timer.dailyCalculate();
|
MyResponse myResponse = timer.dailyCalculate();
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import javax.validation.constraints.NotNull;
|
|||||||
@Data
|
@Data
|
||||||
public class ApprovalAndParameterForm {
|
public class ApprovalAndParameterForm {
|
||||||
// @NotBlank(message = "流程不能为空")
|
// @NotBlank(message = "流程不能为空")
|
||||||
// private String flowId;
|
private String flowId;
|
||||||
@NotBlank(message = "模板不能为空")
|
@NotBlank(message = "模板不能为空")
|
||||||
private String templateId;
|
private String templateId;
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@ public class BenchmarkingReportPageForm {
|
|||||||
private String projectName;
|
private String projectName;
|
||||||
private String projectNumber;
|
private String projectNumber;
|
||||||
private String status;
|
private String status;
|
||||||
private String sysParts;
|
|
||||||
|
|
||||||
@NotBlank(message = "上传用户不能为空")
|
@NotBlank(message = "上传用户不能为空")
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|||||||
@ -20,7 +20,9 @@ public class SaveBenchmarkingReportForm {
|
|||||||
private String marketSegment;
|
private String marketSegment;
|
||||||
private String projectName;
|
private String projectName;
|
||||||
private String projectNumber;
|
private String projectNumber;
|
||||||
private String sysParts;
|
|
||||||
|
private String subsystem;
|
||||||
|
private String partsName;
|
||||||
|
|
||||||
@NotBlank(message = "发起人不能为空")
|
@NotBlank(message = "发起人不能为空")
|
||||||
private String userId;
|
private String userId;
|
||||||
|
|||||||
@ -22,7 +22,9 @@ public class UpdateBenchmarkingReportForm {
|
|||||||
private String marketSegment;
|
private String marketSegment;
|
||||||
private String projectName;
|
private String projectName;
|
||||||
private String projectNumber;
|
private String projectNumber;
|
||||||
private String sysParts;
|
|
||||||
|
private String subsystem;
|
||||||
|
private String partsName;
|
||||||
|
|
||||||
private String fileUrl;
|
private String fileUrl;
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,7 @@ public class ApprovalFlow extends MpaasBasePojo {
|
|||||||
private String templateId;
|
private String templateId;
|
||||||
private String currentNode; // 节点:PROOFREAD, REVIEW, COUNTERSIGN, APPROVE
|
private String currentNode; // 节点:PROOFREAD, REVIEW, COUNTERSIGN, APPROVE
|
||||||
private String flowStatus; //DRAFT(草稿)、APPROVING(审批中)、COMPLETE(已完成)、RETURNED(已撤回)、REJECTED(已拒绝)
|
private String flowStatus; //DRAFT(草稿)、APPROVING(审批中)、COMPLETE(已完成)、RETURNED(已撤回)、REJECTED(已拒绝)
|
||||||
|
private String returnNum;
|
||||||
|
|
||||||
private String proofreadUsers; // 校对人员
|
private String proofreadUsers; // 校对人员
|
||||||
private String reviewUsers; // 审核人员
|
private String reviewUsers; // 审核人员
|
||||||
|
|||||||
@ -34,7 +34,9 @@ public class BenchmarkingReport extends MpaasBasePojo {
|
|||||||
private String marketSegment;
|
private String marketSegment;
|
||||||
private String projectName;
|
private String projectName;
|
||||||
private String projectNumber;
|
private String projectNumber;
|
||||||
private String sysParts;
|
|
||||||
|
private String subsystem;
|
||||||
|
private String partsName;
|
||||||
|
|
||||||
private String createBy;
|
private String createBy;
|
||||||
private Integer isDelete;
|
private Integer isDelete;
|
||||||
|
|||||||
@ -28,10 +28,13 @@ public class RevisionRecord extends MpaasBasePojo {
|
|||||||
private Timestamp createTime;
|
private Timestamp createTime;
|
||||||
private String parameterId;
|
private String parameterId;
|
||||||
|
|
||||||
|
private String returnNum;
|
||||||
|
|
||||||
public RevisionRecord(String templateName, Integer version,
|
public RevisionRecord(String templateName, Integer version,
|
||||||
Integer parameterNumber, String modifyDetails,
|
Integer parameterNumber, String modifyDetails,
|
||||||
String templateId, String preTemplateId,
|
String templateId, String preTemplateId,
|
||||||
Timestamp createTime, String parameterId) {
|
Timestamp createTime, String parameterId,
|
||||||
|
String returnNum) {
|
||||||
this.templateName = templateName;
|
this.templateName = templateName;
|
||||||
this.version = version;
|
this.version = version;
|
||||||
this.parameterNumber = parameterNumber;
|
this.parameterNumber = parameterNumber;
|
||||||
@ -40,5 +43,6 @@ public class RevisionRecord extends MpaasBasePojo {
|
|||||||
this.preTemplateId = preTemplateId;
|
this.preTemplateId = preTemplateId;
|
||||||
this.createTime = createTime;
|
this.createTime = createTime;
|
||||||
this.parameterId = parameterId;
|
this.parameterId = parameterId;
|
||||||
|
this.returnNum = returnNum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,7 +37,7 @@ public class Template extends MpaasBasePojo {
|
|||||||
private Timestamp publishedTime;
|
private Timestamp publishedTime;
|
||||||
private Long orderNum;
|
private Long orderNum;
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
private String returnNum;
|
||||||
|
|
||||||
@Column(type = ColumnType.CALCULATE)
|
@Column(type = ColumnType.CALCULATE)
|
||||||
private Integer maxOrder;
|
private Integer maxOrder;
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import lombok.Data;
|
|||||||
|
|
||||||
@SQLQuery(value = {
|
@SQLQuery(value = {
|
||||||
@SQL(view = "getParameterAndChange",
|
@SQL(view = "getParameterAndChange",
|
||||||
sql = "SELECT p.*, r.pre_template_id, r.modify_details FROM ( SELECT *, ROW_NUMBER() OVER (PARTITION BY parameter_id ORDER BY create_time DESC) AS rn FROM yfsjglpt_model_revision_record ) r LEFT JOIN yfsjglpt_model_parameter p ON r.parameter_id = p.id WHERE r.rn = 1 and r.template_id = #templateId order by r.create_time desc ")
|
sql = "SELECT p.*, r.pre_template_id, r.modify_details FROM ( SELECT *, row_number() OVER (PARTITION BY parameter_id ORDER BY create_time DESC) AS rn FROM yfsjglpt_model_revision_record ) r LEFT JOIN yfsjglpt_model_parameter p ON r.parameter_id = p.id WHERE r.rn = 1 AND r.template_id = #templateId AND r.return_num <= #returnNum ORDER BY r.create_time DESC")
|
||||||
})
|
})
|
||||||
@Data
|
@Data
|
||||||
public class TemplateChangeView {
|
public class TemplateChangeView {
|
||||||
|
|||||||
@ -8,8 +8,12 @@ import lombok.Data;
|
|||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
|
|
||||||
@SQLQuery(value = {
|
@SQLQuery(value = {
|
||||||
|
@SQL(view = "getAllReportApprovalByParts",
|
||||||
|
sql = "SELECT br.id AS \"reportId\", af.id AS \"flowId\", br.* FROM yfsjglpt_model_approval_flow af RIGHT JOIN yfsjglpt_model_benchmarking_report br ON af.template_id = br.id AND af.flow_type = 2 WHERE br.is_delete = 0 and br.title like CONCAT('%', #title, '%') and br.manufacturer_name like CONCAT('%', #manufacturerName, '%') and br.model_name like CONCAT('%', #modelName, '%') and br.product_number like CONCAT('%', #productNumber, '%') and br.module like CONCAT('%', #module, '%') and br.plate like CONCAT('%', #plate, '%') and br.platform like CONCAT('%', #platform, '%') and br.series like CONCAT('%', #series, '%') and br.market_segment like CONCAT('%', #marketSegment, '%') and br.project_name like CONCAT('%', #projectName, '%') and br.project_number like CONCAT('%', #projectNumber, '%') and br.status like CONCAT('%', #status, '%') and br.subsystem = #subsystem and br.parts_name in (#partsName) ORDER BY CASE br.status WHEN 'COMPLETE' THEN 1 WHEN 'APPROVING' THEN 2 WHEN 'REJECTED' THEN 3 ELSE 4 END ASC"),
|
||||||
|
@SQL(view = "getAllReportApprovalBySub",
|
||||||
|
sql = "SELECT br.id AS \"reportId\", af.id AS \"flowId\", br.* FROM yfsjglpt_model_approval_flow af RIGHT JOIN yfsjglpt_model_benchmarking_report br ON af.template_id = br.id AND af.flow_type = 2 WHERE br.is_delete = 0 and br.title like CONCAT('%', #title, '%') and br.manufacturer_name like CONCAT('%', #manufacturerName, '%') and br.model_name like CONCAT('%', #modelName, '%') and br.product_number like CONCAT('%', #productNumber, '%') and br.module like CONCAT('%', #module, '%') and br.plate like CONCAT('%', #plate, '%') and br.platform like CONCAT('%', #platform, '%') and br.series like CONCAT('%', #series, '%') and br.market_segment like CONCAT('%', #marketSegment, '%') and br.project_name like CONCAT('%', #projectName, '%') and br.project_number like CONCAT('%', #projectNumber, '%') and br.status like CONCAT('%', #status, '%') and br.subsystem = #subsystem ORDER BY CASE br.status WHEN 'COMPLETE' THEN 1 WHEN 'APPROVING' THEN 2 WHEN 'REJECTED' THEN 3 ELSE 4 END ASC"),
|
||||||
@SQL(view = "getAllReportApproval",
|
@SQL(view = "getAllReportApproval",
|
||||||
sql = "SELECT br.id AS \"reportId\", af.id AS \"flowId\", br.* FROM yfsjglpt_model_approval_flow af RIGHT JOIN yfsjglpt_model_benchmarking_report br ON af.template_id = br.id AND af.flow_type = 2 WHERE br.is_delete = 0 and br.title like CONCAT('%', #title, '%') and br.manufacturer_name like CONCAT('%', #manufacturerName, '%') and br.model_name like CONCAT('%', #modelName, '%') and br.product_number like CONCAT('%', #productNumber, '%') and br.module like CONCAT('%', #module, '%') and br.plate like CONCAT('%', #plate, '%') and br.platform like CONCAT('%', #platform, '%') and br.series like CONCAT('%', #series, '%') and br.market_segment like CONCAT('%', #marketSegment, '%') and br.project_name like CONCAT('%', #projectName, '%') and br.project_number like CONCAT('%', #projectNumber, '%') and br.status like CONCAT('%', #status, '%') or br.sys_parts = #sysParts ORDER BY CASE br.status WHEN 'COMPLETE' THEN 1 WHEN 'APPROVING' THEN 2 WHEN 'REJECTED' THEN 3 ELSE 4 END ASC")
|
sql = "SELECT br.id AS \"reportId\", af.id AS \"flowId\", br.* FROM yfsjglpt_model_approval_flow af RIGHT JOIN yfsjglpt_model_benchmarking_report br ON af.template_id = br.id AND af.flow_type = 2 WHERE br.is_delete = 0 and br.title like CONCAT('%', #title, '%') and br.manufacturer_name like CONCAT('%', #manufacturerName, '%') and br.model_name like CONCAT('%', #modelName, '%') and br.product_number like CONCAT('%', #productNumber, '%') and br.module like CONCAT('%', #module, '%') and br.plate like CONCAT('%', #plate, '%') and br.platform like CONCAT('%', #platform, '%') and br.series like CONCAT('%', #series, '%') and br.market_segment like CONCAT('%', #marketSegment, '%') and br.project_name like CONCAT('%', #projectName, '%') and br.project_number like CONCAT('%', #projectNumber, '%') and br.status like CONCAT('%', #status, '%') ORDER BY CASE br.status WHEN 'COMPLETE' THEN 1 WHEN 'APPROVING' THEN 2 WHEN 'REJECTED' THEN 3 ELSE 4 END ASC")
|
||||||
})
|
})
|
||||||
@Data
|
@Data
|
||||||
public class TodoAndReportView {
|
public class TodoAndReportView {
|
||||||
|
|||||||
@ -102,12 +102,6 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageQueryResult<TodoAndReportView> getBenchmarkingReportByCondition(BenchmarkingReportPageForm form) {
|
public PageQueryResult<TodoAndReportView> getBenchmarkingReportByCondition(BenchmarkingReportPageForm form) {
|
||||||
// List<TodoAndReportView> approvalList = new ArrayList<>();
|
|
||||||
// Set<String> flowIds = new HashSet<>(Objects.requireNonNull(redisTemplate.opsForSet().members(TODO_PREFIX + form.getCreateBy())));
|
|
||||||
// List<String> ids = new ArrayList<>(flowIds);
|
|
||||||
if (form.getSysParts() == null) {
|
|
||||||
form.setSysParts("");
|
|
||||||
}
|
|
||||||
PageQueryResult<TodoAndReportView> result = bd.getBusinessDatabase()
|
PageQueryResult<TodoAndReportView> result = bd.getBusinessDatabase()
|
||||||
.viewQueryMode(true)
|
.viewQueryMode(true)
|
||||||
.view("getAllReportApproval")
|
.view("getAllReportApproval")
|
||||||
@ -123,26 +117,7 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
.setVar("projectName", form.getProjectName())
|
.setVar("projectName", form.getProjectName())
|
||||||
.setVar("projectNumber", form.getProjectNumber())
|
.setVar("projectNumber", form.getProjectNumber())
|
||||||
.setVar("status", form.getStatus())
|
.setVar("status", form.getStatus())
|
||||||
.setVar("sysParts", form.getSysParts())
|
|
||||||
.doPageQuery(form.getPageNumber(), form.getPageSize(), TodoAndReportView.class);
|
.doPageQuery(form.getPageNumber(), form.getPageSize(), TodoAndReportView.class);
|
||||||
// List<TodoAndReportView> todoList = bd.getBusinessDatabase()
|
|
||||||
// .viewQueryMode(true)
|
|
||||||
// .view("getTodoAndReport")
|
|
||||||
// .setVar("ids", ids)
|
|
||||||
// .setVar("createBy", form.getCreateBy())
|
|
||||||
// .setVar("title", form.getTitle())
|
|
||||||
// .setVar("manufacturerName", form.getManufacturerName())
|
|
||||||
// .setVar("modelName", form.getModelName())
|
|
||||||
// .setVar("productNumber", form.getProductNumber())
|
|
||||||
// .setVar("module", form.getModule())
|
|
||||||
// .setVar("plate", form.getPlate())
|
|
||||||
// .setVar("platform", form.getPlatform())
|
|
||||||
// .setVar("series", form.getSeries())
|
|
||||||
// .setVar("marketSegment", form.getMarketSegment())
|
|
||||||
// .setVar("projectName", form.getProjectName())
|
|
||||||
// .setVar("projectNumber", form.getProjectNumber())
|
|
||||||
// .setVar("status", form.getStatus())
|
|
||||||
// .doQuery(TodoAndReportView.class);
|
|
||||||
setCurrentApprovers(result);
|
setCurrentApprovers(result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -230,13 +205,12 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional(rollbackFor = CommonException.class)
|
||||||
public void handleReportApproval(HandleApprovalRequest request) {
|
public void handleReportApproval(HandleApprovalRequest request) {
|
||||||
ApprovalFlow flow = bd.getBusinessDatabase()
|
ApprovalFlow flow = bd.getBusinessDatabase()
|
||||||
.eq("id", request.getFlowId())
|
.eq("id", request.getFlowId())
|
||||||
.eq("flow_type", 2)
|
.eq("flow_type", 2)
|
||||||
.doQueryFirst(ApprovalFlow.class);
|
.doQueryFirst(ApprovalFlow.class);
|
||||||
|
|
||||||
if (flow == null || !"APPROVING".equals(flow.getFlowStatus())) {
|
if (flow == null || !"APPROVING".equals(flow.getFlowStatus())) {
|
||||||
throw new CommonException("流程不存在或已结束");
|
throw new CommonException("流程不存在或已结束");
|
||||||
}
|
}
|
||||||
@ -408,7 +382,6 @@ public class BenchmarkingReportServiceImpl implements BenchmarkingReportService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = CommonException.class)
|
|
||||||
public void processApprovalLogic(ApprovalFlow flow, HandleApprovalRequest request, String currentNode) {
|
public void processApprovalLogic(ApprovalFlow flow, HandleApprovalRequest request, String currentNode) {
|
||||||
// 记录审批结果
|
// 记录审批结果
|
||||||
ApprovalRecord record = new ApprovalRecord();
|
ApprovalRecord record = new ApprovalRecord();
|
||||||
|
|||||||
@ -319,7 +319,8 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
newTemplate.getId(),
|
newTemplate.getId(),
|
||||||
null,
|
null,
|
||||||
Timestamp.valueOf(LocalDateTime.now()),
|
Timestamp.valueOf(LocalDateTime.now()),
|
||||||
newParameter.getId()
|
newParameter.getId(),
|
||||||
|
newTemplate.getReturnNum()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -363,7 +364,8 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
newTemplate.getId(),
|
newTemplate.getId(),
|
||||||
baseTemplate.getId(),
|
baseTemplate.getId(),
|
||||||
Timestamp.valueOf(LocalDateTime.now()),
|
Timestamp.valueOf(LocalDateTime.now()),
|
||||||
updatedParameter.getId()
|
updatedParameter.getId(),
|
||||||
|
newTemplate.getReturnNum()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,7 +422,8 @@ public class ParameterServiceImpl implements ParameterService {
|
|||||||
newTemplate.getId(),
|
newTemplate.getId(),
|
||||||
baseTemplate.getId(),
|
baseTemplate.getId(),
|
||||||
Timestamp.valueOf(LocalDateTime.now()),
|
Timestamp.valueOf(LocalDateTime.now()),
|
||||||
deletedParameter.getId()
|
deletedParameter.getId(),
|
||||||
|
newTemplate.getReturnNum()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,6 +93,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
flow.setCreatedTime(Timestamp.valueOf(LocalDateTime.now()));
|
flow.setCreatedTime(Timestamp.valueOf(LocalDateTime.now()));
|
||||||
flow.setFlowType(1); // 设置为模板审批流程
|
flow.setFlowType(1); // 设置为模板审批流程
|
||||||
flow.setExplanation(request.getExplanation());
|
flow.setExplanation(request.getExplanation());
|
||||||
|
flow.setReturnNum(template.getReturnNum());
|
||||||
bd.getBusinessDatabase().doInsert(flow);
|
bd.getBusinessDatabase().doInsert(flow);
|
||||||
|
|
||||||
// 新增待办
|
// 新增待办
|
||||||
@ -263,24 +264,36 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageQueryResult<TemplateChangeView> getTemplateChanges(ApprovalAndParameterForm form) {
|
public PageQueryResult<TemplateChangeView> getTemplateChanges(ApprovalAndParameterForm form) {
|
||||||
PageQueryResult<TemplateChangeView> results = bd.getBusinessDatabase()
|
Template template = bd.getBusinessDatabase()
|
||||||
.viewQueryMode(true)
|
.eq("id", form.getTemplateId())
|
||||||
.view("getParameterAndChange")
|
.doQueryFirst(Template.class);
|
||||||
.setVar("templateId", form.getTemplateId())
|
if (form.getFlowId() == null) {
|
||||||
.doPageQuery(form.getPageNumber(), form.getPageSize(), TemplateChangeView.class);
|
return bd.getBusinessDatabase()
|
||||||
|
.viewQueryMode(true)
|
||||||
// results.getResult().forEach(item -> {
|
.view("getParameterAndChange")
|
||||||
// if (item.getPreTemplateId() != null) {
|
.setVar("templateId", form.getTemplateId())
|
||||||
// Parameter parameter = bd.getBusinessDatabase()
|
.setVar("returnNum", template.getReturnNum())
|
||||||
// .viewQueryMode(true)
|
.doPageQuery(form.getPageNumber(), form.getPageSize(), TemplateChangeView.class);
|
||||||
// .view("selectParametersByTemplateId")
|
} else {
|
||||||
// .setVar("templateId", item.getPreTemplateId())
|
ApprovalFlow approvalFlow = bd.getBusinessDatabase()
|
||||||
// .eq("parameter_number", item.getParameterNumber())
|
.eq("id", form.getFlowId())
|
||||||
// .doQueryFirst(Parameter.class);
|
.doQueryFirst(ApprovalFlow.class);
|
||||||
// BeanUtils.copyProperties(parameter, item);
|
if (approvalFlow == null) {
|
||||||
// }
|
return bd.getBusinessDatabase()
|
||||||
// });
|
.viewQueryMode(true)
|
||||||
return results;
|
.view("getParameterAndChange")
|
||||||
|
.setVar("templateId", form.getTemplateId())
|
||||||
|
.setVar("returnNum", template.getReturnNum())
|
||||||
|
.doPageQuery(form.getPageNumber(), form.getPageSize(), TemplateChangeView.class);
|
||||||
|
} else {
|
||||||
|
return bd.getBusinessDatabase()
|
||||||
|
.viewQueryMode(true)
|
||||||
|
.view("getParameterAndChangeByApprovalId")
|
||||||
|
.setVar("templateId", form.getTemplateId())
|
||||||
|
.setVar("returnNum", approvalFlow.getReturnNum())
|
||||||
|
.doPageQuery(form.getPageNumber(), form.getPageSize(), TemplateChangeView.class);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -559,6 +572,7 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
bd.getBusinessDatabase()
|
bd.getBusinessDatabase()
|
||||||
.rowid("id", template.getRowId())
|
.rowid("id", template.getRowId())
|
||||||
.update("status", template.getStatus())
|
.update("status", template.getStatus())
|
||||||
|
.update("return_num", template.getReturnNum() + 1)
|
||||||
.doUpdate(Template.class);
|
.doUpdate(Template.class);
|
||||||
// 清除所有待办
|
// 清除所有待办
|
||||||
clearAllTodo(flow, userId);
|
clearAllTodo(flow, userId);
|
||||||
|
|||||||
@ -186,13 +186,15 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
|
|
||||||
List<Parameter> list;
|
List<Parameter> list;
|
||||||
if (form.isTemplateEmpty()) {
|
if (form.isTemplateEmpty()) {
|
||||||
list = bd.getBusinessDatabase()
|
// list = bd.getBusinessDatabase()
|
||||||
.viewQueryMode(true)
|
// .viewQueryMode(true)
|
||||||
.view("selectParametersByTId")
|
// .view("selectParametersByTId")
|
||||||
.setVar("templateId", templateDB.getId())
|
// .setVar("templateId", templateDB.getId())
|
||||||
.select("parameterName", "parameterNumber")
|
// .select("parameterName", "parameterNumber")
|
||||||
.orderBy("parameterNumber", "asc")
|
// .orderBy("parameterNumber", "asc")
|
||||||
.doQuery(Parameter.class);
|
// .doQuery(Parameter.class);
|
||||||
|
list = new ArrayList<>();
|
||||||
|
list.add(new Parameter());
|
||||||
} else {
|
} else {
|
||||||
list = bd.getBusinessDatabase()
|
list = bd.getBusinessDatabase()
|
||||||
.viewQueryMode(true)
|
.viewQueryMode(true)
|
||||||
@ -359,7 +361,8 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
finalLastTemplate.getId(),
|
finalLastTemplate.getId(),
|
||||||
null,
|
null,
|
||||||
Timestamp.valueOf(LocalDateTime.now()),
|
Timestamp.valueOf(LocalDateTime.now()),
|
||||||
parameter.getId()
|
parameter.getId(),
|
||||||
|
finalLastTemplate.getReturnNum()
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@ -448,7 +451,8 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
lastTemplate.getId(),
|
lastTemplate.getId(),
|
||||||
null,
|
null,
|
||||||
Timestamp.valueOf(LocalDateTime.now()),
|
Timestamp.valueOf(LocalDateTime.now()),
|
||||||
parameter.getId()
|
parameter.getId(),
|
||||||
|
lastTemplate.getReturnNum()
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
@ -473,7 +477,8 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
lastTemplate.getId(),
|
lastTemplate.getId(),
|
||||||
parameterChange.getOriginal().getId(),
|
parameterChange.getOriginal().getId(),
|
||||||
Timestamp.valueOf(LocalDateTime.now()),
|
Timestamp.valueOf(LocalDateTime.now()),
|
||||||
parameterChange.getUpdated().getId()
|
parameterChange.getUpdated().getId(),
|
||||||
|
lastTemplate.getReturnNum()
|
||||||
);
|
);
|
||||||
bd.getBusinessDatabase().doInsert(record);
|
bd.getBusinessDatabase().doInsert(record);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -14,6 +14,7 @@ CREATE TABLE `yfsjglpt_model_approval_flow`
|
|||||||
`created_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
`created_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
`flow_type` int(11) NOT NULL DEFAULT '1' COMMENT '流程类型:1模板审批流程,2对标审批流程',
|
`flow_type` int(11) NOT NULL DEFAULT '1' COMMENT '流程类型:1模板审批流程,2对标审批流程',
|
||||||
`explanation` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`explanation` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
|
`return_num` int(11) DEFAULT 0 COMMENT '退回次数',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
DEFAULT CHARSET = utf8mb4
|
DEFAULT CHARSET = utf8mb4
|
||||||
@ -59,7 +60,7 @@ CREATE TABLE `yfsjglpt_model_benchmarking_report`
|
|||||||
`create_by` varchar(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT '上传人',
|
`create_by` varchar(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT '上传人',
|
||||||
`file_path` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '文件地址',
|
`file_path` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '文件地址',
|
||||||
`status` varchar(20) COLLATE utf8mb4_general_ci DEFAULT 'DRAFT' COMMENT '状态 DRAFT(草稿)、APPROVING(审批中)、COMPLETE(已完成)、RETURNED(已撤回)、REJECTED(已拒绝)',
|
`status` varchar(20) COLLATE utf8mb4_general_ci DEFAULT 'DRAFT' COMMENT '状态 DRAFT(草稿)、APPROVING(审批中)、COMPLETE(已完成)、RETURNED(已撤回)、REJECTED(已拒绝)',
|
||||||
`sys_parts` varchar(100) COLLATE utf8mb4_general_ci NOT NULL COMMENT '子系统和零部件',
|
`is_delete` int(11) DEFAULT 0 COMMENT '删除标志',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
DEFAULT CHARSET = utf8mb4
|
DEFAULT CHARSET = utf8mb4
|
||||||
@ -120,6 +121,7 @@ CREATE TABLE `yfsjglpt_model_template`
|
|||||||
`published_time` timestamp NULL DEFAULT NULL,
|
`published_time` timestamp NULL DEFAULT NULL,
|
||||||
`order_num` int NOT NULL DEFAULT '1',
|
`order_num` int NOT NULL DEFAULT '1',
|
||||||
`create_by` varchar(10) COLLATE utf8mb4_general_ci NOT NULL,
|
`create_by` varchar(10) COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
|
`return_num` int(11) DEFAULT 0 COMMENT '退回次数',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `uk_template_version` (`template_name`, `version`),
|
UNIQUE KEY `uk_template_version` (`template_name`, `version`),
|
||||||
KEY `idx_template_name` (`template_name`),
|
KEY `idx_template_name` (`template_name`),
|
||||||
@ -145,6 +147,7 @@ CREATE TABLE `yfsjglpt_model_revision_record`
|
|||||||
`pre_template_id` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
`pre_template_id` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||||
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
`create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
`parameter_id` varchar(64) COLLATE utf8mb4_general_ci NOT NULL,
|
`parameter_id` varchar(64) COLLATE utf8mb4_general_ci NOT NULL,
|
||||||
|
`return_num` int(11) DEFAULT 0 COMMENT '退回次数',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
DEFAULT CHARSET = utf8mb4
|
DEFAULT CHARSET = utf8mb4
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user