【DAOP-1.0】数据需求
【功能点】新增接口
Showing
13 changed files
with
631 additions
and
296 deletions
| 1 | package com.csbr.qingcloud.domain.vo; | ||
| 2 | |||
| 3 | import csbr.cloud.entity.domain.base.dto.BasePageDTO; | ||
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | import lombok.EqualsAndHashCode; | ||
| 6 | import lombok.Data; | ||
| 7 | import java.math.BigDecimal; | ||
| 8 | import java.util.Date; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * @program: D:/csbr/sjzc/ms-data-circulation-portal-service | ||
| 12 | * @description: 查询参数 | ||
| 13 | * @author: xushaobo | ||
| 14 | * @create: 2024-12-30 16:29 | ||
| 15 | **/ | ||
| 16 | @EqualsAndHashCode(callSuper = true) | ||
| 17 | @Data | ||
| 18 | @Schema(title = "查询参数") | ||
| 19 | public class DemandQueryVO extends BasePageDTO { | ||
| 20 | |||
| 21 | } | 
| 1 | package com.csbr.qingcloud.mybatis.service; | ||
| 2 | |||
| 3 | import com.csbr.cloud.base.service.CsbrService; | ||
| 4 | import com.csbr.qingcloud.mybatis.entity.MfDemand; | ||
| 5 | |||
| 6 | /** | ||
| 7 | * @program: D:/csbr/sjzc/ms-data-circulation-portal-service | ||
| 8 | * @description: 逻辑层接口 | ||
| 9 | * @author: xushaobo | ||
| 10 | * @create: 2024-12-30 16:29 | ||
| 11 | **/ | ||
| 12 | public interface MfDemandService extends CsbrService<MfDemand> { | ||
| 13 | |||
| 14 | } | 
| 1 | package com.csbr.qingcloud.controller; | 1 | package com.csbr.qingcloud.portal.controller; | 
| 2 | 2 | ||
| 3 | import com.csbr.cloud.common.response.CommonRes; | 3 | import com.csbr.cloud.common.response.CommonRes; | 
| 4 | import csbr.cloud.entity.annotation.SystemLog; | 4 | import csbr.cloud.entity.annotation.SystemLog; | 
| 5 | import csbr.cloud.entity.domain.base.vo.PageListVO; | 5 | import csbr.cloud.entity.domain.base.vo.PageListVO; | 
| 6 | import com.csbr.qingcloud.domain.vo.DemandQueryVO; | 6 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | 
| 7 | import com.csbr.qingcloud.domain.vo.DemandRQVO; | 7 | import com.csbr.qingcloud.portal.domain.vo.DemandQueryVO; | 
| 8 | import com.csbr.qingcloud.domain.vo.DemandRSVO; | 8 | import com.csbr.qingcloud.portal.domain.vo.DemandRQVO; | 
| 9 | import com.csbr.qingcloud.service.DemandService; | 9 | import com.csbr.qingcloud.portal.domain.vo.DemandRSVO; | 
| 10 | import com.csbr.qingcloud.portal.service.DemandService; | ||
| 10 | import io.swagger.v3.oas.annotations.Operation; | 11 | import io.swagger.v3.oas.annotations.Operation; | 
| 11 | import io.swagger.v3.oas.annotations.Parameter; | 12 | import io.swagger.v3.oas.annotations.Parameter; | 
| 12 | import io.swagger.v3.oas.annotations.tags.Tag; | 13 | import io.swagger.v3.oas.annotations.tags.Tag; | 
| ... | @@ -17,14 +18,14 @@ import org.springframework.web.bind.annotation.*; | ... | @@ -17,14 +18,14 @@ import org.springframework.web.bind.annotation.*; | 
| 17 | import java.util.List; | 18 | import java.util.List; | 
| 18 | 19 | ||
| 19 | /** | 20 | /** | 
| 20 | * @program: D:/csbr/sjzc/ms-data-circulation-portal-service | 21 | * @program: D:/git/ms-data-circulation-portal-service | 
| 21 | * @description: -控制器 | 22 | * @description: 数据需求-控制器 | 
| 22 | * @author: xushaobo | 23 | * @author: xcq | 
| 23 | * @create: 2024-12-30 16:29 | 24 | * @create: 2024-12-31 18:46 | 
| 24 | **/ | 25 | **/ | 
| 25 | @RestController | 26 | @RestController | 
| 26 | @RequestMapping("/demand") | 27 | @RequestMapping("/demand") | 
| 27 | @Tag(name = "-控制器") | 28 | @Tag(name = "数据需求-控制器") | 
| 28 | public class DemandController { | 29 | public class DemandController { | 
| 29 | 30 | ||
| 30 | @Resource | 31 | @Resource | 
| ... | @@ -33,49 +34,57 @@ public class DemandController { | ... | @@ -33,49 +34,57 @@ public class DemandController { | 
| 33 | //region 基本操作 | 34 | //region 基本操作 | 
| 34 | 35 | ||
| 35 | @PostMapping("/save") | 36 | @PostMapping("/save") | 
| 36 | @SystemLog(value = "-新增") | 37 | @SystemLog(value = "数据需求-新增") | 
| 37 | @Operation(summary = "-新增") | 38 | @Operation(summary = "数据需求-新增") | 
| 38 | public CommonRes<Boolean> saveDemand(@RequestBody @Valid DemandRQVO vo) { | 39 | public CommonRes<Boolean> saveDemand(@RequestBody @Valid DemandRQVO vo) { | 
| 39 | demandService.saveDemand(vo); | 40 | demandService.saveDemand(vo); | 
| 40 | return CommonRes.success(true); | 41 | return CommonRes.success(true); | 
| 41 | } | 42 | } | 
| 42 | 43 | ||
| 43 | @PutMapping("/update") | 44 | @PutMapping("/update") | 
| 44 | @SystemLog(value = "-修改") | 45 | @SystemLog(value = "数据需求-修改") | 
| 45 | @Operation(summary = "-修改") | 46 | @Operation(summary = "数据需求-修改") | 
| 46 | public CommonRes<Boolean> updateDemand(@RequestBody @Valid DemandRQVO vo) { | 47 | public CommonRes<Boolean> updateDemand(@RequestBody @Valid DemandRQVO vo) { | 
| 47 | demandService.updateDemand(vo); | 48 | demandService.updateDemand(vo); | 
| 48 | return CommonRes.success(true); | 49 | return CommonRes.success(true); | 
| 49 | } | 50 | } | 
| 50 | 51 | ||
| 51 | @DeleteMapping("/delete") | 52 | @DeleteMapping("/delete") | 
| 52 | @SystemLog(value = "-批量删除") | 53 | @SystemLog(value = "数据需求-批量删除") | 
| 53 | @Operation(summary = "-批量删除") | 54 | @Operation(summary = "数据需求-批量删除") | 
| 54 | public CommonRes<Boolean> removeByGuids(@RequestBody List<String> guids) { | 55 | public CommonRes<Boolean> removeByGuids(@RequestBody List<String> guids) { | 
| 55 | demandService.removeByGuids(guids); | 56 | demandService.removeByGuids(guids); | 
| 56 | return CommonRes.success(true); | 57 | return CommonRes.success(true); | 
| 57 | } | 58 | } | 
| 58 | 59 | ||
| 59 | @PostMapping("/page-list") | 60 | @PostMapping("/page-list") | 
| 60 | @SystemLog(value = "-分页") | 61 | @SystemLog(value = "数据需求-分页") | 
| 61 | @Operation(summary = "-分页") | 62 | @Operation(summary = "数据需求-分页") | 
| 62 | public CommonRes<PageListVO<DemandRSVO>> pageList(@RequestBody @Valid DemandQueryVO queryVO) { | 63 | public CommonRes<PageListVO<DemandRSVO>> pageList(@RequestBody @Valid DemandQueryVO queryVO) { | 
| 63 | PageListVO<DemandRSVO> pageVO = demandService.pageList(queryVO); | 64 | PageListVO<DemandRSVO> pageVO = demandService.pageList(queryVO); | 
| 64 | return CommonRes.success(pageVO); | 65 | return CommonRes.success(pageVO); | 
| 65 | } | 66 | } | 
| 66 | 67 | ||
| 67 | @GetMapping("/detail") | 68 | @GetMapping("/detail") | 
| 68 | @SystemLog(value = "-详情") | 69 | @SystemLog(value = "数据需求-详情") | 
| 69 | @Operation( | 70 | @Operation( | 
| 70 | summary = "-详情", | 71 | summary = "数据需求-详情", | 
| 71 | parameters = { | 72 | parameters = { | 
| 72 | @Parameter(name = "guid", description = "唯一标识", required = true)} | 73 | @Parameter(name = "guid", description = "数据需求唯一标识", required = true)} | 
| 73 | ) | 74 | ) | 
| 74 | public CommonRes<DemandRSVO> getDemandDetail(@RequestParam String guid) { | 75 | public CommonRes<DemandRSVO> getDemandDetail(@RequestParam String guid) { | 
| 75 | DemandRSVO vo = demandService.getDemandDetail(guid); | 76 | DemandRSVO vo = demandService.getDemandDetail(guid); | 
| 76 | return CommonRes.success(vo); | 77 | return CommonRes.success(vo); | 
| 77 | } | 78 | } | 
| 78 | 79 | ||
| 80 | @PostMapping("/flow-call-back") | ||
| 81 | @SystemLog(value = "数据需求-流程结束后进行业务回调") | ||
| 82 | @Operation(summary = "数据需求-流程结束后进行业务回调", hidden = true) | ||
| 83 | public CommonRes<Boolean> flowCallBack(@RequestBody @Valid BizCallbackDTO dto) { | ||
| 84 | demandService.flowCallBack(dto); | ||
| 85 | return CommonRes.success(true); | ||
| 86 | } | ||
| 87 | |||
| 79 | //endregion | 88 | //endregion | 
| 80 | 89 | ||
| 81 | } | 90 | } | ... | ... | 
| 1 | package com.csbr.qingcloud.portal.domain.vo; | ||
| 2 | |||
| 3 | import com.csbr.cloud.workflow.domain.dto.appove.FlowBizGuidQueryDTO; | ||
| 4 | import io.swagger.v3.oas.annotations.media.Schema; | ||
| 5 | import lombok.EqualsAndHashCode; | ||
| 6 | import lombok.Data; | ||
| 7 | import java.math.BigDecimal; | ||
| 8 | import java.util.Date; | ||
| 9 | import java.util.List; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * @program: D:/git/ms-data-circulation-portal-service | ||
| 13 | * @description: 数据需求查询参数 | ||
| 14 | * @author: xcq | ||
| 15 | * @create: 2024-12-31 18:46 | ||
| 16 | **/ | ||
| 17 | @EqualsAndHashCode(callSuper = true) | ||
| 18 | @Data | ||
| 19 | @Schema(title = "数据需求查询参数") | ||
| 20 | public class DemandQueryVO extends FlowBizGuidQueryDTO { | ||
| 21 | |||
| 22 | /** | ||
| 23 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃】 | ||
| 24 | */ | ||
| 25 | @Schema(description = "业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃】") | ||
| 26 | private String bizApproveState; | ||
| 27 | |||
| 28 | /******** 自定义扩展 *****/ | ||
| 29 | |||
| 30 | /** | ||
| 31 | * 数据唯一标识【List集合】 | ||
| 32 | */ | ||
| 33 | @Schema(description = "数据唯一标识", hidden = true) | ||
| 34 | private List<String> guidList; | ||
| 35 | |||
| 36 | /** | ||
| 37 | * 是否调用查询的判断 | ||
| 38 | */ | ||
| 39 | @Schema(description = "是否调用查询的判断", hidden = true) | ||
| 40 | private Boolean isNeedQuery; | ||
| 41 | |||
| 42 | } | 
| 1 | package com.csbr.qingcloud.domain.vo; | 1 | package com.csbr.qingcloud.portal.domain.vo; | 
| 2 | 2 | ||
| 3 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; | 
| 4 | import com.fasterxml.jackson.annotation.JsonFormat; | 5 | import com.fasterxml.jackson.annotation.JsonFormat; | 
| 5 | import lombok.Data; | 6 | import lombok.Data; | 
| ... | @@ -7,20 +8,14 @@ import java.math.BigDecimal; | ... | @@ -7,20 +8,14 @@ import java.math.BigDecimal; | 
| 7 | import java.util.Date; | 8 | import java.util.Date; | 
| 8 | 9 | ||
| 9 | /** | 10 | /** | 
| 10 | * @program: D:/csbr/sjzc/ms-data-circulation-portal-service | 11 | * @program: D:/git/ms-data-circulation-portal-service | 
| 11 | * @description: 新增、修改参数 | 12 | * @description: 数据需求新增、修改参数 | 
| 12 | * @author: xushaobo | 13 | * @author: xcq | 
| 13 | * @create: 2024-12-30 16:29 | 14 | * @create: 2024-12-31 18:46 | 
| 14 | **/ | 15 | **/ | 
| 15 | @Data | 16 | @Data | 
| 16 | @Schema(title = "新增、修改参数") | 17 | @Schema(title = "数据需求新增、修改参数") | 
| 17 | public class DemandRQVO { | 18 | public class DemandRQVO extends FlowRQBaseVO { | 
| 18 | |||
| 19 | /** | ||
| 20 | * 系统唯一标识 | ||
| 21 | */ | ||
| 22 | @Schema(description = "系统唯一标识") | ||
| 23 | private String guid; | ||
| 24 | 19 | ||
| 25 | /** | 20 | /** | 
| 26 | * 数据需求名称 | 21 | * 数据需求名称 | 
| ... | @@ -29,12 +24,24 @@ public class DemandRQVO { | ... | @@ -29,12 +24,24 @@ public class DemandRQVO { | 
| 29 | private String dataDemandName; | 24 | private String dataDemandName; | 
| 30 | 25 | ||
| 31 | /** | 26 | /** | 
| 32 | * 需求类型 (1 产业端;2 科研端;3 临床端) | 27 | * 需求类型 | 
| 33 | */ | 28 | */ | 
| 34 | @Schema(description = "需求类型 (1 产业端;2 科研端;3 临床端)") | 29 | @Schema(description = "需求类型") | 
| 35 | private String requirementType; | 30 | private String requirementType; | 
| 36 | 31 | ||
| 37 | /** | 32 | /** | 
| 33 | * 需求分类【1新增 2调整】 | ||
| 34 | */ | ||
| 35 | @Schema(description = "需求分类【1新增 2调整】") | ||
| 36 | private String demandCategory; | ||
| 37 | |||
| 38 | /** | ||
| 39 | * 数据产品唯一标识 | ||
| 40 | */ | ||
| 41 | @Schema(description = "数据产品唯一标识") | ||
| 42 | private String dataProductGuid; | ||
| 43 | |||
| 44 | /** | ||
| 38 | * 需求开始时间 | 45 | * 需求开始时间 | 
| 39 | */ | 46 | */ | 
| 40 | @Schema(description = "需求开始时间") | 47 | @Schema(description = "需求开始时间") | 
| ... | @@ -55,16 +62,17 @@ public class DemandRQVO { | ... | @@ -55,16 +62,17 @@ public class DemandRQVO { | 
| 55 | private String requirementContent; | 62 | private String requirementContent; | 
| 56 | 63 | ||
| 57 | /** | 64 | /** | 
| 58 | * 数据需求字段 数据格式:[{"name":"","path":""},{"name":"","path":""}] | 65 | * 数据需求字段【数据格式:[{"name":"","path":""},{"name":"","path":""}]】 | 
| 59 | */ | 66 | */ | 
| 60 | @Schema(description = "数据需求字段 数据格式:[{\"name\":\"\",\"path\":\"\"},{\"name\":\"\",\"path\":\"\"}]") | 67 | @Schema(description = "数据需求字段【数据格式:[{\"name\":\"\",\"path\":\"\"},{\"name\":\"\",\"path\":\"\"}]】") | 
| 61 | private String dataDemandFieldAttachJson; | 68 | private String dataDemandFieldAttachJson; | 
| 62 | 69 | ||
| 63 | /** | 70 | /** | 
| 64 | * 期望交付时间 | 71 | * 期望交付时间 | 
| 65 | */ | 72 | */ | 
| 66 | @Schema(description = "期望交付时间") | 73 | @Schema(description = "期望交付时间") | 
| 67 | private BigDecimal deliveryTime; | 74 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | 
| 75 | private Date deliveryTime; | ||
| 68 | 76 | ||
| 69 | /** | 77 | /** | 
| 70 | * 最低预算 | 78 | * 最低预算 | 
| ... | @@ -85,15 +93,15 @@ public class DemandRQVO { | ... | @@ -85,15 +93,15 @@ public class DemandRQVO { | 
| 85 | private String costSource; | 93 | private String costSource; | 
| 86 | 94 | ||
| 87 | /** | 95 | /** | 
| 88 | * 更新周期 | 96 | * 更新周期【取数据字典:周期,1 年度,2 半年度,3 季度,4 月度】 | 
| 89 | */ | 97 | */ | 
| 90 | @Schema(description = "更新周期") | 98 | @Schema(description = "更新周期【取数据字典:周期,1 年度,2 半年度,3 季度,4 月度】") | 
| 91 | private String updateCycle; | 99 | private String updateCycle; | 
| 92 | 100 | ||
| 93 | /** | 101 | /** | 
| 94 | * 获取路径方式 (1 接口调用;2 文件下载) | 102 | * 获取路径方式 | 
| 95 | */ | 103 | */ | 
| 96 | @Schema(description = "获取路径方式 (1 接口调用;2 文件下载)") | 104 | @Schema(description = "获取路径方式") | 
| 97 | private String requestType; | 105 | private String requestType; | 
| 98 | 106 | ||
| 99 | /** | 107 | /** | 
| ... | @@ -144,6 +152,56 @@ public class DemandRQVO { | ... | @@ -144,6 +152,56 @@ public class DemandRQVO { | 
| 144 | @Schema(description = "联系方式") | 152 | @Schema(description = "联系方式") | 
| 145 | private String contactInformation; | 153 | private String contactInformation; | 
| 146 | 154 | ||
| 155 | /** | ||
| 156 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】 | ||
| 157 | */ | ||
| 158 | @Schema(description = "业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】") | ||
| 159 | private String bizApproveState; | ||
| 160 | |||
| 161 | /** | ||
| 162 | * 加工单生成时间 | ||
| 163 | */ | ||
| 164 | @Schema(description = "加工单生成时间") | ||
| 165 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 166 | private Date processingGenerateTime; | ||
| 167 | |||
| 168 | /** | ||
| 169 | * 验收完成时间 | ||
| 170 | */ | ||
| 171 | @Schema(description = "验收完成时间") | ||
| 172 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 173 | private Date acceptFinishTime; | ||
| 174 | |||
| 175 | /** | ||
| 176 | * 完成周期 | ||
| 177 | */ | ||
| 178 | @Schema(description = "完成周期") | ||
| 179 | private Integer finishCycle; | ||
| 180 | |||
| 181 | /** | ||
| 182 | * 资源获取状态【N未开始 A进行中 Y已完成】 | ||
| 183 | */ | ||
| 184 | @Schema(description = "资源获取状态【N未开始 A进行中 Y已完成】") | ||
| 185 | private String resourceAcquisitionState; | ||
| 186 | |||
| 187 | /** | ||
| 188 | * 产品加工状态【N未开始 A进行中 Y已完成】 | ||
| 189 | */ | ||
| 190 | @Schema(description = "产品加工状态【N未开始 A进行中 Y已完成】") | ||
| 191 | private String productProcessingState; | ||
| 192 | |||
| 193 | /** | ||
| 194 | * 产品交付状态【N未开始 A进行中 Y已完成】 | ||
| 195 | */ | ||
| 196 | @Schema(description = "产品交付状态【N未开始 A进行中 Y已完成】") | ||
| 197 | private String productDeliveryState; | ||
| 198 | |||
| 199 | /** | ||
| 200 | * 产品验收状态【N未开始 A进行中 Y已完成】 | ||
| 201 | */ | ||
| 202 | @Schema(description = "产品验收状态【N未开始 A进行中 Y已完成】") | ||
| 203 | private String productAcceptState; | ||
| 204 | |||
| 147 | /******** 库表存储属性 需处理 *****/ | 205 | /******** 库表存储属性 需处理 *****/ | 
| 148 | 206 | ||
| 149 | /******** 自定义扩展 *****/ | 207 | /******** 自定义扩展 *****/ | ... | ... | 
| 1 | package com.csbr.qingcloud.domain.vo; | 1 | package com.csbr.qingcloud.portal.domain.vo; | 
| 2 | 2 | ||
| 3 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; | 
| 4 | import com.fasterxml.jackson.annotation.JsonFormat; | 4 | import com.fasterxml.jackson.annotation.JsonFormat; | 
| 5 | import lombok.Data; | 5 | import lombok.Data; | 
| 6 | import com.csbr.cloud.workflow.domain.vo.appove.BizApproveVO; | ||
| 6 | import java.math.BigDecimal; | 7 | import java.math.BigDecimal; | 
| 7 | import java.util.Date; | 8 | import java.util.Date; | 
| 8 | 9 | ||
| 9 | /** | 10 | /** | 
| 10 | * @program: D:/csbr/sjzc/ms-data-circulation-portal-service | 11 | * @program: D:/git/ms-data-circulation-portal-service | 
| 11 | * @description: 返回参数 | 12 | * @description: 数据需求返回参数 | 
| 12 | * @author: xushaobo | 13 | * @author: xcq | 
| 13 | * @create: 2024-12-30 16:29 | 14 | * @create: 2024-12-31 18:46 | 
| 14 | **/ | 15 | **/ | 
| 15 | @Data | 16 | @Data | 
| 16 | @Schema(title = "返回参数") | 17 | @Schema(title = "数据需求返回参数") | 
| 17 | public class DemandRSVO { | 18 | public class DemandRSVO { | 
| 18 | 19 | ||
| 19 | /** | 20 | /** | 
| ... | @@ -29,12 +30,24 @@ public class DemandRSVO { | ... | @@ -29,12 +30,24 @@ public class DemandRSVO { | 
| 29 | private String dataDemandName; | 30 | private String dataDemandName; | 
| 30 | 31 | ||
| 31 | /** | 32 | /** | 
| 32 | * 需求类型 (1 产业端;2 科研端;3 临床端) | 33 | * 需求类型 | 
| 33 | */ | 34 | */ | 
| 34 | @Schema(description = "需求类型 (1 产业端;2 科研端;3 临床端)") | 35 | @Schema(description = "需求类型") | 
| 35 | private String requirementType; | 36 | private String requirementType; | 
| 36 | 37 | ||
| 37 | /** | 38 | /** | 
| 39 | * 需求分类【1新增 2调整】 | ||
| 40 | */ | ||
| 41 | @Schema(description = "需求分类【1新增 2调整】") | ||
| 42 | private String demandCategory; | ||
| 43 | |||
| 44 | /** | ||
| 45 | * 数据产品唯一标识 | ||
| 46 | */ | ||
| 47 | @Schema(description = "数据产品唯一标识") | ||
| 48 | private String dataProductGuid; | ||
| 49 | |||
| 50 | /** | ||
| 38 | * 需求开始时间 | 51 | * 需求开始时间 | 
| 39 | */ | 52 | */ | 
| 40 | @Schema(description = "需求开始时间") | 53 | @Schema(description = "需求开始时间") | 
| ... | @@ -55,16 +68,17 @@ public class DemandRSVO { | ... | @@ -55,16 +68,17 @@ public class DemandRSVO { | 
| 55 | private String requirementContent; | 68 | private String requirementContent; | 
| 56 | 69 | ||
| 57 | /** | 70 | /** | 
| 58 | * 数据需求字段 数据格式:[{"name":"","path":""},{"name":"","path":""}] | 71 | * 数据需求字段【数据格式:[{"name":"","path":""},{"name":"","path":""}]】 | 
| 59 | */ | 72 | */ | 
| 60 | @Schema(description = "数据需求字段 数据格式:[{\"name\":\"\",\"path\":\"\"},{\"name\":\"\",\"path\":\"\"}]") | 73 | @Schema(description = "数据需求字段【数据格式:[{\"name\":\"\",\"path\":\"\"},{\"name\":\"\",\"path\":\"\"}]】") | 
| 61 | private String dataDemandFieldAttachJson; | 74 | private String dataDemandFieldAttachJson; | 
| 62 | 75 | ||
| 63 | /** | 76 | /** | 
| 64 | * 期望交付时间 | 77 | * 期望交付时间 | 
| 65 | */ | 78 | */ | 
| 66 | @Schema(description = "期望交付时间") | 79 | @Schema(description = "期望交付时间") | 
| 67 | private BigDecimal deliveryTime; | 80 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | 
| 81 | private Date deliveryTime; | ||
| 68 | 82 | ||
| 69 | /** | 83 | /** | 
| 70 | * 最低预算 | 84 | * 最低预算 | 
| ... | @@ -85,15 +99,15 @@ public class DemandRSVO { | ... | @@ -85,15 +99,15 @@ public class DemandRSVO { | 
| 85 | private String costSource; | 99 | private String costSource; | 
| 86 | 100 | ||
| 87 | /** | 101 | /** | 
| 88 | * 更新周期 | 102 | * 更新周期【取数据字典:周期,1 年度,2 半年度,3 季度,4 月度】 | 
| 89 | */ | 103 | */ | 
| 90 | @Schema(description = "更新周期") | 104 | @Schema(description = "更新周期【取数据字典:周期,1 年度,2 半年度,3 季度,4 月度】") | 
| 91 | private String updateCycle; | 105 | private String updateCycle; | 
| 92 | 106 | ||
| 93 | /** | 107 | /** | 
| 94 | * 获取路径方式 (1 接口调用;2 文件下载) | 108 | * 获取路径方式 | 
| 95 | */ | 109 | */ | 
| 96 | @Schema(description = "获取路径方式 (1 接口调用;2 文件下载)") | 110 | @Schema(description = "获取路径方式") | 
| 97 | private String requestType; | 111 | private String requestType; | 
| 98 | 112 | ||
| 99 | /** | 113 | /** | 
| ... | @@ -144,10 +158,66 @@ public class DemandRSVO { | ... | @@ -144,10 +158,66 @@ public class DemandRSVO { | 
| 144 | @Schema(description = "联系方式") | 158 | @Schema(description = "联系方式") | 
| 145 | private String contactInformation; | 159 | private String contactInformation; | 
| 146 | 160 | ||
| 161 | /** | ||
| 162 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】 | ||
| 163 | */ | ||
| 164 | @Schema(description = "业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】") | ||
| 165 | private String bizApproveState; | ||
| 166 | |||
| 167 | /** | ||
| 168 | * 加工单生成时间 | ||
| 169 | */ | ||
| 170 | @Schema(description = "加工单生成时间") | ||
| 171 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 172 | private Date processingGenerateTime; | ||
| 173 | |||
| 174 | /** | ||
| 175 | * 验收完成时间 | ||
| 176 | */ | ||
| 177 | @Schema(description = "验收完成时间") | ||
| 178 | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") | ||
| 179 | private Date acceptFinishTime; | ||
| 180 | |||
| 181 | /** | ||
| 182 | * 完成周期 | ||
| 183 | */ | ||
| 184 | @Schema(description = "完成周期") | ||
| 185 | private Integer finishCycle; | ||
| 186 | |||
| 187 | /** | ||
| 188 | * 资源获取状态【N未开始 A进行中 Y已完成】 | ||
| 189 | */ | ||
| 190 | @Schema(description = "资源获取状态【N未开始 A进行中 Y已完成】") | ||
| 191 | private String resourceAcquisitionState; | ||
| 192 | |||
| 193 | /** | ||
| 194 | * 产品加工状态【N未开始 A进行中 Y已完成】 | ||
| 195 | */ | ||
| 196 | @Schema(description = "产品加工状态【N未开始 A进行中 Y已完成】") | ||
| 197 | private String productProcessingState; | ||
| 198 | |||
| 199 | /** | ||
| 200 | * 产品交付状态【N未开始 A进行中 Y已完成】 | ||
| 201 | */ | ||
| 202 | @Schema(description = "产品交付状态【N未开始 A进行中 Y已完成】") | ||
| 203 | private String productDeliveryState; | ||
| 204 | |||
| 205 | /** | ||
| 206 | * 产品验收状态【N未开始 A进行中 Y已完成】 | ||
| 207 | */ | ||
| 208 | @Schema(description = "产品验收状态【N未开始 A进行中 Y已完成】") | ||
| 209 | private String productAcceptState; | ||
| 210 | |||
| 147 | /******** 库表存储属性 需处理 *****/ | 211 | /******** 库表存储属性 需处理 *****/ | 
| 148 | 212 | ||
| 149 | /******** 自定义扩展 *****/ | 213 | /******** 自定义扩展 *****/ | 
| 150 | 214 | ||
| 215 | /** | ||
| 216 | * 审批信息 | ||
| 217 | */ | ||
| 218 | @Schema(description = "审批信息") | ||
| 219 | private BizApproveVO approveVO; | ||
| 220 | |||
| 151 | /******** 子对象 *****/ | 221 | /******** 子对象 *****/ | 
| 152 | 222 | ||
| 153 | } | 223 | } | ... | ... | 
| 1 | package com.csbr.qingcloud.mybatis.entity; | 1 | package com.csbr.qingcloud.portal.mybatis.entity; | 
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.annotation.FieldStrategy; | ||
| 4 | import com.baomidou.mybatisplus.annotation.TableField; | ||
| 3 | import csbr.cloud.entity.domain.base.dao.BaseShardingDO; | 5 | import csbr.cloud.entity.domain.base.dao.BaseShardingDO; | 
| 4 | import jdk.jfr.Name; | 6 | import jdk.jfr.Name; | 
| 5 | import lombok.Data; | 7 | import lombok.Data; | 
| ... | @@ -9,15 +11,15 @@ import java.math.BigDecimal; | ... | @@ -9,15 +11,15 @@ import java.math.BigDecimal; | 
| 9 | import java.util.Date; | 11 | import java.util.Date; | 
| 10 | 12 | ||
| 11 | /** | 13 | /** | 
| 12 | * @program: D:/csbr/sjzc/ms-data-circulation-portal-service | 14 | * @program: D:/git/ms-data-circulation-portal-service | 
| 13 | * @description: 实体 | 15 | * @description: 数据需求实体 | 
| 14 | * @author: xushaobo | 16 | * @author: xcq | 
| 15 | * @create: 2024-12-30 16:26 | 17 | * @create: 2024-12-31 18:46 | 
| 16 | **/ | 18 | **/ | 
| 17 | @Data | 19 | @Data | 
| 18 | @EqualsAndHashCode(callSuper = true) | 20 | @EqualsAndHashCode(callSuper = true) | 
| 19 | @Accessors(chain = true) | 21 | @Accessors(chain = true) | 
| 20 | @Name("") | 22 | @Name("数据需求") | 
| 21 | public class MfDemand extends BaseShardingDO { | 23 | public class MfDemand extends BaseShardingDO { | 
| 22 | 24 | ||
| 23 | /** | 25 | /** | 
| ... | @@ -27,12 +29,24 @@ public class MfDemand extends BaseShardingDO { | ... | @@ -27,12 +29,24 @@ public class MfDemand extends BaseShardingDO { | 
| 27 | private String dataDemandName; | 29 | private String dataDemandName; | 
| 28 | 30 | ||
| 29 | /** | 31 | /** | 
| 30 | * 需求类型 (1 产业端;2 科研端;3 临床端) | 32 | * 需求类型 | 
| 31 | */ | 33 | */ | 
| 32 | @Name("需求类型 (1 产业端;2 科研端;3 临床端)") | 34 | @Name("需求类型") | 
| 33 | private String requirementType; | 35 | private String requirementType; | 
| 34 | 36 | ||
| 35 | /** | 37 | /** | 
| 38 | * 需求分类【1新增 2调整】 | ||
| 39 | */ | ||
| 40 | @Name("需求分类【1新增 2调整】") | ||
| 41 | private String demandCategory; | ||
| 42 | |||
| 43 | /** | ||
| 44 | * 数据产品唯一标识 | ||
| 45 | */ | ||
| 46 | @Name("数据产品唯一标识") | ||
| 47 | private String dataProductGuid; | ||
| 48 | |||
| 49 | /** | ||
| 36 | * 需求开始时间 | 50 | * 需求开始时间 | 
| 37 | */ | 51 | */ | 
| 38 | @Name("需求开始时间") | 52 | @Name("需求开始时间") | 
| ... | @@ -51,16 +65,17 @@ public class MfDemand extends BaseShardingDO { | ... | @@ -51,16 +65,17 @@ public class MfDemand extends BaseShardingDO { | 
| 51 | private String requirementContent; | 65 | private String requirementContent; | 
| 52 | 66 | ||
| 53 | /** | 67 | /** | 
| 54 | * 数据需求字段 数据格式:[{"name":"","path":""},{"name":"","path":""}] | 68 | * 数据需求字段【数据格式:[{"name":"","path":""},{"name":"","path":""}]】 | 
| 55 | */ | 69 | */ | 
| 56 | @Name("数据需求字段 数据格式:[{\"name\":\"\",\"path\":\"\"},{\"name\":\"\",\"path\":\"\"}]") | 70 | @Name("数据需求字段【数据格式:[{\"name\":\"\",\"path\":\"\"},{\"name\":\"\",\"path\":\"\"}]】") | 
| 71 | @TableField(updateStrategy = FieldStrategy.ALWAYS) | ||
| 57 | private String dataDemandFieldAttachJson; | 72 | private String dataDemandFieldAttachJson; | 
| 58 | 73 | ||
| 59 | /** | 74 | /** | 
| 60 | * 期望交付时间 | 75 | * 期望交付时间 | 
| 61 | */ | 76 | */ | 
| 62 | @Name("期望交付时间") | 77 | @Name("期望交付时间") | 
| 63 | private BigDecimal deliveryTime; | 78 | private Date deliveryTime; | 
| 64 | 79 | ||
| 65 | /** | 80 | /** | 
| 66 | * 最低预算 | 81 | * 最低预算 | 
| ... | @@ -81,15 +96,15 @@ public class MfDemand extends BaseShardingDO { | ... | @@ -81,15 +96,15 @@ public class MfDemand extends BaseShardingDO { | 
| 81 | private String costSource; | 96 | private String costSource; | 
| 82 | 97 | ||
| 83 | /** | 98 | /** | 
| 84 | * 更新周期 | 99 | * 更新周期【取数据字典:周期,1 年度,2 半年度,3 季度,4 月度】 | 
| 85 | */ | 100 | */ | 
| 86 | @Name("更新周期") | 101 | @Name("更新周期【取数据字典:周期,1 年度,2 半年度,3 季度,4 月度】") | 
| 87 | private String updateCycle; | 102 | private String updateCycle; | 
| 88 | 103 | ||
| 89 | /** | 104 | /** | 
| 90 | * 获取路径方式 (1 接口调用;2 文件下载) | 105 | * 获取路径方式 | 
| 91 | */ | 106 | */ | 
| 92 | @Name("获取路径方式 (1 接口调用;2 文件下载)") | 107 | @Name("获取路径方式") | 
| 93 | private String requestType; | 108 | private String requestType; | 
| 94 | 109 | ||
| 95 | /** | 110 | /** | 
| ... | @@ -140,4 +155,52 @@ public class MfDemand extends BaseShardingDO { | ... | @@ -140,4 +155,52 @@ public class MfDemand extends BaseShardingDO { | 
| 140 | @Name("联系方式") | 155 | @Name("联系方式") | 
| 141 | private String contactInformation; | 156 | private String contactInformation; | 
| 142 | 157 | ||
| 158 | /** | ||
| 159 | * 业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】 | ||
| 160 | */ | ||
| 161 | @Name("业务审批状态【N 草稿中,A 审批中,Y 已通过,R 驳回,C 已撤销,D 已废弃; 默认 N】") | ||
| 162 | private String bizApproveState; | ||
| 163 | |||
| 164 | /** | ||
| 165 | * 加工单生成时间 | ||
| 166 | */ | ||
| 167 | @Name("加工单生成时间") | ||
| 168 | private Date processingGenerateTime; | ||
| 169 | |||
| 170 | /** | ||
| 171 | * 验收完成时间 | ||
| 172 | */ | ||
| 173 | @Name("验收完成时间") | ||
| 174 | private Date acceptFinishTime; | ||
| 175 | |||
| 176 | /** | ||
| 177 | * 完成周期 | ||
| 178 | */ | ||
| 179 | @Name("完成周期") | ||
| 180 | private Integer finishCycle; | ||
| 181 | |||
| 182 | /** | ||
| 183 | * 资源获取状态【N未开始 A进行中 Y已完成】 | ||
| 184 | */ | ||
| 185 | @Name("资源获取状态【N未开始 A进行中 Y已完成】") | ||
| 186 | private String resourceAcquisitionState; | ||
| 187 | |||
| 188 | /** | ||
| 189 | * 产品加工状态【N未开始 A进行中 Y已完成】 | ||
| 190 | */ | ||
| 191 | @Name("产品加工状态【N未开始 A进行中 Y已完成】") | ||
| 192 | private String productProcessingState; | ||
| 193 | |||
| 194 | /** | ||
| 195 | * 产品交付状态【N未开始 A进行中 Y已完成】 | ||
| 196 | */ | ||
| 197 | @Name("产品交付状态【N未开始 A进行中 Y已完成】") | ||
| 198 | private String productDeliveryState; | ||
| 199 | |||
| 200 | /** | ||
| 201 | * 产品验收状态【N未开始 A进行中 Y已完成】 | ||
| 202 | */ | ||
| 203 | @Name("产品验收状态【N未开始 A进行中 Y已完成】") | ||
| 204 | private String productAcceptState; | ||
| 205 | |||
| 143 | } | 206 | } | ... | ... | 
| 1 | package com.csbr.qingcloud.mybatis.mapper; | 1 | package com.csbr.qingcloud.portal.mybatis.mapper; | 
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | 
| 4 | import org.apache.ibatis.annotations.Mapper; | 4 | import org.apache.ibatis.annotations.Mapper; | 
| 5 | import com.csbr.qingcloud.mybatis.entity.MfDemand; | 5 | import com.csbr.qingcloud.portal.mybatis.entity.MfDemand; | 
| 6 | 6 | ||
| 7 | /** | 7 | /** | 
| 8 | * @program: D:/csbr/sjzc/ms-data-circulation-portal-service | 8 | * @program: D:/git/ms-data-circulation-portal-service | 
| 9 | * @description: Mapper 接口 | 9 | * @description: 数据需求 Mapper 接口 | 
| 10 | * @author: xushaobo | 10 | * @author: xcq | 
| 11 | * @create: 2024-12-30 16:29 | 11 | * @create: 2024-12-31 18:46 | 
| 12 | **/ | 12 | **/ | 
| 13 | @Mapper | 13 | @Mapper | 
| 14 | public interface MfDemandMapper extends BaseMapper<MfDemand> { | 14 | public interface MfDemandMapper extends BaseMapper<MfDemand> { | ... | ... | 
| 1 | package com.csbr.qingcloud.portal.mybatis.service; | ||
| 2 | |||
| 3 | import com.csbr.cloud.base.service.CsbrService; | ||
| 4 | import com.csbr.qingcloud.portal.mybatis.entity.MfDemand; | ||
| 5 | |||
| 6 | /** | ||
| 7 | * @program: D:/git/ms-data-circulation-portal-service | ||
| 8 | * @description: 数据需求逻辑层接口 | ||
| 9 | * @author: xcq | ||
| 10 | * @create: 2024-12-31 18:46 | ||
| 11 | **/ | ||
| 12 | public interface MfDemandService extends CsbrService<MfDemand> { | ||
| 13 | |||
| 14 | } | 
| 1 | package com.csbr.qingcloud.mybatis.service.impl; | 1 | package com.csbr.qingcloud.portal.mybatis.service.impl; | 
| 2 | 2 | ||
| 3 | import com.csbr.cloud.mybatis.service.impl.CsbrServiceImpl; | 3 | import com.csbr.cloud.mybatis.service.impl.CsbrServiceImpl; | 
| 4 | import com.csbr.qingcloud.mybatis.mapper.MfDemandMapper; | 4 | import com.csbr.qingcloud.portal.mybatis.mapper.MfDemandMapper; | 
| 5 | import com.csbr.qingcloud.mybatis.entity.MfDemand; | 5 | import com.csbr.qingcloud.portal.mybatis.entity.MfDemand; | 
| 6 | import com.csbr.qingcloud.mybatis.service.MfDemandService; | 6 | import com.csbr.qingcloud.portal.mybatis.service.MfDemandService; | 
| 7 | import jakarta.annotation.Resource; | 7 | import jakarta.annotation.Resource; | 
| 8 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; | 
| 9 | 9 | ||
| 10 | /** | 10 | /** | 
| 11 | * @program: D:/csbr/sjzc/ms-data-circulation-portal-service | 11 | * @program: D:/git/ms-data-circulation-portal-service | 
| 12 | * @description: 逻辑层接口实现 | 12 | * @description: 数据需求逻辑层接口实现 | 
| 13 | * @author: xushaobo | 13 | * @author: xcq | 
| 14 | * @create: 2024-12-30 16:29 | 14 | * @create: 2024-12-31 18:46 | 
| 15 | **/ | 15 | **/ | 
| 16 | @Service | 16 | @Service | 
| 17 | public class MfDemandServiceImpl extends CsbrServiceImpl<MfDemandMapper, MfDemand> implements MfDemandService { | 17 | public class MfDemandServiceImpl extends CsbrServiceImpl<MfDemandMapper, MfDemand> implements MfDemandService { | ... | ... | 
| 1 | package com.csbr.qingcloud.portal.service; | ||
| 2 | |||
| 3 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
| 4 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | ||
| 5 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | ||
| 6 | import com.csbr.qingcloud.portal.domain.vo.DemandQueryVO; | ||
| 7 | import com.csbr.qingcloud.portal.domain.vo.DemandRSVO; | ||
| 8 | |||
| 9 | import java.util.List; | ||
| 10 | |||
| 11 | /** | ||
| 12 | * @program: D:/git/ms-data-circulation-portal-service | ||
| 13 | * @description: 数据需求业务逻辑接口 | ||
| 14 | * @author: xcq | ||
| 15 | * @create: 2024-12-31 18:46 | ||
| 16 | **/ | ||
| 17 | public interface DemandService { | ||
| 18 | |||
| 19 | /** | ||
| 20 | * 数据需求分页查询 | ||
| 21 | * @author xcq | ||
| 22 | * @date 2024-12-31 18:46 | ||
| 23 | * @param queryVO | ||
| 24 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.DemandRSVO> | ||
| 25 | */ | ||
| 26 | PageListVO<DemandRSVO> pageList(DemandQueryVO queryVO); | ||
| 27 | |||
| 28 | /** | ||
| 29 | * 数据需求获取详情数据 | ||
| 30 | * @author xcq | ||
| 31 | * @date 2024-12-31 18:46 | ||
| 32 | * @param guid | ||
| 33 | * @return com.csbr.qingcloud.portal.domain.vo.DemandRSVO | ||
| 34 | */ | ||
| 35 | DemandRSVO getDemandDetail(String guid); | ||
| 36 | |||
| 37 | /** | ||
| 38 | * 数据需求数据新增 | ||
| 39 | * @author xcq | ||
| 40 | * @date 2024-12-31 18:46 | ||
| 41 | * @param flowBaseVO | ||
| 42 | * @return void | ||
| 43 | */ | ||
| 44 | void saveDemand(FlowRQBaseVO flowBaseVO); | ||
| 45 | |||
| 46 | /** | ||
| 47 | * 数据需求数据修改 | ||
| 48 | * @author xcq | ||
| 49 | * @date 2024-12-31 18:46 | ||
| 50 | * @param flowBaseVO | ||
| 51 | * @return void | ||
| 52 | */ | ||
| 53 | void updateDemand(FlowRQBaseVO flowBaseVO); | ||
| 54 | |||
| 55 | /** | ||
| 56 | * 数据需求数据删除、并有相关的处理操作 | ||
| 57 | * @author xcq | ||
| 58 | * @date 2024-12-31 18:46 | ||
| 59 | * @param guids | ||
| 60 | * @return void | ||
| 61 | */ | ||
| 62 | void removeByGuids(List<String> guids); | ||
| 63 | |||
| 64 | /** | ||
| 65 | * 流程结束后进行业务回调 | ||
| 66 | * @author xcq | ||
| 67 | * @date 2024-12-31 18:46 | ||
| 68 | * @param dto | ||
| 69 | * @return void | ||
| 70 | */ | ||
| 71 | void flowCallBack(BizCallbackDTO dto); | ||
| 72 | |||
| 73 | } | 
| 1 | package com.csbr.qingcloud.service.impl; | 1 | package com.csbr.qingcloud.portal.service.impl; | 
| 2 | 2 | ||
| 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 
| 4 | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; | ||
| 4 | import com.csbr.cloud.common.enums.SystemError; | 5 | import com.csbr.cloud.common.enums.SystemError; | 
| 6 | import com.csbr.cloud.common.enums.WorkFlowBizEnum; | ||
| 7 | import csbr.cloud.entity.enums.ApprovalStateEnum; | ||
| 5 | import com.csbr.cloud.common.exception.CsbrSystemException; | 8 | import com.csbr.cloud.common.exception.CsbrSystemException; | 
| 6 | import com.csbr.cloud.common.util.CommonUtil; | 9 | import com.csbr.cloud.common.util.CommonUtil; | 
| 7 | import com.csbr.cloud.common.util.CsbrBeanUtil; | 10 | import com.csbr.cloud.common.util.CsbrBeanUtil; | 
| 11 | import com.csbr.cloud.workflow.util.ApprovalFlowUtil; | ||
| 12 | import com.csbr.cloud.workflow.util.FlowAbstractImpl; | ||
| 8 | import com.csbr.cloud.common.util.MessageSourceUtil; | 13 | import com.csbr.cloud.common.util.MessageSourceUtil; | 
| 9 | import csbr.cloud.entity.domain.base.vo.PageListVO; | 14 | import csbr.cloud.entity.domain.base.vo.PageListVO; | 
| 10 | import com.csbr.qingcloud.domain.vo.DemandQueryVO; | 15 | import com.csbr.cloud.workflow.domain.vo.appove.FlowRQBaseVO; | 
| 11 | import com.csbr.qingcloud.domain.vo.DemandRQVO; | 16 | import com.csbr.cloud.workflow.domain.dto.appove.AddApprovalDTO; | 
| 12 | import com.csbr.qingcloud.domain.vo.DemandRSVO; | 17 | import com.csbr.cloud.workflow.domain.dto.callback.BizCallbackDTO; | 
| 13 | import com.csbr.qingcloud.mybatis.entity.MfDemand; | 18 | import com.csbr.qingcloud.portal.domain.vo.DemandQueryVO; | 
| 14 | import com.csbr.qingcloud.mybatis.service.MfDemandService; | 19 | import com.csbr.qingcloud.portal.domain.vo.DemandRQVO; | 
| 15 | import com.csbr.qingcloud.service.DemandService; | 20 | import com.csbr.qingcloud.portal.domain.vo.DemandRSVO; | 
| 21 | import com.csbr.qingcloud.portal.mybatis.entity.MfDemand; | ||
| 22 | import com.csbr.qingcloud.portal.mybatis.service.MfDemandService; | ||
| 23 | import com.csbr.qingcloud.portal.service.DemandService; | ||
| 16 | import jakarta.annotation.Resource; | 24 | import jakarta.annotation.Resource; | 
| 17 | import lombok.extern.slf4j.Slf4j; | 25 | import lombok.extern.slf4j.Slf4j; | 
| 18 | import org.apache.commons.collections.CollectionUtils; | 26 | import org.apache.commons.collections.CollectionUtils; | 
| 19 | import org.apache.commons.lang3.StringUtils; | 27 | import org.apache.commons.lang3.StringUtils; | 
| 20 | import org.springframework.stereotype.Service; | 28 | import org.springframework.stereotype.Service; | 
| 29 | import io.seata.spring.annotation.GlobalTransactional; | ||
| 21 | import org.springframework.transaction.annotation.Transactional; | 30 | import org.springframework.transaction.annotation.Transactional; | 
| 22 | 31 | ||
| 23 | import java.util.ArrayList; | 32 | import java.util.ArrayList; | 
| ... | @@ -25,19 +34,24 @@ import java.util.Collections; | ... | @@ -25,19 +34,24 @@ import java.util.Collections; | 
| 25 | import java.util.List; | 34 | import java.util.List; | 
| 26 | 35 | ||
| 27 | /** | 36 | /** | 
| 28 | * @program: D:/csbr/sjzc/ms-data-circulation-portal-service | 37 | * @program: D:/git/ms-data-circulation-portal-service | 
| 29 | * @description: 业务逻辑实现 | 38 | * @description: 数据需求业务逻辑实现 | 
| 30 | * @author: xushaobo | 39 | * @author: xcq | 
| 31 | * @create: 2024-12-30 16:30 | 40 | * @create: 2024-12-31 18:46 | 
| 32 | **/ | 41 | **/ | 
| 33 | @Slf4j | 42 | @Slf4j | 
| 34 | @Service | 43 | @Service | 
| 35 | public class DemandServiceImpl implements DemandService { | 44 | public class DemandServiceImpl extends FlowAbstractImpl implements DemandService { | 
| 36 | 45 | ||
| 37 | /** | 46 | /** | 
| 38 | * 功能名称 | 47 | * 功能名称 | 
| 39 | */ | 48 | */ | 
| 40 | private static final String FUNCTION_NAME = ""; | 49 | private static final String FUNCTION_NAME = "数据需求"; | 
| 50 | |||
| 51 | /** | ||
| 52 | * 流程类型 | ||
| 53 | */ | ||
| 54 | private static final String FLOW_TYPE = WorkFlowBizEnum.FLOW_TYPE.getValue(); | ||
| 41 | 55 | ||
| 42 | @Resource | 56 | @Resource | 
| 43 | private MfDemandService mfDemandService; | 57 | private MfDemandService mfDemandService; | 
| ... | @@ -46,32 +60,40 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -46,32 +60,40 @@ public class DemandServiceImpl implements DemandService { | 
| 46 | private CsbrBeanUtil csbrBeanUtil; | 60 | private CsbrBeanUtil csbrBeanUtil; | 
| 47 | 61 | ||
| 48 | @Resource | 62 | @Resource | 
| 63 | private ApprovalFlowUtil approvalFlowUtil; | ||
| 64 | |||
| 65 | @Resource | ||
| 49 | private MessageSourceUtil messageSourceUtil; | 66 | private MessageSourceUtil messageSourceUtil; | 
| 50 | 67 | ||
| 51 | /** | 68 | /** | 
| 52 | * 分页查询 | 69 | * 数据需求分页查询 | 
| 53 | * @author xushaobo | 70 | * @author xcq | 
| 54 | * @date 2024-12-30 16:30 | 71 | * @date 2024-12-31 18:46 | 
| 55 | * @param queryVO | 72 | * @param queryVO | 
| 56 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.domain.vo.DemandRSVO> | 73 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.portal.domain.vo.DemandRSVO> | 
| 57 | */ | 74 | */ | 
| 58 | @Override | 75 | @Override | 
| 59 | public PageListVO<DemandRSVO> pageList(DemandQueryVO queryVO) { | 76 | public PageListVO<DemandRSVO> pageList(DemandQueryVO queryVO) { | 
| 60 | beforeQuery(queryVO); | 77 | beforeQuery(queryVO); | 
| 78 | if (queryVO.getIsNeedQuery()) { | ||
| 61 | LambdaQueryWrapper<MfDemand> queryWrapper = mfDemandService.csbrQueryWrapper(queryVO, MfDemand.class); | 79 | LambdaQueryWrapper<MfDemand> queryWrapper = mfDemandService.csbrQueryWrapper(queryVO, MfDemand.class); | 
| 80 | queryWrapper.in(CollectionUtils.isNotEmpty(queryVO.getGuidList()), MfDemand::getGuid, | ||
| 81 | queryVO.getGuidList()); | ||
| 62 | queryWrapper.orderByDesc(MfDemand::getCreateTime); | 82 | queryWrapper.orderByDesc(MfDemand::getCreateTime); | 
| 63 | PageListVO<MfDemand> pageList = mfDemandService.csbrPageList(queryVO, queryWrapper); | 83 | PageListVO<MfDemand> pageList = mfDemandService.csbrPageList(queryVO, queryWrapper); | 
| 64 | PageListVO<DemandRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); | 84 | PageListVO<DemandRSVO> rsPageList = csbrBeanUtil.convert(pageList, PageListVO.class); | 
| 65 | afterQuery(pageList, rsPageList); | 85 | afterQuery(pageList, rsPageList); | 
| 66 | return rsPageList; | 86 | return rsPageList; | 
| 67 | } | 87 | } | 
| 88 | return new PageListVO<>(); | ||
| 89 | } | ||
| 68 | 90 | ||
| 69 | /** | 91 | /** | 
| 70 | * 获取详情数据 | 92 | * 数据需求获取详情数据 | 
| 71 | * @author xushaobo | 93 | * @author xcq | 
| 72 | * @date 2024-12-30 16:30 | 94 | * @date 2024-12-31 18:46 | 
| 73 | * @param guid | 95 | * @param guid | 
| 74 | * @return com.csbr.qingcloud.domain.vo.DemandRSVO | 96 | * @return com.csbr.qingcloud.portal.domain.vo.DemandRSVO | 
| 75 | */ | 97 | */ | 
| 76 | @Override | 98 | @Override | 
| 77 | public DemandRSVO getDemandDetail(String guid) { | 99 | public DemandRSVO getDemandDetail(String guid) { | 
| ... | @@ -88,79 +110,99 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -88,79 +110,99 @@ public class DemandServiceImpl implements DemandService { | 
| 88 | } | 110 | } | 
| 89 | 111 | ||
| 90 | /** | 112 | /** | 
| 91 | * 数据新增 | 113 | * 数据需求数据新增 | 
| 92 | * @author xushaobo | 114 | * @author xcq | 
| 93 | * @date 2024-12-30 16:30 | 115 | * @date 2024-12-31 18:46 | 
| 94 | * @param rqVO | 116 | * @param flowBaseVO | 
| 95 | * @return boolean | 117 | * @return void | 
| 96 | */ | 118 | */ | 
| 119 | @GlobalTransactional(rollbackFor = Exception.class) | ||
| 97 | @Transactional(rollbackFor = Exception.class) | 120 | @Transactional(rollbackFor = Exception.class) | 
| 98 | @Override | 121 | @Override | 
| 99 | public void saveDemand(DemandRQVO rqVO) { | 122 | public void saveDemand(FlowRQBaseVO flowBaseVO) { | 
| 123 | DemandRQVO rqVO = (DemandRQVO) flowBaseVO; | ||
| 100 | beforeSave(rqVO); | 124 | beforeSave(rqVO); | 
| 101 | MfDemand entity = convertToEntity(rqVO); | 125 | MfDemand entity = convertToEntity(rqVO); | 
| 126 | // 发起审批流程或保存草稿 | ||
| 127 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); | ||
| 128 | super.startWorkFlow(rqVO, approvalDTO, entity::setBizApproveState); | ||
| 129 | // 业务数据保存 | ||
| 102 | boolean flag = mfDemandService.save(entity); | 130 | boolean flag = mfDemandService.save(entity); | 
| 103 | if (!flag) { | 131 | if (!flag) { | 
| 104 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(FUNCTION_NAME)); | 132 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, rqVO.getImmediateApprove() ? | 
| 133 | messageSourceUtil.submitMessage(FUNCTION_NAME) : messageSourceUtil.addMessage(FUNCTION_NAME)); | ||
| 105 | } | 134 | } | 
| 106 | afterSave(rqVO, entity); | 135 | afterSave(entity, rqVO); | 
| 107 | } | 136 | } | 
| 108 | 137 | ||
| 109 | /** | 138 | /** | 
| 110 | * 数据修改 | 139 | * 数据需求数据修改 | 
| 111 | * @author xushaobo | 140 | * @author xcq | 
| 112 | * @date 2024-12-30 16:30 | 141 | * @date 2024-12-31 18:46 | 
| 113 | * @param rqVO | 142 | * @param flowBaseVO | 
| 114 | * @return boolean | 143 | * @return void | 
| 115 | */ | 144 | */ | 
| 145 | @GlobalTransactional(rollbackFor = Exception.class) | ||
| 116 | @Transactional(rollbackFor = Exception.class) | 146 | @Transactional(rollbackFor = Exception.class) | 
| 117 | @Override | 147 | @Override | 
| 118 | public void updateDemand(DemandRQVO rqVO) { | 148 | public void updateDemand(FlowRQBaseVO flowBaseVO) { | 
| 119 | beforeUpdate(rqVO); | 149 | DemandRQVO rqVO = (DemandRQVO) flowBaseVO; | 
| 120 | // 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行 | 150 | // 将修改前数据查出来缓存下来,传入到修改后方法中,用于一些特殊逻辑处理,如某个值变化才进行 | 
| 121 | // MfDemand oldEntity = mfDemandService.getById(rqVO.getGuid()); | 151 | // MfDemand oldEntity = mfDemandService.getById(rqVO.getGuid()); | 
| 152 | beforeUpdate(rqVO); | ||
| 122 | MfDemand entity = convertToEntity(rqVO); | 153 | MfDemand entity = convertToEntity(rqVO); | 
| 154 | // 发起审批流程或保存草稿 | ||
| 155 | AddApprovalDTO approvalDTO = getAddApprovalDTO(entity); | ||
| 156 | super.startOrRestartWorkFlow(rqVO, rqVO.getBizApproveState(), approvalDTO, entity::setBizApproveState); | ||
| 157 | if (rqVO.getIsRestart()) { | ||
| 158 | // 重新提交 | ||
| 159 | againSubmitFlow(entity, rqVO, approvalDTO); | ||
| 160 | } else { | ||
| 161 | // 修改业务数据 | ||
| 123 | boolean flag = mfDemandService.updateById(entity); | 162 | boolean flag = mfDemandService.updateById(entity); | 
| 124 | if (!flag) { | 163 | if (!flag) { | 
| 125 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(FUNCTION_NAME)); | 164 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, rqVO.getImmediateApprove() ? | 
| 165 | messageSourceUtil.submitMessage(FUNCTION_NAME) : messageSourceUtil.updateMessage(FUNCTION_NAME)); | ||
| 166 | } | ||
| 167 | afterUpdate(entity, rqVO); | ||
| 126 | } | 168 | } | 
| 127 | afterUpdate(rqVO, entity); | ||
| 128 | } | 169 | } | 
| 129 | 170 | ||
| 130 | /** | 171 | /** | 
| 131 | * 数据删除 | 172 | * 重新提交数据需求 | 
| 132 | * @author xushaobo | 173 | * @author xcq | 
| 133 | * @date 2024-12-30 16:30 | 174 | * @date 2024-12-31 18:46 | 
| 134 | * @param guids | 175 | * @param entity | 
| 176 | * @param rqVO | ||
| 177 | * @param approvalDTO | ||
| 135 | * @return void | 178 | * @return void | 
| 136 | */ | 179 | */ | 
| 137 | @Transactional(rollbackFor = Exception.class) | 180 | private void againSubmitFlow(MfDemand entity, DemandRQVO rqVO, AddApprovalDTO approvalDTO) { | 
| 138 | @Override | 181 | // 重新提交的数据重置相关字段 | 
| 139 | public void removeByGuids(List<String> guids) { | 182 | entity.setGuid(CommonUtil.newGuid()); | 
| 140 | if (CollectionUtils.isEmpty(guids)) { | 183 | mfDemandService.csbrBaseEntity(entity); | 
| 141 | // W00012 = {0}:参数[{1}]不能为空! | 184 | // 保存新数据 | 
| 142 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | 185 | boolean flag = mfDemandService.save(entity); | 
| 143 | String.format("删除%s数据", FUNCTION_NAME), "数据唯一标识")); | ||
| 144 | } | ||
| 145 | if (!mfDemandService.isExistsData(guids, MfDemand.class)) { | ||
| 146 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | ||
| 147 | } | ||
| 148 | boolean flag = mfDemandService.csbrDeleteData(guids, MfDemand.class); | ||
| 149 | if (!flag) { | 186 | if (!flag) { | 
| 150 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.delMessage(FUNCTION_NAME)); | 187 | throw new CsbrSystemException(SystemError.DATA_ADD_ERROR, messageSourceUtil.addMessage(String.format("重新提交%s",FUNCTION_NAME))); | 
| 151 | } | 188 | } | 
| 189 | // 发起新的流程 | ||
| 190 | approvalDTO.setGuid(entity.getGuid()); | ||
| 191 | approvalFlowUtil.addApproval(approvalDTO); | ||
| 192 | afterSave(entity, rqVO); | ||
| 152 | } | 193 | } | 
| 153 | 194 | ||
| 154 | /** | 195 | /** | 
| 155 | * 数据删除、并有相关的处理操作 | 196 | * 数据需求数据删除、并有相关的处理操作 | 
| 156 | * @author xushaobo | 197 | * @author xcq | 
| 157 | * @date 2024-12-30 16:30 | 198 | * @date 2024-12-31 18:46 | 
| 158 | * @param guids | 199 | * @param guids | 
| 159 | * @return void | 200 | * @return void | 
| 160 | */ | 201 | */ | 
| 202 | @GlobalTransactional(rollbackFor = Exception.class) | ||
| 161 | @Transactional(rollbackFor = Exception.class) | 203 | @Transactional(rollbackFor = Exception.class) | 
| 162 | @Override | 204 | @Override | 
| 163 | public void removeHandleByGuids(List<String> guids) { | 205 | public void removeByGuids(List<String> guids) { | 
| 164 | if (CollectionUtils.isEmpty(guids)) { | 206 | if (CollectionUtils.isEmpty(guids)) { | 
| 165 | // W00012 = {0}:参数[{1}]不能为空! | 207 | // W00012 = {0}:参数[{1}]不能为空! | 
| 166 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | 208 | throw new CsbrSystemException(SystemError.DATA_INPUT_ERROR, messageSourceUtil.getMessage("W00012", | 
| ... | @@ -175,12 +217,63 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -175,12 +217,63 @@ public class DemandServiceImpl implements DemandService { | 
| 175 | } | 217 | } | 
| 176 | afterRemove(entity); | 218 | afterRemove(entity); | 
| 177 | } | 219 | } | 
| 220 | // 删除流程数据 | ||
| 221 | approvalFlowUtil.removeApproveByBizGuids(guids); | ||
| 222 | } | ||
| 223 | |||
| 224 | /** | ||
| 225 | * 流程结束后进行业务回调 | ||
| 226 | * @author xcq | ||
| 227 | * @date 2024-12-31 18:46 | ||
| 228 | * @param dto | ||
| 229 | * @return void | ||
| 230 | */ | ||
| 231 | @Transactional(rollbackFor = Exception.class) | ||
| 232 | @Override | ||
| 233 | public void flowCallBack(BizCallbackDTO dto) { | ||
| 234 | MfDemand entity = mfDemandService.getById(dto.getBizGuid()); | ||
| 235 | if (entity == null) { | ||
| 236 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToSelectMessage(FUNCTION_NAME)); | ||
| 237 | } | ||
| 238 | if (ApprovalStateEnum.PASSED.getValue().equals(dto.getApprovalState())) { | ||
| 239 | // todo | ||
| 240 | } | ||
| 241 | // 同步更新审批状态 | ||
| 242 | LambdaUpdateWrapper<MfDemand> updateWrapper = mfDemandService.csbrUpdateWrapper(MfDemand.class); | ||
| 243 | updateWrapper.set(MfDemand::getBizApproveState, dto.getApprovalState()); | ||
| 244 | updateWrapper.eq(MfDemand::getGuid, dto.getBizGuid()); | ||
| 245 | boolean flag = mfDemandService.update(updateWrapper); | ||
| 246 | if (!flag) { | ||
| 247 | throw new CsbrSystemException(SystemError.DATA_UPDATE_ERROR, messageSourceUtil.updateMessage(String.format("%s的业务审批状态", FUNCTION_NAME))); | ||
| 248 | } | ||
| 249 | } | ||
| 250 | |||
| 251 | /** | ||
| 252 | * 获取发起流程参数 | ||
| 253 | * @author xcq | ||
| 254 | * @date 2024-12-31 18:46 | ||
| 255 | * @param entity | ||
| 256 | * @return com.csbr.cloud.workflow.domain.dto.appove.AddApprovalDTO | ||
| 257 | */ | ||
| 258 | private AddApprovalDTO getAddApprovalDTO(MfDemand entity) { | ||
| 259 | AddApprovalDTO approvalDTO = new AddApprovalDTO(FLOW_TYPE, entity.getGuid()); | ||
| 260 | // todo | ||
| 261 | approvalDTO.setFuncCode(SysFuncCode); | ||
| 262 | // 流程消息中的变量替换参数 | ||
| 263 | approvalDTO.setFlowMessageBody(null); | ||
| 264 | // 流程列表数据核心param参数处理 | ||
| 265 | approvalDTO.setParam1(null); | ||
| 266 | approvalDTO.setParam2(null); | ||
| 267 | approvalDTO.setParam3(null); | ||
| 268 | approvalDTO.setParam4(null); | ||
| 269 | |||
| 270 | return approvalDTO; | ||
| 178 | } | 271 | } | 
| 179 | 272 | ||
| 180 | /** | 273 | /** | 
| 181 | * 新新增前置处理 | 274 | * 数据需求新新增前置处理 | 
| 182 | * @author xushaobo | 275 | * @author xcq | 
| 183 | * @date 2024-12-30 16:30 | 276 | * @date 2024-12-31 18:46 | 
| 184 | * @param rqVO | 277 | * @param rqVO | 
| 185 | * @return void | 278 | * @return void | 
| 186 | */ | 279 | */ | 
| ... | @@ -220,14 +313,14 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -220,14 +313,14 @@ public class DemandServiceImpl implements DemandService { | 
| 220 | } | 313 | } | 
| 221 | 314 | ||
| 222 | /** | 315 | /** | 
| 223 | * 新增后置处理 | 316 | * 数据需求新增后置处理 | 
| 224 | * @author xushaobo | 317 | * @author xcq | 
| 225 | * @date 2024-12-30 16:30 | 318 | * @date 2024-12-31 18:46 | 
| 226 | * @param rqVO | ||
| 227 | * @param entity | 319 | * @param entity | 
| 320 | * @param rqVO | ||
| 228 | * @return void | 321 | * @return void | 
| 229 | */ | 322 | */ | 
| 230 | private void afterSave(DemandRQVO rqVO, MfDemand entity) { | 323 | private void afterSave(MfDemand entity, DemandRQVO rqVO) { | 
| 231 | //region 1.输出特殊转换 | 324 | //region 1.输出特殊转换 | 
| 232 | 325 | ||
| 233 | //region 1.1.输出过滤与补充处理 | 326 | //region 1.1.输出过滤与补充处理 | 
| ... | @@ -237,9 +330,9 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -237,9 +330,9 @@ public class DemandServiceImpl implements DemandService { | 
| 237 | } | 330 | } | 
| 238 | 331 | ||
| 239 | /** | 332 | /** | 
| 240 | * 修改前置校验、处理 | 333 | * 数据需求修改前置校验、处理 | 
| 241 | * @author xushaobo | 334 | * @author xcq | 
| 242 | * @date 2024-12-30 16:30 | 335 | * @date 2024-12-31 18:46 | 
| 243 | * @param rqVO | 336 | * @param rqVO | 
| 244 | * @return void | 337 | * @return void | 
| 245 | */ | 338 | */ | 
| ... | @@ -256,8 +349,12 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -256,8 +349,12 @@ public class DemandServiceImpl implements DemandService { | 
| 256 | //endregion 2.1.业务合规性验证 | 349 | //endregion 2.1.业务合规性验证 | 
| 257 | 350 | ||
| 258 | //region 2.2.业务数据验证 | 351 | //region 2.2.业务数据验证 | 
| 259 | if (!mfDemandService.isExistsData(Collections.singletonList(rqVO.getGuid()), MfDemand.class)) { | 352 | LambdaQueryWrapper<MfDemand> queryWrapper = new LambdaQueryWrapper<>(); | 
| 260 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToUpdateMessage(FUNCTION_NAME)); | 353 | queryWrapper.eq(MfDemand::getGuid, rqVO.getGuid()); | 
| 354 | queryWrapper.select(MfDemand::getGuid, MfDemand::getBizApproveState); | ||
| 355 | MfDemand entity = mfDemandService.getOne(queryWrapper); | ||
| 356 | if (entity == null) { | ||
| 357 | throw new CsbrSystemException(SystemError.DATA_NOT_EXISTS, messageSourceUtil.notExistsToUpdateMessage(FUNCTION_NAME)); | ||
| 261 | } | 358 | } | 
| 262 | //endregion 2.2.业务数据验证 | 359 | //endregion 2.2.业务数据验证 | 
| 263 | 360 | ||
| ... | @@ -266,6 +363,7 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -266,6 +363,7 @@ public class DemandServiceImpl implements DemandService { | 
| 266 | //region 3.数据转换处理 | 363 | //region 3.数据转换处理 | 
| 267 | 364 | ||
| 268 | //region 3.1.数据过程转换 | 365 | //region 3.1.数据过程转换 | 
| 366 | rqVO.setBizApproveState(entity.getBizApproveState()); | ||
| 269 | //endregion 3.1.数据过程转换 | 367 | //endregion 3.1.数据过程转换 | 
| 270 | 368 | ||
| 271 | //endregion 3.数据转换处理 | 369 | //endregion 3.数据转换处理 | 
| ... | @@ -285,14 +383,14 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -285,14 +383,14 @@ public class DemandServiceImpl implements DemandService { | 
| 285 | } | 383 | } | 
| 286 | 384 | ||
| 287 | /** | 385 | /** | 
| 288 | * 修改后置处理 | 386 | * 数据需求修改后置处理 | 
| 289 | * @author xushaobo | 387 | * @author xcq | 
| 290 | * @date 2024-12-30 16:30 | 388 | * @date 2024-12-31 18:46 | 
| 291 | * @param rqVO | ||
| 292 | * @param entity | 389 | * @param entity | 
| 390 | * @param rqVO | ||
| 293 | * @return void | 391 | * @return void | 
| 294 | */ | 392 | */ | 
| 295 | protected void afterUpdate(DemandRQVO rqVO, MfDemand entity) { | 393 | protected void afterUpdate(MfDemand entity, DemandRQVO rqVO) { | 
| 296 | //region 1.输出特殊转换 | 394 | //region 1.输出特殊转换 | 
| 297 | 395 | ||
| 298 | //region 1.1.输出过滤与补充处理 | 396 | //region 1.1.输出过滤与补充处理 | 
| ... | @@ -303,9 +401,9 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -303,9 +401,9 @@ public class DemandServiceImpl implements DemandService { | 
| 303 | 401 | ||
| 304 | 402 | ||
| 305 | /** | 403 | /** | 
| 306 | * 删除前置处理 | 404 | * 数据需求删除前置处理 | 
| 307 | * @author xushaobo | 405 | * @author xcq | 
| 308 | * @date 2024-12-30 16:30 | 406 | * @date 2024-12-31 18:46 | 
| 309 | * @param entity | 407 | * @param entity | 
| 310 | * @return void | 408 | * @return void | 
| 311 | */ | 409 | */ | 
| ... | @@ -313,12 +411,16 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -313,12 +411,16 @@ public class DemandServiceImpl implements DemandService { | 
| 313 | if (entity == null) { | 411 | if (entity == null) { | 
| 314 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | 412 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, messageSourceUtil.notExistsToDelMessage(FUNCTION_NAME)); | 
| 315 | } | 413 | } | 
| 414 | if (ApprovalStateEnum.CHECKING.getValue().equals(entity.getBizApproveState()) || | ||
| 415 | ApprovalStateEnum.PASSED.getValue().equals(entity.getBizApproveState())) { | ||
| 416 | throw new CsbrSystemException(SystemError.DATA_DEL_ERROR, "审批中和审批通过的数据不能删除!"); | ||
| 417 | } | ||
| 316 | } | 418 | } | 
| 317 | 419 | ||
| 318 | /** | 420 | /** | 
| 319 | * 删除后置处理 | 421 | * 数据需求删除后置处理 | 
| 320 | * @author xushaobo | 422 | * @author xcq | 
| 321 | * @date 2024-12-30 16:30 | 423 | * @date 2024-12-31 18:46 | 
| 322 | * @param entity | 424 | * @param entity | 
| 323 | * @return void | 425 | * @return void | 
| 324 | */ | 426 | */ | 
| ... | @@ -327,20 +429,29 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -327,20 +429,29 @@ public class DemandServiceImpl implements DemandService { | 
| 327 | } | 429 | } | 
| 328 | 430 | ||
| 329 | /** | 431 | /** | 
| 330 | * 查询方法前置验证、处理 | 432 | * 数据需求查询方法前置验证、处理 | 
| 331 | * @author xushaobo | 433 | * @author xcq | 
| 332 | * @date 2024-12-30 16:30 | 434 | * @date 2024-12-31 18:46 | 
| 333 | * @param rqQueryVO | 435 | * @param rqQueryVO | 
| 334 | * @return void | 436 | * @return void | 
| 335 | */ | 437 | */ | 
| 336 | private void beforeQuery(DemandQueryVO rqQueryVO) { | 438 | private void beforeQuery(DemandQueryVO rqQueryVO) { | 
| 337 | 439 | rqQueryVO.setIsNeedQuery(true); | |
| 440 | if (approvalFlowUtil.isQueryBizGuid(rqQueryVO)) { | ||
| 441 | rqQueryVO.setFlowType(FLOW_TYPE); | ||
| 442 | List<String> bizGuidList = approvalFlowUtil.getApprovalBizGuids(rqQueryVO); | ||
| 443 | if (CollectionUtils.isEmpty(bizGuidList)) { | ||
| 444 | rqQueryVO.setIsNeedQuery(false); | ||
| 445 | } else { | ||
| 446 | rqQueryVO.setGuidList(bizGuidList); | ||
| 447 | } | ||
| 448 | } | ||
| 338 | } | 449 | } | 
| 339 | 450 | ||
| 340 | /** | 451 | /** | 
| 341 | * 查询方法后置数据转换、处理 | 452 | * 数据需求查询方法后置数据转换、处理 | 
| 342 | * @author xushaobo | 453 | * @author xcq | 
| 343 | * @date 2024-12-30 16:30 | 454 | * @date 2024-12-31 18:46 | 
| 344 | * @param pageList 数据库查询数据 | 455 | * @param pageList 数据库查询数据 | 
| 345 | * @param rsPageList 返回的最终数据 | 456 | * @param rsPageList 返回的最终数据 | 
| 346 | * @return void | 457 | * @return void | 
| ... | @@ -363,11 +474,11 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -363,11 +474,11 @@ public class DemandServiceImpl implements DemandService { | 
| 363 | //region 辅助操作 | 474 | //region 辅助操作 | 
| 364 | 475 | ||
| 365 | /** | 476 | /** | 
| 366 | * 实体数据转换为视图对象数据(多个) | 477 | * 数据需求实体数据转换为视图对象数据(多个) | 
| 367 | * @author xushaobo | 478 | * @author xcq | 
| 368 | * @date 2024-12-30 16:30 | 479 | * @date 2024-12-31 18:46 | 
| 369 | * @param entityList 实体数据列表 | 480 | * @param entityList 实体数据列表 | 
| 370 | * @return java.util.List<com.csbr.qingcloud.domain.vo.DemandRSVO> 视图对象列表 | 481 | * @return java.util.List<com.csbr.qingcloud.portal.domain.vo.DemandRSVO> 视图对象列表 | 
| 371 | */ | 482 | */ | 
| 372 | private List<DemandRSVO> convertToVO(List<MfDemand> entityList) { | 483 | private List<DemandRSVO> convertToVO(List<MfDemand> entityList) { | 
| 373 | if (CollectionUtils.isEmpty(entityList)) { | 484 | if (CollectionUtils.isEmpty(entityList)) { | 
| ... | @@ -384,23 +495,25 @@ public class DemandServiceImpl implements DemandService { | ... | @@ -384,23 +495,25 @@ public class DemandServiceImpl implements DemandService { | 
| 384 | } | 495 | } | 
| 385 | 496 | ||
| 386 | /** | 497 | /** | 
| 387 | * 实体数据转换为视图对象数据 | 498 | * 数据需求实体数据转换为视图对象数据 | 
| 388 | * @author xushaobo | 499 | * @author xcq | 
| 389 | * @date 2024-12-30 16:30 | 500 | * @date 2024-12-31 18:46 | 
| 390 | * @param entity | 501 | * @param entity | 
| 391 | * @return com.csbr.qingcloud.domain.vo.DemandRSVO | 502 | * @return com.csbr.qingcloud.portal.domain.vo.DemandRSVO | 
| 392 | */ | 503 | */ | 
| 393 | private DemandRSVO convertToVO(MfDemand entity) { | 504 | private DemandRSVO convertToVO(MfDemand entity) { | 
| 394 | DemandRSVO vo = csbrBeanUtil.convert(entity, DemandRSVO.class); | 505 | DemandRSVO vo = csbrBeanUtil.convert(entity, DemandRSVO.class); | 
| 506 | //流程数据处理 | ||
| 507 | vo.setApproveVO(approvalFlowUtil.getApprovalInfo(entity.getGuid())); | ||
| 395 | return vo; | 508 | return vo; | 
| 396 | } | 509 | } | 
| 397 | 510 | ||
| 398 | /** | 511 | /** | 
| 399 | * 新增、修改和其他情况的参数转换为实体 | 512 | * 数据需求新增、修改和其他情况的参数转换为实体 | 
| 400 | * @author xushaobo | 513 | * @author xcq | 
| 401 | * @date 2024-12-30 16:30 | 514 | * @date 2024-12-31 18:46 | 
| 402 | * @param vo | 515 | * @param vo | 
| 403 | * @return com.csbr.qingcloud.mybatis.entity.MfDemand | 516 | * @return com.csbr.qingcloud.portal.mybatis.entity.MfDemand | 
| 404 | */ | 517 | */ | 
| 405 | private MfDemand convertToEntity(DemandRQVO vo) { | 518 | private MfDemand convertToEntity(DemandRQVO vo) { | 
| 406 | MfDemand entity = csbrBeanUtil.convert(vo, MfDemand.class); | 519 | MfDemand entity = csbrBeanUtil.convert(vo, MfDemand.class); | ... | ... | 
| 1 | package com.csbr.qingcloud.service; | ||
| 2 | |||
| 3 | import csbr.cloud.entity.domain.base.vo.PageListVO; | ||
| 4 | import com.csbr.qingcloud.domain.vo.DemandQueryVO; | ||
| 5 | import com.csbr.qingcloud.domain.vo.DemandRQVO; | ||
| 6 | import com.csbr.qingcloud.domain.vo.DemandRSVO; | ||
| 7 | |||
| 8 | import java.util.List; | ||
| 9 | |||
| 10 | /** | ||
| 11 | * @program: D:/csbr/sjzc/ms-data-circulation-portal-service | ||
| 12 | * @description: 业务逻辑接口 | ||
| 13 | * @author: xushaobo | ||
| 14 | * @create: 2024-12-30 16:31 | ||
| 15 | **/ | ||
| 16 | public interface DemandService { | ||
| 17 | |||
| 18 | /** | ||
| 19 | * 分页查询 | ||
| 20 | * @author xushaobo | ||
| 21 | * @date 2024-12-30 16:31 | ||
| 22 | * @param queryVO | ||
| 23 | * @return com.csbr.cloud.mybatis.entity.PageListVO<com.csbr.qingcloud.domain.vo.DemandRSVO> | ||
| 24 | */ | ||
| 25 | PageListVO<DemandRSVO> pageList(DemandQueryVO queryVO); | ||
| 26 | |||
| 27 | /** | ||
| 28 | * 获取详情数据 | ||
| 29 | * @author xushaobo | ||
| 30 | * @date 2024-12-30 16:31 | ||
| 31 | * @param guid | ||
| 32 | * @return com.csbr.qingcloud.domain.vo.DemandRSVO | ||
| 33 | */ | ||
| 34 | DemandRSVO getDemandDetail(String guid); | ||
| 35 | |||
| 36 | /** | ||
| 37 | * 数据新增 | ||
| 38 | * @author xushaobo | ||
| 39 | * @date 2024-12-30 16:31 | ||
| 40 | * @param rqVO | ||
| 41 | * @return boolean | ||
| 42 | */ | ||
| 43 | void saveDemand(DemandRQVO rqVO); | ||
| 44 | |||
| 45 | /** | ||
| 46 | * 数据修改 | ||
| 47 | * @author xushaobo | ||
| 48 | * @date 2024-12-30 16:31 | ||
| 49 | * @param rqVO | ||
| 50 | * @return boolean | ||
| 51 | */ | ||
| 52 | void updateDemand(DemandRQVO rqVO); | ||
| 53 | |||
| 54 | /** | ||
| 55 | * 数据删除 | ||
| 56 | * @author xushaobo | ||
| 57 | * @date 2024-12-30 16:31 | ||
| 58 | * @param guids | ||
| 59 | * @return void | ||
| 60 | */ | ||
| 61 | void removeByGuids(List<String> guids); | ||
| 62 | |||
| 63 | /** | ||
| 64 | * 数据删除、并有相关的处理操作 | ||
| 65 | * @author xushaobo | ||
| 66 | * @date 2024-12-30 16:31 | ||
| 67 | * @param guids | ||
| 68 | * @return void | ||
| 69 | */ | ||
| 70 | void removeHandleByGuids(List<String> guids); | ||
| 71 | |||
| 72 | } | 
- 
Please register or sign in to post a comment
