diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicle.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicle.java index e260fd4874..28f68ca407 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicle.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicle.java @@ -140,4 +140,13 @@ public class BaseVehicle extends BaseEntity { private String witPinStateValue; @ApiModelProperty(value = "是否为问题车辆(0无问题 1有问题)") private String isProblemVeh; + @ApiModelProperty(value = "采购系统sid") + private String purchaseSystemSid; + @ApiModelProperty(value = "采购系统名称") + private String purchaseSystemName; + @ApiModelProperty(value = "厂家销售通路sid") + private String manufSaleAccessSid; + @ApiModelProperty(value = "厂家销售通路名称") + private String manufSaleAccessName; + } diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleDto.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleDto.java index 44e77c77fa..9b205afa71 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleDto.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleDto.java @@ -106,4 +106,12 @@ public class BaseVehicleDto implements Dto { private String witPinStateValue; @ApiModelProperty(value = "是否为问题车辆(0无问题 1有问题)") private String isProblemVeh; + @ApiModelProperty(value = "采购系统sid") + private String purchaseSystemSid; + @ApiModelProperty(value = "采购系统名称") + private String purchaseSystemName; + @ApiModelProperty(value = "厂家销售通路sid") + private String manufSaleAccessSid; + @ApiModelProperty(value = "厂家销售通路名称") + private String manufSaleAccessName; } \ No newline at end of file diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleFeign.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleFeign.java index 71bddc72d3..3bb82628a3 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleFeign.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleFeign.java @@ -166,6 +166,17 @@ public interface BaseVehicleFeign { @ResponseBody @ApiOperation(value = "导入") public ResultBean getExcelInfo(@RequestParam(value = "fileName") String fileName, @RequestParam(value = "file") MultipartFile file) throws IOException, ParseException; + + + /** + * 修改保存 + * + * @param sid 车辆sid + * @return + */ + @ApiOperation("修改车辆台账备注") + @PostMapping("/updateVehRemarks/{remarks}/{sid}") + public ResultBean updateVehRemarks(@PathVariable("remarks") String remarks, @PathVariable("sid") String sid); /***************************************************** PC现车接口 **********************************************************/ /** diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleFeignFallback.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleFeignFallback.java index 176442b218..f5ec3ad9e9 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleFeignFallback.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleFeignFallback.java @@ -98,6 +98,11 @@ public class BaseVehicleFeignFallback implements BaseVehicleFeign { return null; } + @Override + public ResultBean updateVehRemarks(String remarks, String sid) { + return null; + } + @Override public ResultBean> exiCarPagerList(PagerQuery pq) { return null; diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleSelectVo.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleSelectVo.java index f43c6d442d..999140d48f 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleSelectVo.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleSelectVo.java @@ -95,4 +95,12 @@ public class BaseVehicleSelectVo implements Vo { private String useOrgName; @ApiModelProperty(value = "是否为问题车辆(0无问题 1有问题)") private String isProblemVeh; + @ApiModelProperty(value = "采购系统sid") + private String purchaseSystemSid; + @ApiModelProperty(value = "采购系统名称") + private String purchaseSystemName; + @ApiModelProperty(value = "厂家销售通路sid") + private String manufSaleAccessSid; + @ApiModelProperty(value = "厂家销售通路名称") + private String manufSaleAccessName; } diff --git a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleVo.java b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleVo.java index 8704f5c822..767a2ea9c1 100644 --- a/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleVo.java +++ b/anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/BaseVehicleVo.java @@ -106,6 +106,14 @@ public class BaseVehicleVo implements Vo { private Long libraryAge; @ApiModelProperty(value = "是否为问题车辆(0无问题 1有问题)") private String isProblemVeh; + @ApiModelProperty(value = "采购系统sid") + private String purchaseSystemSid; + @ApiModelProperty(value = "采购系统名称") + private String purchaseSystemName; + @ApiModelProperty(value = "厂家销售通路sid") + private String manufSaleAccessSid; + @ApiModelProperty(value = "厂家销售通路名称") + private String manufSaleAccessName; //车型配置 @ApiModelProperty("车身颜色(陕汽必须的字段)") diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleMapper.java b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleMapper.java index b6d4eed199..9e7ceeb329 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleMapper.java +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleMapper.java @@ -9,6 +9,7 @@ import com.yxt.anrui.base.api.basevehicle.*; import com.yxt.anrui.base.api.basevehicle.app.AppBaseVehicleOrderVo; import com.yxt.anrui.base.api.basevehicle.app.InputVinListVo; import com.yxt.anrui.scm.api.scmvehiclepatrolinspection.AppScmVehiclePatrolinspectionPageQuery; +import com.yxt.common.core.result.ResultBean; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Update; @@ -460,4 +461,7 @@ public interface BaseVehicleMapper extends BaseMapper { IPage saleOrderVin(IPage page, @Param(Constants.WRAPPER) QueryWrapper qw, @Param("names") String names); + + @Update("update base_vehicle set remarks = #{remarks} where sid = #{sid}") + ResultBean updateVehRemarks(@Param("remarks") String remarks,@Param("sid") String sid); } \ No newline at end of file diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleRest.java b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleRest.java index 8f1016587f..83c059b4e6 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleRest.java +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleRest.java @@ -420,6 +420,11 @@ public class BaseVehicleRest implements BaseVehicleFeign { } } + @Override + public ResultBean updateVehRemarks(String remarks, String sid) { + return baseVehicleService.updateVehRemarks(remarks,sid); + } + /** * pc端现车分页列表 * diff --git a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleService.java b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleService.java index 5b100b6133..0b894d1c1c 100644 --- a/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleService.java +++ b/anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleService.java @@ -2102,10 +2102,10 @@ public class BaseVehicleService extends MybatisBaseService p = PagerUtil.pageToVo(pagging, null); return p; } + + public ResultBean updateVehRemarks(String remarks, String sid) { + return baseMapper.updateVehRemarks(remarks,sid); + } } \ No newline at end of file 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 b15a784f1f..e039930ac5 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 @@ -37,6 +37,8 @@ public enum ProcDefEnum { SCMSPECIALREBATEWITHAPPLY("专项返利预提申请","process_l0yxpgs2:1:590004"), SCMSPECIALREBATECHECKAPPLY("专项返利核对申请","process_qw22vupn:1:590008"), SCMSPECIALREBATECHEDISTRIBUTE("专项返利分配申请","process_h3w1aval:1:615004"), + SCMCOLLECTIONREBATEWITHAPPLY("回款返利预提申请","process_k4lodiyg:1:630004"), + SCMCOLLECTIONREBATECHECKAPPLY("回款返利核对申请","process_fgrv1mbv:1:630008"), CONTRACTAPPLY("合同审核","process_gd8c9xd5:1:545008"), ; diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmapplyinboundvehicle/ScmApplyInboundVehicle.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmapplyinboundvehicle/ScmApplyInboundVehicle.java index 6b66c7c0a2..f2c19e9b57 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmapplyinboundvehicle/ScmApplyInboundVehicle.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmapplyinboundvehicle/ScmApplyInboundVehicle.java @@ -33,4 +33,7 @@ public class ScmApplyInboundVehicle extends BaseEntity { @ApiModelProperty("车架号(VIN)") private String vinNo; + + @ApiModelProperty("发动机号") + private String engineNo; } diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmapplyinboundvehicle/ScmApplyInboundVehicleDto.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmapplyinboundvehicle/ScmApplyInboundVehicleDto.java index 2990c9cbd4..54a7026f04 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmapplyinboundvehicle/ScmApplyInboundVehicleDto.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmapplyinboundvehicle/ScmApplyInboundVehicleDto.java @@ -38,6 +38,9 @@ public class ScmApplyInboundVehicleDto implements Dto { @ApiModelProperty("车架号(VIN)") private String vinNo; + @ApiModelProperty("发动机号") + private String engineNo; + @ApiModelProperty("备注") private String remarks; } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmapplyinboundvehicle/ScmApplyInboundVehicleVo.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmapplyinboundvehicle/ScmApplyInboundVehicleVo.java index 8d360546a4..a8f45ce2de 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmapplyinboundvehicle/ScmApplyInboundVehicleVo.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmapplyinboundvehicle/ScmApplyInboundVehicleVo.java @@ -36,6 +36,9 @@ public class ScmApplyInboundVehicleVo implements Vo { @ApiModelProperty("车架号(VIN)") private String vinNo; + @ApiModelProperty("发动机号") + private String engineNo; + @ApiModelProperty("备注") private String remarks; } diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateFeign.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateFeign.java index 6db8157bf0..536c7995d7 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateFeign.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateFeign.java @@ -75,4 +75,21 @@ public interface ScmCollectionRebateFeign { @GetMapping("/fetchDetailsBySid/{sid}") @ResponseBody public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid); + + @ApiOperation("回款返利未预提申请选择回款返利信息") + @PostMapping("/withApplyGetCollectionRebate") + @ResponseBody + public ResultBean> withApplyGetCollectionRebate(@RequestBody PagerQuery pq); + + @ApiOperation("回款返利核对申请选择待核对回款返利信息") + @PostMapping("/checkApplyGetCollectionRebate") + @ResponseBody + public ResultBean> checkApplyGetCollectionRebate(@RequestBody PagerQuery pq); + + @ApiOperation("回款返利核对申请选择已上传回款返利信息") + @PostMapping("/checkApplyGetAlreadyUploadCollectionRebate") + @ResponseBody + public ResultBean> checkApplyGetAlreadyUploadCollectionRebate(@RequestBody PagerQuery pq); + + } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateFeignFallback.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateFeignFallback.java index 0b28c726a6..1f0d4752d1 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateFeignFallback.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateFeignFallback.java @@ -69,4 +69,19 @@ public class ScmCollectionRebateFeignFallback implements ScmCollectionRebateFeig ResultBean rb = ResultBean.fireFail(); return rb.setMsg("接口anrui-scm/scmcollectionrebate/fetchDetailsBySid无法访问"); } + + @Override + public ResultBean> withApplyGetCollectionRebate(PagerQuery pq) { + return null; + } + + @Override + public ResultBean> checkApplyGetCollectionRebate(PagerQuery pq) { + return null; + } + + @Override + public ResultBean> checkApplyGetAlreadyUploadCollectionRebate(PagerQuery pq) { + return null; + } } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateQuery.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateQuery.java index 0b1e52672a..5767a216dc 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateQuery.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateQuery.java @@ -32,6 +32,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.List; + /** * Project: anrui-scm(回款返利)
* File: ScmCollectionRebateQuery.java
@@ -51,13 +53,19 @@ public class ScmCollectionRebateQuery implements Query { @ApiModelProperty("回款方式key") private String collectionTypeKey; // 回款方式key - @ApiModelProperty("回款日期") - private String collectionDate; // 回款日期 - @ApiModelProperty(value = "创建开始日期") - private String createStartTime; - @ApiModelProperty(value = "创建结束日期") - private String createEndTime; - @ApiModelProperty("创建组织sid") + @ApiModelProperty("回款开始日期") + private String collectionStartDate; // 回款开始日期 + @ApiModelProperty("回款结束日期") + private String collectionEndDate; // 回款结束日期 + @ApiModelProperty("创建组织sid") private String createOrgSid; // 创建组织sid + @ApiModelProperty("创建开始日期") + private String createStartTime; // 创建开始日期 + @ApiModelProperty("创建结束日期") + private String createEndTime; // 创建结束日期 + @ApiModelProperty("状态") + private String state; // 状态 + @ApiModelProperty("回款返利sid") + private List sidList; // 回款返利sid } diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateVo.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateVo.java index 2513f0d8e2..e9ba51f86b 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateVo.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebate/ScmCollectionRebateVo.java @@ -26,12 +26,15 @@ package com.yxt.anrui.scm.api.scmcollectionrebate; +import com.fasterxml.jackson.annotation.JsonFormat; import com.yxt.common.core.vo.Vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.util.Date; + /** * Project: anrui-scm(回款返利)
* File: ScmCollectionRebateVo.java
@@ -68,13 +71,17 @@ public class ScmCollectionRebateVo implements Vo { @ApiModelProperty("运费") private String freight; // 运费 @ApiModelProperty("回款日期") - private String collectionDate; // 回款日期 + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date collectionDate; // 回款日期 @ApiModelProperty("计算标准") private String calculationStandard; // 计算标准 @ApiModelProperty("预计返利") private String estimateRebate; // 预计返利 @ApiModelProperty("预提日期") - private String withholdingDate; // 预提日期 + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date withholdingDate; // 预提日期 + @ApiModelProperty("预提日期(页面展示)") + private String withholdingDateCopy; // 预提日期(页面展示) @ApiModelProperty("上传日期") private String uploadDate; // 上传日期 @ApiModelProperty("上传金额") @@ -91,5 +98,6 @@ public class ScmCollectionRebateVo implements Vo { private String createOrgSid; // 创建组织sid @ApiModelProperty("创建组织名称") private String createOrgName; // 创建组织名称 - + @ApiModelProperty("上传状态(2未上传、3已上传)") + private String uploadState; // 上传状态 } diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyDto.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyDto.java index da52c75964..6699fb7bdc 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyDto.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyDto.java @@ -62,6 +62,8 @@ public class ScmCollectionRebateWithApplyDto implements Dto { private String brandName; // 品牌名称 @ApiModelProperty("回款申请标题") private String collectionApply; // 回款申请标题 + @ApiModelProperty("创建人sid") + private String createBySid; // 创建人sid @ApiModelProperty("创建人姓名") private String createByName; // 创建人姓名 @ApiModelProperty("使用组织sid") diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeign.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeign.java index 549723d423..1dc54a067b 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeign.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeign.java @@ -25,14 +25,22 @@ *********************************************************/ package com.yxt.anrui.scm.api.scmcollectionrebatewithapply; +import com.yxt.anrui.scm.api.flow.FlowTaskVo; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeQuery; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeVo; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.ScmCollectionRebateWithApplyCompleteDto; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.SubmitScmCollectionRebateWithApplyDto; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; 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.ApiParam; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.cloud.openfeign.SpringQueryMap; import org.springframework.web.bind.annotation.*; +import javax.validation.Valid; import java.util.List; /** @@ -75,4 +83,39 @@ public interface ScmCollectionRebateWithApplyFeign { @GetMapping("/fetchDetailsBySid/{sid}") @ResponseBody public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid); + + /**************************************回款返利预提审批流程*******************************************/ + + @ApiOperation("提交回款返利预提申请") + @PostMapping("/submitCollectionRebateWithApply") + public ResultBean submitCollectionRebateWithApply(@RequestBody @Valid SubmitScmCollectionRebateWithApplyDto dto); + + @ApiOperation(value = "办理(同意)") + @PostMapping("/complete") + public ResultBean complete(@Valid @RequestBody ScmCollectionRebateWithApplyCompleteDto dto); + + @ApiOperation(value = "撤回流程") + @PostMapping(value = "/revokeProcess") + public ResultBean revokeProcess(@ApiParam(value = "工作流任务相关--请求参数") @RequestBody FlowTaskVo flowTaskVo); + + @ApiOperation(value = "驳回任务") + @PostMapping(value = "/reject") + public ResultBean taskReject(@ApiParam(value = "工作流任务相关--请求参数") @RequestBody FlowTaskVo flowTaskVo); + + @ApiOperation(value = "终止任务") + @PostMapping(value = "/breakProcess") + public ResultBean breakProcess(@RequestBody FlowTaskVo flowTaskVo); + + @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); + } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeignFallback.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeignFallback.java index 2088bd3d43..2e91422f6d 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeignFallback.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyFeignFallback.java @@ -25,6 +25,11 @@ *********************************************************/ package com.yxt.anrui.scm.api.scmcollectionrebatewithapply; +import com.yxt.anrui.scm.api.flow.FlowTaskVo; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeQuery; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeVo; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.ScmCollectionRebateWithApplyCompleteDto; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.SubmitScmCollectionRebateWithApplyDto; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; @@ -69,4 +74,44 @@ public class ScmCollectionRebateWithApplyFeignFallback implements ScmCollectionR ResultBean rb = ResultBean.fireFail(); return rb.setMsg("接口anrui-scm/scmcollectionrebatewithapply/fetchDetailsBySid无法访问"); } + + @Override + public ResultBean submitCollectionRebateWithApply(SubmitScmCollectionRebateWithApplyDto dto) { + return null; + } + + @Override + public ResultBean complete(ScmCollectionRebateWithApplyCompleteDto dto) { + return null; + } + + @Override + public ResultBean revokeProcess(FlowTaskVo flowTaskVo) { + return null; + } + + @Override + public ResultBean taskReject(FlowTaskVo flowTaskVo) { + return null; + } + + @Override + public ResultBean breakProcess(FlowTaskVo flowTaskVo) { + 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; + } } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/GetNodeQuery.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/GetNodeQuery.java new file mode 100644 index 0000000000..a0b95f7c15 --- /dev/null +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/GetNodeQuery.java @@ -0,0 +1,25 @@ +package com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow; + +import com.yxt.common.core.query.Query; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +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") + @NotBlank(message = "参数错误:taskDefKey") + private String taskDefKey; + + @ApiModelProperty(value = "分支字段及业务字段") + private Map formVariables; +} diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/GetNodeVo.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/GetNodeVo.java new file mode 100644 index 0000000000..4ae014ae7f --- /dev/null +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/GetNodeVo.java @@ -0,0 +1,25 @@ +package com.yxt.anrui.scm.api.scmcollectionrebatewithapply.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-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/ScmCollectionRebateWithApplyCompleteDto.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/ScmCollectionRebateWithApplyCompleteDto.java new file mode 100644 index 0000000000..1ffedfb6e0 --- /dev/null +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/ScmCollectionRebateWithApplyCompleteDto.java @@ -0,0 +1,42 @@ +package com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow; + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.util.HashMap; +import java.util.Map; + +/** + * @Author dimengzhe + * @Date 2022/6/28 9:01 + * @Description + */ +@Data +public class ScmCollectionRebateWithApplyCompleteDto implements Dto { + private static final long serialVersionUID = 3240453987322803352L; + @ApiModelProperty(value = "用户sid") + @NotBlank(message = "参数错误:userSid") + private String userSid; + @ApiModelProperty(value = "用户全路径sid") + @NotBlank(message = "参数错误:orgSidPath") + 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 = new HashMap<>(); +} diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/ScmCollectionRebateWithApplyTaskQuery.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/ScmCollectionRebateWithApplyTaskQuery.java new file mode 100644 index 0000000000..6ab17f7d3a --- /dev/null +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/ScmCollectionRebateWithApplyTaskQuery.java @@ -0,0 +1,56 @@ +package com.yxt.anrui.scm.api.scmcollectionrebatewithapply.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 ScmCollectionRebateWithApplyTaskQuery 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-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/SubmitScmCollectionRebateWithApplyDto.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/SubmitScmCollectionRebateWithApplyDto.java new file mode 100644 index 0000000000..f83ccec739 --- /dev/null +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmcollectionrebatewithapply/flow/SubmitScmCollectionRebateWithApplyDto.java @@ -0,0 +1,22 @@ +package com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow; + +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyDto; +import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApplyDto; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * @Author dimengzhe + * @Date 2022/6/27 13:38 + * @Description + */ +@Data +public class SubmitScmCollectionRebateWithApplyDto extends ScmCollectionRebateWithApplyDto { + private static final long serialVersionUID = 378585162071125756L; + @ApiModelProperty("意见") + private String comment; + @ApiModelProperty("流程实例id") + private String instanceId; + @ApiModelProperty("任务id") + private String taskId; +} diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthVo.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthVo.java index 286280f908..8b8b52a908 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthVo.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehinventorymonth/ScmVehInventorymonthVo.java @@ -54,7 +54,7 @@ public class ScmVehInventorymonthVo implements Vo { private String sid; // sid @ApiModelProperty("生成报告状态") - private String state; + private int state; @ApiModelProperty("编号(yyyyMMdd)") private String billNo; // 编号(yyyyMMdd) @ApiModelProperty("创建时间") diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebate/ScmCollectionRebateMapper.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebate/ScmCollectionRebateMapper.java index 1305622eea..94045d5eb4 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebate/ScmCollectionRebateMapper.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebate/ScmCollectionRebateMapper.java @@ -34,6 +34,7 @@ import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import com.yxt.anrui.scm.api.scmcollectionrebate.ScmCollectionRebate; import com.yxt.anrui.scm.api.scmcollectionrebate.ScmCollectionRebateVo; +import org.apache.ibatis.annotations.Update; import java.util.List; @@ -62,4 +63,10 @@ public interface ScmCollectionRebateMapper extends BaseMapper selectListVo(); + + @Update("update scm_collection_rebate set withholdingDate = CURRENT_TIMESTAMP where sid = #{collectionRebateSid}") + void updateWithholdingDateBySid(String collectionRebateSid); + + @Update("update scm_collection_rebate set state = 1 where sid = #{collectionRebateSid}") + void updateState(String collectionRebateSid); } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebate/ScmCollectionRebateRest.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebate/ScmCollectionRebateRest.java index 89c5902953..f47b567c7b 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebate/ScmCollectionRebateRest.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebate/ScmCollectionRebateRest.java @@ -92,13 +92,13 @@ public class ScmCollectionRebateRest implements ScmCollectionRebateFeign { for (String s : stringList) { ScmCollectionRebateWithApply scmCollectionRebateWithApply = scmCollectionRebateWithApplyService.fetchBySid(s); if (!scmCollectionRebateWithApply.getNodeState().equals("待提交")) { - return rb.setMsg("所选数据中包含已提交专项返利信息,无法删除"); + return rb.setMsg("所选数据中包含已提交回款返利信息,无法删除"); } } ScmCollectionRebate scmCollectionRebate = scmCollectionRebateService.fetchBySid(sid); Integer state = scmCollectionRebate.getState(); if (state == 1) { - return rb.setMsg("所选数据中包含已预提专项返利信息,无法删除"); + return rb.setMsg("所选数据中包含已预提回款返利信息,无法删除"); } } scmCollectionRebateService.delBySids(sids); @@ -113,4 +113,25 @@ public class ScmCollectionRebateRest implements ScmCollectionRebateFeign { ScmCollectionRebateDetailsVo vo = scmCollectionRebateService.fetchDetailsVoBySid(sid); return rb.success().setData(vo); } + + @Override + public ResultBean> withApplyGetCollectionRebate(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = scmCollectionRebateService.withApplyGetCollectionRebate(pq); + return rb.success().setData(pv); + } + + @Override + public ResultBean> checkApplyGetCollectionRebate(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = scmCollectionRebateService.checkApplyGetCollectionRebate(pq); + return rb.success().setData(pv); + } + + @Override + public ResultBean> checkApplyGetAlreadyUploadCollectionRebate(PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = scmCollectionRebateService.checkApplyGetAlreadyUploadCollectionRebate(pq); + return rb.success().setData(pv); + } } diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebate/ScmCollectionRebateService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebate/ScmCollectionRebateService.java index a0720980f4..46572d24f1 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebate/ScmCollectionRebateService.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebate/ScmCollectionRebateService.java @@ -26,6 +26,7 @@ package com.yxt.anrui.scm.biz.scmcollectionrebate; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.date.DateUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.apache.commons.lang3.StringUtils; @@ -43,6 +44,7 @@ import com.yxt.anrui.scm.api.scmcollectionrebate.ScmCollectionRebateFeign; import org.springframework.stereotype.Service; +import java.util.Date; import java.util.List; /** @@ -74,9 +76,11 @@ public class ScmCollectionRebateService extends MybatisBaseService= date_format('" + collectionStartDate + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(collectionEndDate), "date_format (collectionDate,'%Y-%m-%d') <= date_format('" + collectionEndDate + "','%Y-%m-%d')" + ); String createStartTime = query.getCreateStartTime(); String createEndTime = query.getCreateEndTime(); qw.apply(StringUtils.isNotEmpty(createStartTime), "date_format (createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). @@ -122,4 +126,107 @@ public class ScmCollectionRebateService extends MybatisBaseService withApplyGetCollectionRebate(PagerQuery pq) { + ScmCollectionRebateQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getCollectionTypeKey())) { + qw.eq("collectionTypeKey", query.getCollectionTypeKey()); + } + String collectionStartDate = query.getCollectionStartDate(); + String collectionEndDate = query.getCollectionEndDate(); + qw.apply(StringUtils.isNotBlank(collectionStartDate), "date_format (collectionDate,'%Y-%m-%d') >= date_format('" + collectionStartDate + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(collectionEndDate), "date_format (collectionDate,'%Y-%m-%d') <= date_format('" + collectionEndDate + "','%Y-%m-%d')" + ); + String createStartTime = query.getCreateStartTime(); + String createEndTime = query.getCreateEndTime(); + qw.apply(StringUtils.isNotBlank(createStartTime), "date_format (createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(createEndTime), "date_format (createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" + ); + qw.eq("createOrgSid", query.getCreateOrgSid()); + qw.eq("state", 0); + if (query.getSidList().size() > 0) { + qw.notIn("sid", query.getSidList()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public PagerVo checkApplyGetCollectionRebate(PagerQuery pq) { + ScmCollectionRebateQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getCollectionTypeKey())) { + qw.eq("collectionTypeKey", query.getCollectionTypeKey()); + } + String collectionStartDate = query.getCollectionStartDate(); + String collectionEndDate = query.getCollectionEndDate(); + qw.apply(StringUtils.isNotBlank(collectionStartDate), "date_format (collectionDate,'%Y-%m-%d') >= date_format('" + collectionStartDate + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(collectionEndDate), "date_format (collectionDate,'%Y-%m-%d') <= date_format('" + collectionEndDate + "','%Y-%m-%d')" + ); + String createStartTime = query.getCreateStartTime(); + String createEndTime = query.getCreateEndTime(); + qw.apply(StringUtils.isNotBlank(createStartTime), "date_format (createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(createEndTime), "date_format (createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" + ); + qw.eq("createOrgSid", query.getCreateOrgSid()); + qw.ne("state", 0); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + for (ScmCollectionRebateVo record : pagging.getRecords()) { + //上传状态:未上传 + if (StringUtils.isBlank(record.getUploadDate()) && StringUtils.isBlank(record.getUploadMoney())) { + record.setUploadState("2"); + } + //上传状态:已上传 + if (StringUtils.isNotBlank(record.getUploadDate()) && StringUtils.isNotBlank(record.getUploadMoney())) { + record.setUploadState("3"); + } + } + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public PagerVo checkApplyGetAlreadyUploadCollectionRebate(PagerQuery pq) { + ScmCollectionRebateQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getCollectionTypeKey())) { + qw.eq("collectionTypeKey", query.getCollectionTypeKey()); + } + String collectionStartDate = query.getCollectionStartDate(); + String collectionEndDate = query.getCollectionEndDate(); + qw.apply(StringUtils.isNotBlank(collectionStartDate), "date_format (collectionDate,'%Y-%m-%d') >= date_format('" + collectionStartDate + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(collectionEndDate), "date_format (collectionDate,'%Y-%m-%d') <= date_format('" + collectionEndDate + "','%Y-%m-%d')" + ); + String createStartTime = query.getCreateStartTime(); + String createEndTime = query.getCreateEndTime(); + qw.apply(StringUtils.isNotBlank(createStartTime), "date_format (createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(createEndTime), "date_format (createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" + ); + qw.eq("createOrgSid", query.getCreateOrgSid()); + qw.eq("state", 3); + if (query.getSidList().size() > 0) { + qw.notIn("sid", query.getSidList()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + for (ScmCollectionRebateVo record : pagging.getRecords()) { + Date withholdingDate = record.getWithholdingDate(); + int year = DateUtil.year(withholdingDate); + int month = DateUtil.month(withholdingDate) + 1; + String withholdingDateCopy = year + "年" + month + "月"; + record.setWithholdingDateCopy(withholdingDateCopy); + } + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewith/ScmCollectionRebateWithMapper.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewith/ScmCollectionRebateWithMapper.java index 378c4bcf8c..cec421dd78 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewith/ScmCollectionRebateWithMapper.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewith/ScmCollectionRebateWithMapper.java @@ -72,4 +72,7 @@ public interface ScmCollectionRebateWithMapper extends BaseMapper fetchByMainSid(String sid); + + @Select("select collectionRebateSid from scm_collection_rebate_with where mainSid = #{businessSid}") + List fetchCollectionReBateSidByMainSid(String businessSid); } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewith/ScmCollectionRebateWithService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewith/ScmCollectionRebateWithService.java index f6ba498b97..9dfb98e5ce 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewith/ScmCollectionRebateWithService.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewith/ScmCollectionRebateWithService.java @@ -119,4 +119,8 @@ public class ScmCollectionRebateWithService extends MybatisBaseService fetchByMainSid(String sid) { return baseMapper.fetchByMainSid(sid); } + + public List fetchCollectionReBateSidByMainSid(String businessSid) { + return baseMapper.fetchCollectionReBateSidByMainSid(businessSid); + } } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyMapper.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyMapper.java index 0a2371cfb2..6909f1dfd7 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyMapper.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyMapper.java @@ -36,6 +36,7 @@ import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWit import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWithApplyVo; import java.util.List; +import java.util.Map; /** * Project: anrui-scm(回款返利)
@@ -64,4 +65,6 @@ public interface ScmCollectionRebateWithApplyMapper extends BaseMapper selectListVo(); int selectBySid(String join); + + int updateFlowFiled(Map beanToMap); } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyMapper.xml b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyMapper.xml index 0b89e8ae89..8cf6fa8a2c 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyMapper.xml +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyMapper.xml @@ -28,4 +28,19 @@ WHERE nodeState != '待提交' and find_in_set(sid, #{list}) + + + UPDATE scm_collection_rebate_with_apply + SET nodeState=#{nodeState}, nodeSid=#{taskDefKey} + + , procDefId=#{procDefId} + + + , procInstId=#{procInsId} + + + , taskId=#{taskId} + + WHERE sid=#{sid} + \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyRest.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyRest.java index d77ed982a6..3ed229fb3b 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyRest.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyRest.java @@ -25,6 +25,14 @@ *********************************************************/ package com.yxt.anrui.scm.biz.scmcollectionrebatewithapply; +import cn.hutool.core.bean.BeanUtil; +import com.yxt.anrui.flowable.api.utils.ProcDefEnum; +import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; +import com.yxt.anrui.scm.api.flow.FlowTaskVo; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeQuery; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeVo; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.ScmCollectionRebateWithApplyCompleteDto; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.SubmitScmCollectionRebateWithApplyDto; import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.vo.PagerVo; @@ -91,4 +99,47 @@ public class ScmCollectionRebateWithApplyRest implements ScmCollectionRebateWith public ResultBean fetchDetailsBySid(@PathVariable("sid") String sid){ return scmCollectionRebateWithApplyService.fetchAllDetailsVo(sid); } + + @Override + public ResultBean submitCollectionRebateWithApply(SubmitScmCollectionRebateWithApplyDto dto) { + return scmCollectionRebateWithApplyService.submitCollectionRebateWithApply(dto); + } + + @Override + public ResultBean complete(ScmCollectionRebateWithApplyCompleteDto dto) { + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(dto, bv); + bv.setModelId(ProcDefEnum.SCMCOLLECTIONREBATEWITHAPPLY.getProDefId()); + return scmCollectionRebateWithApplyService.complete(bv); + } + + @Override + public ResultBean revokeProcess(FlowTaskVo flowTaskVo) { + return scmCollectionRebateWithApplyService.revokeProcess(flowTaskVo); + } + + @Override + public ResultBean taskReject(FlowTaskVo flowTaskVo) { + return scmCollectionRebateWithApplyService.taskReject(flowTaskVo); + } + + @Override + public ResultBean breakProcess(FlowTaskVo flowTaskVo) { + return scmCollectionRebateWithApplyService.breakProcess(flowTaskVo); + } + + @Override + public ResultBean flowRecord(String procInsId) { + return scmCollectionRebateWithApplyService.flowRecord(procInsId); + } + + @Override + public ResultBean> getNextNodesForSubmit(GetNodeQuery query) { + return scmCollectionRebateWithApplyService.getNextNodesForSubmit(query); + } + + @Override + public ResultBean> getPreviousNodesForReject(GetNodeQuery query) { + return scmCollectionRebateWithApplyService.getPreviousNodesForReject(query); + } } diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyService.java index e466dda661..6baafd4fd3 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyService.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmcollectionrebatewithapply/ScmCollectionRebateWithApplyService.java @@ -26,11 +26,26 @@ package com.yxt.anrui.scm.biz.scmcollectionrebatewithapply; import cn.hutool.core.bean.BeanUtil; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.anrui.flowable.api.flow.FlowableFeign; +import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo; +import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; +import com.yxt.anrui.flowable.api.utils.ProcDefEnum; +import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; +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.scm.api.flow.FlowTaskVo; import com.yxt.anrui.scm.api.scmcollectionrebatewith.ScmCollectionRebateWith; import com.yxt.anrui.scm.api.scmcollectionrebatewith.ScmCollectionRebateWithDetailsVo; import com.yxt.anrui.scm.api.scmcollectionrebatewith.ScmCollectionRebateWithDto; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeQuery; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.GetNodeVo; +import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.flow.SubmitScmCollectionRebateWithApplyDto; +import com.yxt.anrui.scm.biz.scmcollectionrebate.ScmCollectionRebateService; import com.yxt.anrui.scm.biz.scmcollectionrebatewith.ScmCollectionRebateWithService; import org.apache.commons.lang3.StringUtils; import com.yxt.common.base.service.MybatisBaseService; @@ -48,8 +63,8 @@ import com.yxt.anrui.scm.api.scmcollectionrebatewithapply.ScmCollectionRebateWit import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.Arrays; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; /** * Project: anrui-scm(回款返利)
@@ -67,131 +82,371 @@ import java.util.List; @Service public class ScmCollectionRebateWithApplyService extends MybatisBaseService { - @Autowired - private ScmCollectionRebateWithService scmCollectionRebateWithService; - - private QueryWrapper createQueryWrapper(ScmCollectionRebateWithApplyQuery query) { - // todo: 这里根据具体业务调整查询条件 - // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); - QueryWrapper qw = new QueryWrapper<>(); - return qw; - } - - public PagerVo listPageVo(PagerQuery pq) { - ScmCollectionRebateWithApplyQuery query = pq.getParams(); - QueryWrapper qw = new QueryWrapper<>(); - if (StringUtils.isNotBlank(query.getBrandSid())) { - qw.eq("scrwa.brandSid", query.getBrandSid()); - } - if (StringUtils.isNotBlank(query.getCollectionApply())) { - qw.like("scrwa.withApply", query.getCollectionApply()); - } - String createStartTime = query.getCreateStartTime(); - String createEndTime = query.getCreateEndTime(); - qw.apply(StringUtils.isNotBlank(createStartTime), "date_format (scrwa.createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). - apply(StringUtils.isNotBlank(createEndTime), "date_format (scrwa.createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" - ); - qw.eq("scrwa.createOrgSid", query.getCreateOrgSid()); - qw.groupBy("scrwa.sid"); - qw.orderByDesc("scrwa.createTime"); - IPage page = PagerUtil.queryToPage(pq); - IPage pagging = baseMapper.selectPageVo(page, qw); - PagerVo p = PagerUtil.pageToVo(pagging, null); - return p; - } - - public ResultBean saveOrUpdateDto(ScmCollectionRebateWithApplyDto dto){ - ResultBean rb = ResultBean.fireFail(); - String dtoSid = dto.getSid(); - List scmCollectionRebateWiths = dto.getScmCollectionRebateWiths(); - if (scmCollectionRebateWiths == null) { - return rb.setMsg("请选择回款返利信息"); - } - if (StringUtils.isBlank(dtoSid)) { - String sid = this.insertByDto(dto).getData(); - for (ScmCollectionRebateWithDto scmCollectionRebateWithDto : scmCollectionRebateWiths) { - List collectionRebateSids = scmCollectionRebateWithDto.getCollectionRebateSids(); - for (String collectionRebateSid : collectionRebateSids) { - ScmCollectionRebateWith scmCollectionRebateWith = new ScmCollectionRebateWith(); - scmCollectionRebateWith.setCollectionRebateSid(collectionRebateSid); - scmCollectionRebateWith.setMainSid(sid); - scmCollectionRebateWithService.save(scmCollectionRebateWith); - } - } - return rb.success().setMsg("添加成功").setData(sid); - } - ScmCollectionRebateWithApply scmCollectionRebateWithApply = fetchBySid(dtoSid); - if (scmCollectionRebateWithApply == null) { - rb.setMsg("该回款返利预提申请单不存在"); - } - this.updateByDto(dto); - scmCollectionRebateWithService.delByMainSid(dtoSid); - for (ScmCollectionRebateWithDto scmCollectionRebateWithDto : scmCollectionRebateWiths) { - List collectionRebateSids = scmCollectionRebateWithDto.getCollectionRebateSids(); - for (String collectionRebateSid : collectionRebateSids) { - ScmCollectionRebateWith scmCollectionRebateWith = new ScmCollectionRebateWith(); - scmCollectionRebateWith.setCollectionRebateSid(collectionRebateSid); - scmCollectionRebateWith.setMainSid(dtoSid); - scmCollectionRebateWithService.save(scmCollectionRebateWith); - } - } - return rb.success().setMsg("修改成功").setData(dtoSid); - } - - public ResultBean insertByDto(ScmCollectionRebateWithApplyDto dto){ - ResultBean rb = ResultBean.fireFail(); - ScmCollectionRebateWithApply entity = new ScmCollectionRebateWithApply(); - BeanUtil.copyProperties(dto, entity, "id", "sid"); - entity.setNodeState("待提交"); - baseMapper.insert(entity); - return rb.success().setData(entity.getSid()); - } - - public void updateByDto(ScmCollectionRebateWithApplyDto dto){ - String dtoSid = dto.getSid(); + @Autowired + private ScmCollectionRebateWithService scmCollectionRebateWithService; + @Autowired + private ScmCollectionRebateService scmCollectionRebateService; + @Autowired + private SysStaffOrgFeign sysStaffOrgFeign; + @Autowired + private FlowableFeign flowableFeign; + @Autowired + private FlowTaskFeign flowTaskFeign; + @Autowired + private SysUserFeign sysUserFeign; + + private QueryWrapper createQueryWrapper(ScmCollectionRebateWithApplyQuery query) { + // todo: 这里根据具体业务调整查询条件 + // 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName())); + QueryWrapper qw = new QueryWrapper<>(); + return qw; + } + + public PagerVo listPageVo(PagerQuery pq) { + ScmCollectionRebateWithApplyQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if (StringUtils.isNotBlank(query.getBrandSid())) { + qw.eq("scrwa.brandSid", query.getBrandSid()); + } + if (StringUtils.isNotBlank(query.getCollectionApply())) { + qw.like("scrwa.withApply", query.getCollectionApply()); + } + String createStartTime = query.getCreateStartTime(); + String createEndTime = query.getCreateEndTime(); + qw.apply(StringUtils.isNotBlank(createStartTime), "date_format (scrwa.createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). + apply(StringUtils.isNotBlank(createEndTime), "date_format (scrwa.createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" + ); + qw.eq("scrwa.createOrgSid", query.getCreateOrgSid()); + qw.groupBy("scrwa.sid"); + qw.orderByDesc("scrwa.createTime"); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + + public ResultBean saveOrUpdateDto(ScmCollectionRebateWithApplyDto dto) { + ResultBean rb = ResultBean.fireFail(); + String dtoSid = dto.getSid(); + List scmCollectionRebateWiths = dto.getScmCollectionRebateWiths(); + if (scmCollectionRebateWiths == null) { + return rb.setMsg("请选择回款返利信息"); + } + if (StringUtils.isBlank(dtoSid)) { + String sid = this.insertByDto(dto).getData(); + for (ScmCollectionRebateWithDto scmCollectionRebateWithDto : scmCollectionRebateWiths) { + List collectionRebateSids = scmCollectionRebateWithDto.getCollectionRebateSids(); + for (String collectionRebateSid : collectionRebateSids) { + ScmCollectionRebateWith scmCollectionRebateWith = new ScmCollectionRebateWith(); + scmCollectionRebateWith.setCollectionRebateSid(collectionRebateSid); + scmCollectionRebateWith.setMainSid(sid); + scmCollectionRebateWithService.save(scmCollectionRebateWith); + } + } + return rb.success().setMsg("添加成功").setData(sid); + } + ScmCollectionRebateWithApply scmCollectionRebateWithApply = fetchBySid(dtoSid); + if (scmCollectionRebateWithApply == null) { + rb.setMsg("该回款返利预提申请单不存在"); + } + this.updateByDto(dto); + scmCollectionRebateWithService.delByMainSid(dtoSid); + for (ScmCollectionRebateWithDto scmCollectionRebateWithDto : scmCollectionRebateWiths) { + List collectionRebateSids = scmCollectionRebateWithDto.getCollectionRebateSids(); + for (String collectionRebateSid : collectionRebateSids) { + ScmCollectionRebateWith scmCollectionRebateWith = new ScmCollectionRebateWith(); + scmCollectionRebateWith.setCollectionRebateSid(collectionRebateSid); + scmCollectionRebateWith.setMainSid(dtoSid); + scmCollectionRebateWithService.save(scmCollectionRebateWith); + } + } + return rb.success().setMsg("修改成功").setData(dtoSid); + } + + public ResultBean insertByDto(ScmCollectionRebateWithApplyDto dto) { + ResultBean rb = ResultBean.fireFail(); + ScmCollectionRebateWithApply entity = new ScmCollectionRebateWithApply(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + entity.setNodeState("待提交"); + baseMapper.insert(entity); + return rb.success().setData(entity.getSid()); + } + + public void updateByDto(ScmCollectionRebateWithApplyDto dto) { + String dtoSid = dto.getSid(); if (StringUtils.isBlank(dtoSid)) { return; - } - ScmCollectionRebateWithApply entity = fetchBySid(dtoSid); - BeanUtil.copyProperties(dto, entity, "id", "sid"); - baseMapper.updateById(entity); - } - - public ScmCollectionRebateWithApplyDetailsVo fetchDetailsVoBySid(String sid){ - ScmCollectionRebateWithApply entity = fetchBySid(sid); - ScmCollectionRebateWithApplyDetailsVo vo = new ScmCollectionRebateWithApplyDetailsVo(); - BeanUtil.copyProperties(entity, vo); - return vo; - } - - public ResultBean delAll(String[] sids) { - ResultBean rb = ResultBean.fireFail(); - //查询该sid中是否有流程不是待提交的 - int count = baseMapper.selectBySid(StringUtils.join(sids, ",")); - if (count > 0) { - return rb.setMsg("删除的数据中包含已经提交审批的数据,删除失败"); - } - delBySids(sids); - for (String sid : sids) { - scmCollectionRebateWithService.delByMainSid(sid); - } - return rb.success().setMsg("删除成功"); - } - - public ResultBean fetchAllDetailsVo(String sid) { - ResultBean rb = ResultBean.fireFail(); - ScmCollectionRebateWithApplyDetailsVo scmCollectionRebateWithApplyDetailsVo = new ScmCollectionRebateWithApplyDetailsVo(); - ScmCollectionRebateWithApply scmCollectionRebateWithApply = fetchBySid(sid); - BeanUtil.copyProperties(scmCollectionRebateWithApply, scmCollectionRebateWithApplyDetailsVo); - List scmCollectionRebateWithDetailsVos = scmCollectionRebateWithService.fetchByMainSid(sid); - for (ScmCollectionRebateWithDetailsVo scmCollectionRebateWithDetailsVo : scmCollectionRebateWithDetailsVos) { - String[] specialRebateSids = scmCollectionRebateWithDetailsVo.getCollectionRebateSid().split(","); - scmCollectionRebateWithDetailsVo.setCollectionRebateSids(Arrays.asList(specialRebateSids)); - String withRebate = scmCollectionRebateWithDetailsVo.getWithRebate(); - withRebate = withRebate.substring(0, withRebate.lastIndexOf(".")); - scmCollectionRebateWithDetailsVo.setWithRebate(withRebate); - } - scmCollectionRebateWithApplyDetailsVo.setScmCollectionRebateWiths(scmCollectionRebateWithDetailsVos); - return rb.success().setData(scmCollectionRebateWithApplyDetailsVo); - } + } + ScmCollectionRebateWithApply entity = fetchBySid(dtoSid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + + public ScmCollectionRebateWithApplyDetailsVo fetchDetailsVoBySid(String sid) { + ScmCollectionRebateWithApply entity = fetchBySid(sid); + ScmCollectionRebateWithApplyDetailsVo vo = new ScmCollectionRebateWithApplyDetailsVo(); + BeanUtil.copyProperties(entity, vo); + return vo; + } + + public ResultBean delAll(String[] sids) { + ResultBean rb = ResultBean.fireFail(); + //查询该sid中是否有流程不是待提交的 + int count = baseMapper.selectBySid(StringUtils.join(sids, ",")); + if (count > 0) { + return rb.setMsg("删除的数据中包含已经提交审批的数据,删除失败"); + } + delBySids(sids); + for (String sid : sids) { + scmCollectionRebateWithService.delByMainSid(sid); + } + return rb.success().setMsg("删除成功"); + } + + public ResultBean fetchAllDetailsVo(String sid) { + ResultBean rb = ResultBean.fireFail(); + ScmCollectionRebateWithApplyDetailsVo scmCollectionRebateWithApplyDetailsVo = new ScmCollectionRebateWithApplyDetailsVo(); + ScmCollectionRebateWithApply scmCollectionRebateWithApply = fetchBySid(sid); + BeanUtil.copyProperties(scmCollectionRebateWithApply, scmCollectionRebateWithApplyDetailsVo); + List scmCollectionRebateWithDetailsVos = scmCollectionRebateWithService.fetchByMainSid(sid); + for (ScmCollectionRebateWithDetailsVo scmCollectionRebateWithDetailsVo : scmCollectionRebateWithDetailsVos) { + String[] collectionRebateSids = scmCollectionRebateWithDetailsVo.getCollectionRebateSid().split(","); + scmCollectionRebateWithDetailsVo.setCollectionRebateSids(Arrays.asList(collectionRebateSids)); + String withRebate = scmCollectionRebateWithDetailsVo.getWithRebate(); + withRebate = withRebate.substring(0, withRebate.lastIndexOf(".")); + scmCollectionRebateWithDetailsVo.setWithRebate(withRebate); + } + scmCollectionRebateWithApplyDetailsVo.setScmCollectionRebateWiths(scmCollectionRebateWithDetailsVos); + return rb.success().setData(scmCollectionRebateWithApplyDetailsVo); + } + + public ResultBean submitCollectionRebateWithApply(SubmitScmCollectionRebateWithApplyDto dto) { + ResultBean rb = ResultBean.fireFail(); + //根据用户sid获取staffSid + ResultBean userVoResultBean = sysUserFeign.fetchBySid(dto.getCreateBySid()); + if (!userVoResultBean.getSuccess()) { + return rb.setMsg(userVoResultBean.getMsg()); + } + //根据staffSid获取用户的组织全路径 + ResultBean orgByStaffSid = sysStaffOrgFeign.getOrgByStaffSid(userVoResultBean.getData().getStaffSid()); + if (!orgByStaffSid.getSuccess()) { + return rb.setMsg(orgByStaffSid.getMsg()); + } + //用户的组织全路径 + String orgSidPath = orgByStaffSid.getData().getOrgSidPath(); + ScmCollectionRebateWithApply scmCollectionRebateWithApply = fetchBySid(dto.getSid()); + int r = submitBusinessData(dto, scmCollectionRebateWithApply); + if (r == 3) { + return rb.setMsg("该申请不存在"); + } + if (r == 0) { + return rb.setMsg("操作失败!提交的数据不一致"); + } + //新增修改保存 + ResultBean resultBean = saveOrUpdateDto(dto); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + String businessSid = resultBean.getData(); + //创建BusinessVariables实体对象 + BusinessVariables bv = new BusinessVariables(); + //流程中的参数赋值 + Map variables = BeanUtil.beanToMap(dto); + //若有网关,则赋值网关中判断的字段。 + variables.put("businessSid", businessSid); + //=====================添加app所需参数 + Map appMap = new HashMap<>(); + appMap.put("sid", businessSid); + variables.put("app", appMap); + //用户的部门全路径sid + bv.setOrgSidPath(orgSidPath); + //业务sid + bv.setBusinessSid(businessSid); + //用户sid + bv.setUserSid(dto.getCreateBySid()); + bv.setFormVariables(variables); + //流程定义id + bv.setModelId(ProcDefEnum.SCMCOLLECTIONREBATEWITHAPPLY.getProDefId()); + //获取回款返利sid + List scmCollectionRebateWiths = dto.getScmCollectionRebateWiths(); + for (ScmCollectionRebateWithDto scmCollectionRebateWith : scmCollectionRebateWiths) { + List collectionRebateSids = scmCollectionRebateWith.getCollectionRebateSids(); + for (String collectionRebateSid : collectionRebateSids) { + scmCollectionRebateService.updateWithholdingDateBySid(collectionRebateSid); + } + } + if (r == 1) { + ResultBean voResultBean = flowableFeign.startProcess(bv); + UpdateFlowFieldVo ufVo = voResultBean.getData(); + updateFlowFiled(BeanUtil.beanToMap(ufVo)); + + return voResultBean; + } + if (r == 2) { + // ToDo:驳回到发起人后再次提交 + if (StringUtils.isBlank(dto.getInstanceId())) { + return rb.setMsg("参数错误:instanceId"); + } + bv.setTaskId(scmCollectionRebateWithApply.getTaskId()); + bv.setTaskDefKey(scmCollectionRebateWithApply.getNodeSid()); + bv.setComment(StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); + bv.setInstanceId(dto.getInstanceId()); + return complete(bv); + } + return rb; + } + + /** + * 判断提交的流程是否被允许 + * + * @param dto + * @return + */ + private synchronized int submitBusinessData(SubmitScmCollectionRebateWithApplyDto dto, ScmCollectionRebateWithApply scmCollectionRebateWithApply) { + int r = 0; + if (StringUtils.isBlank(dto.getSid())) { + r = 1; + } else { + if (scmCollectionRebateWithApply != null) { + String businessTaskId = scmCollectionRebateWithApply.getTaskId(); + if (StringUtils.isBlank(businessTaskId) && StringUtils.isBlank(dto.getTaskId())) { + //新提交 + r = 1; + } else if (StringUtils.isNotBlank(businessTaskId) && businessTaskId.equals(dto.getTaskId())) { + //二次提交//只有数据一致的时候才能进行下一步 + r = 2; + } + } else { + r = 3; + } + + } + return r; + } + + private int updateFlowFiled(Map beanToMap) { + return baseMapper.updateFlowFiled(beanToMap); + } + + public ResultBean complete(BusinessVariables bv) { + ResultBean rb = ResultBean.fireFail(); + ScmCollectionRebateWithApply scmCollectionRebateWithApply = fetchBySid(bv.getBusinessSid()); + List collectionRebateSids = scmCollectionRebateWithService.fetchCollectionReBateSidByMainSid(bv.getBusinessSid()); + if (bv.getTaskId().equals(scmCollectionRebateWithApply.getTaskId())) { + ResultBean resultBean = flowableFeign.handleProsess(bv); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); + if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { + for (String collectionRebateSid : collectionRebateSids) { + scmCollectionRebateService.updateState(collectionRebateSid); + } + } + return rb.success().setData(resultBean.getData()); + } else { + return rb.setMsg("操作失败!提交的数据不一致"); + } + } + + public ResultBean revokeProcess(FlowTaskVo query) { + ResultBean rb = ResultBean.fireFail(); + if (StringUtils.isBlank(query.getUserSid())) { + return rb.setMsg("参数错误:userSid"); + } + //根据业务sid查询排内购申请 + ScmCollectionRebateWithApply scmCollectionRebateWithApply = fetchBySid(query.getBusinessSid()); + String businessTaskId = scmCollectionRebateWithApply.getTaskId(); + if (StringUtils.isNotBlank(businessTaskId)) { + if (businessTaskId.equals(query.getTaskId())) { + com.yxt.anrui.flowable.api.flowtask.FlowTaskVo flowTaskVo = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + flowTaskVo.setValues(BeanUtil.beanToMap(scmCollectionRebateWithApply)); + ResultBean resultBean = flowableFeign.revokeProcess(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); + return rb.success().setData(resultBean.getData()); + } + } + return rb.setMsg("操作失败,提交的数据不一致!"); + } + + public ResultBean taskReject(FlowTaskVo query) { + ResultBean rb = ResultBean.fireFail(); + ScmCollectionRebateWithApply scmCollectionRebateWithApply = fetchBySid(query.getBusinessSid()); + if (scmCollectionRebateWithApply == null) { + return rb.setMsg("该申请不存在"); + } + String businessTaskId = scmCollectionRebateWithApply.getTaskId(); + if (StringUtils.isNotBlank(businessTaskId)) { + if (businessTaskId.equals(query.getTaskId())) { + com.yxt.anrui.flowable.api.flowtask.FlowTaskVo flowTaskVo = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + ResultBean resultBean = flowableFeign.taskReject(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + Map map = BeanUtil.beanToMap(resultBean.getData()); + //更新业务中的流程相关的参数 + updateFlowFiled(map); + return rb.success(); + } + } + return rb.setMsg("操作失败!提交的数据不一致!"); + } + + public ResultBean breakProcess(FlowTaskVo query) { + ResultBean rb = ResultBean.fireFail(); + if (StringUtils.isBlank(query.getInstanceId())) { + return rb.setMsg("参数错误:instanceId"); + } + if (StringUtils.isBlank(query.getUserSid())) { + return rb.setMsg("参数错误:userSid"); + } + ScmCollectionRebateWithApply scmCollectionRebateWithApply = fetchBySid(query.getBusinessSid()); + String businessTaskId = scmCollectionRebateWithApply.getTaskId(); + if (StringUtils.isNotBlank(businessTaskId)) { + if (businessTaskId.equals(query.getTaskId())) { + com.yxt.anrui.flowable.api.flowtask.FlowTaskVo flowTaskVo = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); + BeanUtil.copyProperties(query, flowTaskVo); + ResultBean resultBean = flowableFeign.breakProcess(flowTaskVo); + if (!resultBean.getSuccess()) { + return rb.setMsg(resultBean.getMsg()); + } + updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); + return rb.success().setData(resultBean.getData()); + } + } + return rb.setMsg("操作失败!提交的数据不一致!"); + } + + public ResultBean flowRecord(String procInsId) { + return flowTaskFeign.businessFlowRecord(procInsId); + } + + public ResultBean> getNextNodesForSubmit(GetNodeQuery query) { + ResultBean> rb = ResultBean.fireFail(); + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(query, bv); + bv.setModelId(ProcDefEnum.SCMCOLLECTIONREBATEWITHAPPLY.getProDefId()); + ResultBean>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); + //判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo + List voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); +// List voList = resultBean.getData().stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); + return rb.success().setData(voList); + } + + public ResultBean> getPreviousNodesForReject(GetNodeQuery query) { + ResultBean> rb = ResultBean.fireFail(); + BusinessVariables bv = new BusinessVariables(); + BeanUtil.copyProperties(query, bv); + bv.setModelId(ProcDefEnum.SCMCOLLECTIONREBATEWITHAPPLY.getProDefId()); + ResultBean>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); + //判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo + List voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); +// List voList = resultBean.getData().stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); + return rb.success().setData(voList); + } } \ No newline at end of file diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthService.java index c1027d1afc..28e5e82023 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthService.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehinventorymonth/ScmVehInventorymonthService.java @@ -123,7 +123,7 @@ public class ScmVehInventorymonthService extends MybatisBaseService