diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributor.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributor.java index 1d33ebc4f0..1603efd718 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributor.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributor.java @@ -98,4 +98,18 @@ public class BaseDistributor extends BaseEntity { private String disLevelKey; @ApiModelProperty("级别value") private String disLevelValue; + @ApiModelProperty("流程定义的id") + private String procDefId; + @ApiModelProperty("环节定义的sid") + private String nodeSid; + @ApiModelProperty("流程实例的id") + private String procInstId; + @ApiModelProperty("流程状态") + private String nodeState; + @ApiModelProperty("任务id") + private String taskId; + @ApiModelProperty("使用组织全路径") + private String orgSidPath; + @ApiModelProperty("办结日期") + private Date closingDate; } diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorDetailsVo.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorDetailsVo.java index 99541a864a..8629d64dfa 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorDetailsVo.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorDetailsVo.java @@ -24,7 +24,7 @@ public class BaseDistributorDetailsVo implements Vo { @ApiModelProperty("统一社会信用代码") private String registNum; @ApiModelProperty("成立时间") - @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date setUpTime; @ApiModelProperty("注册(登记)地址") private String registDetailAddress; @@ -71,7 +71,7 @@ public class BaseDistributorDetailsVo implements Vo { @ApiModelProperty("是否担保 0是/1否") private String isGuarantee; @ApiModelProperty("开始合作日期") - @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date startCoopDate; @ApiModelProperty("创建组织") private String createOrg; @@ -101,4 +101,11 @@ public class BaseDistributorDetailsVo implements Vo { private List frsfzList; @ApiModelProperty("其他资料附件list") private List qtzlList; + @ApiModelProperty("taskId") + private String taskId; // taskId + @ApiModelProperty("流程实例的sid") + private String procInsId; // 流程实例的sid + @ApiModelProperty("userSid") + private String userSid; + private String orgSidPath; } diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorDto.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorDto.java index ca99df98a4..2f6987158a 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorDto.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorDto.java @@ -108,4 +108,5 @@ public class BaseDistributorDto implements Dto { private List frsfzList; @ApiModelProperty("其他资料附件list") private List qtzlList; + private String orgSidPath; } \ No newline at end of file diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeign.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeign.java index 98106f87f5..e4965fae94 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeign.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeign.java @@ -1,12 +1,14 @@ package com.yxt.anrui.base.api.basedistributor; import com.yxt.anrui.base.api.basedistributor.app.*; +import com.yxt.anrui.base.api.basedistributor.flow.*; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.SpringQueryMap; import org.springframework.web.bind.annotation.*; @@ -82,8 +84,46 @@ public interface BaseDistributorFeign { @ApiOperation("PC端-中介人员-经销商列表") @PostMapping("/getDistributors") ResultBean> getDistributors(@RequestBody BaseDistributorsListQuery pagerQuery); - //---------------------------------------移动端-------------------------------------------------// + //---------------------------------------------- 流程接口 --------------------------------------------------/ + @ApiOperation("经销商备案提交") + @PostMapping("/submit") + public ResultBean submitRecordApplication(@RequestBody @Valid SubmitBaseDistributorApplyDto dto); + + @ApiOperation(value = "办理(同意)") + @PostMapping("/complete") + public ResultBean complete(@Valid @RequestBody BaseDistributorCompleteDto dto); + + //分公司到风控中心同意 + @ApiOperation(value = "办理(同意)") + @PostMapping("/companyToDivisionOperate") + public ResultBean companyToDivisionOperate(@Valid @RequestBody BaseDistributorCompleteDto query); + + @ApiOperation(value = "撤回流程") + @PostMapping(value = "/revokeProcess") + public ResultBean revokeProcess(@ApiParam(value = "工作流任务相关--请求参数") @RequestBody BaseDistributorTaskQuery query); + + @ApiOperation(value = "驳回任务") + @PostMapping(value = "/reject") + public ResultBean taskReject(@ApiParam(value = "工作流任务相关--请求参数") @RequestBody BaseDistributorTaskQuery query); + + @ApiOperation(value = "终止任务") + @PostMapping(value = "/breakProcess") + public ResultBean breakProcess(@RequestBody BaseDistributorTaskQuery query); + + @ApiOperation(value = "流程历史流转记录") + @GetMapping(value = "/task/flowRecord/{procInsId}/{deployId}") + public ResultBean flowRecord(@ApiParam(value = "流程实例id") @PathVariable(value = "procInsId") String procInsId); + + @ApiOperation(value = "获取下一个环节") + @GetMapping(value = "/getNextNodesForSubmit") + ResultBean> getNextNodesForSubmit(@Valid @SpringQueryMap GetNodeQuery query); + + @ApiOperation(value = "获取上一个环节") + @GetMapping(value = "/getPreviousNodesForReject") + ResultBean> getPreviousNodesForReject(@Valid @SpringQueryMap GetNodeQuery query); + + //---------------------------------------移动端-------------------------------------------------// @ApiOperation("移动端-销售订单-经销商分页列 表") @PostMapping("/getDistributorList") ResultBean> getDistributorList(@RequestBody PagerQuery pagerQuery); @@ -142,13 +182,18 @@ public interface BaseDistributorFeign { @ApiOperation("查询所有经销商信息") @GetMapping("/selectAllDisList") - ResultBean> selectAllDisList(@RequestParam("orgSid") String orgSid,@RequestParam("staffSid") String staffSid); + ResultBean> selectAllDisList(@RequestParam("orgSid") String orgSid, @RequestParam("staffSid") String staffSid); @ApiOperation("移动端查询经销商和客户信息") @GetMapping("/invoiceName") - ResultBean> invoiceName(@RequestParam("userSid") String userSid,@RequestParam("orgPath") String orgPath,@RequestParam(value = "search",required = false) String search); + ResultBean> invoiceName(@RequestParam("userSid") String userSid, @RequestParam("orgPath") String orgPath, @RequestParam(value = "search", required = false) String search); @ApiOperation("根据sid查询所有经销商信息") @GetMapping("/selectDisListBySid/{sid}") ResultBean selectDisListBySid(@PathVariable("sid") String sid); + + //---------------------------------------移动端流程---------------------------------------------// + @ApiOperation("经销商备案提交") + @PostMapping("/submitDistributor") + public ResultBean submitDistributor(@RequestBody @Valid AppSubmitDistributorApplyDto dto); } \ No newline at end of file diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeignFallback.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeignFallback.java index de95d0f4f4..8f2e2f8b36 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeignFallback.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorFeignFallback.java @@ -1,6 +1,7 @@ package com.yxt.anrui.base.api.basedistributor; import com.yxt.anrui.base.api.basedistributor.app.*; +import com.yxt.anrui.base.api.basedistributor.flow.*; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; @@ -82,6 +83,51 @@ public class BaseDistributorFeignFallback implements BaseDistributorFeign { return null; } + @Override + public ResultBean submitRecordApplication(SubmitBaseDistributorApplyDto dto) { + return null; + } + + @Override + public ResultBean complete(BaseDistributorCompleteDto dto) { + return null; + } + + @Override + public ResultBean companyToDivisionOperate(BaseDistributorCompleteDto query) { + return null; + } + + @Override + public ResultBean revokeProcess(BaseDistributorTaskQuery query) { + return null; + } + + @Override + public ResultBean taskReject(BaseDistributorTaskQuery query) { + return null; + } + + @Override + public ResultBean breakProcess(BaseDistributorTaskQuery query) { + return null; + } + + @Override + public ResultBean flowRecord(String procInsId) { + return null; + } + + @Override + public ResultBean> getNextNodesForSubmit(GetNodeQuery query) { + return null; + } + + @Override + public ResultBean> getPreviousNodesForReject(GetNodeQuery query) { + return null; + } + @Override public ResultBean> getDistributorList(PagerQuery pagerQuery) { return null; @@ -167,5 +213,10 @@ public class BaseDistributorFeignFallback implements BaseDistributorFeign { return null; } + @Override + public ResultBean submitDistributor(AppSubmitDistributorApplyDto dto) { + return null; + } + } \ No newline at end of file diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorVo.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorVo.java index 8c3c617c99..96018d6534 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorVo.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/BaseDistributorVo.java @@ -102,4 +102,11 @@ public class BaseDistributorVo implements Vo { private String disLevelValue; @ApiModelProperty("是否关联(0未关联,1已关联)") private String isRelation; + @ApiModelProperty("备案状态") + private String state; + private String procDefId; + @ApiModelProperty("实例id") + private String procInstId; + @ApiModelProperty("流程状态") + private String nodeState; } diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/app/BaseDisDetailsVo.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/app/BaseDisDetailsVo.java index 49ac1bf739..773b9075f7 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/app/BaseDisDetailsVo.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/app/BaseDisDetailsVo.java @@ -22,6 +22,7 @@ public class BaseDisDetailsVo implements Vo { private BaseFileVo fileInfo; @ApiModelProperty(value = "人员列表") private List records; - + private String procInstId; + private String taskId; } diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/app/BaseDistribuDeailVo.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/app/BaseDistribuDeailVo.java index 89f8fe6124..fe76a6da4d 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/app/BaseDistribuDeailVo.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/app/BaseDistribuDeailVo.java @@ -20,7 +20,8 @@ public class BaseDistribuDeailVo implements Vo { private Integer invoiceInfoState; @ApiModelProperty(value = "文件信息状态") private Integer fileInfoState; - + private String procInstId; + private String taskId; private List records; } diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/app/BaseDistributorsVo.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/app/BaseDistributorsVo.java index 3f75aa9f16..89b31a2269 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/app/BaseDistributorsVo.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/app/BaseDistributorsVo.java @@ -31,4 +31,6 @@ public class BaseDistributorsVo implements Vo { private String invoPhone; @ApiModelProperty(value = "成立日期") private String setUpTime; + //private String nodeState; + private boolean updateBtn; } diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/AppSubmitDistributorApplyDto.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/AppSubmitDistributorApplyDto.java new file mode 100644 index 0000000000..60810c8704 --- /dev/null +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/AppSubmitDistributorApplyDto.java @@ -0,0 +1,23 @@ +package com.yxt.anrui.base.api.basedistributor.flow; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author Administrator + * @description + * @date 2023/7/14 9:15 + */ +@Data +public class AppSubmitDistributorApplyDto implements Dto { + @ApiModelProperty("distributorSid") + private String distributorSid; + @ApiModelProperty("任务id") + private String taskId; + @ApiModelProperty("流程实例id") + @JsonProperty("procInsId") + private String instanceId; + +} diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/BaseDistributorCompleteDto.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/BaseDistributorCompleteDto.java new file mode 100644 index 0000000000..c02d08103d --- /dev/null +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/BaseDistributorCompleteDto.java @@ -0,0 +1,40 @@ +package com.yxt.anrui.base.api.basedistributor.flow; + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.Map; + +/** + * @Author dimengzhe + * @Date 2022/6/28 9:01 + * @Description + */ +@Data +public class BaseDistributorCompleteDto implements Dto { + private static final long serialVersionUID = 3240453987322803352L; + @ApiModelProperty(value = "用户sid") + @NotBlank(message = "参数错误:userSid") + private String userSid; + @ApiModelProperty(value = "用户全路径sid") + private String orgSidPath; + @ApiModelProperty(value = "节点id") + @NotBlank(message = "参数错误:taskDefKey") + private String taskDefKey; + @ApiModelProperty(value = "任务id") + @NotBlank(message = "参数错误:taskId") + private String taskId; + @ApiModelProperty(value = "流程id") + @NotBlank(message = "参数错误:instanceId") + private String instanceId; + @ApiModelProperty(value = "意见") + @NotBlank(message = "参数错误:comment") + private String comment; + @ApiModelProperty(value = "业务sid") + @NotBlank(message = "参数错误:businessSid") + private String businessSid; + @ApiModelProperty(value = "分支字段及业务字段") + private Map formVariables; +} diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/BaseDistributorTaskQuery.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/BaseDistributorTaskQuery.java new file mode 100644 index 0000000000..9715775bd1 --- /dev/null +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/BaseDistributorTaskQuery.java @@ -0,0 +1,56 @@ +package com.yxt.anrui.base.api.basedistributor.flow; + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Author dimengzhe + * @Date 2022/6/28 17:29 + * @Description 终止、撤回、驳回查询参数 + */ +@Data +public class BaseDistributorTaskQuery implements Query { + private static final long serialVersionUID = -4006020771892400451L; + /** + * 终止、驳回、撤回 + */ + @ApiModelProperty("任务Id") + @NotBlank(message = "参数错误:taskId") + private String taskId; + /** + * 终止、驳回、撤回 + */ + @ApiModelProperty("业务sid") + @NotBlank(message = "参数错误:businessSid") + private String businessSid; + /** + * 终止、驳回 + */ + @ApiModelProperty("任务意见") + private String comment; + /** + * 终止、撤回、驳回 + */ + @ApiModelProperty("用户Sid") + private String userSid; + /** + * 终止 + */ + @ApiModelProperty("流程实例Id") + private String instanceId; + /*@ApiModelProperty("用户Id") + private String userId; + @ApiModelProperty("节点") + private String targetKey; + @ApiModelProperty("流程变量信息") + private Map values = new HashMap<>(); + @ApiModelProperty("审批人") + private String assignee; + @ApiModelProperty("候选人") + private List candidateUsers = new ArrayList<>(); + @ApiModelProperty("审批组") + private List candidateGroups = new ArrayList<>();*/ +} diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/GetNodeQuery.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/GetNodeQuery.java new file mode 100644 index 0000000000..35032b4e74 --- /dev/null +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/GetNodeQuery.java @@ -0,0 +1,26 @@ +package com.yxt.anrui.base.api.basedistributor.flow; + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Map; + +/** + * @Author dimengzhe + * @Date 2022/6/28 10:42 + * @Description + */ +@Data +public class GetNodeQuery implements Query { + private static final long serialVersionUID = -5674867230708197611L; + + @ApiModelProperty(value = "环节定义id") + private String taskDefKey; + @ApiModelProperty(value = "业务sid") + private String businessSid; + + @ApiModelProperty(value = "分支字段及业务字段") + private Map formVariables; + +} diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/GetNodeVo.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/GetNodeVo.java new file mode 100644 index 0000000000..94d40520c8 --- /dev/null +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/GetNodeVo.java @@ -0,0 +1,25 @@ +package com.yxt.anrui.base.api.basedistributor.flow; + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +/** + * @Author dimengzhe + * @Date 2022/6/28 11:09 + * @Description + */ +@Data +public class GetNodeVo implements Vo { + private static final long serialVersionUID = 8802774014747063504L; + @ApiModelProperty(value = "节点名称") + private String name; + @ApiModelProperty(value = "节点id") + private String id; + @ApiModelProperty(value = "审批组") + private List candidateGroups; + @ApiModelProperty(value = "是否是最后环节") + private String endTask; +} diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/SubmitBaseDistributorApplyDto.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/SubmitBaseDistributorApplyDto.java new file mode 100644 index 0000000000..20a755f9c9 --- /dev/null +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basedistributor/flow/SubmitBaseDistributorApplyDto.java @@ -0,0 +1,22 @@ +package com.yxt.anrui.base.api.basedistributor.flow; + +import com.yxt.anrui.base.api.basedistributor.BaseDistributorDto; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author dimengzhe + * @Date 2022/6/27 13:38 + * @Description + */ +@Data +public class SubmitBaseDistributorApplyDto extends BaseDistributorDto { + private static final long serialVersionUID = 378585162071125756L; + @ApiModelProperty("流程实例id") + private String instanceId; + @ApiModelProperty("任务id") + private String taskId; + @ApiModelProperty("业务sid") + private String sid; +} diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.java b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.java index d0410c1f7c..2aa5b669b5 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.java +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.java @@ -136,4 +136,6 @@ public interface BaseDistributorMapper extends BaseMapper { BaseDistributorListVo selectDisListBySid(String sid); List selectAppAllDisList(@Param("sid") String sid, @Param("search") String search); + + int updateFlowFiled(Map map); } \ No newline at end of file diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.xml b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.xml index 1964ffaf6c..beeed4c8f7 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.xml +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basedistributor/BaseDistributorMapper.xml @@ -12,7 +12,14 @@ bd.invoBankNum, bd.setUpTime, bd.isGuarantee, - bd.pDistributorName + bd.pDistributorName, + bd.procDefId, + bd.procInstId, + bd.nodeState, + case bd.state + when 1 then '未报备' + when 3 then '报备中' + when 2 then '已报备' end as `state` FROM base_distributor bd ${ew.sqlSegment} @@ -95,7 +102,7 @@ SELECT bd.sid, bd.disName, - case bd.state - when 1 then '未备案' - when 2 then '已备案' end as state, + bd.nodeState as state, if(length(bd.pDistributorName)>0,bd.pDistributorName,'无') as pDistributorName, bd.registNum, bd.registDetailAddress, bd.invoPhone, + bd.nodeState, DATE_FORMAT(bd.setUpTime, '%Y-%m-%d') as setUpTime FROM base_distributor bd @@ -168,7 +174,7 @@ @@ -194,6 +200,21 @@ invoBank = #{invoBank} where sid = #{sid} + + UPDATE base_distributor + SET nodeState=#{nodeState} + , nodeSid=#{taskDefKey} + + , procDefId=#{procDefId} + + + , procInstId=#{procInsId} + + + , taskId=#{taskId} + + WHERE sid = #{sid} + SELECT * FROM base_vehicle - WHERE vinNo = #{vinNo} + WHERE vinNo LIKE concat('%', #{vinNo}, '%') AND createOrgSid = #{createOrgSid} AND isDelete = 0 AND vehicleState != "0004" diff --git a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/FinSelectVo.java b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/FinSelectVo.java index 254ae749ce..34412939b2 100644 --- a/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/FinSelectVo.java +++ b/anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/FinSelectVo.java @@ -10,7 +10,7 @@ import lombok.Data; */ @Data public class FinSelectVo { - + private String receivablesSid; @ApiModelProperty("款项名称") private String receivablesName; @@ -23,4 +23,14 @@ public class FinSelectVo { private String notSubscriptionMoney; private String remarks; + @ApiModelProperty("付款时间") + private String subscriptionDate; + @ApiModelProperty("收款开户行") + private String collectionBank; + @ApiModelProperty("收款账户") + private String receivingName; + @ApiModelProperty("付款人") + private String payerName; + @ApiModelProperty("付款时间") + private String collectionDate; } diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java index 55553c48a5..53452e525d 100644 --- a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java @@ -82,9 +82,14 @@ import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempVo; import com.yxt.anrui.fin.api.finbillapplication.FinBillApplicationDto; import com.yxt.anrui.fin.api.finbillapplication.FinBillApplicationFeign; import com.yxt.anrui.fin.api.finbillvehicle.FinBillVehicleDto; +import com.yxt.anrui.fin.api.fincollectionconfirmation.FinCollectionConfirmationDetailsVo; +import com.yxt.anrui.fin.api.fincollectionconfirmation.FinCollectionConfirmationFeign; import com.yxt.anrui.fin.api.fincompanyinvoicing.FinCompanyInvoicingDetailsVo; import com.yxt.anrui.fin.api.fincompanyinvoicing.FinCompanyInvoicingFeign; +import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.FinSelectedReceivablesDetailed; +import com.yxt.anrui.fin.api.finselectedreceivablesdetailed.FinSelectedReceivablesDetailedFeign; import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailed.FinUncollectedReceivablesDetailedFeign; +import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailed.FinUncollectedReceivablesDetailedVo; import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailed.ReceiveInvoiceVo; import com.yxt.anrui.fin.api.finuncollectedreceivablesdetailed.ReceiveSeleteVo; import com.yxt.anrui.fin.api.finvehicleinvoice.FinVehicleInvoice; @@ -204,6 +209,11 @@ public class BusDeliveredApplyService extends MybatisBaseService defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); - if(StringUtils.isNotBlank(defaultIdReltBean.getData())){ + if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { //数据权限ID(1集团、2事业部、3分公司、4部门、5个人) String orgSidPath = query.getOrgPath(); orgSidPath = orgSidPath + "/"; @@ -285,17 +295,17 @@ public class BusDeliveredApplyService extends MybatisBaseService p = new PagerVo<>(); return p; } - }else{ + } else { PagerVo p = new PagerVo<>(); return p; } - }else{ + } else { qw.eq("bd.applySid", query.getApplySid()); } } @@ -303,9 +313,9 @@ public class BusDeliveredApplyService extends MybatisBaseService pagging = baseMapper.selectPageVo(page, qw); List records = pagging.getRecords(); for (BusDeliveredApplyVo record : records) { - if(query.getApplySid().equals(record.getCreateBySid())){ + if (query.getApplySid().equals(record.getCreateBySid())) { record.setAllowModify(true); - }else{ + } else { record.setAllowModify(false); } } @@ -726,7 +736,7 @@ public class BusDeliveredApplyService extends MybatisBaseService variables = new HashMap<>(); + Map variables = new HashMap<>(); //若app移动端有此功能,则传递appMap参数 Map appMap = new HashMap<>(); //需和移动端沟通业务sid保存的属性具体值:appMap中sid不是固定的。移动端提供具体字段。 @@ -736,24 +746,24 @@ public class BusDeliveredApplyService extends MybatisBaseService detailsVoResultBean = loanSolutionsFeign.selectDetailsss(busSalesOrder.getSid()); - if(detailsVoResultBean.getData() != null){ - if("01".equals(detailsVoResultBean.getData().getTypeKey())){ + if (detailsVoResultBean.getData() != null) { + if ("01".equals(detailsVoResultBean.getData().getTypeKey())) { //自营非担保 - variables.put("isDanBao",true); - }else{ - variables.put("isDanBao",false); + variables.put("isDanBao", true); + } else { + variables.put("isDanBao", false); } } - }else{ - variables.put("isDanBao",false); + } else { + variables.put("isDanBao", false); } - }else{ - variables.put("isDanBao",true); + } else { + variables.put("isDanBao", true); } FlowProcessMapQuery flowProcessMapQuery = new FlowProcessMapQuery(); flowProcessMapQuery.setProDefKey(busDeliveredApply.getProcDefId()); @@ -815,12 +825,12 @@ public class BusDeliveredApplyService extends MybatisBaseService> rb = new ResultBean<>(); BusinessVariables bv = new BusinessVariables(); BeanUtil.copyProperties(query, bv); - if(StringUtils.isNotBlank(query.getBusinessSid())){ + if (StringUtils.isNotBlank(query.getBusinessSid())) { BusDeliveredApply busDeliveredApply = fetchBySid(query.getBusinessSid()); bv.setModelId(busDeliveredApply.getProcDefId()); - Map variables = new HashMap<>(); + Map variables = new HashMap<>(); //若app移动端有此功能,则传递appMap参数 Map appMap = new HashMap<>(); //需和移动端沟通业务sid保存的属性具体值:appMap中sid不是固定的。移动端提供具体字段。 @@ -1208,25 +1218,25 @@ public class BusDeliveredApplyService extends MybatisBaseService detailsVoResultBean = loanSolutionsFeign.selectDetailsss(busSalesOrder.getSid()); - if(detailsVoResultBean.getData() != null){ - if("01".equals(detailsVoResultBean.getData().getTypeKey())){ + if (detailsVoResultBean.getData() != null) { + if ("01".equals(detailsVoResultBean.getData().getTypeKey())) { //自营非担保 - variables.put("isDanBao",true); - }else{ - variables.put("isDanBao",false); + variables.put("isDanBao", true); + } else { + variables.put("isDanBao", false); } } - }else{ - variables.put("isDanBao",false); + } else { + variables.put("isDanBao", false); } - }else{ - variables.put("isDanBao",true); + } else { + variables.put("isDanBao", true); } FlowProcessMapQuery flowProcessMapQuery = new FlowProcessMapQuery(); flowProcessMapQuery.setProDefKey(busDeliveredApply.getProcDefId()); @@ -1234,7 +1244,7 @@ public class BusDeliveredApplyService extends MybatisBaseService> rb = ResultBean.fireFail(); BusinessVariables bv = new BusinessVariables(); BeanUtil.copyProperties(query, bv); - if(StringUtils.isNotBlank(query.getBusinessSid())){ + if (StringUtils.isNotBlank(query.getBusinessSid())) { BusDeliveredApply busDeliveredApply = fetchBySid(query.getBusinessSid()); bv.setModelId(busDeliveredApply.getProcDefId()); - Map variables = new HashMap<>(); + Map variables = new HashMap<>(); //若app移动端有此功能,则传递appMap参数 Map appMap = new HashMap<>(); //需和移动端沟通业务sid保存的属性具体值:appMap中sid不是固定的。移动端提供具体字段。 @@ -1266,25 +1276,25 @@ public class BusDeliveredApplyService extends MybatisBaseService detailsVoResultBean = loanSolutionsFeign.selectDetailsss(busSalesOrder.getSid()); - if(detailsVoResultBean.getData() != null){ - if("01".equals(detailsVoResultBean.getData().getTypeKey())){ + if (detailsVoResultBean.getData() != null) { + if ("01".equals(detailsVoResultBean.getData().getTypeKey())) { //自营非担保 - variables.put("isDanBao",true); - }else{ - variables.put("isDanBao",false); + variables.put("isDanBao", true); + } else { + variables.put("isDanBao", false); } } - }else{ - variables.put("isDanBao",false); + } else { + variables.put("isDanBao", false); } - }else{ - variables.put("isDanBao",true); + } else { + variables.put("isDanBao", true); } FlowProcessMapQuery flowProcessMapQuery = new FlowProcessMapQuery(); flowProcessMapQuery.setProDefKey(busDeliveredApply.getProcDefId()); @@ -1292,7 +1302,7 @@ public class BusDeliveredApplyService extends MybatisBaseService>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); @@ -1327,25 +1337,25 @@ public class BusDeliveredApplyService extends MybatisBaseService detailsVoResultBean = loanSolutionsFeign.selectDetailsss(busSalesOrder.getSid()); - if(detailsVoResultBean.getData() != null){ - if("01".equals(detailsVoResultBean.getData().getTypeKey())){ + if (detailsVoResultBean.getData() != null) { + if ("01".equals(detailsVoResultBean.getData().getTypeKey())) { //自营非担保 - variables.put("isDanBao",true); - }else{ - variables.put("isDanBao",false); + variables.put("isDanBao", true); + } else { + variables.put("isDanBao", false); } } - }else{ - variables.put("isDanBao",false); + } else { + variables.put("isDanBao", false); } - }else{ - variables.put("isDanBao",true); + } else { + variables.put("isDanBao", true); } FlowProcessMapQuery flowProcessMapQuery = new FlowProcessMapQuery(); flowProcessMapQuery.setProDefKey(busDeliveredApply.getProcDefId()); @@ -1428,25 +1438,25 @@ public class BusDeliveredApplyService extends MybatisBaseService detailsVoResultBean = loanSolutionsFeign.selectDetailsss(busSalesOrder.getSid()); - if(detailsVoResultBean.getData() != null){ - if("01".equals(detailsVoResultBean.getData().getTypeKey())){ + if (detailsVoResultBean.getData() != null) { + if ("01".equals(detailsVoResultBean.getData().getTypeKey())) { //自营非担保 - variables.put("isDanBao",true); - }else{ - variables.put("isDanBao",false); + variables.put("isDanBao", true); + } else { + variables.put("isDanBao", false); } } - }else{ - variables.put("isDanBao",false); + } else { + variables.put("isDanBao", false); } - }else{ - variables.put("isDanBao",true); + } else { + variables.put("isDanBao", true); } FlowProcessMapQuery flowProcessMapQuery = new FlowProcessMapQuery(); flowProcessMapQuery.setProDefKey(busDeliveredApply.getProcDefId()); @@ -1495,7 +1505,7 @@ public class BusDeliveredApplyService extends MybatisBaseService resultBean = flowableFeign.breakProcess(flowTaskVo); @@ -1508,7 +1518,7 @@ public class BusDeliveredApplyService extends MybatisBaseService qw = new QueryWrapper<>(); String orgPath = pagerQuery.getParams().getOrgPath(); //========================================数据授权开始 - if(StringUtils.isNotBlank(query.getMenuSid())){ + if (StringUtils.isNotBlank(query.getMenuSid())) { //======================= PrivilegeQuery privilegeQuery = new PrivilegeQuery(); privilegeQuery.setOrgPath(query.getOrgPath()); privilegeQuery.setMenuSid(query.getMenuSid()); privilegeQuery.setUserSid(query.getUserSid()); ResultBean defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); - if(StringUtils.isNotBlank(defaultIdReltBean.getData())){ + if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { //数据权限ID(1集团、2事业部、3分公司、4部门、5个人) String orgSidPath = query.getOrgPath(); orgSidPath = orgSidPath + "/"; @@ -1568,17 +1578,17 @@ public class BusDeliveredApplyService extends MybatisBaseService p = new PagerVo<>(); return p; } - }else{ + } else { PagerVo p = new PagerVo<>(); return p; } - }else{ + } else { String orgSid = ""; if (StringUtils.isNotBlank(orgPath)) { orgSid = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); @@ -1592,16 +1602,16 @@ public class BusDeliveredApplyService extends MybatisBaseService iPage = baseMapper.getRetrievalApplyList(page, qw, pagerQuery.getParams().getName()); List records = iPage.getRecords(); records.removeAll(Collections.singleton(null)); - if(!records.isEmpty()){ - for (AppDeliveredApplyPageVo appDeliveredApplyPageVo : records){ - if(query.getUserSid().equals(appDeliveredApplyPageVo.getCreateBySid()) && appDeliveredApplyPageVo.isShowDelete()){ + if (!records.isEmpty()) { + for (AppDeliveredApplyPageVo appDeliveredApplyPageVo : records) { + if (query.getUserSid().equals(appDeliveredApplyPageVo.getCreateBySid()) && appDeliveredApplyPageVo.isShowDelete()) { appDeliveredApplyPageVo.setShowDelete(true); - }else{ + } else { appDeliveredApplyPageVo.setShowDelete(false); } - if(query.getUserSid().equals(appDeliveredApplyPageVo.getCreateBySid()) && appDeliveredApplyPageVo.isShowUpdata()){ + if (query.getUserSid().equals(appDeliveredApplyPageVo.getCreateBySid()) && appDeliveredApplyPageVo.isShowUpdata()) { appDeliveredApplyPageVo.setShowUpdata(true); - }else{ + } else { appDeliveredApplyPageVo.setShowUpdata(false); } } @@ -1739,10 +1749,10 @@ public class BusDeliveredApplyService extends MybatisBaseService busVinSidList = baseMapper.selectByContractNoToVinSid(dto.getContractId(),vinSid); + List busVinSidList = baseMapper.selectByContractNoToVinSid(dto.getContractId(), vinSid); busSidList.removeAll(busVinSidList); busVinSidList.removeAll(Collections.singleton(null)); - if(busVinSidList.isEmpty()){ + if (busVinSidList.isEmpty()) { isTrue = true; } //是否是最后一批出库车辆 - if(isTrue){ + if (isTrue) { //是否存在未赠送的套餐,如果存在则不允许提交 int num = baseMapper.selectNumByContractNo(dto.getContractId()); int orderNum = busSalesOrderDiscountService.selectByContractNo(dto.getContractId()); - if(orderNum>num){ + if (orderNum > num) { return rb.setMsg("本次出库为该订单最后一批出库,还存在未赠送的套餐,不允许提交"); } } @@ -2142,26 +2152,26 @@ public class BusDeliveredApplyService extends MybatisBaseService detailsVoResultBean = loanSolutionsFeign.selectDetailsss(busSalesOrder.getSid()); - if(detailsVoResultBean.getData() != null){ - if("01".equals(detailsVoResultBean.getData().getTypeKey())){ + if (detailsVoResultBean.getData() != null) { + if ("01".equals(detailsVoResultBean.getData().getTypeKey())) { //自营非担保 - variables.put("isDanBao",true); - }else{ - variables.put("isDanBao",false); + variables.put("isDanBao", true); + } else { + variables.put("isDanBao", false); } - }else{ - variables.put("isDanBao",false); + } else { + variables.put("isDanBao", false); } - }else{ - variables.put("isDanBao",false); + } else { + variables.put("isDanBao", false); } - }else{ - variables.put("isDanBao",true); + } else { + variables.put("isDanBao", true); } FlowProcessMapQuery flowProcessMapQuery = new FlowProcessMapQuery(); @@ -2265,7 +2275,37 @@ public class BusDeliveredApplyService extends MybatisBaseService receiveSeleteVoList = receiveInvoiceVoResultBean.getData().getReceiveSeleteVoList(); List voList = Optional.ofNullable(receiveSeleteVoList).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), FinSelectVo.class)).collect(Collectors.toList()); - deliveredFinVo.setFinSelectVoList(voList); + voList.removeAll(Collections.singleton(null)); + List finSelectVos = new ArrayList<>(); + if (!voList.isEmpty()) { + for (FinSelectVo finSelectVo : voList) { + String receivablesSid = finSelectVo.getReceivablesSid(); + FinSelectedReceivablesDetailed data = finSelectedReceivablesDetailedFeign.fetchByReceivablesSidLimt(receivablesSid).getData(); + if (data != null) { + String collSid = data.getCollSid(); + if (StringUtils.isNotBlank(data.getSubscriptionDate())) { + finSelectVo.setSubscriptionDate(data.getSubscriptionDate()); + } + FinCollectionConfirmationDetailsVo confirmationDetailsVo = finCollectionConfirmationFeign.fetchBySid(collSid).getData(); + if (null != confirmationDetailsVo) { + if (StringUtils.isNotBlank(confirmationDetailsVo.getCollectionBank())) { + finSelectVo.setCollectionBank(confirmationDetailsVo.getCollectionBank()); + } + if (StringUtils.isNotBlank(confirmationDetailsVo.getReceivingName())) { + finSelectVo.setReceivingName(confirmationDetailsVo.getReceivingName()); + } + if (StringUtils.isNotBlank(confirmationDetailsVo.getPayerName())) { + finSelectVo.setPayerName(confirmationDetailsVo.getPayerName()); + } + if (StringUtils.isNotBlank(confirmationDetailsVo.getCollectionDate())) { + finSelectVo.setCollectionDate(confirmationDetailsVo.getCollectionDate()); + } + } + } + finSelectVos.add(finSelectVo); + } + } + deliveredFinVo.setFinSelectVoList(finSelectVos); InvoiceVo invoiceVo = receiveInvoiceVoResultBean.getData().getInvoiceVo(); if (invoiceVo != null) { VinInvoiceVo vinInvoiceVo = new VinInvoiceVo(); diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bushandover/BusHandoverService.java b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bushandover/BusHandoverService.java index d78f569178..00f825cbec 100644 --- a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bushandover/BusHandoverService.java +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bushandover/BusHandoverService.java @@ -1306,7 +1306,8 @@ public class BusHandoverService extends MybatisBaseService voResultBean = flowableFeign.startProcess(bv); + ResultBean voResultBean = flowFeign.startProcess(bv); if (!voResultBean.getSuccess()) { return rb.setMsg(voResultBean.getMsg()); } @@ -4819,7 +4825,7 @@ public class BusSalesOrderService extends MybatisBaseService resultBean = flowableFeign.handleProsess(bv); + ResultBean resultBean = flowFeign.handleProsess(bv); if (!resultBean.getSuccess()) { return rb.setMsg(resultBean.getMsg()); } UpdateFlowFieldVo ufVo = resultBean.getData(); updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); - + busSalesOrder = fetchBySid(bv.getBusinessSid()); //极光推送 if (!"Event_end".equals(resultBean.getData().getTaskDefKey())) { - //极光推送 - busSalesOrder = fetchBySid(bv.getBusinessSid()); - MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); - MessageFlowVo messageFlowVo = new MessageFlowVo(); - BeanUtil.copyProperties(ufVo, messageFlowVo); - ufVo.setProcInsId(busSalesOrder.getProcInstId()); - messageFlowableQuery.setUfVo(messageFlowVo); - messageFlowableQuery.setAppMap((Map) variables.get("app")); - messageFlowableQuery.setBusinessSid(bv.getBusinessSid()); - messageFlowableQuery.setModuleName("销售订单申请"); - messageFlowableQuery.setMsgContent(busSalesOrder.getStaffName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); - messageFlowableQuery.setMsgTitle("销售订单"); - ResultBean stringResultBean = messageFeign.pushMessage(messageFlowableQuery); + try { + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("demo-pool-%d").build(); + ExecutorService pool = new ThreadPoolExecutor(2, 100, + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); + BusSalesOrder finalBusSalesOrder = busSalesOrder; + Future future1 = pool.submit(() -> { + //极光推送 + MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); + MessageFlowVo messageFlowVo = new MessageFlowVo(); + BeanUtil.copyProperties(ufVo, messageFlowVo); + ufVo.setProcInsId(finalBusSalesOrder.getProcInstId()); + messageFlowableQuery.setUfVo(messageFlowVo); + messageFlowableQuery.setAppMap((Map) variables.get("app")); + messageFlowableQuery.setBusinessSid(bv.getBusinessSid()); + messageFlowableQuery.setModuleName("销售订单申请"); + messageFlowableQuery.setMsgContent(finalBusSalesOrder.getStaffName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); + messageFlowableQuery.setMsgTitle("销售订单"); + ResultBean stringResultBean = messageFeign.pushMessage(messageFlowableQuery); + }); + } catch (Exception e) { + e.printStackTrace(); + } } else { ResultBean details = getSaleOrderDetails(bv.getBusinessSid()); AppOrderDetailsVo vo = details.getData(); diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicledatahandover/BusVehicleDataHandoverService.java b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicledatahandover/BusVehicleDataHandoverService.java index c203b3c0f7..469765b3da 100644 --- a/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicledatahandover/BusVehicleDataHandoverService.java +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busvehicledatahandover/BusVehicleDataHandoverService.java @@ -235,7 +235,7 @@ public class BusVehicleDataHandoverService extends MybatisBaseService - + +<#-- --> +<#-- _____--> +<#-- --> - _____ + + + + + + @@ -1421,17 +1429,33 @@ +<#-- --> +<#-- _____--> +<#-- --> - ____ + + + + + + - + +<#-- --> +<#-- _____--> +<#-- --> - ___ + + + + + + diff --git a/anrui-buscenter/anrui-buscenter-biz/src/main/resources/ftl/vinHandoverData.ftl b/anrui-buscenter/anrui-buscenter-biz/src/main/resources/ftl/vinHandoverData.ftl new file mode 100644 index 0000000000..37d92d4ed8 --- /dev/null +++ b/anrui-buscenter/anrui-buscenter-biz/src/main/resources/ftl/vinHandoverData.ftl @@ -0,0 +1,1287 @@ + + + + Administrator + FAN + 2023-04-17T03:01:26Z + 2023-07-20T03:03:44Z + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 14 + + + 2052-11.1.0.14309 + 0931D27161CC42B892BDB400A2C82318_13 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 交车资料确认单 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 单据编号: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${documentNumber!} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 制单日期: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${createTime!} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 合同编号: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${contractNo!} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 客户名称: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${customerName!} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 序号 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 车架号 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 交车资料 + + + + + <#list newList as listKey> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${listKey.sNo!} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${listKey.vinNo!} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${listKey.vehicleHandoverData!} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 接收人签字: + + + + + + + + + + + + + + + + + + + + + (要求字迹工整) + + + + + + + + + + + + + + + + + + + + + 联系电话: + + + + + + + + + + + + + + + + + + + + + 日期: + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/AppCrmCustomerTempQuery.java b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/AppCrmCustomerTempQuery.java index 9952c78458..3198e1b1b3 100644 --- a/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/AppCrmCustomerTempQuery.java +++ b/anrui-crm/anrui-crm-api/src/main/java/com/yxt/anrui/crm/api/crmcustomertemp/AppCrmCustomerTempQuery.java @@ -38,4 +38,6 @@ public class AppCrmCustomerTempQuery implements Query { // @ApiModelProperty("组织机构sid") // private String orgPath; + private String type; + } diff --git a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java index 2d992babe7..73fc005399 100644 --- a/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java +++ b/anrui-crm/anrui-crm-biz/src/main/java/com/yxt/anrui/crm/biz/crmcustomertemp/CrmCustomerTempService.java @@ -473,6 +473,9 @@ public class CrmCustomerTempService extends MybatisBaseService iPage = baseMapper.getCustomerTempListByUserSid(page, qw); diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/FinCustNameAndPhone.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/FinCustNameAndPhone.java new file mode 100644 index 0000000000..ab513d7fa7 --- /dev/null +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/FinCustNameAndPhone.java @@ -0,0 +1,15 @@ +package com.yxt.anrui.fin.api.finfundscarriedforwardapply; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class FinCustNameAndPhone { + + @ApiModelProperty("付款人姓名") + private String draweeName; + @ApiModelProperty("付款人联系电话") + private String draweeMobile; + @ApiModelProperty("业务员sid") + private String staffSid; +} diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/ZC.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/TzDto.java similarity index 52% rename from anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/ZC.java rename to anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/TzDto.java index e1e60a2632..81f66cabec 100644 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/ZC.java +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/TzDto.java @@ -1,25 +1,31 @@ package com.yxt.anrui.fin.api.finfundscarriedforwardapply; import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.NoArgsConstructor; @Data -public class ZC { +@AllArgsConstructor +@NoArgsConstructor +public class TzDto { @ApiModelProperty("调账类型") - private String zc; + private String tzType; + @ApiModelProperty("业务sud") + private String busSid; @ApiModelProperty("合同编号") private String conNo; + @ApiModelProperty("客户sid") + private String custSid; @ApiModelProperty("客户名称") private String name; + @ApiModelProperty("客户编码") + private String custNo; @ApiModelProperty("物料编码") private String vinNo; @ApiModelProperty("调出金额") - private String dcje; + private Integer dcje = 0; @ApiModelProperty("调入金额") - private String drje; - @ApiModelProperty("调出前余额") - private String dcqye; - @ApiModelProperty("调出后余额") - private String dchye; + private Integer drje = 0; } diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/ZR.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/ZR.java deleted file mode 100644 index aa6e1f8e3a..0000000000 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finfundscarriedforwardapply/ZR.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yxt.anrui.fin.api.finfundscarriedforwardapply; - -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; - -@Data -public class ZR { - - @ApiModelProperty("调账类型") - private String zr; - @ApiModelProperty("合同编号") - private String conNo; - @ApiModelProperty("客户名称") - private String name; - @ApiModelProperty("物料编码") - private String vinNo; - @ApiModelProperty("调出金额") - private String dcje; - @ApiModelProperty("调入金额") - private String drje; - @ApiModelProperty("调出前余额") - private String dcqye; - @ApiModelProperty("调出后余额") - private String dchye; -} diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailed/ReceiveInvoiceVo.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailed/ReceiveInvoiceVo.java index 9e99dcf37a..3ead3bae25 100644 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailed/ReceiveInvoiceVo.java +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailed/ReceiveInvoiceVo.java @@ -14,6 +14,8 @@ import java.util.List; @Data public class ReceiveInvoiceVo { + + private List receiveSeleteVoList = new ArrayList<>(); private InvoiceVo invoiceVo; diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailed/ReceiveSeleteVo.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailed/ReceiveSeleteVo.java index 93b2103a0e..30320d4280 100644 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailed/ReceiveSeleteVo.java +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/finuncollectedreceivablesdetailed/ReceiveSeleteVo.java @@ -3,6 +3,8 @@ package com.yxt.anrui.fin.api.finuncollectedreceivablesdetailed; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.Date; + /** * @Author dimengzhe * @Date 2023/4/19 14:18 @@ -11,6 +13,7 @@ import lombok.Data; @Data public class ReceiveSeleteVo { + private String receivablesSid; @ApiModelProperty("款项名称") private String receivablesName; @@ -23,4 +26,15 @@ public class ReceiveSeleteVo { private String notSubscriptionMoney; @ApiModelProperty("备注") private String remarks; + + @ApiModelProperty("付款时间") + private String subscriptionDate; + @ApiModelProperty("收款开户行") + private String collectionBank; + @ApiModelProperty("收款账户") + private String receivingName; + @ApiModelProperty("付款人") + private String payerName; + @ApiModelProperty("付款时间") + private String collectionDate; } diff --git a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/otherarreceivable/OtherReceivable.java b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/otherarreceivable/OtherReceivable.java index 465c2d72a7..3a665cd530 100644 --- a/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/otherarreceivable/OtherReceivable.java +++ b/anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/otherarreceivable/OtherReceivable.java @@ -15,6 +15,8 @@ import java.util.List; @Data public class OtherReceivable { + @ApiModelProperty("单据编号") + public String billNo; @ApiModelProperty("单据类型") public String billType = "QTYSD01_SYS"; @ApiModelProperty("往来单位类型") diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationMapper.xml b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationMapper.xml index 726a99f597..48a3fe8816 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationMapper.xml +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationMapper.xml @@ -201,13 +201,13 @@ - + SELECT bd.`draweeName`, + bd.draweeMobile, + ffa.`staffSid` FROM fin_funds_carried_forward_veh ffv + LEFT JOIN fin_funds_carried_forward_apply ffa + ON ffv.`mainSid` = ffa.`sid` + LEFT JOIN fin_selected_receivables_detailed fsrd + ON ffv.`busSid` = fsrd.`sid` LEFT JOIN fin_collection_confirmation fcc - ON ffv.`busSid` = fcc.`sid` + ON fsrd.`collSid` = fcc.`sid` + AND fcc.`pushMessgae` = 1 LEFT JOIN anrui_buscenter.`bus_deposit` bd ON fcc.`busSid` = bd.`billSid` - WHERE ffv.`mainSid` = #{sid} - GROUP BY bd.`draweeMobile` - - - - - \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finfundscarriedforwardveh/FinFundsCarriedForwardVehService.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finfundscarriedforwardveh/FinFundsCarriedForwardVehService.java index 721e7dd228..b5897781f1 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finfundscarriedforwardveh/FinFundsCarriedForwardVehService.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finfundscarriedforwardveh/FinFundsCarriedForwardVehService.java @@ -43,6 +43,7 @@ import com.yxt.anrui.buscenter.api.bussalesordermodel.BusSalesOrderModel; import com.yxt.anrui.buscenter.api.bussalesorderprice.BusSalesOrderPrice; import com.yxt.anrui.buscenter.api.bussalesordersubmit.BusSalesOrderSubmit; import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicle; +import com.yxt.anrui.fin.api.finfundscarriedforwardapply.FinCustNameAndPhone; import com.yxt.anrui.portal.api.flow.PCHistTaskListAndCommentList; import com.yxt.anrui.portal.api.sysorganization.SysOrganization; import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; @@ -162,15 +163,7 @@ public class FinFundsCarriedForwardVehService extends MybatisBaseService fetchByMainSidAndGroupCustPhone(String sid) { - return baseMapper.fetchByMainSidAndGroupCustPhone(sid); - } - - public List fetchJzMoneyByContractNoAndMainSid(String jzCustNo, String sid) { - return baseMapper.fetchJzMoneyByContractNoAndMainSid(jzCustNo,sid); - } - - public List fetchJzMoneyByCustSidAndMainSid(String custSid, String sid) { - return baseMapper.fetchJzMoneyByCustSidAndMainSid(custSid,sid); + public List fetchNameAndPhoneByBusSid(String busSid) { + return baseMapper.fetchNameAndPhoneByBusSid(busSid); } } \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.java index e23da0bbed..5dd9c6dc1e 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.java @@ -143,7 +143,7 @@ public interface FinSelectedReceivablesDetailedMapper extends BaseMapper selectPageLists(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw, @Param("name") String name); + + FinSelectedReceivablesDetailed fetchYeBySid(String busSid); } \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml index d8c33850db..c16d37f1c2 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedMapper.xml @@ -294,7 +294,7 @@ update fin_selected_receivables_detailed set auditState = #{auditState} - where collSid = #{collSid} + where sid = #{sid} + SELECT fsrd.contractNo, + fsrd.`customerSid`, + fsrd.`customerName`, + fsrd.`VIN`, + fsrd.collSid, + ( + fsrd.`subscriptionMoney` - COALESCE(SUM(ffc.`thisUseMoney`), 0) + ) AS balance + FROM fin_selected_receivables_detailed fsrd + LEFT JOIN `fin_funds_carried_forward_veh` ffc + ON ffc.`busSid` = fsrd.`sid` + WHERE fsrd.`sid` = #{busSid} + GROUP BY fsrd.sid + \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedService.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedService.java index dd497f100d..5140c6d1a2 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedService.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finselectedreceivablesdetailed/FinSelectedReceivablesDetailedService.java @@ -622,4 +622,8 @@ public class FinSelectedReceivablesDetailedService extends MybatisBaseService fetchJzMoneyByContractNoAndMainSid(String ysCustNo, String sid) { return baseMapper.fetchJzMoneyByContractNoAndMainSid(ysCustNo,sid); } + + public FinSelectedReceivablesDetailed fetchYeBySid(String busSid) { + return baseMapper.fetchYeBySid(busSid); + } } \ No newline at end of file diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finuncollectedreceivablesdetailed/FinUncollectedReceivablesDetailedMapper.xml b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finuncollectedreceivablesdetailed/FinUncollectedReceivablesDetailedMapper.xml index e1c3bff4d6..bba85e33fe 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finuncollectedreceivablesdetailed/FinUncollectedReceivablesDetailedMapper.xml +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/finuncollectedreceivablesdetailed/FinUncollectedReceivablesDetailedMapper.xml @@ -45,18 +45,18 @@ SELECT furd.receivablesName, furd.reveivableMoney, + furd.sid as receivablesSid, ( SELECT sum(subscriptionMoney) FROM fin_selected_receivables_detailed diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillCastToKingDeeBillFields.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillCastToKingDeeBillFields.java index 07b1942cde..96ccc0e5e0 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillCastToKingDeeBillFields.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillCastToKingDeeBillFields.java @@ -36,21 +36,21 @@ public class OtherReceivableBillCastToKingDeeBillFields { fEntityModel_ =KingDeeUtils.replaceTemplateParams(fEntityModel_, map_fEntityModel_); JSONObject jsonFEntityModel_= JSONObject.parseObject(fEntityModel_,Feature.OrderedField); - List list_fEntityDetail_=new ArrayList<>(); + List list_fEntity_=new ArrayList<>(); //对模板字段赋值 根据传递进来的map数据的集合进行赋值 for(int i=0;i params=vehicleList.get(i); - Map map_fEntityDetail_=new HashMap<>(); + Map map_fEntity_=new HashMap<>(); for (Map.Entry entry : params.entrySet()) { - map_fEntityDetail_.put(entry.getKey(),entry.getValue()); + map_fEntity_.put(entry.getKey(),entry.getValue()); } - fEntityDetail_ =KingDeeUtils.replaceTemplateParams(fEntityDetail_, map_fEntityDetail_); - list_fEntityDetail_.add(JSONObject.parseObject(fEntityDetail_,Feature.OrderedField)); + fEntity_ =KingDeeUtils.replaceTemplateParams(fEntity_, map_fEntity_); + list_fEntity_.add(JSONObject.parseObject(fEntity_,Feature.OrderedField)); } - jsonFEntityModel_.put("FEntityDetail", JSONArray.parseArray(JSON.toJSONString(list_fEntityDetail_))); + jsonFEntityModel_.put("FEntity", JSONArray.parseArray(JSON.toJSONString(list_fEntity_))); jsonFEntityData_.put("Model",JSONObject.parseObject(JSON.toJSONString(jsonFEntityModel_),Feature.OrderedField)); jsonObj.put("data",jsonFEntityData_.toJSONString()); diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillService.java b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillService.java index e4b3f64dea..dd450efe67 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillService.java +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/OtherReceivableBillService.java @@ -27,6 +27,11 @@ public class OtherReceivableBillService extends FinKingDeeService { //业务表的主表数据集合 Map map_fEntityModel_=new HashMap<>(); //物料的数组集合 + //单据编号 + if(otherReceivable.getBillNo()==null){ + return rb.setMsg("单据编号不能为空"); + } + map_fEntityModel_.put("FBillNo",otherReceivable.getBillNo()); //业务日期 if(otherReceivable.getBussDate()==null){ return rb.setMsg("业务日期不能为空"); diff --git a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/data_model.json b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/data_model.json index 37cc654b5d..d1ec9e70ad 100644 --- a/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/data_model.json +++ b/anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/otherreceivablebill/data_model.json @@ -3,7 +3,7 @@ "FBillTypeID": { "FNUMBER": "QTYSD01_SYS" }, - "FBillNo": "", + "FBillNo": "@KD_FBillNo", "FDATE": "@KD_FDATE", "FENDDATE_H": "1900-01-01", "FISINIT": "false", diff --git a/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flow2/FlowFeign.java b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flow2/FlowFeign.java new file mode 100644 index 0000000000..9e4f439e5f --- /dev/null +++ b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flow2/FlowFeign.java @@ -0,0 +1,34 @@ +package com.yxt.anrui.flowable.api.flow2; + +import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; +import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; +import com.yxt.common.core.result.ResultBean; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + * @description: + * @author: dimengzhe + * @date: 2023/7/20 + **/ +@FeignClient( + contextId = "anrui-flowable-Flow", + name = "anrui-flowable", + path = "v2/flow", + fallback = FlowFeignback.class) +public interface FlowFeign { + + @ApiOperation(value = "启动流程") + @PostMapping(value = "/startProcess") + @ResponseBody + ResultBean startProcess(@RequestBody BusinessVariables dto); + + @ApiOperation(value = "处理流程") + @PostMapping(value = "/handleProsess") + @ResponseBody + ResultBean handleProsess(@RequestBody BusinessVariables bv); +} diff --git a/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flow2/FlowFeignback.java b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flow2/FlowFeignback.java new file mode 100644 index 0000000000..4c644465b3 --- /dev/null +++ b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flow2/FlowFeignback.java @@ -0,0 +1,9 @@ +package com.yxt.anrui.flowable.api.flow2; + +/** + * @description: + * @author: dimengzhe + * @date: 2023/7/20 + **/ +public class FlowFeignback { +} diff --git a/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java index c14eed4bbb..2d6987262d 100644 --- a/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java +++ b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java @@ -51,7 +51,7 @@ public enum ProcDefEnum { BUSSALESORDERRETURNVEHAPPLY("销售订单退车申请", "process_tzjjs03y:1:1012504"), BASETRAILEROUTAPPLY("挂车出库申请", "process_tkw6vhfw:1:1705004"), FINFUNDSAPPLY("款项结转申请", "process_ypafrrvg:1:2257504"), - BUSHANDOVER("交车确认", "process_e8feloik:5:1747508"), + BUSHANDOVER("交车确认", "process_e8feloik:6:2675004"), LOANFINPOLICYRECORDAPPLY("金融产品政策备案", "process_u45lo7qc:1:2272516"), LOANOTHERPOLICYRECORDAPPLY("其它融产品备案", "process_7pptyzfc:1:2272524"), DEALERFILINGAPPLY("经销商备案", "process_jdu35cog:3:2577504"), diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableRest.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableRest.java index c2353ab93b..4286cafc9f 100644 --- a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableRest.java +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow/FlowableRest.java @@ -205,6 +205,13 @@ public class FlowableRest implements FlowableFeign { if (processVariables.containsKey("sendRecommendSid")) {//增加的其他的抄送人 userSids.append(processVariables.get("sendRecommendSid").toString()).append(","); } + //查询是否有设置转办的,抄送给设置转办人员 + List zbUserSids = processCommentService.selectByIdAndComment("转办",bv.getInstanceId()); + zbUserSids.removeAll(Collections.singleton(null)); + if(!zbUserSids.isEmpty()){ + String zbUser = String.join(",",zbUserSids); + userSids.append(zbUser).append(","); + } userSids.deleteCharAt(userSids.length() - 1); mfq.setUserSids(userSids.toString()); mfq.setOrgPath(createrOrgPath); @@ -284,11 +291,9 @@ public class FlowableRest implements FlowableFeign { public ResultBean startProcess(BusinessVariables dto) { log.info("startProcess.dto:{}", dto); ResultBean rb = ResultBean.fireFail(); - if (StringUtils.isBlank(dto.getBusinessSid())) { return rb.setMsg("businessSid 不能为空!"); } - if (dto.getFormVariables() == null) dto.setFormVariables(new HashMap()); Map formVariables = dto.getFormVariables(); @@ -296,20 +301,17 @@ public class FlowableRest implements FlowableFeign { String orgPath = dto.getOrgSidPath(); formVariables.put("createrOrgPath", orgPath);//发起人的组织结构sid } - dto.getFormVariables().put("businessSid", dto.getBusinessSid()); String nextNodeUserSids_ = dto.getNextNodeUserSids(); if (StringUtils.isBlank(nextNodeUserSids_)) { ResultBean nextNodeUserSidsOfCreate = getNextNodeUserSidsOfCreate(dto); boolean success = nextNodeUserSidsOfCreate.getSuccess(); if (!success) { -// return rb.setMsg(nextNodeUserSidsOfCreate.getMsg()); nextNodeUserSids_ = ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId(); } else { nextNodeUserSids_ = nextNodeUserSidsOfCreate.getData().getUserSid(); dto.getFormVariables().put(BusinessVariables.ORGPATH, nextNodeUserSidsOfCreate.getData().getOrgPath()); } - } dto.setNextNodeUserSids(nextNodeUserSids_); ResultBean resultBean1 = flowableService.businessStart(dto); @@ -431,7 +433,7 @@ public class FlowableRest implements FlowableFeign { //若下一环节用户与系统管理员一致,则自动审批 if (ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId().equals(nextUserSid)) { adminContains = true; - }else{ + } else { //下一环节不为空,查询下一环节用户是否有转办人 if (nextUserSid != null) { List nextUserList = Arrays.asList(nextUserSid.split(",")); @@ -531,6 +533,7 @@ public class FlowableRest implements FlowableFeign { dto.setTaskId(vo.getTaskId()); dto.setTaskDefKey(taskDefKey); dto.setComment("系统自动跳过"); + dto.setNextNodeUserSids(""); return handleProsess(dto, false); } List flowElements = processService.calApprovePath(dto.getModelId(), dto.getModelId(), diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowMapper.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowMapper.java new file mode 100644 index 0000000000..75a54ab80c --- /dev/null +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowMapper.java @@ -0,0 +1,14 @@ +package com.yxt.anrui.flowable.biz.flow2; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.yxt.anrui.flowable.api.flow.Flowable; +import org.apache.ibatis.annotations.Mapper; + +/** + * @description: + * @author: dimengzhe + * @date: 2023/7/20 + **/ +@Mapper +public interface FlowMapper extends BaseMapper { +} diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowMapper.xml b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowMapper.xml new file mode 100644 index 0000000000..155d9f2b05 --- /dev/null +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowMapper.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowRest.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowRest.java new file mode 100644 index 0000000000..255bfa6c0a --- /dev/null +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowRest.java @@ -0,0 +1,104 @@ +package com.yxt.anrui.flowable.biz.flow2; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSONObject; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; +import com.yxt.anrui.flowable.api.flow2.FlowFeign; +import com.yxt.anrui.flowable.biz.process.ProcessService; +import com.yxt.anrui.flowable.feign.MessageFeign; +import com.yxt.anrui.flowable.feign.form.MessageFlowVo; +import com.yxt.anrui.flowable.feign.form.MessageFlowableQuery; +import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; +import com.yxt.anrui.portal.api.sysflowcc.SysFlowccFeign; +import com.yxt.anrui.portal.api.sysflowcc.SysFlowccVo; +import com.yxt.anrui.portal.api.sysuser.SysUserFeign; +import com.yxt.anrui.portal.api.sysuser.SysUserVo; +import com.yxt.anrui.portal.api.sysuser.UserByRolesAndOrgQuery; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.result.ResultBean; +import org.apache.tomcat.util.threads.ThreadPoolExecutor; +import org.flowable.engine.HistoryService; +import org.flowable.task.api.history.HistoricTaskInstance; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.*; + +/** + * @description: + * @author: dimengzhe + * @date: 2023/7/20 + **/ +@RestController +@RequestMapping("v2/flow") +public class FlowRest implements FlowFeign { + Logger log = LoggerFactory.getLogger(FlowRest.class); + + @Autowired + private FlowService flowService; + + @Autowired + private SysUserFeign sysUserFeign; + + @Override + public ResultBean startProcess(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + //获取表单中的参数 + Map formVariables = bv.getFormVariables(); + formVariables = formVariables == null ? new HashMap<>() : formVariables; + //发起人的组织全路径 + String orgPath = bv.getOrgSidPath(); + formVariables.put("createrOrgPath", orgPath); + formVariables.put("businessSid", bv.getBusinessSid()); + //获取下一环节待办人 + ResultBean userResultBean = flowService.getNextNodeUser(bv); + bv.setNextNodeUserSids(userResultBean.getData()); + //启动流程实例 + ResultBean startResultBean = flowService.businessStartProcessInstanceById(bv); + return startResultBean; + } + + @Override + public ResultBean handleProsess(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + ResultBean updateFlowFieldVoResultBean = flowService.handleProsess(bv, true); + //添加抄送 + log.info("流程返回:{}", JSONObject.toJSONString(updateFlowFieldVoResultBean)); + //需要判断办结后再执行 TODO + if (updateFlowFieldVoResultBean.getSuccess()) { + log.info("流程返回:{}", JSONObject.toJSONString(updateFlowFieldVoResultBean)); + if ("Event_end".equals(updateFlowFieldVoResultBean.getData().getTaskDefKey())) { + try { + ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("demo-pool-%d").build(); + ExecutorService pool = new ThreadPoolExecutor(2, 100, + 0L, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); + + Future future1 = pool.submit(() -> { + HashMap map = new HashMap<>(); + map.put("bv", bv); + UpdateFlowFieldVo ufVo = updateFlowFieldVoResultBean.getData(); + ufVo.setTaskId(bv.getTaskId()); + map.put("uff", ufVo); + flowService.cc(map, bv.getTaskDefKey()); + }); + } catch (Exception e) { + e.printStackTrace(); + return rb.setMsg("抄送失败"); + } + } + } + return updateFlowFieldVoResultBean; + } + + +} diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowService.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowService.java new file mode 100644 index 0000000000..2ef8b208b8 --- /dev/null +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flow2/FlowService.java @@ -0,0 +1,719 @@ +package com.yxt.anrui.flowable.biz.flow2; + +import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.yxt.anrui.flowable.api.flow.Flowable; +import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; +import com.yxt.anrui.flowable.api.flowcomment.FlowComment; +import com.yxt.anrui.flowable.api.flowtask.FlowTask; +import com.yxt.anrui.flowable.api.flowtask.LatestTaskVo; +import com.yxt.anrui.flowable.api.processcomment.ProcessCommentDto; +import com.yxt.anrui.flowable.api.utils.ProcDefEnum; +import com.yxt.anrui.flowable.biz.flowtask.FlowTaskService; +import com.yxt.anrui.flowable.biz.process.ExpressionCmd; +import com.yxt.anrui.flowable.biz.process.ProcessService; +import com.yxt.anrui.flowable.biz.processcomment.ProcessCommentService; +import com.yxt.anrui.flowable.common.ProcessConstants; +import com.yxt.anrui.flowable.feign.MessageFeign; +import com.yxt.anrui.flowable.feign.form.MessageFlowVo; +import com.yxt.anrui.flowable.feign.form.MessageFlowableQuery; +import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; +import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigFeign; +import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigQuery; +import com.yxt.anrui.portal.api.sysflowableconfig.SysFlowableConfigVvo; +import com.yxt.anrui.portal.api.sysflowcc.SysFlowccFeign; +import com.yxt.anrui.portal.api.sysflowcc.SysFlowccVo; +import com.yxt.anrui.portal.api.sysuser.*; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.base.utils.StringUtils; +import com.yxt.common.core.result.ResultBean; +import lombok.extern.slf4j.Slf4j; +import org.flowable.bpmn.model.*; +import org.flowable.engine.*; +import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl; +import org.flowable.engine.repository.ProcessDefinition; +import org.flowable.engine.runtime.ProcessInstance; +import org.flowable.task.api.DelegationState; +import org.flowable.task.api.Task; +import org.flowable.task.api.history.HistoricTaskInstance; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @description: + * @author: dimengzhe + * @date: 2023/7/20 + **/ +@Service +@Slf4j +public class FlowService extends MybatisBaseService { + + @Autowired + RepositoryService repositoryService; + @Autowired + RuntimeService runtimeService; + + @Autowired + ManagementService managementService; + @Autowired + ProcessEngineConfigurationImpl processEngineConfiguration; + @Autowired + private SysUserFeign sysUserFeign; + + @Autowired + protected IdentityService identityService; + @Autowired + protected TaskService taskService; + @Autowired + private SysFlowableConfigFeign sysFlowableConfigFeign; + @Autowired + private FlowTaskService flowTaskService; + @Autowired + private ProcessCommentService processCommentService; + + @Autowired + protected HistoryService historyService; + + @Autowired + private ProcessService processService; + + @Autowired + private MessageFeign messageFeign; + @Autowired + private SysFlowccFeign sysFlowccFeign; + + public ResultBean getNextNodeUser(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + //根据业务参数取流程流转的环节 信息 + List> list = (List>) getProcessCirculationNodesByMap(bv).getData(); + if (list == null || list.size() < 2) { + return rb.setMsg("流程设计问题"); + } + //取第二个环节的配置角色 + Object o = list.get(1).get("candidateGroups"); + if (o == null) { + return rb.setMsg("流程设计问题"); + } + JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(o)); + String roleSid = jsonArray.get(0).toString(); + //根据组织架构、角色两个参数取相关符合条件的用户信息 + UserQuery userQuery = new UserQuery(); + userQuery.setRoleSid(roleSid); + userQuery.setOrgSidPath(bv.getOrgSidPath()); + String nextNodeUserSids_ = ""; + List sysUserVos = sysUserFeign.getUserByRole(userQuery).getData(); + if (sysUserVos == null || sysUserVos.size() < 1) { + nextNodeUserSids_ = ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId(); + } else { + StringBuilder nextNodeUserSids = new StringBuilder(); + for (SysUserVo su : sysUserVos) { + nextNodeUserSids.append(su.getSid()).append(","); + } + //符合条件的用户的sid,拼接的字符串 + nextNodeUserSids_ = nextNodeUserSids.toString(); + nextNodeUserSids_ = nextNodeUserSids_.substring(0, nextNodeUserSids_.length() - 1); + } + return rb.success().setData(nextNodeUserSids_); + + } + + public ResultBean getProcessCirculationNodesByMap(BusinessVariables bv) { + ResultBean>> rb = new ResultBean>>(); + String modelId = bv.getModelId(); + List flowElements = calApprovePath(modelId, bv.getFormVariables()); + List> list = new ArrayList<>(); + for (FlowElement f : flowElements) { + Map map = new HashMap<>(); + map.put("name", f.getName()); + map.put("id", f.getId()); + String s = JSON.toJSONString(f); + JSONObject jsonObject = JSONObject.parseObject(s); + log.info("item:{}", jsonObject); + Object candidateGroups = jsonObject.get("candidateGroups"); + map.put("candidateGroups", candidateGroups); + list.add(map); + } + return rb.setData(list); + } + + /** + * 1. 首先拿到BpmnModel,所有流程定义信息都可以通过BpmnModel获取;若流程尚未发起,则用modelId查询最新部署的流程定义数据; + * 若流程已经发起,可以通过流程实例的processDefinitionId查询流程定义的历史数据。 + * + * @param variableMap 流程变量,用于计算条件分支 + */ + public List calApprovePath(String modelId, Map variableMap) { + BpmnModel bpmnModel = repositoryService.getBpmnModel(modelId); + Collection flowElements = new ArrayList<>(); + Collection flowElements2 = bpmnModel.getMainProcess().getFlowElements(); + flowElements.addAll(flowElements2); + List passElements = new ArrayList<>(); + dueStartElement(passElements, flowElements, variableMap); + return passElements; + } + + /** + * 2. 找到开始节点,通过它的目标节点,然后再不断往下找。 + */ + private void dueStartElement(List passElements, Collection flowElements, Map variableMap) { + Optional startElementOpt = flowElements.stream().filter(flowElement -> flowElement instanceof StartEvent).findFirst(); + startElementOpt.ifPresent(startElement -> { + flowElements.remove(startElement); + List outgoingFlows = ((StartEvent) startElement).getOutgoingFlows(); + String targetRef = outgoingFlows.get(0).getTargetRef(); + // 根据ID找到FlowElement + FlowElement targetElementOfStartElement = getFlowElement(flowElements, targetRef); + if (targetElementOfStartElement instanceof UserTask) { + this.getPassElementList(passElements, flowElements, targetElementOfStartElement, variableMap); + } + }); + } + + /** + * 3. 我只用到了UserTask、ExclusiveGateway、ParallelGateway,所以代码里只列举了这三种,如果用到了其他的,可以再自己补充 + */ + private void getPassElementList(List passElements, Collection flowElements, FlowElement curFlowElement, Map variableMap) { + // 任务节点 + if (curFlowElement instanceof UserTask) { + this.dueUserTaskElement(passElements, flowElements, curFlowElement, variableMap); + return; + } + // 排他网关 + if (curFlowElement instanceof ExclusiveGateway) { + this.dueExclusiveGateway(passElements, flowElements, curFlowElement, variableMap); + return; + } + // 并行网关 + if (curFlowElement instanceof ParallelGateway) { + this.dueParallelGateway(passElements, flowElements, curFlowElement, variableMap); + } + } + + private void dueUserTaskElement(List passElements, Collection flowElements, + FlowElement curFlowElement, Map variableMap) { + passElements.add(curFlowElement); + List outgoingFlows = ((UserTask) curFlowElement).getOutgoingFlows(); + String targetRef = outgoingFlows.get(0).getTargetRef(); + if (outgoingFlows.size() > 1) { + // 找到表达式成立的sequenceFlow + SequenceFlow sequenceFlow = getSequenceFlow(variableMap, outgoingFlows); + targetRef = sequenceFlow.getTargetRef(); + } + // 根据ID找到FlowElement + FlowElement targetElement = getFlowElement(flowElements, targetRef); + this.getPassElementList(passElements, flowElements, targetElement, variableMap); + } + + private void dueExclusiveGateway(List passElements, Collection flowElements, FlowElement curFlowElement, Map variableMap) { + // 获取符合条件的sequenceFlow的目标FlowElement + List exclusiveGatewayOutgoingFlows = ((ExclusiveGateway) curFlowElement).getOutgoingFlows(); + flowElements.remove(curFlowElement); + // 找到表达式成立的sequenceFlow + SequenceFlow sequenceFlow = getSequenceFlow(variableMap, exclusiveGatewayOutgoingFlows); + // 根据ID找到FlowElement + FlowElement targetElement = getFlowElement(flowElements, sequenceFlow.getTargetRef()); + this.getPassElementList(passElements, flowElements, targetElement, variableMap); + } + + private void dueParallelGateway(List passElements, Collection flowElements, FlowElement curFlowElement, Map variableMap) { + FlowElement targetElement; + List parallelGatewayOutgoingFlows = ((ParallelGateway) curFlowElement).getOutgoingFlows(); + for (SequenceFlow sequenceFlow : parallelGatewayOutgoingFlows) { + targetElement = getFlowElement(flowElements, sequenceFlow.getTargetRef()); + this.getPassElementList(passElements, flowElements, targetElement, variableMap); + } + } + + private FlowElement getFlowElement(Collection flowElements, String targetRef) { + return flowElements.stream().filter(flowElement -> targetRef.equals(flowElement.getId())).findFirst().orElse(null); + } + + /** + * 4. 根据传入的变量,计算出表达式成立的那一条SequenceFlow + * + * @param variableMap + * @param outgoingFlows + * @return + */ + private SequenceFlow getSequenceFlow(Map variableMap, List outgoingFlows) { + Optional sequenceFlowOpt = outgoingFlows.stream().filter(item -> { + try { + return this.getElValue(item.getConditionExpression(), variableMap); + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + }).findFirst(); + return sequenceFlowOpt.orElse(outgoingFlows.get(0)); + } + + private boolean getElValue(String exp, Map variableMap) { + return managementService.executeCommand(new ExpressionCmd(runtimeService, processEngineConfiguration, null, exp, variableMap)); + } + + public ResultBean businessStartProcessInstanceById(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + UpdateFlowFieldVo updateFlowFieldVo = new UpdateFlowFieldVo(); + String procDefId = bv.getModelId(); + String userSid = bv.getUserSid(); + String nextNodeUserSids = bv.getNextNodeUserSids(); + Map variables = bv.getFormVariables(); + Map variablesSeconds = bv.getFormVariables(); + //根据流程定义id查询 + ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId) + .latestVersion().singleResult(); + if (Objects.nonNull(processDefinition) && processDefinition.isSuspended()) { + return rb.setMsg("流程已被挂起,请先激活流程"); + } + // 设置流程发起人Id到流程中 + ResultBean sysUserVoResultBean = sysUserFeign.fetchBySid(userSid); + SysUserVo sysUser = sysUserVoResultBean.getData(); + identityService.setAuthenticatedUserId(sysUser.getSid()); + variables.put(ProcessConstants.PROCESS_INITIATOR, userSid); + variables.put(ProcessConstants.USER_TYPE_ASSIGNEE, userSid); + ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, variables); + // 给第一步申请人节点设置任务执行人和意见 todo:第一个节点不设置为申请人节点有点问题? + Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult(); + if (Objects.nonNull(task)) { + taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.START.getType(), + sysUser.getName() + "发起流程申请"); + taskService.setAssignee(task.getId(), userSid); + taskService.setVariablesLocal(task.getId(), variables); + taskService.complete(task.getId(), variables); + } + + //根据流程实例的id查询最新的待办环节 + ResultBean> latestTasksNew = flowTaskService.getLatestTasksNew(processInstance.getId()); + List data = latestTasksNew.getData(); + LatestTaskVo latestTaskVo = data.get(0); + String id_ = latestTaskVo.getId_(); + String task_def_key_ = latestTaskVo.getTask_def_key_(); + //查询下一环节是否有转办并添加评论 + nextNodeUserSids = change(nextNodeUserSids, processInstance.getProcessInstanceId()); + taskService.setAssignee(id_, nextNodeUserSids); + if (ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId().equals(nextNodeUserSids)) { + bv.setModelId(procDefId); + bv.setInstanceId(task.getProcessInstanceId()); + bv.setTaskId(id_); + bv.setUserSid(nextNodeUserSids); + bv.setBusinessSid(bv.getBusinessSid()); + bv.setTaskDefKey(task_def_key_); + bv.setFormVariables(variables); + bv.setOrgSidPath(bv.getOrgSidPath()); + bv.setComment("系统自动跳过!"); + bv.setFormVariables(variablesSeconds); + bv.setNextNodeUserSids(""); + ResultBean updateFlowFieldVoResultBean = handleProsess(bv, false); + if (updateFlowFieldVoResultBean.getSuccess() && updateFlowFieldVoResultBean.getData() != null) { + UpdateFlowFieldVo vo = updateFlowFieldVoResultBean.getData(); + updateFlowFieldVo.setProcInsId(vo.getProcInsId()); + updateFlowFieldVo.setNodeState(vo.getNodeState()); + updateFlowFieldVo.setTaskId(vo.getTaskId()); + updateFlowFieldVo.setTaskDefKey(vo.getTaskDefKey()); + updateFlowFieldVo.setProcDefId(bv.getModelId()); + updateFlowFieldVo.setSid(bv.getBusinessSid()); + return rb.success().setData(updateFlowFieldVo).setMsg("流程启动成功"); + } + } + if (bv.getUserSid().equals(nextNodeUserSids)) { + //如果申请人与下一环节审批人相同,则自动审批 + bv.setModelId(procDefId); + bv.setInstanceId(task.getProcessInstanceId()); + bv.setTaskId(id_); + bv.setUserSid(nextNodeUserSids); + bv.setBusinessSid(bv.getBusinessSid()); + bv.setTaskDefKey(task_def_key_); + bv.setFormVariables(variables); + bv.setOrgSidPath(bv.getOrgSidPath()); + bv.setFormVariables(variablesSeconds); + bv.setComment("因与申请人相同,系统自动处理,需以下一级审批人审批意见为准!"); + bv.setNextNodeUserSids(""); + ResultBean updateFlowFieldVoResultBean = handleProsess(bv, false); + if (updateFlowFieldVoResultBean.getSuccess() && updateFlowFieldVoResultBean.getData() != null) { + UpdateFlowFieldVo vo = updateFlowFieldVoResultBean.getData(); + updateFlowFieldVo.setProcInsId(vo.getProcInsId()); + updateFlowFieldVo.setNodeState(vo.getNodeState()); + updateFlowFieldVo.setTaskId(vo.getTaskId()); + updateFlowFieldVo.setTaskDefKey(vo.getTaskDefKey()); + updateFlowFieldVo.setProcDefId(bv.getModelId()); + updateFlowFieldVo.setSid(bv.getBusinessSid()); + return rb.success().setData(updateFlowFieldVo).setMsg("流程启动成功"); + } + } + updateFlowFieldVo.setProcInsId(task.getProcessInstanceId()); + updateFlowFieldVo.setNodeState(latestTaskVo.getName_()); + updateFlowFieldVo.setTaskId(id_); + updateFlowFieldVo.setTaskDefKey(task_def_key_); + updateFlowFieldVo.setProcDefId(bv.getModelId()); + updateFlowFieldVo.setSid(bv.getBusinessSid()); + return rb.success().setData(updateFlowFieldVo).setMsg("流程启动成功"); + } + + /** + * 查询下一环节用户是否有转办用户,若有转办用户则添加转办评论 + * + * @param nextNodeUserSids 下一环节用户 + * @param instanceId 实例id + * @return + */ + public String change(String nextNodeUserSids, String instanceId) { + //查询下一环节是否有转办 + String firstSid = ""; + String firstName = ""; + //默认无转办 + boolean isChange = false; + if (StringUtils.isNotBlank(nextNodeUserSids)) { + List nextUserList = Arrays.asList(nextNodeUserSids.split(",")); + if (nextUserList.size() == 1) { + firstSid = nextUserList.get(0); + ResultBean userVoResultBean = sysUserFeign.fetchBySid(firstSid); + if (userVoResultBean.getData() != null) { + firstName = userVoResultBean.getData().getName(); + } + SysFlowableConfigQuery sysFlowableConfigQuery = new SysFlowableConfigQuery(); + sysFlowableConfigQuery.setUserSid(firstSid); + sysFlowableConfigQuery.setNowDate(new Date()); + ResultBean sysFlowableConfigVvoResultBean = sysFlowableConfigFeign.selectByUserSid(sysFlowableConfigQuery); + if (sysFlowableConfigVvoResultBean.getData() != null) { + if (StringUtils.isNotBlank(sysFlowableConfigVvoResultBean.getData().getChangeUserSid())) { + nextNodeUserSids = sysFlowableConfigVvoResultBean.getData().getChangeUserSid(); + isChange = true; + } + } + } + } + if (isChange) {//添加评论 + ResultBean userVoResultBean = sysUserFeign.fetchBySid(nextNodeUserSids); + ProcessCommentDto processCommentDto = new ProcessCommentDto(); + processCommentDto.setReviewerSid(firstSid); + if (userVoResultBean.getData() != null) { + String changeName = userVoResultBean.getData().getName(); + processCommentDto.setReviewer(firstName); + processCommentDto.setContent("交" + changeName + "转办"); + } + processCommentDto.setTime(new Date()); + processCommentDto.setProcessId(instanceId); + processCommentService.saveOrUpdateDto(processCommentDto); + } + return nextNodeUserSids; + } + + public ResultBean handleProsess(BusinessVariables bv, boolean b) { + ResultBean rb = ResultBean.fireFail(); + UpdateFlowFieldVo vo = new UpdateFlowFieldVo(); + //获取表单中的参数 + Map formVariables = bv.getFormVariables(); + formVariables = formVariables == null ? new HashMap<>() : formVariables; + formVariables.put("businessSid", bv.getBusinessSid()); + String nextUserSid = bv.getNextNodeUserSids(); + String taskId = bv.getTaskId(); + String userSid = bv.getUserSid(); + String instanceId = bv.getInstanceId(); + String comment = bv.getComment(); + String nodeState = ""; + String taskDefKey = ""; + String orgPath = bv.getOrgSidPath(); + //设置下一环节审批人是否自动审批通过,默认否 + boolean contains = false; + //设置是否是管理员自动审批,默认否 + boolean adminContains = false; + if (StringUtils.isBlank(nextUserSid)) { + ResultBean stringResultBean = getNextNodeUserSidsOfSubmit(bv); + if (!stringResultBean.getSuccess()) { + //下一环节用户为空的情况 + nextUserSid = ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId(); + adminContains = true; + } else { + nextUserSid = stringResultBean.getData(); + } + } else { + //若下一环节用户与系统管理员一致,则自动审批 + if (ProcDefEnum.DEFAUL_TADMIN_SID.getProDefId().equals(nextUserSid)) { + adminContains = true; + } + } + //查询任务id为taskId的任务是否存在 + Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); + if (Objects.isNull(task)) { + return rb.setMsg("任务不存在"); + } + String assignee = task.getAssignee(); + if (b && (StringUtils.isNotBlank(assignee) && assignee.indexOf(userSid) < 0)) { + return rb.setMsg("当前用户不是环节的待办人,不能进行办理操作!"); + } + + if (DelegationState.PENDING.equals(task.getDelegationState())) { + //加签 + taskService.addComment(taskId, instanceId, + FlowComment.DELEGATE.getType(), comment); + taskService.resolveTask(taskId, formVariables); + } else { + //当前环节办理通过,且将下一环节用户放入流程中 + taskService.addComment(taskId, instanceId, FlowComment.NORMAL.getType(), comment); + log.error("taskid:{},userSid:{}", taskId, userSid); + log.error("formVariables:{}", JSON.toJSONString(formVariables)); + taskService.setAssignee(taskId, userSid); + taskService.complete(taskId, formVariables);//当前用户办理通过 + //根据流程实例的id取最新的待办环节,给环节设置上用户sid + ResultBean> ll = flowTaskService.getLatestTasksNew(instanceId); + if (ll.getData().size() > 0) { + LatestTaskVo latestTaskVo = ll.getData().get(0); + String id_ = latestTaskVo.getId_(); + //查询下一环节用户是否有转办人 + nextUserSid = change(nextUserSid, bv.getInstanceId()); + taskService.setAssignee(id_, nextUserSid);//将下一环节用户放入流程中 + vo.setTaskId(id_); + //在act_ru_variable表中增加环节上的业务参数的变量 + taskService.setVariablesLocal(id_, formVariables); + nodeState = latestTaskVo.getName_(); + taskDefKey = latestTaskVo.getTask_def_key_(); + } else { + nodeState = FlowComment.SETTLE.getRemark(); + taskDefKey = "Event_end"; + vo.setNodeState(FlowComment.SETTLE.getRemark()); + } + } + //设置管理员是否自动审批的字段是否是是。//若下一环节用户与系统管理员一致,则自动审批 + if (adminContains) { + bv.setUserSid(nextUserSid); + bv.setTaskId(vo.getTaskId()); + bv.setTaskDefKey(taskDefKey); + bv.setComment("系统自动跳过"); + bv.setNextNodeUserSids(""); + return handleProsess(bv, false); + } + //获取该流程所有要走的环节节点 + List flowElements = calApprovePath(bv.getModelId(), + bv.getFormVariables()); + for (int i = 0; i < flowElements.size(); i++) { + FlowElement flowElement = flowElements.get(i); + String id = flowElement.getId(); + if (taskDefKey.equals(id) && i + 1 < flowElements.size()) { + //获取下下一环节 + FlowElement flowElement1 = flowElements.get(i + 1); + List sysUserVoLists2 = new ArrayList<>(); + if (i + 2 < flowElements.size()) { + //获取下下下一环节用户 + FlowElement flowElement2 = flowElements.get(i + 2); + if (flowElement2 instanceof UserTask) { + UserTask userTask = (UserTask) flowElement2; + List candidateGroups = userTask.getCandidateGroups(); + UserssQuery userssQuery = new UserssQuery(); + userssQuery.setCandidateGroups(candidateGroups); + userssQuery.setOrgSidPath(orgPath); + sysUserVoLists2 = sysUserFeign.getUsersByRoles(userssQuery).getData(); + if (sysUserVoLists2 == null) { + sysUserVoLists2 = new ArrayList<>(); + } + } + } + if (flowElement1 instanceof UserTask) { + UserTask userTask = (UserTask) flowElement1; + List candidateGroups = userTask.getCandidateGroups(); + List sysUserVoLists = new ArrayList<>(); + UserssQuery userssQuery = new UserssQuery(); + userssQuery.setCandidateGroups(candidateGroups); + userssQuery.setOrgSidPath(orgPath); + sysUserVoLists = sysUserFeign.getUsersByRoles(userssQuery).getData(); + if (sysUserVoLists == null) { + sysUserVoLists = new ArrayList<>(); + } + //当前环节运营部总经理 刘丽艳 点击同意 下一环节 事业部副总经理 (nextUserSid) 和事业部总经理(sysUserVoLists.get(0).getSid()) + //判断查询回来的用户的集合size是1 并且用户的sid和下一环节的用户的sid相同。 + if (sysUserVoLists.size() == 1 && sysUserVoLists.get(0).getSid().equals(nextUserSid)) { + contains = true; + break; + } + //如果下下一环节无用户,下下下一环节用户与下一环节用户相同且只有一个,则下一环节用户自动审批。 + if (sysUserVoLists.size() == 0 && sysUserVoLists2.size() == 1 && sysUserVoLists2.get(0).getSid().equals(nextUserSid)) { + contains = true; + break; + } + } + } + if (contains) { + break; + } + } + if (contains) { + bv.setUserSid(nextUserSid); + bv.setTaskId(vo.getTaskId()); + bv.setTaskDefKey(taskDefKey); + bv.setComment("因与下一级审批人相同,系统自动处理,需以下一级审批人审批意见为准!"); + return handleProsess(bv, false); + } + vo.setProcInsId(instanceId); + vo.setProcDefId(bv.getModelId()); + vo.setNodeState(nodeState); + vo.setTaskDefKey(taskDefKey); + vo.setSid(bv.getBusinessSid()); + return rb.success().setData(vo); + } + + /** + * 获取下一环节用户 + * + * @param bv + * @return + */ + public ResultBean getNextNodeUserSidsOfSubmit(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + String orgPath = bv.getOrgSidPath(); + String taskDefKey = bv.getTaskDefKey(); + //根据业务参数取流程流转的环节 信息 + List> list = (List>) getProcessCirculationNodesByMap(bv).getData(); + Map task_map = new HashMap<>(); + boolean endTask = true; + for (int i = 0; i < list.size(); i++) { + String id = list.get(i).get("id").toString(); + if (id.equals(taskDefKey) && i + 1 < list.size()) { + task_map = list.get(i + 1); + endTask = false; + } + } + if (endTask) { + task_map.put("name", "结束"); + return rb.success(); + } else { + Object o = task_map.get("candidateGroups"); + JSONArray jsonArray = JSONArray.parseArray(JSON.toJSONString(o)); + String roleSid = jsonArray.get(0).toString(); + //根据组织架构、角色两个参数取相关符合条件的用户信息 + UserQuery userQuery = new UserQuery(); + userQuery.setRoleSid(roleSid); + userQuery.setOrgSidPath(orgPath); + String nextNodeUserSids_ = ""; + List sysUserVos = sysUserFeign.getUserByRole(userQuery).getData(); + if (sysUserVos == null || sysUserVos.size() < 1) { + return rb; + } else { + StringBuilder nextNodeUserSids = new StringBuilder(); + for (SysUserVo su : sysUserVos) { + nextNodeUserSids.append(su.getSid()).append(","); + } + //符合条件的用户的sid,拼接的字符串 + nextNodeUserSids_ = nextNodeUserSids.toString(); + nextNodeUserSids_ = nextNodeUserSids_.substring(0, nextNodeUserSids_.length() - 1); + } + return rb.success().setData(nextNodeUserSids_); + } + } + + /** + * 流程抄送的功能 + * + * @param map + * @return + */ + public ResultBean cc(Map map, String taskDefKey) { + ResultBean rb = ResultBean.fireFail(); + log.info("FlowableRest-cc:{}", JSONObject.toJSONString(map)); + Object bv1 = map.get("bv"); + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(bv1, bv); + Object uff1 = map.get("uff"); + UpdateFlowFieldVo uff = new UpdateFlowFieldVo(); + BeanUtil.copyProperties(uff1, uff); + uff.setTaskDefKey(taskDefKey); + + //流程定义的id + String modelId = bv.getModelId(); + //将modelId根据冒号:分成三部分,取第一部分作为key + List stringList = Arrays.asList(modelId.split(":")); + modelId = stringList.get(0); + //抄送的角色的sid + ResultBean roleSidByModelId = sysFlowccFeign.getRoleSidByModelId(modelId); + //组织机构sid + String orgSidPath = bv.getOrgSidPath(); + if (roleSidByModelId.getData() == null) { + log.info("抄送失败,没有配置对应的角色!"); + return rb.setMsg("抄送失败,没有配置对应的角色!"); + } + SysFlowccVo data = roleSidByModelId.getData(); + if (StringUtils.isBlank(data.getRoleSid())) { + log.info("抄送失败,没有配置对应的角色!"); + return rb.setMsg("抄送失败,没有配置对应的角色!"); + } + List list = Arrays.asList(data.getRoleSid().split(",")); + UserByRolesAndOrgQuery userQuery = new UserByRolesAndOrgQuery(); + userQuery.setRoleSids(list); + userQuery.setOrgSidPath(orgSidPath); + List sysUserVos = sysUserFeign.getUserByRoles(userQuery).getData(); + if (sysUserVos == null || sysUserVos.size() < 1) { + log.info("抄送失败,没有用户!"); + return rb.setMsg("抄送失败,没有用户!"); + } + StringBuilder userName = new StringBuilder(); + StringBuilder userSids = new StringBuilder(); + sysUserVos.forEach(f -> { + userName.append(f.getName()).append(","); + userSids.append(f.getSid()).append(","); + }); + + //抄送的业务逻辑 + MessageFlowableQuery mfq = new MessageFlowableQuery(); + MessageFlowVo messageFlowVo = new MessageFlowVo(); + BeanUtil.copyProperties(uff, messageFlowVo); + mfq.setUfVo(messageFlowVo); + //移动端的参数 + HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery() + .includeProcessVariables().taskId(bv.getTaskId()).singleResult(); + if (historicTaskInstance == null) { + log.info("抄送失败:没有获取到业务参数!"); + return rb.setMsg("抄送失败!"); + } + Map processVariables = historicTaskInstance.getProcessVariables(); + String createrOrgPath = (String) processVariables.get("createrOrgPath"); + if (historicTaskInstance == null) { + log.info("抄送失败:没有获取到业务参数!"); + return rb.setMsg("抄送失败!"); + } + Map app = new HashMap<>(); + if (processVariables.get("app") != null) { + app = (Map) processVariables.get("app"); + } + log.info("抄送方法-historicTaskInstance:{}", JSONObject.toJSONString(historicTaskInstance)); + mfq.setAppMap(app); + mfq.setBusinessSid(bv.getBusinessSid()); + + mfq.setMsgContent("系统抄送的流程审批,请查看"); +// act_re_procdef + Map process = processService.getProcessDefByDefId(historicTaskInstance.getProcessDefinitionId()); + log.info("抄送成功-process:{}", process); + if (process == null) { + log.info("抄送失败,流程定义不存在!"); + return rb.setMsg("抄送失败,流程定义不存在!"); + } + mfq.setModuleName(process.get("NAME_")); + if (processVariables.containsKey("orderNames")) { + mfq.setMsgTitle(processVariables.get("orderNames").toString()); + } else { + mfq.setMsgTitle(process.get("NAME_")); + } + if (processVariables.containsKey("sendRecommendSid")) {//增加的其他的抄送人 + userSids.append(processVariables.get("sendRecommendSid").toString()).append(","); + } + //查询是否有设置转办的,抄送给设置转办人员 + List zbUserSids = processCommentService.selectByIdAndComment("转办",bv.getInstanceId()); + zbUserSids.removeAll(Collections.singleton(null)); + if(!zbUserSids.isEmpty()){ + String zbUser = String.join(",",zbUserSids); + userSids.append(zbUser).append(","); + } + userSids.deleteCharAt(userSids.length() - 1); + mfq.setUserSids(userSids.toString()); + mfq.setOrgPath(createrOrgPath); + ResultBean resultBean = messageFeign.pushMessageCC(mfq); + log.info("抄送成功:{}", userName.toString()); + log.info("抄送成功-resultBean:{}", resultBean); + if (!resultBean.getSuccess()) { + log.info("抄送失败,同送消息异常!:{}", JSONObject.toJSONString(resultBean)); + return rb.setMsg("抄送失败,同送消息异常!"); + } + return rb.success().setMsg("抄送" + userName.toString() + "成功!"); + } +} diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.java index 2974556ee8..dcc3730a67 100644 --- a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.java +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.java @@ -69,4 +69,6 @@ public interface ProcessCommentMapper extends BaseMapper { ProcessComment fetchBySid(@Param("sid")String sid); void insertByDto(ProcessCommentDto dto); + + List selectByIdAndComment(@Param("comment") String comment, @Param("instanceId") String instanceId); } \ No newline at end of file diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.xml b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.xml index 3551c99e56..b44df399cb 100644 --- a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.xml +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentMapper.xml @@ -17,4 +17,8 @@ insert into `process_comment` ( `sid`, `reviewer`, `reviewerSid`, `time`, `content`, `processId`, `processInstSid`,processFile) values(#{sid},#{reviewer},#{reviewerSid},#{time},#{content},#{processId},#{processInstSid},#{processFile}); + + \ No newline at end of file diff --git a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentService.java b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentService.java index 05da790cc9..4095efe52f 100644 --- a/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentService.java +++ b/anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/processcomment/ProcessCommentService.java @@ -135,4 +135,8 @@ public class ProcessCommentService extends MybatisBaseService selectByIdAndComment(String comment, String instanceId) { + return baseMapper.selectByIdAndComment(comment, instanceId); + } } \ No newline at end of file diff --git a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanpreloancreditapply/LoanPreloanCreditApplyVo.java b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanpreloancreditapply/LoanPreloanCreditApplyVo.java index 643aff62d2..1e3a7ca81c 100644 --- a/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanpreloancreditapply/LoanPreloanCreditApplyVo.java +++ b/anrui-riskcenter/anrui-riskcenter-api/src/main/java/com/yxt/anrui/riskcenter/api/loanpreloancreditapply/LoanPreloanCreditApplyVo.java @@ -67,4 +67,8 @@ public class LoanPreloanCreditApplyVo implements Vo { private String zffkjg; @ApiModelProperty("申诉结果") private String ssjg; + @ApiModelProperty("是否可以办理") + private Boolean isEdit; + @ApiModelProperty("是否可以删除") + private Boolean isDelete; } diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanpreloancreditapply/LoanPreloanCreditApplyService.java b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanpreloancreditapply/LoanPreloanCreditApplyService.java index baec720838..3d5e7f2c4c 100644 --- a/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanpreloancreditapply/LoanPreloanCreditApplyService.java +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loanpreloancreditapply/LoanPreloanCreditApplyService.java @@ -141,6 +141,16 @@ public class LoanPreloanCreditApplyService extends MybatisBaseService page = PagerUtil.queryToPage(pq); IPage pagging = baseMapper.selectPageVo(page, qw); + for (LoanPreloanCreditApplyVo record : pagging.getRecords()) { + String state = record.getState(); + if ("1".equals(state)){ + record.setIsEdit(true); + record.setIsDelete(true); + }else { + record.setIsEdit(false); + record.setIsDelete(false); + } + } PagerVo p = PagerUtil.pageToVo(pagging, null); return p; } @@ -224,6 +234,16 @@ public class LoanPreloanCreditApplyService extends MybatisBaseService page = PagerUtil.queryToPage(pq); IPage pagging = baseMapper.selectPageVo(page, qw); + for (LoanPreloanCreditApplyVo record : pagging.getRecords()) { + String state = record.getState(); + if ("0".equals(state)){ + record.setIsEdit(true); + record.setIsDelete(false); + }else { + record.setIsEdit(false); + record.setIsDelete(false); + } + } PagerVo p = PagerUtil.pageToVo(pagging, null); return p; } diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/resources/template_word/金融方案预估报价单1.docx b/anrui-riskcenter/anrui-riskcenter-biz/src/main/resources/template_word/金融方案预估报价单1.docx new file mode 100644 index 0000000000..58b697e3d5 --- /dev/null +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/resources/template_word/金融方案预估报价单1.docx @@ -0,0 +1,22 @@ + 金融方案预估报价单 + + 车型: +${model!} + 融资项目: +${templateName!} + 总期数 +${period!} + 前${times!}期月还 +${previousRepay!} + 剩余期数月还 +${monthlyRepay!} + 预计首期还款日 +${returnTime!} + 名义(留购)价款: +${nominalPrice!} + 注:结清时需交纳此费用 + + + 客户签章: + + 年 月 日 diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/resources/template_word/金融方案预估报价单2.docx b/anrui-riskcenter/anrui-riskcenter-biz/src/main/resources/template_word/金融方案预估报价单2.docx new file mode 100644 index 0000000000..7839b07d02 --- /dev/null +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/resources/template_word/金融方案预估报价单2.docx @@ -0,0 +1,23 @@ + 金融方案预估报价单 + + 车型: +${model!} + 融资项目: +${templateName!} + 预估应收合计 +${amountTotal!} + 总期数 +${period!} + 前${times!}期月还 +${previousRepay!} + 剩余期数月还 +${monthlyRepay!} + 名义(留购)价款: +${nominalPrice!} + 预计首期还款日 +${returnTime!} + + + 客户签章: + + 年 月 日 diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/resources/template_word/金融方案预估报价单3.docx b/anrui-riskcenter/anrui-riskcenter-biz/src/main/resources/template_word/金融方案预估报价单3.docx new file mode 100644 index 0000000000..83c4125dde --- /dev/null +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/resources/template_word/金融方案预估报价单3.docx @@ -0,0 +1,29 @@ + 金融方案预估报价单 + + 车型: +${model!} + 融资项目: +${templateName!} + 预估应收合计 +${amountTotal!} + 贷款保证金 +¥${bondAmounts!} + 落户保证金 +¥${depositSettle!} + 保险保证金 +¥${depositPremium!} + 总期数 +${period!} + 前${times!}期月还 +${previousRepay!} + 剩余期数月还 +${monthlyRepay!} + 名义(留购)价款: +¥${nominalPrice!} + 预计首期还款日 +${returnTime!} + + + 客户签章: + + 年 月 日 diff --git a/anrui-riskcenter/anrui-riskcenter-biz/src/main/resources/template_word/金融方案预估报价单4.docx b/anrui-riskcenter/anrui-riskcenter-biz/src/main/resources/template_word/金融方案预估报价单4.docx new file mode 100644 index 0000000000..bebe2bdb4b --- /dev/null +++ b/anrui-riskcenter/anrui-riskcenter-biz/src/main/resources/template_word/金融方案预估报价单4.docx @@ -0,0 +1,42 @@ + 金融方案预估报价单 + + 车型: +${model!} + 融资项目: +${templateName!} + 预估应收合计: +${amountTotal!} + 融资首付: +¥${downPayAmounts!} + 贷款保证金: +¥${bondAmounts!} + 服务费: +¥${serviceAmount!} + 代收首年保险费: +¥${proxyPremium!} + 落户保证金: +¥${depositSettle!} + 补车价: +¥${vehOtherPrice!} + 代收购置税: +¥${proxyPurchasetax!} + 保险保证金: +¥${depositPremium!} + 其他费用: +¥${otherAmount!} + 代收意外险: +${proxyAccidentPremium!} + 总期数: +${period!} + 前${times!}期月还: +${previousRepay!} + 剩余期数月还: +${monthlyRepay!} + 名义(留购)价款: +¥${nominalPrice!} + 预计首期还款日: +${returnTime!} + + 客户签章: + + 年 月 日 diff --git a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DisDetailsVo.java b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DisDetailsVo.java index 4d8575d212..84f84538c9 100644 --- a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DisDetailsVo.java +++ b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DisDetailsVo.java @@ -1,5 +1,6 @@ package com.yxt.anrui.terminal.api.autoservice.distributor; +import com.fasterxml.jackson.annotation.JsonProperty; import com.yxt.common.core.vo.Vo; import lombok.Data; @@ -22,4 +23,7 @@ public class DisDetailsVo implements Vo { private DisFileVo fileInfo; private List records = new ArrayList<>(); + @JsonProperty("procInsId") + private String procInstId; + private String taskId; } diff --git a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DisInitDetailsVo.java b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DisInitDetailsVo.java index b3e3794c3d..e0c6ca800e 100644 --- a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DisInitDetailsVo.java +++ b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DisInitDetailsVo.java @@ -1,5 +1,6 @@ package com.yxt.anrui.terminal.api.autoservice.distributor; +import com.fasterxml.jackson.annotation.JsonProperty; import com.yxt.common.core.vo.Vo; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -21,6 +22,8 @@ public class DisInitDetailsVo implements Vo { private Integer invoiceInfoState; @ApiModelProperty(value = "文件信息状态") private Integer fileInfoState; - + @JsonProperty("procInsId") + private String procInstId; + private String taskId; private List records; } diff --git a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DistributorFeign.java b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DistributorFeign.java index 186fa6ddd0..8af99f8258 100644 --- a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DistributorFeign.java +++ b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DistributorFeign.java @@ -1,13 +1,20 @@ package com.yxt.anrui.terminal.api.autoservice.distributor; +import com.yxt.anrui.terminal.api.autoservice.distributor.flowable.CompleteDistributorDto; +import com.yxt.anrui.terminal.api.autoservice.distributor.flowable.DistributorFlowableQuery; +import com.yxt.anrui.terminal.api.autoservice.distributor.flowable.DistributorTaskQuery; +import com.yxt.anrui.terminal.api.autoservice.distributor.flowable.SubmitDistributorApplyDto; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.cloud.openfeign.SpringQueryMap; import org.springframework.web.bind.annotation.*; +import javax.validation.Valid; + /** * @Author dimengzhe * @Date 2022/7/13 14:38 @@ -85,5 +92,42 @@ public interface DistributorFeign { @PostMapping("/saveDistributorFileInfo") @ResponseBody ResultBean saveDistributorFileInfo(@RequestBody DisFileDto dto); +//----------------------------------流程代码------------------------------------------------- + + @ApiOperation("提交流程") + @PostMapping("/submitDistributorBaseInfo") + @ResponseBody + ResultBean submitDistributorBaseInfo(@Valid @RequestBody SubmitDistributorApplyDto dto); + + + @ApiOperation("办理") + @PutMapping("/agreeDistributorBaseInfo") + @ResponseBody + ResultBean agreeDistributorBaseInfo(@Valid @RequestBody CompleteDistributorDto dto); + + @ApiOperation("从分公司到风控中心办理") + @PutMapping("/agreeCompanyToDivisionOperate") + @ResponseBody + ResultBean agreeCompanyToDivisionOperate(@Valid @RequestBody CompleteDistributorDto dto); + + @ApiOperation("驳回") + @PutMapping("/rejectDistributorBaseInfo") + @ResponseBody + ResultBean rejectDistributorBaseInfo(@Valid @RequestBody DistributorTaskQuery query); + + @ApiOperation("撤回") + @PutMapping("/recallDistributorBaseInfo") + @ResponseBody + ResultBean recallDistributorBaseInfo(@Valid @RequestBody DistributorTaskQuery query); + + @ApiOperation("终止") + @PutMapping("/stopDistributorBaseInfo") + @ResponseBody + ResultBean stopDistributorBaseInfo(@Valid @RequestBody DistributorTaskQuery query); + + @ApiOperation("获取流程操作标题") + @GetMapping("/getFlowOperateTitle") + @ResponseBody + ResultBean getFlowOperateTitle(@Valid @SpringQueryMap DistributorFlowableQuery query); } diff --git a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DistributorVo.java b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DistributorVo.java index 65e3f4475d..56d69b56e6 100644 --- a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DistributorVo.java +++ b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/DistributorVo.java @@ -33,7 +33,7 @@ public class DistributorVo implements Vo { private String invoPhone; @ApiModelProperty(value = "成立日期") private String setUpTime; - - + // private String nodeState; + private boolean updateBtn; } diff --git a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/flowable/CompleteDistributorDto.java b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/flowable/CompleteDistributorDto.java new file mode 100644 index 0000000000..339c71a0fb --- /dev/null +++ b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/flowable/CompleteDistributorDto.java @@ -0,0 +1,33 @@ +package com.yxt.anrui.terminal.api.autoservice.distributor.flowable; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class CompleteDistributorDto implements Dto { + private static final long serialVersionUID = -1634177638238174363L; + + @ApiModelProperty(value = "任务id") + @NotBlank(message = "参数错误:taskId") + private String taskId; + @ApiModelProperty(value = "流程id") + @NotBlank(message = "参数错误:procInsId") + @JsonProperty("procInsId") + private String instanceId; + @ApiModelProperty(value = "意见") + private String comment; + @ApiModelProperty(value = "业务sid") + @NotBlank(message = "参数错误:businessSid") + private String businessSid; + @ApiModelProperty(value = "用户sid") + @NotBlank(message = "参数错误:userSid") + private String userSid; + @ApiModelProperty(value = "节点id") + @NotBlank(message = "参数错误:taskDefKey") + private String taskDefKey; + +} diff --git a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/flowable/DistributorFlowableQuery.java b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/flowable/DistributorFlowableQuery.java new file mode 100644 index 0000000000..7e402709e2 --- /dev/null +++ b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/flowable/DistributorFlowableQuery.java @@ -0,0 +1,21 @@ +package com.yxt.anrui.terminal.api.autoservice.distributor.flowable; + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +public class DistributorFlowableQuery implements Query { + private static final long serialVersionUID = -5879668616710833830L; + + @ApiModelProperty(value = "节点key") + private String taskDefKey; + @ApiModelProperty(value = "业务sid") + private String businessSid; + @ApiModelProperty(value = "0 上一环节 1下一环节") + @NotNull(message = "参数错误:next") + private Integer next; + +} diff --git a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/flowable/DistributorTaskQuery.java b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/flowable/DistributorTaskQuery.java new file mode 100644 index 0000000000..4432dbcbe7 --- /dev/null +++ b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/flowable/DistributorTaskQuery.java @@ -0,0 +1,44 @@ +package com.yxt.anrui.terminal.api.autoservice.distributor.flowable; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +@Data +public class DistributorTaskQuery implements Query { + private static final long serialVersionUID = -6061453269533691015L; + + /** + * 终止、驳回、撤回 + */ + @ApiModelProperty("任务Id") + @NotBlank(message = "参数错误:taskId") + private String taskId; + /** + * 终止、驳回、撤回 + */ + @ApiModelProperty("业务sid") + @NotBlank(message = "参数错误:businessSid") + private String businessSid; + /** + * 终止、驳回 + */ + @ApiModelProperty("任务意见") + private String comment; + /** + * 终止、撤回、驳回 + */ + @ApiModelProperty("用户Sid") + private String userSid; + /** + * 终止 + */ + @ApiModelProperty("流程实例Id") + @JsonProperty("procInsId") + private String instanceId; + + +} diff --git a/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/flowable/SubmitDistributorApplyDto.java b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/flowable/SubmitDistributorApplyDto.java new file mode 100644 index 0000000000..dd84349744 --- /dev/null +++ b/anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/autoservice/distributor/flowable/SubmitDistributorApplyDto.java @@ -0,0 +1,22 @@ +package com.yxt.anrui.terminal.api.autoservice.distributor.flowable; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @author Administrator + * @description + * @date 2023/7/14 9:15 + */ +@Data +public class SubmitDistributorApplyDto implements Dto { + @ApiModelProperty("distributorSid") + private String distributorSid; + @ApiModelProperty("任务id") + private String taskId; + @ApiModelProperty("流程实例id") + @JsonProperty("procInsId") + private String instanceId; +} diff --git a/anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/autoservice/distributor/DistributorRest.java b/anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/autoservice/distributor/DistributorRest.java index d0cc9d5bb6..aad73939c2 100644 --- a/anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/autoservice/distributor/DistributorRest.java +++ b/anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/autoservice/distributor/DistributorRest.java @@ -1,6 +1,10 @@ package com.yxt.anrui.terminal.biz.autoservice.distributor; import com.yxt.anrui.terminal.api.autoservice.distributor.*; +import com.yxt.anrui.terminal.api.autoservice.distributor.flowable.CompleteDistributorDto; +import com.yxt.anrui.terminal.api.autoservice.distributor.flowable.DistributorFlowableQuery; +import com.yxt.anrui.terminal.api.autoservice.distributor.flowable.DistributorTaskQuery; +import com.yxt.anrui.terminal.api.autoservice.distributor.flowable.SubmitDistributorApplyDto; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; @@ -86,4 +90,39 @@ public class DistributorRest implements DistributorFeign { public ResultBean saveDistributorFileInfo(DisFileDto dto) { return distributorService.saveDistributorFileInfo(dto); } + + @Override + public ResultBean submitDistributorBaseInfo(SubmitDistributorApplyDto dto) { + return distributorService.submitDistributorBaseInfo(dto); + } + + @Override + public ResultBean agreeDistributorBaseInfo(CompleteDistributorDto dto) { + return distributorService.agreeDistributorBaseInfo(dto); + } + + @Override + public ResultBean agreeCompanyToDivisionOperate(CompleteDistributorDto dto) { + return distributorService.agreeCompanyToDivisionOperate(dto); + } + + @Override + public ResultBean rejectDistributorBaseInfo(DistributorTaskQuery query) { + return distributorService.rejectDistributorBaseInfo(query); + } + + @Override + public ResultBean recallDistributorBaseInfo(DistributorTaskQuery query) { + return distributorService.recallDistributorBaseInfo(query); + } + + @Override + public ResultBean stopDistributorBaseInfo(DistributorTaskQuery query) { + return distributorService.stopDistributorBaseInfo(query); + } + + @Override + public ResultBean getFlowOperateTitle(DistributorFlowableQuery query) { + return distributorService.getFlowOperateTitle(query); + } } diff --git a/anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/autoservice/distributor/DistributorService.java b/anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/autoservice/distributor/DistributorService.java index fc3182fdb5..2831107200 100644 --- a/anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/autoservice/distributor/DistributorService.java +++ b/anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/autoservice/distributor/DistributorService.java @@ -4,7 +4,19 @@ import cn.hutool.core.bean.BeanUtil; import com.alibaba.fastjson.JSON; import com.yxt.anrui.base.api.basedistributor.BaseDistributorFeign; import com.yxt.anrui.base.api.basedistributor.app.*; +import com.yxt.anrui.base.api.basedistributor.flow.AppSubmitDistributorApplyDto; +import com.yxt.anrui.base.api.basedistributor.flow.BaseDistributorCompleteDto; +import com.yxt.anrui.base.api.basedistributor.flow.BaseDistributorTaskQuery; +import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; +import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; +import com.yxt.anrui.portal.api.sysuser.SysUserFeign; +import com.yxt.anrui.portal.api.sysuser.SysUserVo; +import com.yxt.anrui.riskcenter.api.loanfinpolicyrecordapply.flow.GetNodeQuery; import com.yxt.anrui.terminal.api.autoservice.distributor.*; +import com.yxt.anrui.terminal.api.autoservice.distributor.flowable.CompleteDistributorDto; +import com.yxt.anrui.terminal.api.autoservice.distributor.flowable.DistributorFlowableQuery; +import com.yxt.anrui.terminal.api.autoservice.distributor.flowable.DistributorTaskQuery; +import com.yxt.anrui.terminal.api.autoservice.distributor.flowable.SubmitDistributorApplyDto; import com.yxt.anrui.terminal.config.CoverUtils; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; @@ -13,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; @@ -27,6 +40,11 @@ public class DistributorService { @Autowired private BaseDistributorFeign baseDistributorFeign; + @Autowired + private SysUserFeign sysUserFeign; + @Autowired + private SysStaffOrgFeign sysStaffOrgFeign; + public ResultBean> pageList(PagerQuery pagerQuery) { ResultBean> rb = ResultBean.fireFail(); @@ -166,4 +184,125 @@ public class DistributorService { } return rb.success(); } + + public ResultBean submitDistributorBaseInfo(SubmitDistributorApplyDto dto) { + ResultBean rb = ResultBean.fireFail(); + AppSubmitDistributorApplyDto submitDistributorApplyDto = new AppSubmitDistributorApplyDto(); + BeanUtil.copyProperties(dto, submitDistributorApplyDto); + ResultBean resultBean = baseDistributorFeign.submitDistributor(submitDistributorApplyDto); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + return rb.success(); + } + + public ResultBean agreeDistributorBaseInfo(CompleteDistributorDto dto) { + ResultBean rb = ResultBean.fireFail(); + //根据用户sid获取staffSid + ResultBean userVoResultBean = sysUserFeign.fetchBySid(dto.getUserSid()); + if (!userVoResultBean.getSuccess()) { + return rb.setMsg(userVoResultBean.getMsg()); + } + //根据staffSid获取用户的组织全路径 + ResultBean staffOrgResultBean = sysStaffOrgFeign.getOrgByStaffSid(userVoResultBean.getData().getStaffSid()); + if (!staffOrgResultBean.getSuccess()) { + return rb.setMsg(staffOrgResultBean.getMsg()); + } + //用户的组织全路径 + String orgSidPath = staffOrgResultBean.getData().getOrgSidPath(); + BaseDistributorCompleteDto baseDistributorCompleteDto = new BaseDistributorCompleteDto(); + BeanUtil.copyProperties(dto, baseDistributorCompleteDto); + baseDistributorCompleteDto.setOrgSidPath(orgSidPath); + ResultBean resultBean = baseDistributorFeign.complete(baseDistributorCompleteDto); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + return rb.success().setData(resultBean.getData()); + } + + public ResultBean agreeCompanyToDivisionOperate(CompleteDistributorDto dto) { + ResultBean rb = ResultBean.fireFail(); + //根据用户sid获取staffSid + ResultBean userVoResultBean = sysUserFeign.fetchBySid(dto.getUserSid()); + if (!userVoResultBean.getSuccess()) { + return rb.setMsg(userVoResultBean.getMsg()); + } + //根据staffSid获取用户的组织全路径 + ResultBean staffOrgResultBean = sysStaffOrgFeign.getOrgByStaffSid(userVoResultBean.getData().getStaffSid()); + if (!staffOrgResultBean.getSuccess()) { + return rb.setMsg(staffOrgResultBean.getMsg()); + } + //用户的组织全路径 + String orgSidPath = staffOrgResultBean.getData().getOrgSidPath(); + BaseDistributorCompleteDto baseDistributorCompleteDto = new BaseDistributorCompleteDto(); + BeanUtil.copyProperties(dto, baseDistributorCompleteDto); + baseDistributorCompleteDto.setOrgSidPath(orgSidPath); + ResultBean resultBean = baseDistributorFeign.companyToDivisionOperate(baseDistributorCompleteDto); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + return rb.success().setData(resultBean.getData()); + } + + public ResultBean rejectDistributorBaseInfo(DistributorTaskQuery query) { + ResultBean rb = ResultBean.fireFail(); + BaseDistributorTaskQuery taskQuery = new BaseDistributorTaskQuery(); + BeanUtil.copyProperties(query, taskQuery); + ResultBean resultBean = baseDistributorFeign.taskReject(taskQuery); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + return rb.success().setData(resultBean.getData()); + } + + public ResultBean recallDistributorBaseInfo(DistributorTaskQuery query) { + ResultBean rb = ResultBean.fireFail(); + BaseDistributorTaskQuery taskQuery = new BaseDistributorTaskQuery(); + BeanUtil.copyProperties(query, taskQuery); + ResultBean resultBean = baseDistributorFeign.revokeProcess(taskQuery); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + return rb.success().setData(resultBean.getData()); + } + + public ResultBean stopDistributorBaseInfo(DistributorTaskQuery query) { + ResultBean rb = ResultBean.fireFail(); + BaseDistributorTaskQuery taskQuery = new BaseDistributorTaskQuery(); + BeanUtil.copyProperties(query, taskQuery); + ResultBean resultBean = baseDistributorFeign.breakProcess(taskQuery); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + return rb.success().setData(resultBean.getData()); + } + + public ResultBean getFlowOperateTitle(DistributorFlowableQuery query) { + ResultBean rb = ResultBean.fireFail(); + //0 上一环节 1下一环节 + int next = query.getNext(); + com.yxt.anrui.base.api.basedistributor.flow.GetNodeQuery getNodeQuery = new com.yxt.anrui.base.api.basedistributor.flow.GetNodeQuery(); + BeanUtil.copyProperties(query, getNodeQuery); + String data = ""; + if (next == 0) { + ResultBean> getPreviousNodesForReject = baseDistributorFeign.getPreviousNodesForReject(getNodeQuery); + if (getPreviousNodesForReject.getSuccess()) { + getPreviousNodesForReject.getData().removeAll(Collections.singleton(null)); + data = getPreviousNodesForReject.getData().get(0).getName(); + } else { + return rb.setMsg(getPreviousNodesForReject.getMsg()); + } + } else if (next == 1) { + ResultBean> getNextNodesForSubmit = baseDistributorFeign.getNextNodesForSubmit(getNodeQuery); + if (getNextNodesForSubmit.getSuccess()) { + getNextNodesForSubmit.getData().removeAll(Collections.singleton(null)); + data = getNextNodesForSubmit.getData().get(0).getName(); + } else { + return rb.setMsg(getNextNodesForSubmit.getMsg()); + } + } else { + return rb.setMsg("参数错误:next"); + } + return rb.success().setData(data); + } } diff --git a/工作内容需要的文档/单据模板/款项结转打印模板/kxjz.ftl b/工作内容需要的文档/单据模板/款项结转打印模板/kxjz.ftl index 60c3b5ecae..173b1ef07d 100644 --- a/工作内容需要的文档/单据模板/款项结转打印模板/kxjz.ftl +++ b/工作内容需要的文档/单据模板/款项结转打印模板/kxjz.ftl @@ -75,7 +75,6 @@ - @@ -86,15 +85,13 @@ - - - - - - - - - + + + + + + + @@ -106,7 +103,6 @@ - @@ -121,14 +117,13 @@ - + - @@ -178,7 +173,6 @@ - @@ -193,14 +187,13 @@ - + - @@ -247,7 +240,6 @@ - @@ -256,19 +248,20 @@ + - + + - @@ -314,14 +307,13 @@ - + - @@ -367,14 +359,13 @@ - + - @@ -420,61 +411,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 物料编码 - - - - - - + @@ -482,166 +419,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 调出金额 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 调入金额 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 调出前余额 - - - - - - - - - - - - - @@ -652,442 +429,145 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - 调出后余额 - - - - - <#list zcList as zc> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.zc!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.conNo!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.name!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.vinNo!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.dcje!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.drje!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.dcqye!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zc.dchye!} - - - - - - <#list zrList as zr> + + + + + + + + + + + + + + + + + + + + + + + + + + + + 物料编码 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 调出金额 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 调入金额 + + + + + <#list tzList as tz> @@ -1098,7 +578,6 @@ - @@ -1107,19 +586,20 @@ + - + + - @@ -1155,20 +635,19 @@ - ${zr.zr!} + ${tz.tzType!} - + - @@ -1199,20 +678,19 @@ - ${zr.conNo!} + ${tz.conNo!} - + - @@ -1230,6 +708,7 @@ + @@ -1243,13 +722,13 @@ - ${zr.name!} + ${tz.name!} - + @@ -1257,7 +736,6 @@ - @@ -1275,6 +753,7 @@ + @@ -1288,21 +767,19 @@ - ${zr.vinNo!} + ${tz.vinNo!} - - + - @@ -1338,124 +815,25 @@ - ${zr.dcje!} + ${tz.dcje!} - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zr.drje!} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ${zr.dcqye!} - - - - - - - - - - - - - - - - - - @@ -1480,7 +858,7 @@ - ${zr.dchye!} + ${tz.drje!} @@ -1496,7 +874,6 @@ - @@ -1517,7 +894,6 @@ - @@ -1571,7 +947,6 @@ - @@ -1611,14 +986,12 @@ - - @@ -1662,14 +1035,13 @@ - + - @@ -1731,7 +1103,7 @@ - + @@ -1745,14 +1117,14 @@ xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"> 1 - 65 - 260 + 45 + 140 0 0 - 2 + 0 false false - 260 + 140 WPS Office_11.1.0.14309_F1E327BC-269C-435d-A152-05C5408002CA 0 @@ -1768,7 +1140,7 @@ 2023-07-10T06:09:57Z God 文档存本地丢失不负责 - 2023-07-10T06:34:23Z + 2023-07-21T00:59:39Z @@ -1781,7 +1153,7 @@ 2052-11.1.0.14309 - 90FD13DE91554DE7BE7213573AD98205_13 + 7D19BE92512D49FCAB02D5921C488073_13 @@ -1873,11 +1245,11 @@ xmlns:sl="http://schemas.openxmlformats.org/schemaLibrary/2006/main" xmlns:wpsCustomData="http://www.wps.cn/officeDocument/2013/wpsCustomData" mc:Ignorable="w14"> - + @@ -1915,14 +1287,20 @@ + + - - - - + + + + + + + + + - @@ -2336,6 +1714,7 @@ + @@ -2350,7 +1729,7 @@ - + @@ -2360,39 +1739,39 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -2471,131 +1850,160 @@ - - - + + - + - - - + + - - - + + - + - - - + + - + - - - + + - - - + + - + - + - + + + + - - + - - + - - + + + + + + + - + + + + + + + - + - + + + + + + + + + + + + - - - - - - - - - - + + - + - - - - + + + + + + + + + + + + + + + + + + + + + + - - + + - + + + diff --git a/工作内容需要的文档/单据模板/款项结转打印模板/款项结转(调账申请).doc b/工作内容需要的文档/单据模板/款项结转打印模板/款项结转(调账申请).doc index 3a10aca0ec..7773da139b 100644 --- a/工作内容需要的文档/单据模板/款项结转打印模板/款项结转(调账申请).doc +++ b/工作内容需要的文档/单据模板/款项结转打印模板/款项结转(调账申请).doc @@ -1,6 +1,9 @@ |调账申请 | |${saleDate!} | -|调账类|合同编号 |客户 |物料编码 | -|型 | |名称 | | +|调账类型 |合同编号 |客户名称 |物料编码 |调出金额 |调入金额 | +|${tz.tzTyp|${tz.conNo|${tz.name!|${tz.vinNo|${tz.dcje!|${tz.drje!| +|e!} |!} |} |!} |} |} | +|申请人|${makeName!} |审核 |${spName!} | +|: | |人: | |