修改:填写人和对标报告修改
This commit is contained in:
parent
248074d3f3
commit
a90836ffe0
@ -24,6 +24,6 @@ public class BusinessDatabase {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public MpaasQuery getTCDatabase() {
|
public MpaasQuery getTCDatabase() {
|
||||||
return queryFactory.buildFromDatasource("yc_lrs_test_relsult");
|
return queryFactory.buildFromDatasource(DatasourceConstant.XDAP_MYSQL_PREFIX + tenantId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,8 +51,14 @@ public class BenchmarkingReportController {
|
|||||||
// 发起审批
|
// 发起审批
|
||||||
@PostMapping("/startReportApproval")
|
@PostMapping("/startReportApproval")
|
||||||
public Response startReportApproval(
|
public Response startReportApproval(
|
||||||
@Valid @RequestBody ApprovalPersonForm form
|
@Valid @RequestBody ApprovalPersonForm form,
|
||||||
|
BindingResult bindingResult
|
||||||
) {
|
) {
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
bindingResult.getFieldErrors().forEach(error -> {
|
||||||
|
throw new CommonException(error.getDefaultMessage());
|
||||||
|
});
|
||||||
|
}
|
||||||
benchmarkingReportService.startReportApproval(form);
|
benchmarkingReportService.startReportApproval(form);
|
||||||
return Response.ok().setMessage("保存成功");
|
return Response.ok().setMessage("保存成功");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,10 +5,7 @@ import com.definesys.mpaas.query.db.PageQueryResult;
|
|||||||
import com.xdap.api.moudle.department.pojo.entity.XdapDepartments;
|
import com.xdap.api.moudle.department.pojo.entity.XdapDepartments;
|
||||||
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
import com.xdap.runtime.service.RuntimeDatasourceService;
|
import com.xdap.runtime.service.RuntimeDatasourceService;
|
||||||
import com.xdap.self_development.controller.form.DepartmentUserForm;
|
import com.xdap.self_development.controller.form.*;
|
||||||
import com.xdap.self_development.controller.form.DeptResponsiblePageForm;
|
|
||||||
import com.xdap.self_development.controller.form.ResponsiblePersonForm;
|
|
||||||
import com.xdap.self_development.controller.form.UpdateResponsiblePersonForm;
|
|
||||||
import com.xdap.self_development.exception.CommonException;
|
import com.xdap.self_development.exception.CommonException;
|
||||||
import com.xdap.self_development.pojo.ResponsiblePerson;
|
import com.xdap.self_development.pojo.ResponsiblePerson;
|
||||||
import com.xdap.self_development.pojo.view.DepartmentUserView;
|
import com.xdap.self_development.pojo.view.DepartmentUserView;
|
||||||
@ -134,7 +131,7 @@ public class ResponsiblePersonController {
|
|||||||
// 保存部门填写人
|
// 保存部门填写人
|
||||||
@PostMapping("/saveFilledPerson")
|
@PostMapping("/saveFilledPerson")
|
||||||
public Response saveFilledPerson(
|
public Response saveFilledPerson(
|
||||||
@Valid @RequestBody ResponsiblePersonForm form,
|
@Valid @RequestBody FilledPersonForm form,
|
||||||
BindingResult bindingResult
|
BindingResult bindingResult
|
||||||
) {
|
) {
|
||||||
if (bindingResult.hasErrors()) {
|
if (bindingResult.hasErrors()) {
|
||||||
@ -162,6 +159,22 @@ public class ResponsiblePersonController {
|
|||||||
return Response.ok().setMessage("添加成功");
|
return Response.ok().setMessage("添加成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 修改部门填写人
|
||||||
|
@PostMapping("/updateFilledPerson")
|
||||||
|
public Response updateFilledPerson(
|
||||||
|
@Valid @RequestBody UpdateFilledPersonForm form,
|
||||||
|
BindingResult bindingResult
|
||||||
|
) {
|
||||||
|
if (bindingResult.hasErrors()) {
|
||||||
|
bindingResult.getFieldErrors().forEach(error -> {
|
||||||
|
throw new CommonException(error.getDefaultMessage());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
responsiblePersonService.updateFilledPerson(form);
|
||||||
|
return Response.ok().setMessage("添加成功");
|
||||||
|
}
|
||||||
|
|
||||||
// 删除部门责任人
|
// 删除部门责任人
|
||||||
@GetMapping("/deleteResponsiblePerson")
|
@GetMapping("/deleteResponsiblePerson")
|
||||||
public Response deleteResponsiblePerson(
|
public Response deleteResponsiblePerson(
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.xdap.self_development.controller.form;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FilledPersonForm {
|
||||||
|
@NotBlank(message = "部门不能为空")
|
||||||
|
private String departmentId;
|
||||||
|
@NotBlank(message = "用户不能为空")
|
||||||
|
private String userId;
|
||||||
|
@NotBlank(message = "部门名不能为空")
|
||||||
|
private String department;
|
||||||
|
@NotBlank(message = "子系统不能为空")
|
||||||
|
private String subsystem;
|
||||||
|
@NotBlank(message = "零部件名不能为空")
|
||||||
|
private String partsName;
|
||||||
|
}
|
||||||
@ -12,6 +12,6 @@ public class ResponsiblePersonForm {
|
|||||||
private String userId;
|
private String userId;
|
||||||
@NotBlank(message = "部门名不能为空")
|
@NotBlank(message = "部门名不能为空")
|
||||||
private String department;
|
private String department;
|
||||||
@NotBlank(message = "子部门不能为空")
|
@NotBlank(message = "子系统不能为空")
|
||||||
private String subsystem;
|
private String subsystem;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,21 @@
|
|||||||
|
package com.xdap.self_development.controller.form;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class UpdateFilledPersonForm {
|
||||||
|
@NotBlank
|
||||||
|
private String rowId;
|
||||||
|
@NotBlank(message = "部门不能为空")
|
||||||
|
private String departmentId;
|
||||||
|
@NotBlank(message = "用户不能为空")
|
||||||
|
private String userId;
|
||||||
|
@NotBlank(message = "部门名不能为空")
|
||||||
|
private String department;
|
||||||
|
@NotBlank(message = "子系统不能为空")
|
||||||
|
private String subsystem;
|
||||||
|
@NotBlank(message = "零部件名不能为空")
|
||||||
|
private String partsName;
|
||||||
|
}
|
||||||
@ -35,9 +35,6 @@ public class BenchmarkingReport extends MpaasBasePojo {
|
|||||||
private String projectName;
|
private String projectName;
|
||||||
private String projectNumber;
|
private String projectNumber;
|
||||||
|
|
||||||
private String subsystem;
|
|
||||||
private String partsName;
|
|
||||||
|
|
||||||
private String createBy;
|
private String createBy;
|
||||||
private Integer isDelete;
|
private Integer isDelete;
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
|||||||
@ -19,6 +19,7 @@ public class ResponsiblePerson extends MpaasBasePojo {
|
|||||||
private String userId;
|
private String userId;
|
||||||
private String department;
|
private String department;
|
||||||
private String subsystem;
|
private String subsystem;
|
||||||
|
private String partsName;
|
||||||
private Integer personLevel;
|
private Integer personLevel;
|
||||||
|
|
||||||
@Column(type = ColumnType.CALCULATE)
|
@Column(type = ColumnType.CALCULATE)
|
||||||
|
|||||||
@ -2,9 +2,7 @@ package com.xdap.self_development.service;
|
|||||||
|
|
||||||
import com.definesys.mpaas.query.db.PageQueryResult;
|
import com.definesys.mpaas.query.db.PageQueryResult;
|
||||||
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
import com.xdap.self_development.controller.form.DeptResponsiblePageForm;
|
import com.xdap.self_development.controller.form.*;
|
||||||
import com.xdap.self_development.controller.form.ResponsiblePersonForm;
|
|
||||||
import com.xdap.self_development.controller.form.UpdateResponsiblePersonForm;
|
|
||||||
import com.xdap.self_development.pojo.ResponsiblePerson;
|
import com.xdap.self_development.pojo.ResponsiblePerson;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
@ -15,10 +13,12 @@ import java.util.Set;
|
|||||||
public interface ResponsiblePersonService {
|
public interface ResponsiblePersonService {
|
||||||
void saveResponsiblePerson(@Valid ResponsiblePersonForm form);
|
void saveResponsiblePerson(@Valid ResponsiblePersonForm form);
|
||||||
|
|
||||||
void saveFilledPerson(@Valid ResponsiblePersonForm form);
|
void saveFilledPerson(@Valid FilledPersonForm form);
|
||||||
|
|
||||||
void updateResponsiblePerson(@Valid UpdateResponsiblePersonForm form);
|
void updateResponsiblePerson(@Valid UpdateResponsiblePersonForm form);
|
||||||
|
|
||||||
|
void updateFilledPerson(@Valid UpdateFilledPersonForm form);
|
||||||
|
|
||||||
void deleteResponsiblePerson(@NotBlank String rowId);
|
void deleteResponsiblePerson(@NotBlank String rowId);
|
||||||
|
|
||||||
PageQueryResult<ResponsiblePerson> getDeptResponsible(@Valid DeptResponsiblePageForm form);
|
PageQueryResult<ResponsiblePerson> getDeptResponsible(@Valid DeptResponsiblePageForm form);
|
||||||
|
|||||||
@ -4,13 +4,10 @@ import com.definesys.mpaas.query.db.PageQueryResult;
|
|||||||
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
import com.xdap.api.moudle.user.pojo.XdapUsers;
|
||||||
import com.xdap.runtime.service.RuntimeDatasourceService;
|
import com.xdap.runtime.service.RuntimeDatasourceService;
|
||||||
import com.xdap.self_development.config.BusinessDatabase;
|
import com.xdap.self_development.config.BusinessDatabase;
|
||||||
import com.xdap.self_development.controller.form.DeptResponsiblePageForm;
|
import com.xdap.self_development.controller.form.*;
|
||||||
import com.xdap.self_development.controller.form.ResponsiblePersonForm;
|
|
||||||
import com.xdap.self_development.controller.form.UpdateResponsiblePersonForm;
|
|
||||||
import com.xdap.self_development.exception.CommonException;
|
import com.xdap.self_development.exception.CommonException;
|
||||||
import com.xdap.self_development.pojo.Parameter;
|
import com.xdap.self_development.pojo.Parameter;
|
||||||
import com.xdap.self_development.pojo.ResponsiblePerson;
|
import com.xdap.self_development.pojo.ResponsiblePerson;
|
||||||
import com.xdap.self_development.pojo.Template;
|
|
||||||
import com.xdap.self_development.service.ResponsiblePersonService;
|
import com.xdap.self_development.service.ResponsiblePersonService;
|
||||||
import com.xdap.self_development.service.XdapDeptUsersService;
|
import com.xdap.self_development.service.XdapDeptUsersService;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
@ -53,7 +50,7 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveFilledPerson(ResponsiblePersonForm form) {
|
public void saveFilledPerson(FilledPersonForm form) {
|
||||||
List<ResponsiblePerson> responsiblePeople = bd.getBusinessDatabase()
|
List<ResponsiblePerson> responsiblePeople = bd.getBusinessDatabase()
|
||||||
.eq("userId", form.getUserId())
|
.eq("userId", form.getUserId())
|
||||||
.eq("personLevel", 2)
|
.eq("personLevel", 2)
|
||||||
@ -68,6 +65,7 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
responsiblePerson.setDepartmentId(form.getDepartmentId());
|
responsiblePerson.setDepartmentId(form.getDepartmentId());
|
||||||
responsiblePerson.setUserId(form.getUserId());
|
responsiblePerson.setUserId(form.getUserId());
|
||||||
responsiblePerson.setSubsystem(form.getSubsystem());
|
responsiblePerson.setSubsystem(form.getSubsystem());
|
||||||
|
responsiblePerson.setPartsName(form.getPartsName());
|
||||||
responsiblePerson.setPersonLevel(2);
|
responsiblePerson.setPersonLevel(2);
|
||||||
bd.getBusinessDatabase().doInsert(responsiblePerson);
|
bd.getBusinessDatabase().doInsert(responsiblePerson);
|
||||||
}
|
}
|
||||||
@ -83,6 +81,18 @@ public class ResponsiblePersonServiceImpl implements ResponsiblePersonService {
|
|||||||
.doUpdate(ResponsiblePerson.class);
|
.doUpdate(ResponsiblePerson.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateFilledPerson(UpdateFilledPersonForm form) {
|
||||||
|
bd.getBusinessDatabase()
|
||||||
|
.rowid("id", form.getRowId())
|
||||||
|
.update("department_id", form.getDepartmentId())
|
||||||
|
.update("user_id", form.getUserId())
|
||||||
|
.update("department", form.getDepartment())
|
||||||
|
.update("subsystem", form.getSubsystem())
|
||||||
|
.update("parts_name", form.getPartsName())
|
||||||
|
.doUpdate(ResponsiblePerson.class);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void deleteResponsiblePerson(String rowId) {
|
public void deleteResponsiblePerson(String rowId) {
|
||||||
bd.getBusinessDatabase()
|
bd.getBusinessDatabase()
|
||||||
|
|||||||
@ -163,6 +163,7 @@ CREATE TABLE `yfsjglpt_model_responsible_person`
|
|||||||
`user_id` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '责任人id',
|
`user_id` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '责任人id',
|
||||||
`department` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门名',
|
`department` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '部门名',
|
||||||
`subsystem` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '子系统',
|
`subsystem` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '子系统',
|
||||||
|
`parts_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '零部件名称',
|
||||||
`person_level` int(11) NOT NULL DEFAULT '1' COMMENT '1:责任人;2:填写人',
|
`person_level` int(11) NOT NULL DEFAULT '1' COMMENT '1:责任人;2:填写人',
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE = InnoDB
|
) ENGINE = InnoDB
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user