feat:供应商管理
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
package com.zt.plat.module.qms.enums;
|
||||||
|
|
||||||
|
public interface QmsSupplierConstant {
|
||||||
|
|
||||||
|
String OPERATING_ITEMS_KEY = "operatingItems";
|
||||||
|
// 供应商属性资质key
|
||||||
|
String CERTIFICATION_KEY = "certification";
|
||||||
|
// 评价流程key
|
||||||
|
String EVALUATION_FLOW_KEY= "OFFICE_SUPPLIER_EVALUATION";
|
||||||
|
}
|
||||||
@@ -93,9 +93,9 @@ public class SupplierController extends AbstractFileUploadController implements
|
|||||||
@Operation(summary = "获得供应商")
|
@Operation(summary = "获得供应商")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('qms:supplier:query')")
|
@PreAuthorize("@ss.hasPermission('qms:supplier:query')")
|
||||||
public CommonResult<SupplierRespVO> getSupplier(@RequestParam("id") Long id) {
|
public CommonResult<SupplierExtendRespVO> getSupplier(@RequestParam("id") Long id) {
|
||||||
SupplierDO supplier = supplierService.getSupplier(id);
|
SupplierExtendRespVO supplier = supplierService.getSupplier(id);
|
||||||
return success(BeanUtils.toBean(supplier, SupplierRespVO.class));
|
return success(supplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.zt.plat.module.qms.office.supplier.controller.admin;
|
package com.zt.plat.module.qms.office.supplier.controller.admin;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainRespVO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainSaveReqVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO;
|
||||||
@@ -57,14 +59,14 @@ public class SupplierEvaluationController extends AbstractFileUploadController i
|
|||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建供应商评价")
|
@Operation(summary = "创建供应商评价")
|
||||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:create')")
|
// @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:create')")
|
||||||
public CommonResult<SupplierEvaluationRespVO> createSupplierEvaluation(@Valid @RequestBody SupplierEvaluationSaveReqVO createReqVO) {
|
public CommonResult<SupplierEvaluationRespVO> createSupplierEvaluation(@Valid @RequestBody SupplierEvaluationSaveReqVO createReqVO) {
|
||||||
return success(supplierEvaluationService.createSupplierEvaluation(createReqVO));
|
return success(supplierEvaluationService.createSupplierEvaluation(createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新供应商评价")
|
@Operation(summary = "更新供应商评价")
|
||||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:update')")
|
// @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:update')")
|
||||||
public CommonResult<Boolean> updateSupplierEvaluation(@Valid @RequestBody SupplierEvaluationSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateSupplierEvaluation(@Valid @RequestBody SupplierEvaluationSaveReqVO updateReqVO) {
|
||||||
supplierEvaluationService.updateSupplierEvaluation(updateReqVO);
|
supplierEvaluationService.updateSupplierEvaluation(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
@@ -73,7 +75,7 @@ public class SupplierEvaluationController extends AbstractFileUploadController i
|
|||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除供应商评价")
|
@Operation(summary = "删除供应商评价")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')")
|
// @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')")
|
||||||
public CommonResult<Boolean> deleteSupplierEvaluation(@RequestParam("id") Long id) {
|
public CommonResult<Boolean> deleteSupplierEvaluation(@RequestParam("id") Long id) {
|
||||||
supplierEvaluationService.deleteSupplierEvaluation(id);
|
supplierEvaluationService.deleteSupplierEvaluation(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
@@ -82,7 +84,7 @@ public class SupplierEvaluationController extends AbstractFileUploadController i
|
|||||||
@DeleteMapping("/delete-list")
|
@DeleteMapping("/delete-list")
|
||||||
@Parameter(name = "ids", description = "编号", required = true)
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
@Operation(summary = "批量删除供应商评价")
|
@Operation(summary = "批量删除供应商评价")
|
||||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')")
|
// @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:delete')")
|
||||||
public CommonResult<Boolean> deleteSupplierEvaluationList(@RequestBody BatchDeleteReqVO req) {
|
public CommonResult<Boolean> deleteSupplierEvaluationList(@RequestBody BatchDeleteReqVO req) {
|
||||||
supplierEvaluationService.deleteSupplierEvaluationListByIds(req.getIds());
|
supplierEvaluationService.deleteSupplierEvaluationListByIds(req.getIds());
|
||||||
return success(true);
|
return success(true);
|
||||||
@@ -91,7 +93,7 @@ public class SupplierEvaluationController extends AbstractFileUploadController i
|
|||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得供应商评价")
|
@Operation(summary = "获得供应商评价")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')")
|
// @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')")
|
||||||
public CommonResult<SupplierEvaluationRespVO> getSupplierEvaluation(@RequestParam("id") Long id) {
|
public CommonResult<SupplierEvaluationRespVO> getSupplierEvaluation(@RequestParam("id") Long id) {
|
||||||
SupplierEvaluationDO supplierEvaluation = supplierEvaluationService.getSupplierEvaluation(id);
|
SupplierEvaluationDO supplierEvaluation = supplierEvaluationService.getSupplierEvaluation(id);
|
||||||
return success(BeanUtils.toBean(supplierEvaluation, SupplierEvaluationRespVO.class));
|
return success(BeanUtils.toBean(supplierEvaluation, SupplierEvaluationRespVO.class));
|
||||||
@@ -99,10 +101,16 @@ public class SupplierEvaluationController extends AbstractFileUploadController i
|
|||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得供应商评价分页")
|
@Operation(summary = "获得供应商评价分页")
|
||||||
@PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')")
|
// @PreAuthorize("@ss.hasPermission('qms:supplier-evaluation:query')")
|
||||||
public CommonResult<PageResult<SupplierEvaluationRespVO>> getSupplierEvaluationPage(@Valid SupplierEvaluationPageReqVO pageReqVO) {
|
public CommonResult<PageResult<SupplierEvaluationRespVO>> getSupplierEvaluationPage(@Valid SupplierEvaluationPageReqVO pageReqVO) {
|
||||||
PageResult<SupplierEvaluationDO> pageResult = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO);
|
PageResult<SupplierEvaluationRespVO> pageResult = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, SupplierEvaluationRespVO.class));
|
return success(pageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/createProcessInstance")
|
||||||
|
@Operation(summary = "发起流程")
|
||||||
|
public CommonResult<SupplierEvaluationRespVO> createProcessInstance(@Valid @RequestBody SupplierEvaluationSaveReqVO createReqVO) {
|
||||||
|
return supplierEvaluationService.createProcessInstance(createReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@@ -112,7 +120,7 @@ public class SupplierEvaluationController extends AbstractFileUploadController i
|
|||||||
public void exportSupplierEvaluationExcel(@Valid SupplierEvaluationPageReqVO pageReqVO,
|
public void exportSupplierEvaluationExcel(@Valid SupplierEvaluationPageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<SupplierEvaluationDO> list = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO).getList();
|
List<SupplierEvaluationRespVO> list = supplierEvaluationService.getSupplierEvaluationPage(pageReqVO).getList();
|
||||||
// 导出 Excel
|
// 导出 Excel
|
||||||
ExcelUtils.write(response, "供应商评价.xls", "数据", SupplierEvaluationRespVO.class,
|
ExcelUtils.write(response, "供应商评价.xls", "数据", SupplierEvaluationRespVO.class,
|
||||||
BeanUtils.toBean(list, SupplierEvaluationRespVO.class));
|
BeanUtils.toBean(list, SupplierEvaluationRespVO.class));
|
||||||
|
|||||||
@@ -57,14 +57,14 @@ public class SupplierPropertiesController extends AbstractFileUploadController i
|
|||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建供应商属性")
|
@Operation(summary = "创建供应商属性")
|
||||||
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:create')")
|
// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:create')")
|
||||||
public CommonResult<SupplierPropertiesRespVO> createSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO createReqVO) {
|
public CommonResult<SupplierPropertiesRespVO> createSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO createReqVO) {
|
||||||
return success(supplierPropertiesService.createSupplierProperties(createReqVO));
|
return success(supplierPropertiesService.createSupplierProperties(createReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新供应商属性")
|
@Operation(summary = "更新供应商属性")
|
||||||
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:update')")
|
// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:update')")
|
||||||
public CommonResult<Boolean> updateSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateSupplierProperties(@Valid @RequestBody SupplierPropertiesSaveReqVO updateReqVO) {
|
||||||
supplierPropertiesService.updateSupplierProperties(updateReqVO);
|
supplierPropertiesService.updateSupplierProperties(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
@@ -73,7 +73,7 @@ public class SupplierPropertiesController extends AbstractFileUploadController i
|
|||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除供应商属性")
|
@Operation(summary = "删除供应商属性")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:delete')")
|
// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:delete')")
|
||||||
public CommonResult<Boolean> deleteSupplierProperties(@RequestParam("id") Long id) {
|
public CommonResult<Boolean> deleteSupplierProperties(@RequestParam("id") Long id) {
|
||||||
supplierPropertiesService.deleteSupplierProperties(id);
|
supplierPropertiesService.deleteSupplierProperties(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
@@ -91,7 +91,7 @@ public class SupplierPropertiesController extends AbstractFileUploadController i
|
|||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得供应商属性")
|
@Operation(summary = "获得供应商属性")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')")
|
// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')")
|
||||||
public CommonResult<SupplierPropertiesRespVO> getSupplierProperties(@RequestParam("id") Long id) {
|
public CommonResult<SupplierPropertiesRespVO> getSupplierProperties(@RequestParam("id") Long id) {
|
||||||
SupplierPropertiesDO supplierProperties = supplierPropertiesService.getSupplierProperties(id);
|
SupplierPropertiesDO supplierProperties = supplierPropertiesService.getSupplierProperties(id);
|
||||||
return success(BeanUtils.toBean(supplierProperties, SupplierPropertiesRespVO.class));
|
return success(BeanUtils.toBean(supplierProperties, SupplierPropertiesRespVO.class));
|
||||||
@@ -99,7 +99,7 @@ public class SupplierPropertiesController extends AbstractFileUploadController i
|
|||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得供应商属性分页")
|
@Operation(summary = "获得供应商属性分页")
|
||||||
@PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')")
|
// @PreAuthorize("@ss.hasPermission('qms:supplier-properties:query')")
|
||||||
public CommonResult<PageResult<SupplierPropertiesRespVO>> getSupplierPropertiesPage(@Valid SupplierPropertiesPageReqVO pageReqVO) {
|
public CommonResult<PageResult<SupplierPropertiesRespVO>> getSupplierPropertiesPage(@Valid SupplierPropertiesPageReqVO pageReqVO) {
|
||||||
PageResult<SupplierPropertiesDO> pageResult = supplierPropertiesService.getSupplierPropertiesPage(pageReqVO);
|
PageResult<SupplierPropertiesDO> pageResult = supplierPropertiesService.getSupplierPropertiesPage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, SupplierPropertiesRespVO.class));
|
return success(BeanUtils.toBean(pageResult, SupplierPropertiesRespVO.class));
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import com.zt.plat.framework.common.pojo.PageParam;
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
@@ -50,4 +51,12 @@ public class SupplierEvaluationPageReqVO extends PageParam {
|
|||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime[] createTime;
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
//==============扩展字段===============
|
||||||
|
@Schema(description = "供应商名称")
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
|
@Schema(description = "审批签名")
|
||||||
|
private String signatureInfo;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
@@ -45,6 +46,7 @@ public class SupplierEvaluationRespVO {
|
|||||||
|
|
||||||
@Schema(description = "流程审批状态", example = "2")
|
@Schema(description = "流程审批状态", example = "2")
|
||||||
@ExcelProperty("流程审批状态")
|
@ExcelProperty("流程审批状态")
|
||||||
|
@Dict(dicCode = "flow_status")
|
||||||
private String flowStatus;
|
private String flowStatus;
|
||||||
|
|
||||||
@Schema(description = "流程实例id", example = "24931")
|
@Schema(description = "流程实例id", example = "24931")
|
||||||
@@ -63,4 +65,13 @@ public class SupplierEvaluationRespVO {
|
|||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
//==============扩展字段===============
|
||||||
|
@Schema(description = "供应商名称")
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
|
@Schema(description = "审批签名")
|
||||||
|
@ExcelProperty("审批签名")
|
||||||
|
private String signatureInfo;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
@@ -45,4 +46,7 @@ public class SupplierEvaluationSaveReqVO {
|
|||||||
@Schema(description = "备注")
|
@Schema(description = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "审批签名")
|
||||||
|
private String signatureInfo;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SupplierExtendRespVO extends SupplierRespVO {
|
||||||
|
|
||||||
|
private String certification;
|
||||||
|
|
||||||
|
public String getCertification() {
|
||||||
|
if (CollUtil.isNotEmpty(this.supplierPropertiesList)) {
|
||||||
|
return this.supplierPropertiesList.stream().map(m -> m.getSubitemCode()).collect(Collectors.joining("、"));
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<SupplierPropertiesDO> supplierPropertiesList;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -21,6 +21,12 @@ public class SupplierPageReqVO extends PageParam {
|
|||||||
@Schema(description = "类型", example = "1")
|
@Schema(description = "类型", example = "1")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "统一社会信用代码")
|
||||||
|
private String creditCode;
|
||||||
|
|
||||||
|
@Schema(description = "注册日期")
|
||||||
|
private LocalDateTime registerDate;
|
||||||
|
|
||||||
@Schema(description = "地址")
|
@Schema(description = "地址")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ public class SupplierPropertiesPageReqVO extends PageParam {
|
|||||||
@Schema(description = "名称", example = "王五")
|
@Schema(description = "名称", example = "王五")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "说明")
|
||||||
|
private String content;
|
||||||
|
|
||||||
@Schema(description = "有效期开始")
|
@Schema(description = "有效期开始")
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime[] startDate;
|
private LocalDateTime[] startDate;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.core.aspect.annotation.Dict;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
@@ -30,12 +31,17 @@ public class SupplierPropertiesRespVO {
|
|||||||
|
|
||||||
@Schema(description = "子业务编码")
|
@Schema(description = "子业务编码")
|
||||||
@ExcelProperty("子业务编码")
|
@ExcelProperty("子业务编码")
|
||||||
|
@Dict(dicCode = "")
|
||||||
private String subitemCode;
|
private String subitemCode;
|
||||||
|
|
||||||
@Schema(description = "名称", example = "王五")
|
@Schema(description = "名称", example = "王五")
|
||||||
@ExcelProperty("名称")
|
@ExcelProperty("名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "说明")
|
||||||
|
@ExcelProperty("说明")
|
||||||
|
private String content;
|
||||||
|
|
||||||
@Schema(description = "有效期开始")
|
@Schema(description = "有效期开始")
|
||||||
@ExcelProperty("有效期开始")
|
@ExcelProperty("有效期开始")
|
||||||
private LocalDateTime startDate;
|
private LocalDateTime startDate;
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ public class SupplierPropertiesSaveReqVO {
|
|||||||
@Schema(description = "名称", example = "王五")
|
@Schema(description = "名称", example = "王五")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "说明")
|
||||||
|
private String content;
|
||||||
|
|
||||||
@Schema(description = "有效期开始")
|
@Schema(description = "有效期开始")
|
||||||
private LocalDateTime startDate;
|
private LocalDateTime startDate;
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,14 @@ public class SupplierRespVO {
|
|||||||
@ExcelProperty("类型")
|
@ExcelProperty("类型")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "统一社会信用代码")
|
||||||
|
@ExcelProperty("统一社会信用代码")
|
||||||
|
private String creditCode;
|
||||||
|
|
||||||
|
@Schema(description = "注册日期")
|
||||||
|
@ExcelProperty("注册日期")
|
||||||
|
private LocalDateTime registerDate;
|
||||||
|
|
||||||
@Schema(description = "地址")
|
@Schema(description = "地址")
|
||||||
@ExcelProperty("地址")
|
@ExcelProperty("地址")
|
||||||
private String address;
|
private String address;
|
||||||
@@ -58,5 +66,4 @@ public class SupplierRespVO {
|
|||||||
@Schema(description = "创建时间")
|
@Schema(description = "创建时间")
|
||||||
@ExcelProperty("创建时间")
|
@ExcelProperty("创建时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
package com.zt.plat.module.qms.office.supplier.controller.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 供应商新增/修改 Request VO")
|
@Schema(description = "管理后台 - 供应商新增/修改 Request VO")
|
||||||
@Data
|
@Data
|
||||||
public class SupplierSaveReqVO {
|
public class SupplierSaveReqVO {
|
||||||
@@ -19,6 +22,12 @@ public class SupplierSaveReqVO {
|
|||||||
@Schema(description = "类型", example = "1")
|
@Schema(description = "类型", example = "1")
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "统一社会信用代码")
|
||||||
|
private String creditCode;
|
||||||
|
|
||||||
|
@Schema(description = "注册日期")
|
||||||
|
private LocalDateTime registerDate;
|
||||||
|
|
||||||
@Schema(description = "地址")
|
@Schema(description = "地址")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package com.zt.plat.module.qms.office.supplier.dal.dataobject;
|
|||||||
import lombok.*;
|
import lombok.*;
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应商 DO
|
* 供应商 DO
|
||||||
*
|
*
|
||||||
@@ -44,6 +47,16 @@ public class SupplierDO extends BusinessBaseDO {
|
|||||||
@TableField("TP")
|
@TableField("TP")
|
||||||
private String type;
|
private String type;
|
||||||
/**
|
/**
|
||||||
|
* 统一社会信用代码
|
||||||
|
*/
|
||||||
|
@TableField("CRDT_CD")
|
||||||
|
private String creditCode;
|
||||||
|
/**
|
||||||
|
* 注册日期
|
||||||
|
*/
|
||||||
|
@TableField("REG_DT")
|
||||||
|
private LocalDateTime registerDate;
|
||||||
|
/**
|
||||||
* 地址
|
* 地址
|
||||||
*/
|
*/
|
||||||
@TableField("ADR")
|
@TableField("ADR")
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ public class SupplierEvaluationDO extends BusinessBaseDO {
|
|||||||
@TableField("FLW_INSC_ID")
|
@TableField("FLW_INSC_ID")
|
||||||
private String flowInstanceId;
|
private String flowInstanceId;
|
||||||
/**
|
/**
|
||||||
|
* 签名信息
|
||||||
|
*/
|
||||||
|
@TableField("SIG_INF")
|
||||||
|
private String signatureInfo;
|
||||||
|
/**
|
||||||
* 所属部门
|
* 所属部门
|
||||||
*/
|
*/
|
||||||
@TableField("SYS_DEPT_CD")
|
@TableField("SYS_DEPT_CD")
|
||||||
|
|||||||
@@ -57,6 +57,11 @@ public class SupplierPropertiesDO extends BusinessBaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableField("NAME")
|
@TableField("NAME")
|
||||||
private String name;
|
private String name;
|
||||||
|
/**
|
||||||
|
* 说明
|
||||||
|
*/
|
||||||
|
@TableField("CNTT")
|
||||||
|
private String content;
|
||||||
/**
|
/**
|
||||||
* 有效期开始
|
* 有效期开始
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package com.zt.plat.module.qms.office.supplier.dal.mapper;
|
|||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||||
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
|
||||||
|
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO;
|
||||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO;
|
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@@ -15,8 +18,11 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface SupplierEvaluationMapper extends BaseMapperX<SupplierEvaluationDO> {
|
public interface SupplierEvaluationMapper extends BaseMapperX<SupplierEvaluationDO> {
|
||||||
|
|
||||||
default PageResult<SupplierEvaluationDO> selectPage(SupplierEvaluationPageReqVO reqVO) {
|
default PageResult<SupplierEvaluationRespVO> selectPage(SupplierEvaluationPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<SupplierEvaluationDO>()
|
return selectJoinPage(reqVO,SupplierEvaluationRespVO.class, new MPJLambdaWrapperX<SupplierEvaluationDO>()
|
||||||
|
.leftJoin(SupplierDO.class,SupplierDO::getId, SupplierEvaluationDO::getSupplierId)
|
||||||
|
.selectAll(SupplierEvaluationDO.class)
|
||||||
|
.selectAs(SupplierDO::getName, SupplierEvaluationRespVO::getSupplierName)
|
||||||
.eqIfPresent(SupplierEvaluationDO::getSupplierId, reqVO.getSupplierId())
|
.eqIfPresent(SupplierEvaluationDO::getSupplierId, reqVO.getSupplierId())
|
||||||
.eqIfPresent(SupplierEvaluationDO::getFormId, reqVO.getFormId())
|
.eqIfPresent(SupplierEvaluationDO::getFormId, reqVO.getFormId())
|
||||||
.eqIfPresent(SupplierEvaluationDO::getContent, reqVO.getContent())
|
.eqIfPresent(SupplierEvaluationDO::getContent, reqVO.getContent())
|
||||||
@@ -29,7 +35,10 @@ public interface SupplierEvaluationMapper extends BaseMapperX<SupplierEvaluation
|
|||||||
.eqIfPresent(SupplierEvaluationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
.eqIfPresent(SupplierEvaluationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
.eqIfPresent(SupplierEvaluationDO::getRemark, reqVO.getRemark())
|
.eqIfPresent(SupplierEvaluationDO::getRemark, reqVO.getRemark())
|
||||||
.betweenIfPresent(SupplierEvaluationDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(SupplierEvaluationDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.likeIfPresent(SupplierDO::getName, reqVO.getSupplierName())
|
||||||
.orderByDesc(SupplierEvaluationDO::getId));
|
.orderByDesc(SupplierEvaluationDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,10 +3,16 @@ package com.zt.plat.module.qms.office.supplier.dal.mapper;
|
|||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||||
|
import com.zt.plat.module.qms.enums.QmsSupplierConstant;
|
||||||
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierExtendRespVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO;
|
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierDO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
|
||||||
|
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierPropertiesDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应商 Mapper
|
* 供应商 Mapper
|
||||||
*
|
*
|
||||||
@@ -21,6 +27,8 @@ public interface SupplierMapper extends BaseMapperX<SupplierDO> {
|
|||||||
.eqIfPresent(SupplierDO::getCode, reqVO.getCode())
|
.eqIfPresent(SupplierDO::getCode, reqVO.getCode())
|
||||||
.eqIfPresent(SupplierDO::getType, reqVO.getType())
|
.eqIfPresent(SupplierDO::getType, reqVO.getType())
|
||||||
.eqIfPresent(SupplierDO::getAddress, reqVO.getAddress())
|
.eqIfPresent(SupplierDO::getAddress, reqVO.getAddress())
|
||||||
|
.eqIfPresent(SupplierDO::getCreditCode, reqVO.getCreditCode())
|
||||||
|
.eqIfPresent(SupplierDO::getRegisterDate, reqVO.getRegisterDate())
|
||||||
.eqIfPresent(SupplierDO::getContact, reqVO.getContact())
|
.eqIfPresent(SupplierDO::getContact, reqVO.getContact())
|
||||||
.eqIfPresent(SupplierDO::getMobile, reqVO.getMobile())
|
.eqIfPresent(SupplierDO::getMobile, reqVO.getMobile())
|
||||||
.eqIfPresent(SupplierDO::getBusinessScope, reqVO.getBusinessScope())
|
.eqIfPresent(SupplierDO::getBusinessScope, reqVO.getBusinessScope())
|
||||||
@@ -30,4 +38,16 @@ public interface SupplierMapper extends BaseMapperX<SupplierDO> {
|
|||||||
.orderByDesc(SupplierDO::getId));
|
.orderByDesc(SupplierDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
default SupplierExtendRespVO selectOneWithCertifications(Long id) {
|
||||||
|
return selectJoinOne(SupplierExtendRespVO.class,
|
||||||
|
new MPJLambdaWrapperX<SupplierDO>()
|
||||||
|
.selectAll(SupplierDO.class)
|
||||||
|
.selectCollection(SupplierPropertiesDO.class, SupplierExtendRespVO::getSupplierPropertiesList)
|
||||||
|
.leftJoin(SupplierPropertiesDO.class, SupplierPropertiesDO::getSupplierId, SupplierDO::getId)
|
||||||
|
.eq(SupplierDO::getId, id)
|
||||||
|
.eq(SupplierPropertiesDO::getBusinessType, QmsSupplierConstant.CERTIFICATION_KEY)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.qms.office.supplier.dal.mapper;
|
package com.zt.plat.module.qms.office.supplier.dal.mapper;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
@@ -22,6 +23,7 @@ public interface SupplierPropertiesMapper extends BaseMapperX<SupplierProperties
|
|||||||
.eqIfPresent(SupplierPropertiesDO::getBusinessCode, reqVO.getBusinessCode())
|
.eqIfPresent(SupplierPropertiesDO::getBusinessCode, reqVO.getBusinessCode())
|
||||||
.eqIfPresent(SupplierPropertiesDO::getSubitemCode, reqVO.getSubitemCode())
|
.eqIfPresent(SupplierPropertiesDO::getSubitemCode, reqVO.getSubitemCode())
|
||||||
.likeIfPresent(SupplierPropertiesDO::getName, reqVO.getName())
|
.likeIfPresent(SupplierPropertiesDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(SupplierPropertiesDO::getContent, reqVO.getContent())
|
||||||
.betweenIfPresent(SupplierPropertiesDO::getStartDate, reqVO.getStartDate())
|
.betweenIfPresent(SupplierPropertiesDO::getStartDate, reqVO.getStartDate())
|
||||||
.betweenIfPresent(SupplierPropertiesDO::getEndDate, reqVO.getEndDate())
|
.betweenIfPresent(SupplierPropertiesDO::getEndDate, reqVO.getEndDate())
|
||||||
.eqIfPresent(SupplierPropertiesDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
.eqIfPresent(SupplierPropertiesDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||||
@@ -29,5 +31,13 @@ public interface SupplierPropertiesMapper extends BaseMapperX<SupplierProperties
|
|||||||
.betweenIfPresent(SupplierPropertiesDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(SupplierPropertiesDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(SupplierPropertiesDO::getId));
|
.orderByDesc(SupplierPropertiesDO::getId));
|
||||||
}
|
}
|
||||||
|
default List<SupplierPropertiesDO> selectList(SupplierPropertiesPageReqVO reqVO) {
|
||||||
|
return selectList(new LambdaQueryWrapperX<SupplierPropertiesDO>()
|
||||||
|
.eqIfPresent(SupplierPropertiesDO::getSupplierId, reqVO.getSupplierId())
|
||||||
|
.eqIfPresent(SupplierPropertiesDO::getBusinessType, reqVO.getBusinessType())
|
||||||
|
.eqIfPresent(SupplierPropertiesDO::getBusinessCode, reqVO.getBusinessCode())
|
||||||
|
.eqIfPresent(SupplierPropertiesDO::getSubitemCode, reqVO.getSubitemCode())
|
||||||
|
.orderByDesc(SupplierPropertiesDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,9 @@ package com.zt.plat.module.qms.office.supplier.service;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainRespVO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainSaveReqVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO;
|
||||||
@@ -59,6 +62,9 @@ public interface SupplierEvaluationService {
|
|||||||
* @param pageReqVO 分页查询
|
* @param pageReqVO 分页查询
|
||||||
* @return 供应商评价分页
|
* @return 供应商评价分页
|
||||||
*/
|
*/
|
||||||
PageResult<SupplierEvaluationDO> getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO);
|
PageResult<SupplierEvaluationRespVO> getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
|
||||||
|
//发起流程
|
||||||
|
CommonResult<SupplierEvaluationRespVO> createProcessInstance(SupplierEvaluationSaveReqVO entity);
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,37 @@
|
|||||||
package com.zt.plat.module.qms.office.supplier.service;
|
package com.zt.plat.module.qms.office.supplier.service;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.security.core.LoginUser;
|
||||||
|
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
|
import com.zt.plat.module.bpm.api.task.BpmTaskApi;
|
||||||
|
import com.zt.plat.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import com.zt.plat.module.bpm.api.task.dto.BpmTaskApproveReqDTO;
|
||||||
|
import com.zt.plat.module.bpm.api.task.dto.BpmTaskRespDTO;
|
||||||
|
import com.zt.plat.module.qms.api.task.BMPCallbackInterface;
|
||||||
|
import com.zt.plat.module.qms.api.task.dto.QmsBpmDTO;
|
||||||
|
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigUserSignatureDO;
|
||||||
|
import com.zt.plat.module.qms.business.config.service.ConfigUserSignatureService;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentMainRespVO;
|
||||||
|
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
|
||||||
|
import com.zt.plat.module.qms.common.data.service.DataKeyCheckService;
|
||||||
|
import com.zt.plat.module.qms.enums.QmsBpmConstant;
|
||||||
|
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||||
|
import com.zt.plat.module.qms.enums.QmsSupplierConstant;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationPageReqVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationRespVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierEvaluationSaveReqVO;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.util.ObjectUtils;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO;
|
import com.zt.plat.module.qms.office.supplier.dal.dataobject.SupplierEvaluationDO;
|
||||||
@@ -17,25 +41,32 @@ import com.zt.plat.framework.common.util.object.BeanUtils;
|
|||||||
import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierEvaluationMapper;
|
import com.zt.plat.module.qms.office.supplier.dal.mapper.SupplierEvaluationMapper;
|
||||||
|
|
||||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||||
|
import static com.zt.plat.module.qms.enums.QmsBpmConstant.BPM_CALLBACK_BEAN_NAME;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 供应商评价 Service 实现类
|
* 供应商评价 Service 实现类
|
||||||
*
|
*
|
||||||
* @author 后台管理
|
* @author 后台管理
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service("supplierEvaluationService")
|
||||||
@Validated
|
@Validated
|
||||||
public class SupplierEvaluationServiceImpl implements SupplierEvaluationService {
|
public class SupplierEvaluationServiceImpl implements SupplierEvaluationService, BMPCallbackInterface {
|
||||||
|
|
||||||
@Resource
|
@Resource private SupplierEvaluationMapper supplierEvaluationMapper;
|
||||||
private SupplierEvaluationMapper supplierEvaluationMapper;
|
@Resource private BpmProcessInstanceApi bpmProcessInstanceApi;
|
||||||
|
@Resource private BpmTaskApi bpmTaskApi;
|
||||||
|
@Resource private ConfigUserSignatureService configUserSignatureService;
|
||||||
|
@Resource private DataKeyCheckService dataKeyCheckService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SupplierEvaluationRespVO createSupplierEvaluation(SupplierEvaluationSaveReqVO createReqVO) {
|
public SupplierEvaluationRespVO createSupplierEvaluation(SupplierEvaluationSaveReqVO createReqVO) {
|
||||||
|
|
||||||
// 插入
|
// 插入
|
||||||
SupplierEvaluationDO supplierEvaluation = BeanUtils.toBean(createReqVO, SupplierEvaluationDO.class);
|
SupplierEvaluationDO supplierEvaluation = BeanUtils.toBean(createReqVO, SupplierEvaluationDO.class);
|
||||||
|
supplierEvaluation.setFlowStatus(QmsCommonConstant.NOT_START);
|
||||||
supplierEvaluationMapper.insert(supplierEvaluation);
|
supplierEvaluationMapper.insert(supplierEvaluation);
|
||||||
// 返回
|
// 返回
|
||||||
return BeanUtils.toBean(supplierEvaluation, SupplierEvaluationRespVO.class);
|
return BeanUtils.toBean(supplierEvaluation, SupplierEvaluationRespVO.class);
|
||||||
@@ -85,8 +116,166 @@ public class SupplierEvaluationServiceImpl implements SupplierEvaluationService
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<SupplierEvaluationDO> getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO) {
|
public PageResult<SupplierEvaluationRespVO> getSupplierEvaluationPage(SupplierEvaluationPageReqVO pageReqVO) {
|
||||||
return supplierEvaluationMapper.selectPage(pageReqVO);
|
return supplierEvaluationMapper.selectPage(pageReqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<SupplierEvaluationRespVO> createProcessInstance(SupplierEvaluationSaveReqVO param) {
|
||||||
|
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
//当前登录用户昵称
|
||||||
|
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||||
|
Long id = param.getId();
|
||||||
|
SupplierEvaluationDO entity = getSupplierEvaluation(id);
|
||||||
|
String flowInsId = entity.getFlowInstanceId();
|
||||||
|
|
||||||
|
if(!ObjectUtils.isEmpty(flowInsId)){
|
||||||
|
CommonResult<List<BpmTaskRespDTO>> taskRet = bpmTaskApi.getTaskListByProcessInstanceId(flowInsId);
|
||||||
|
List<BpmTaskRespDTO> taskList = taskRet.getData();
|
||||||
|
if(taskList.isEmpty())
|
||||||
|
throw exception0(ERROR_CODE_MODULE_COMMON, "流程任务查询失败,请联系管理员处理");
|
||||||
|
String taskId = taskList.get(taskList.size() - 1).getId();
|
||||||
|
//驳回后重新提交
|
||||||
|
BpmTaskApproveReqDTO reqVO = new BpmTaskApproveReqDTO();
|
||||||
|
reqVO.setId(taskId);
|
||||||
|
CommonResult<Boolean> result = bpmProcessInstanceApi.approveTask(reqVO);
|
||||||
|
if(!result.isSuccess()){
|
||||||
|
throw exception0(ERROR_CODE_MODULE_COMMON, result.getMsg());
|
||||||
|
}
|
||||||
|
entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS);
|
||||||
|
//todo 生成报告编号 documentCode
|
||||||
|
supplierEvaluationMapper.updateById(entity);
|
||||||
|
SupplierEvaluationRespVO respVO = BeanUtils.toBean(entity, SupplierEvaluationRespVO.class);
|
||||||
|
return CommonResult.success(respVO);
|
||||||
|
}
|
||||||
|
JSONObject formData = new JSONObject();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
|
||||||
|
formData.put("mainId", id);
|
||||||
|
formData.put("applyUser", nickName);
|
||||||
|
formData.put("applyUserId", loginUser.getId());
|
||||||
|
formData.put("applyDepartment", loginUser.getVisitDeptName());
|
||||||
|
formData.put("applyDepartmentId", loginUser.getVisitDeptId());
|
||||||
|
formData.put("applyTime", sdf.format(new Date()));
|
||||||
|
Map<String, Object> variables = formData.toJavaObject(Map.class);
|
||||||
|
variables.put(BPM_CALLBACK_BEAN_NAME, "supplierEvaluationService"); //流程回调时使用的service
|
||||||
|
BpmProcessInstanceCreateReqDTO reqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
|
reqDTO.setBusinessKey(String.valueOf(id));
|
||||||
|
reqDTO.setProcessDefinitionKey(QmsSupplierConstant.EVALUATION_FLOW_KEY);
|
||||||
|
reqDTO.setVariables(variables);
|
||||||
|
CommonResult<String> result = bpmProcessInstanceApi.createProcessInstance(loginUser.getId(), reqDTO);
|
||||||
|
if(!result.isSuccess()){
|
||||||
|
throw exception0(ERROR_CODE_MODULE_COMMON, result.getMsg());
|
||||||
|
}
|
||||||
|
String wfInsId = result.getData();
|
||||||
|
entity.setFlowInstanceId(wfInsId);
|
||||||
|
entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS);
|
||||||
|
entity.setEvaluationDate(LocalDateTime.now());
|
||||||
|
entity.setEvaluator(nickName);
|
||||||
|
supplierEvaluationMapper.updateById(entity);
|
||||||
|
SupplierEvaluationRespVO respVO = BeanUtils.toBean(entity, SupplierEvaluationRespVO.class);
|
||||||
|
return CommonResult.success(respVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<JSONObject> callback(QmsBpmDTO reqDTO) {
|
||||||
|
|
||||||
|
JSONObject variables = reqDTO.getVariables();
|
||||||
|
String processInsId = variables.getString(QmsBpmConstant.BPM_PROCESS_INS_ID);
|
||||||
|
String currentActivityInsId = variables.getString(QmsBpmConstant.BPM_CUR_ACTIVITY_INS_ID);
|
||||||
|
String returnFlag = variables.getString(QmsBpmConstant.BPM_REJECT_TO_FIRST_FLAG); //退回标识。在任务监听中设置
|
||||||
|
//同一个节点实例只触发一次
|
||||||
|
String checkKey = currentActivityInsId;
|
||||||
|
if(ObjectUtils.isEmpty(currentActivityInsId))
|
||||||
|
checkKey = processInsId + "-create";
|
||||||
|
if("1".equals(returnFlag))
|
||||||
|
checkKey += "-reject";
|
||||||
|
try{
|
||||||
|
dataKeyCheckService.create(checkKey, this.getClass().getName());
|
||||||
|
}catch (Exception e){
|
||||||
|
// e.printStackTrace();
|
||||||
|
|
||||||
|
return CommonResult.success(new JSONObject());
|
||||||
|
}
|
||||||
|
//流程状态 1-提交(含退回) 4-取消流程
|
||||||
|
String PROCESS_STATUS = variables.getString(QmsBpmConstant.PROCESS_INSTANCE_VARIABLE_STATUS);
|
||||||
|
String mainId = variables.getString("mainId");
|
||||||
|
JSONArray fieldExtensions = new JSONArray();
|
||||||
|
if(variables.containsKey(QmsBpmConstant.BPM_FIELD_EXTENSIONS)){
|
||||||
|
fieldExtensions = variables.getJSONArray(QmsBpmConstant.BPM_FIELD_EXTENSIONS);
|
||||||
|
}
|
||||||
|
SupplierEvaluationDO entity = getSupplierEvaluation(Long.valueOf(mainId));
|
||||||
|
|
||||||
|
String currentActivityId = variables.getString(QmsBpmConstant.BPM_CALLBACK_ACTIVITY_ID);
|
||||||
|
|
||||||
|
//判断是否最后一个节点
|
||||||
|
String lastActivityFlag = "0";
|
||||||
|
String firstActivityFlag = "0";
|
||||||
|
if(!fieldExtensions.isEmpty()){
|
||||||
|
for(int i = 0; i < fieldExtensions.size(); i++){
|
||||||
|
JSONObject fieldExtension = fieldExtensions.getJSONObject(i);
|
||||||
|
if(fieldExtension.getString("fieldName").equalsIgnoreCase(QmsBpmConstant.BPM_LAST_ACTIVITY_FLAG)){
|
||||||
|
lastActivityFlag = "1";
|
||||||
|
}
|
||||||
|
if(fieldExtension.getString("fieldName").equalsIgnoreCase(QmsBpmConstant.BPM_FIRST_ACTIVITY_FLAG)){
|
||||||
|
firstActivityFlag = "1";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//"RETURN_FLAG_Activity_001": true 标识驳回到发起环节
|
||||||
|
if(("1").equals(returnFlag)){
|
||||||
|
//驳回。流程需要配置退回到发起节点
|
||||||
|
entity.setFlowStatus(QmsCommonConstant.REJECTED);
|
||||||
|
entity.setSignatureInfo("");
|
||||||
|
}else if("4".equals(PROCESS_STATUS)){
|
||||||
|
//作废
|
||||||
|
entity.setFlowStatus(QmsCommonConstant.VOID);
|
||||||
|
entity.setSignatureInfo("");
|
||||||
|
}else if("1".equals(PROCESS_STATUS)){
|
||||||
|
//通过
|
||||||
|
assembleSignature(currentActivityId, entity);
|
||||||
|
if("1".equals(firstActivityFlag))
|
||||||
|
entity.setFlowStatus(QmsCommonConstant.IN_PROGRESS); //驳回后重新提交
|
||||||
|
if("1".equals(lastActivityFlag))
|
||||||
|
entity.setFlowStatus(QmsCommonConstant.COMPLETED); //结束审批
|
||||||
|
}
|
||||||
|
|
||||||
|
supplierEvaluationMapper.updateById(entity);
|
||||||
|
|
||||||
|
// try {
|
||||||
|
// reportDocumentAssistService.updateDocFileAndCreateIWorkflow( variables, entity);
|
||||||
|
// } catch (IOException e) {
|
||||||
|
// throw new RuntimeException(e);
|
||||||
|
// }
|
||||||
|
|
||||||
|
JSONObject ret = new JSONObject();
|
||||||
|
return CommonResult.success(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void assembleSignature(String currentActivityId, SupplierEvaluationDO entity){
|
||||||
|
if(ObjectUtils.isEmpty(currentActivityId) || "null".equals(currentActivityId))
|
||||||
|
return;
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
String sign = entity.getSignatureInfo();
|
||||||
|
JSONObject signObj = new JSONObject();
|
||||||
|
if(!ObjectUtils.isEmpty( sign))
|
||||||
|
signObj = JSONObject.parseObject(sign);
|
||||||
|
if(signObj.containsKey(currentActivityId))
|
||||||
|
return;
|
||||||
|
JSONObject obj = new JSONObject();
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
Long userId = loginUser.getId();
|
||||||
|
//当前登录用户昵称
|
||||||
|
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||||
|
ConfigUserSignatureDO configUserSignatureDO = configUserSignatureService.getByUserId(userId);
|
||||||
|
obj.put("signatureId", "");
|
||||||
|
if(configUserSignatureDO != null)
|
||||||
|
obj.put("signatureId", configUserSignatureDO.getId());
|
||||||
|
obj.put("userId", userId);
|
||||||
|
obj.put("userName", nickName);
|
||||||
|
obj.put("signTime", sdf.format(new Date()));
|
||||||
|
signObj.put(currentActivityId, obj);
|
||||||
|
entity.setSignatureInfo(signObj.toJSONString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.qms.office.supplier.service;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierExtendRespVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO;
|
||||||
@@ -51,7 +52,7 @@ public interface SupplierService {
|
|||||||
* @param id 编号
|
* @param id 编号
|
||||||
* @return 供应商
|
* @return 供应商
|
||||||
*/
|
*/
|
||||||
SupplierDO getSupplier(Long id);
|
SupplierExtendRespVO getSupplier(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得供应商分页
|
* 获得供应商分页
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.zt.plat.module.qms.office.supplier.service;
|
package com.zt.plat.module.qms.office.supplier.service;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierExtendRespVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierPageReqVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierRespVO;
|
||||||
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO;
|
import com.zt.plat.module.qms.office.supplier.controller.vo.SupplierSaveReqVO;
|
||||||
@@ -80,8 +81,8 @@ public class SupplierServiceImpl implements SupplierService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SupplierDO getSupplier(Long id) {
|
public SupplierExtendRespVO getSupplier(Long id) {
|
||||||
return supplierMapper.selectById(id);
|
return supplierMapper.selectOneWithCertifications(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user