新增:参数常用部分功能
This commit is contained in:
parent
8e4e7a871a
commit
d02dd6dfed
@ -0,0 +1,51 @@
|
|||||||
|
package com.xdap.self_development.controller;
|
||||||
|
|
||||||
|
import com.definesys.mpaas.common.http.Response;
|
||||||
|
import com.xdap.self_development.controller.form.ModelCommonItem;
|
||||||
|
import com.xdap.self_development.controller.form.ModelCommonParameterForm;
|
||||||
|
import com.xdap.self_development.service.CommonParameterService;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/custom/common")
|
||||||
|
public class CommonParameterController {
|
||||||
|
@Resource
|
||||||
|
private CommonParameterService commonParameterService;
|
||||||
|
|
||||||
|
// 查询机型参数常用
|
||||||
|
@GetMapping("/getModelCommon")
|
||||||
|
public Response getModelCommonParameter(
|
||||||
|
@NotBlank @RequestParam String modelCommonId
|
||||||
|
) {
|
||||||
|
List<ModelCommonItem> list = commonParameterService.getModelCommonParameter(modelCommonId);
|
||||||
|
return Response.ok().data(list);
|
||||||
|
}
|
||||||
|
// 新增机型参数常用
|
||||||
|
@PostMapping("/insertModelCommon")
|
||||||
|
public Response insertModelCommonParameter(
|
||||||
|
@Valid @RequestBody ModelCommonParameterForm form
|
||||||
|
) {
|
||||||
|
|
||||||
|
return Response.ok();
|
||||||
|
}
|
||||||
|
// 修改机型参数常用
|
||||||
|
@PostMapping("/updateModelCommon")
|
||||||
|
public Response updateModelCommonParameter(
|
||||||
|
@Valid @RequestBody ModelCommonParameterForm form
|
||||||
|
) {
|
||||||
|
|
||||||
|
return Response.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询数据分析常用
|
||||||
|
|
||||||
|
// 新增数据分析常用
|
||||||
|
|
||||||
|
// 修改数据分析常用
|
||||||
|
}
|
||||||
@ -78,6 +78,21 @@ public class TemplateApprovalController {
|
|||||||
return Response.ok();
|
return Response.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 撤回审批
|
||||||
|
@PostMapping("/handleReturn")
|
||||||
|
public Response handleReturn(
|
||||||
|
@RequestBody @Valid HandleApprovalRequest request,
|
||||||
|
BindingResult bindingResult
|
||||||
|
) {
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
bindingResult.getFieldErrors().forEach(error -> {
|
||||||
|
throw new CommonException(error.getDefaultMessage());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
templateApprovalService.handleReturn(request);
|
||||||
|
return Response.ok();
|
||||||
|
}
|
||||||
|
|
||||||
// 获取模板变动
|
// 获取模板变动
|
||||||
@GetMapping("/getTemplateChanges")
|
@GetMapping("/getTemplateChanges")
|
||||||
public Response getTemplateChanges(
|
public Response getTemplateChanges(
|
||||||
|
|||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.xdap.self_development.controller.form;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ModelCommonItem {
|
||||||
|
private String subsystem;
|
||||||
|
List<String> parameterId;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
package com.xdap.self_development.controller.form;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ModelCommonParameterForm {
|
||||||
|
private String userId;
|
||||||
|
private List<ModelCommonItem> subsystems;
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
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 com.definesys.mpaas.query.model.MpaasBasePojo;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@Table("yfsjglpt_analysis_common_parameters")
|
||||||
|
public class AnalysisCommonParameters extends MpaasBasePojo {
|
||||||
|
@RowID(sequence = "analysis_common_parameters_s", type = RowIDType.UUID)
|
||||||
|
private String id;
|
||||||
|
private String modelName;
|
||||||
|
private String plate;
|
||||||
|
private String platform;
|
||||||
|
private String series;
|
||||||
|
private String projectName;
|
||||||
|
private String projectNumber;
|
||||||
|
private String emission;
|
||||||
|
private String displacementMin;
|
||||||
|
private String displacementMax;
|
||||||
|
private String combustionType;
|
||||||
|
private String userId;
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
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 com.definesys.mpaas.query.model.MpaasBasePojo;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@Table("yfsjglpt_model_common_parameters")
|
||||||
|
public class ModelCommonParameters extends MpaasBasePojo {
|
||||||
|
@RowID(sequence = "model_common_parameters_s", type = RowIDType.UUID)
|
||||||
|
private String id;
|
||||||
|
private String subsystem;
|
||||||
|
private String parameterId;
|
||||||
|
private String userId;
|
||||||
|
}
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.xdap.self_development.service;
|
||||||
|
|
||||||
|
import com.xdap.self_development.controller.form.ModelCommonItem;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface CommonParameterService {
|
||||||
|
List<ModelCommonItem> getModelCommonParameter(@NotBlank String modelCommonId);
|
||||||
|
}
|
||||||
@ -15,4 +15,5 @@ public interface TemplateApprovalService {
|
|||||||
void handleApproval(HandleApprovalRequest request);
|
void handleApproval(HandleApprovalRequest request);
|
||||||
PageQueryResult<TemplateChangeView> getTemplateChanges(@Valid ApprovalAndParameterForm form);
|
PageQueryResult<TemplateChangeView> getTemplateChanges(@Valid ApprovalAndParameterForm form);
|
||||||
ApprovalFlowView getApprovalProcess(@Valid ApprovalFlowForm form);
|
ApprovalFlowView getApprovalProcess(@Valid ApprovalFlowForm form);
|
||||||
|
void handleReturn(@Valid HandleApprovalRequest request);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,26 @@
|
|||||||
|
package com.xdap.self_development.service.impl;
|
||||||
|
|
||||||
|
import com.xdap.self_development.config.BusinessDatabase;
|
||||||
|
import com.xdap.self_development.controller.form.ModelCommonItem;
|
||||||
|
import com.xdap.self_development.pojo.ModelCommonParameters;
|
||||||
|
import com.xdap.self_development.service.CommonParameterService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CommonParameterServiceImpl implements CommonParameterService {
|
||||||
|
@Resource
|
||||||
|
private BusinessDatabase bd;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ModelCommonItem> getModelCommonParameter(String modelCommonId) {
|
||||||
|
List<ModelCommonParameters> modelCommonParameters = bd.getBusinessDatabase()
|
||||||
|
.eq("id", modelCommonId)
|
||||||
|
.doQuery(ModelCommonParameters.class);
|
||||||
|
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -261,6 +261,23 @@ public class TemplateApprovalServiceImpl implements TemplateApprovalService {
|
|||||||
return approvalFlowView;
|
return approvalFlowView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleReturn(HandleApprovalRequest request) {
|
||||||
|
ApprovalFlow flow = bd.getBusinessDatabase()
|
||||||
|
.eq("id", request.getFlowId())
|
||||||
|
.doQueryFirst(ApprovalFlow.class);
|
||||||
|
if (!Objects.equals(flow.getCreateBy(), request.getUserId())) {
|
||||||
|
throw new CommonException("不是申请人无法撤回");
|
||||||
|
}
|
||||||
|
if ("RETURN".equals(request.getResult())) {
|
||||||
|
// 申请人撤回
|
||||||
|
cancelProcess(flow, "RETURNED");
|
||||||
|
} {
|
||||||
|
throw new CommonException("无法撤回");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private List<ApprovalNodeView> getNodeList(String flowId, String node) {
|
private List<ApprovalNodeView> getNodeList(String flowId, String node) {
|
||||||
List<ApprovalNodeView> list = bd.getBusinessDatabase()
|
List<ApprovalNodeView> list = bd.getBusinessDatabase()
|
||||||
.viewQueryMode(true)
|
.viewQueryMode(true)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
-- 新增机型参数常用参数表
|
-- 新增机型参数常用参数表
|
||||||
CREATE TABLE yfsjglpt_model_common_parameter (
|
CREATE TABLE yfsjglpt_model_common_parameters (
|
||||||
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID',
|
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID',
|
||||||
`subsystem` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '子系统',
|
`subsystem` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '子系统',
|
||||||
`parameter_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '参数ID',
|
`parameter_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '参数ID',
|
||||||
@ -9,7 +9,7 @@ CREATE TABLE yfsjglpt_model_common_parameter (
|
|||||||
|
|
||||||
|
|
||||||
-- 新增分析常用参数表
|
-- 新增分析常用参数表
|
||||||
CREATE TABLE yfsjglpt_analysis_common_parameter (
|
CREATE TABLE yfsjglpt_analysis_common_parameters (
|
||||||
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID',
|
`id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID',
|
||||||
`model_name` varchar(100) COLLATE utf8mb4_general_ci NOT NULL COMMENT '产品型号',
|
`model_name` varchar(100) COLLATE utf8mb4_general_ci NOT NULL COMMENT '产品型号',
|
||||||
`plate` varchar(100) COLLATE utf8mb4_general_ci NOT NULL COMMENT '板块',
|
`plate` varchar(100) COLLATE utf8mb4_general_ci NOT NULL COMMENT '板块',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user