
41 changed files with 1256 additions and 710 deletions
@ -0,0 +1,64 @@ |
|||||
|
package com.yxt.anrui.base.api.baseaccadjapply; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/8/25 11:29 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AppCompanyAdjustList implements Vo { |
||||
|
private static final long serialVersionUID = 7979018402791508819L; |
||||
|
|
||||
|
@ApiModelProperty("sid") |
||||
|
private String sid; |
||||
|
|
||||
|
@ApiModelProperty("车型sid") |
||||
|
private String modelSid; |
||||
|
|
||||
|
@ApiModelProperty("配置sid") |
||||
|
private String configSid; |
||||
|
|
||||
|
@ApiModelProperty("车型名称") |
||||
|
@JsonProperty("modelName") |
||||
|
private String vehicleAlias; |
||||
|
|
||||
|
@ApiModelProperty("车架号") |
||||
|
@JsonProperty("vin") |
||||
|
private String vinNo; |
||||
|
|
||||
|
@ApiModelProperty("销售指导价") |
||||
|
@JsonProperty("guidancePrice") |
||||
|
private String guidedPrice; |
||||
|
|
||||
|
@ApiModelProperty("库存地点") |
||||
|
@JsonProperty("address") |
||||
|
private String inventoryLocationName; |
||||
|
|
||||
|
@ApiModelProperty("内销价格") |
||||
|
@JsonProperty("domesticPrice") |
||||
|
private String witPinMoney; |
||||
|
|
||||
|
@ApiModelProperty("运费") |
||||
|
@JsonProperty("fare") |
||||
|
private String freight; |
||||
|
|
||||
|
@ApiModelProperty("运费承担方") |
||||
|
@JsonProperty("freightPayer") |
||||
|
private String freightUndertakerName; |
||||
|
|
||||
|
@ApiModelProperty("备注") |
||||
|
private String remarks; |
||||
|
|
||||
|
private AppVehicleVersionVo carDetailPage; |
||||
|
|
||||
|
@ApiModelProperty("是否可编辑车架号") |
||||
|
private Boolean editVin; |
||||
|
|
||||
|
@ApiModelProperty("是否可编辑销售指导价") |
||||
|
private Boolean editPrice; |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
package com.yxt.anrui.base.api.baseaccadjapply; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class AppCompanyAdjustVo implements Vo { |
||||
|
|
||||
|
private String sid; |
||||
|
|
||||
|
private String userSid; |
||||
|
|
||||
|
private String taskId; |
||||
|
|
||||
|
private String procInsId; |
||||
|
@ApiModelProperty("调入分公司名称") |
||||
|
@JsonProperty("company2") |
||||
|
private String callInOrgName; |
||||
|
@ApiModelProperty("调出分公司名称") |
||||
|
@JsonProperty("company") |
||||
|
private String callOutOrgName; |
||||
|
@ApiModelProperty("调车类型key") |
||||
|
@JsonProperty("typeKey") |
||||
|
private String shuntingTypeKey; |
||||
|
@ApiModelProperty("调车类型") |
||||
|
@JsonProperty("type") |
||||
|
private String shuntingTypeValue; |
||||
|
|
||||
|
private List<AppCompanyAdjustList> records = new ArrayList<>(); |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.yxt.anrui.base.api.baseaccadjapply; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/8/26 10:51 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class AppVehicleVersionVo implements Vo { |
||||
|
private static final long serialVersionUID = -2662961586728421196L; |
||||
|
|
||||
|
@ApiModelProperty("版本编码") |
||||
|
private Integer moduleVersion; |
||||
|
|
||||
|
@ApiModelProperty("apk下载地址") |
||||
|
private String path; |
||||
|
|
||||
|
@ApiModelProperty("0.内置Activity 1.内置WebView 2.RePlugin插件") |
||||
|
private String type; |
||||
|
|
||||
|
@ApiModelProperty("插件名称") |
||||
|
private String modulePluginName; |
||||
|
|
||||
|
@ApiModelProperty("地址") |
||||
|
private String moduleAction; |
||||
|
|
||||
|
private String json; |
||||
|
} |
@ -0,0 +1,58 @@ |
|||||
|
package com.yxt.anrui.terminal.api.supplychain.companyAdjust; |
||||
|
|
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyAdjust.flowable.CompanyAdjustDto; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyAdjust.flowable.CompanyAdjustQuery; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyAdjust.flowable.CompanyAdjustTaskQuery; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyShunting.CompanyShuntingVo; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyShunting.flowable.CompanyShuntingDto; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyShunting.flowable.CompanyShuntingQuery; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyShunting.flowable.CompanyShuntingTaskQuery; |
||||
|
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.cloud.openfeign.SpringQueryMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
@Api(tags = "分公司调车调账") |
||||
|
@FeignClient( |
||||
|
contextId = "anrui-terminal-CompanyAdjust", |
||||
|
name = "anrui-terminal", |
||||
|
path = "/v1/companyAdjust") |
||||
|
public interface CompanyAdjustFeign { |
||||
|
|
||||
|
@ApiOperation("分公司调车调账详情") |
||||
|
@GetMapping("/getCompanyAdjust/{sid}") |
||||
|
@ResponseBody |
||||
|
ResultBean<CompanyAdjustVo> getCompanyAdjust(@PathVariable("sid") String sid); |
||||
|
|
||||
|
@ApiOperation("办理") |
||||
|
@PutMapping("/complete") |
||||
|
@ResponseBody |
||||
|
ResultBean complete(@RequestBody CompanyAdjustDto dto); |
||||
|
|
||||
|
@ApiOperation("办理-分公司跨分公司") |
||||
|
@PutMapping("/InitiatorToAnswer") |
||||
|
@ResponseBody |
||||
|
ResultBean InitiatorToAnswer(@RequestBody CompanyAdjustDto dto); |
||||
|
|
||||
|
@ApiOperation("驳回") |
||||
|
@PutMapping("/reject") |
||||
|
@ResponseBody |
||||
|
ResultBean reject(@RequestBody CompanyAdjustTaskQuery query); |
||||
|
|
||||
|
@ApiOperation("撤回") |
||||
|
@PutMapping("/revokeProcess") |
||||
|
@ResponseBody |
||||
|
ResultBean revokeProcess(@RequestBody CompanyAdjustTaskQuery query); |
||||
|
|
||||
|
@ApiOperation("终止") |
||||
|
@PutMapping("/breakProcess") |
||||
|
@ResponseBody |
||||
|
ResultBean breakProcess(@RequestBody CompanyAdjustTaskQuery query); |
||||
|
|
||||
|
@ApiOperation("获取流程操作标题") |
||||
|
@GetMapping("/getFlowOperateTitle") |
||||
|
@ResponseBody |
||||
|
ResultBean<String> getFlowOperateTitle(@SpringQueryMap CompanyAdjustQuery query); |
||||
|
} |
@ -0,0 +1,65 @@ |
|||||
|
package com.yxt.anrui.terminal.api.supplychain.companyAdjust; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyShunting.CompanyShutingVersionVo; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/8/25 11:29 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CompanyAdjustList implements Vo { |
||||
|
private static final long serialVersionUID = 7979018402791508819L; |
||||
|
|
||||
|
@ApiModelProperty("sid") |
||||
|
private String sid; |
||||
|
|
||||
|
@ApiModelProperty("车型sid") |
||||
|
private String modelSid; |
||||
|
|
||||
|
@ApiModelProperty("配置sid") |
||||
|
private String configSid; |
||||
|
|
||||
|
@ApiModelProperty("车型名称") |
||||
|
@JsonProperty("modelName") |
||||
|
private String vehicleAlias; |
||||
|
|
||||
|
@ApiModelProperty("车架号") |
||||
|
@JsonProperty("vin") |
||||
|
private String vinNo; |
||||
|
|
||||
|
@ApiModelProperty("销售指导价") |
||||
|
@JsonProperty("guidancePrice") |
||||
|
private String guidedPrice; |
||||
|
|
||||
|
@ApiModelProperty("库存地点") |
||||
|
@JsonProperty("address") |
||||
|
private String inventoryLocationName; |
||||
|
|
||||
|
@ApiModelProperty("内销价格") |
||||
|
@JsonProperty("domesticPrice") |
||||
|
private String witPinMoney; |
||||
|
|
||||
|
@ApiModelProperty("运费") |
||||
|
@JsonProperty("fare") |
||||
|
private String freight; |
||||
|
|
||||
|
@ApiModelProperty("运费承担方") |
||||
|
@JsonProperty("freightPayer") |
||||
|
private String freightUndertakerName; |
||||
|
|
||||
|
@ApiModelProperty("备注") |
||||
|
private String remarks; |
||||
|
|
||||
|
private CompanyAdjustVersionVo carDetailPage; |
||||
|
|
||||
|
@ApiModelProperty("是否可编辑车架号") |
||||
|
private Boolean editVin; |
||||
|
|
||||
|
@ApiModelProperty("是否可编辑销售指导价") |
||||
|
private Boolean editPrice; |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.yxt.anrui.terminal.api.supplychain.companyAdjust; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/8/26 20:23 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CompanyAdjustVersionVo implements Vo { |
||||
|
private static final long serialVersionUID = -1626902109690426737L; |
||||
|
|
||||
|
@ApiModelProperty("版本编码") |
||||
|
private Integer moduleVersion; |
||||
|
|
||||
|
@ApiModelProperty("apk下载地址") |
||||
|
private String path; |
||||
|
|
||||
|
@ApiModelProperty("0.内置Activity 1.内置WebView 2.RePlugin插件") |
||||
|
private String type; |
||||
|
|
||||
|
@ApiModelProperty("插件名称") |
||||
|
private String modulePluginName; |
||||
|
|
||||
|
@ApiModelProperty("地址") |
||||
|
private String moduleAction; |
||||
|
|
||||
|
private String json; |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
package com.yxt.anrui.terminal.api.supplychain.companyAdjust; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyShunting.CompanyShuntingList; |
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
public class CompanyAdjustVo implements Vo { |
||||
|
|
||||
|
private String sid; |
||||
|
|
||||
|
private String userSid; |
||||
|
|
||||
|
private String taskId; |
||||
|
|
||||
|
private String procInsId; |
||||
|
@ApiModelProperty("调入分公司名称") |
||||
|
@JsonProperty("company2") |
||||
|
private String buyerOrgName; |
||||
|
@ApiModelProperty("调出分公司名称") |
||||
|
@JsonProperty("company") |
||||
|
private String sellerOrgName; |
||||
|
@ApiModelProperty("调车类型key") |
||||
|
@JsonProperty("typeKey") |
||||
|
private String shuntingTypeKey; |
||||
|
@ApiModelProperty("调车类型") |
||||
|
@JsonProperty("type") |
||||
|
private String shuntingTypeValue; |
||||
|
|
||||
|
private List<CompanyAdjustList> records = new ArrayList<>(); |
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package com.yxt.anrui.terminal.api.supplychain.companyAdjust.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; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/8/25 11:43 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CompanyAdjustDto implements Dto { |
||||
|
private static final long serialVersionUID = -1526555701754422925L; |
||||
|
|
||||
|
@ApiModelProperty(value = "用户sid") |
||||
|
@NotBlank(message = "参数错误:userSid") |
||||
|
private String userSid; |
||||
|
@ApiModelProperty(value = "节点id") |
||||
|
@NotBlank(message = "参数错误:taskDefKey") |
||||
|
private String taskDefKey; |
||||
|
@ApiModelProperty(value = "任务id") |
||||
|
@NotBlank(message = "参数错误:taskId") |
||||
|
private String taskId; |
||||
|
@ApiModelProperty(value = "流程id") |
||||
|
@JsonProperty("procInsId") |
||||
|
@NotBlank(message = "参数错误:procInsId") |
||||
|
private String instanceId; |
||||
|
@ApiModelProperty(value = "意见") |
||||
|
@NotBlank(message = "参数错误:comment") |
||||
|
private String comment; |
||||
|
@ApiModelProperty(value = "业务sid") |
||||
|
@NotBlank(message = "参数错误:businessSid") |
||||
|
private String businessSid; |
||||
|
|
||||
|
private String json; |
||||
|
|
||||
|
private String orgPath; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.yxt.anrui.terminal.api.supplychain.companyAdjust.flowable; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/8/25 11:48 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CompanyAdjustQuery implements Query { |
||||
|
private static final long serialVersionUID = 5168595226107955454L; |
||||
|
|
||||
|
@ApiModelProperty(value = "节点key") |
||||
|
private String taskDefKey; |
||||
|
@ApiModelProperty(value = "业务sid") |
||||
|
private String businessSid; |
||||
|
@ApiModelProperty(value = "0 上一环节 1下一环节") |
||||
|
@NotNull(message = "参数错误:next") |
||||
|
private Integer next; |
||||
|
} |
@ -0,0 +1,47 @@ |
|||||
|
package com.yxt.anrui.terminal.api.supplychain.companyAdjust.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; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/8/25 11:47 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CompanyAdjustTaskQuery implements Query { |
||||
|
private static final long serialVersionUID = -8199630188033418050L; |
||||
|
|
||||
|
/** |
||||
|
* 终止、驳回、撤回 |
||||
|
*/ |
||||
|
@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; |
||||
|
} |
@ -0,0 +1,61 @@ |
|||||
|
package com.yxt.anrui.terminal.biz.supplychain.companyAdjust; |
||||
|
|
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyAdjust.CompanyAdjustFeign; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyAdjust.CompanyAdjustVo; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyAdjust.flowable.CompanyAdjustDto; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyAdjust.flowable.CompanyAdjustQuery; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyAdjust.flowable.CompanyAdjustTaskQuery; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyShunting.CompanyShuntingFeign; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyShunting.CompanyShuntingVo; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyShunting.flowable.CompanyShuntingDto; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyShunting.flowable.CompanyShuntingQuery; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyShunting.flowable.CompanyShuntingTaskQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
|
||||
|
@Api(tags = "分公司间调车调账") |
||||
|
@Controller |
||||
|
@RequestMapping("/v1/companyAdjust") |
||||
|
public class CompanyAdjustRest implements CompanyAdjustFeign { |
||||
|
|
||||
|
@Autowired |
||||
|
private CompanyAdjustService companyAdjustService; |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<CompanyAdjustVo> getCompanyAdjust(String sid) { |
||||
|
return companyAdjustService.getCompanyAdjust(sid); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean complete(CompanyAdjustDto dto) { |
||||
|
return companyAdjustService.complete(dto); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean InitiatorToAnswer(CompanyAdjustDto dto) { |
||||
|
return companyAdjustService.InitiatorToAnswer(dto); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean reject(CompanyAdjustTaskQuery query) { |
||||
|
return companyAdjustService.reject(query); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean revokeProcess(CompanyAdjustTaskQuery query) { |
||||
|
return companyAdjustService.revokeProcess(query); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean breakProcess(CompanyAdjustTaskQuery query) { |
||||
|
return companyAdjustService.breakProcess(query); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public ResultBean<String> getFlowOperateTitle(CompanyAdjustQuery query) { |
||||
|
return companyAdjustService.getFlowOperateTitle(query); |
||||
|
} |
||||
|
} |
@ -0,0 +1,184 @@ |
|||||
|
package com.yxt.anrui.terminal.biz.supplychain.companyAdjust; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.alibaba.fastjson.TypeReference; |
||||
|
import com.yxt.anrui.base.api.baseaccadjapply.AppCompanyAdjustVo; |
||||
|
import com.yxt.anrui.base.api.baseaccadjapply.BaseAccadjApplyDetailsVo; |
||||
|
import com.yxt.anrui.base.api.baseaccadjapply.BaseAccadjApplyFeign; |
||||
|
import com.yxt.anrui.base.api.baseaccadjapply.flow.BaseAccAdjApplyCompleteDto; |
||||
|
import com.yxt.anrui.base.api.baseaccadjapply.flow.BaseAccAdjApplyTaskQuery; |
||||
|
import com.yxt.anrui.base.api.baseaccadjapply.flow.GetNodeQuery; |
||||
|
import com.yxt.anrui.base.api.baseaccadjapply.flow.GetNodeVo; |
||||
|
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.terminal.api.supplychain.companyAdjust.CompanyAdjustVo; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyAdjust.flowable.CompanyAdjustDto; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyAdjust.flowable.CompanyAdjustQuery; |
||||
|
import com.yxt.anrui.terminal.api.supplychain.companyAdjust.flowable.CompanyAdjustTaskQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.Collections; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @Author dimengzhe |
||||
|
* @Date 2022/8/25 11:32 |
||||
|
* @Description |
||||
|
*/ |
||||
|
@Service |
||||
|
public class CompanyAdjustService { |
||||
|
|
||||
|
@Autowired |
||||
|
private BaseAccadjApplyFeign baseAccadjApplyFeign; |
||||
|
@Autowired |
||||
|
private SysUserFeign sysUserFeign; |
||||
|
@Autowired |
||||
|
private SysStaffOrgFeign sysStaffOrgFeign; |
||||
|
|
||||
|
public ResultBean<CompanyAdjustVo> getCompanyAdjust(String sid) { |
||||
|
ResultBean<CompanyAdjustVo> rb = ResultBean.fireFail(); |
||||
|
ResultBean<AppCompanyAdjustVo> resultBean = baseAccadjApplyFeign.getCompanyAdjust(sid); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
CompanyAdjustVo companyAdjustVo = new CompanyAdjustVo(); |
||||
|
AppCompanyAdjustVo vo = resultBean.getData(); |
||||
|
BeanUtil.copyProperties(vo, companyAdjustVo); |
||||
|
return rb.success().setData(companyAdjustVo); |
||||
|
} |
||||
|
|
||||
|
public ResultBean complete(CompanyAdjustDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
BaseAccAdjApplyCompleteDto baseAccAdjApplyCompleteDto = new BaseAccAdjApplyCompleteDto(); |
||||
|
BeanUtil.copyProperties(dto, baseAccAdjApplyCompleteDto); |
||||
|
String orgPath = dto.getOrgPath(); |
||||
|
if (StringUtils.isBlank(orgPath)) { |
||||
|
//根据用户sid获取staffSid
|
||||
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getUserSid()); |
||||
|
if (!userVoResultBean.getSuccess()) { |
||||
|
return rb.setMsg(userVoResultBean.getMsg()); |
||||
|
} |
||||
|
//根据staffSid获取用户的组织全路径
|
||||
|
ResultBean<SysStaffOrg> staffOrgResultBean = sysStaffOrgFeign.getOrgByStaffSid(userVoResultBean.getData().getStaffSid()); |
||||
|
if (!staffOrgResultBean.getSuccess()) { |
||||
|
return rb.setMsg(staffOrgResultBean.getMsg()); |
||||
|
} |
||||
|
//用户的组织全路径
|
||||
|
String orgSidPath = staffOrgResultBean.getData().getOrgSidPath(); |
||||
|
baseAccAdjApplyCompleteDto.setOrgSidPath(orgSidPath); |
||||
|
} else { |
||||
|
baseAccAdjApplyCompleteDto.setOrgSidPath(orgPath); |
||||
|
|
||||
|
} |
||||
|
BaseAccadjApplyDetailsVo data = baseAccadjApplyFeign.fetchDetailsBySid(dto.getBusinessSid()).getData(); |
||||
|
baseAccAdjApplyCompleteDto.setBaseInternalPurchaseVehicles(data.getBaseInternalPurchaseVehicles()); |
||||
|
ResultBean resultBean = baseAccadjApplyFeign.complete(baseAccAdjApplyCompleteDto); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
public ResultBean InitiatorToAnswer(CompanyAdjustDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
BaseAccAdjApplyCompleteDto baseAccAdjApplyCompleteDto = new BaseAccAdjApplyCompleteDto(); |
||||
|
BeanUtil.copyProperties(dto, baseAccAdjApplyCompleteDto); |
||||
|
Map<String, Object> map = new HashMap<>(); |
||||
|
String orgPath = dto.getOrgPath(); |
||||
|
if (StringUtils.isBlank(orgPath)) { |
||||
|
//根据用户sid获取staffSid
|
||||
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getUserSid()); |
||||
|
if (!userVoResultBean.getSuccess()) { |
||||
|
return rb.setMsg(userVoResultBean.getMsg()); |
||||
|
} |
||||
|
//根据staffSid获取用户的组织全路径
|
||||
|
ResultBean<SysStaffOrg> staffOrgResultBean = sysStaffOrgFeign.getOrgByStaffSid(userVoResultBean.getData().getStaffSid()); |
||||
|
if (!staffOrgResultBean.getSuccess()) { |
||||
|
return rb.setMsg(staffOrgResultBean.getMsg()); |
||||
|
} |
||||
|
//用户的组织全路径
|
||||
|
String orgSidPath = staffOrgResultBean.getData().getOrgSidPath(); |
||||
|
baseAccAdjApplyCompleteDto.setOrgSidPath(orgSidPath); |
||||
|
} else { |
||||
|
baseAccAdjApplyCompleteDto.setOrgSidPath(orgPath); |
||||
|
} |
||||
|
BaseAccadjApplyDetailsVo data = baseAccadjApplyFeign.fetchDetailsBySid(dto.getBusinessSid()).getData(); |
||||
|
baseAccAdjApplyCompleteDto.setBaseInternalPurchaseVehicles(data.getBaseInternalPurchaseVehicles()); |
||||
|
baseAccAdjApplyCompleteDto.setFormVariables(map); |
||||
|
ResultBean resultBean = baseAccadjApplyFeign.InitiatorToAnswer(baseAccAdjApplyCompleteDto); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
public ResultBean reject(CompanyAdjustTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
BaseAccAdjApplyTaskQuery baseAccAdjApplyTaskQuery = new BaseAccAdjApplyTaskQuery(); |
||||
|
BeanUtil.copyProperties(query, baseAccAdjApplyTaskQuery); |
||||
|
ResultBean resultBean = baseAccadjApplyFeign.taskReject(baseAccAdjApplyTaskQuery); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
public ResultBean revokeProcess(CompanyAdjustTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
BaseAccAdjApplyTaskQuery baseAccAdjApplyTaskQuery = new BaseAccAdjApplyTaskQuery(); |
||||
|
BeanUtil.copyProperties(query, baseAccAdjApplyTaskQuery); |
||||
|
ResultBean resultBean = baseAccadjApplyFeign.revokeProcess(baseAccAdjApplyTaskQuery); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
public ResultBean breakProcess(CompanyAdjustTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
BaseAccAdjApplyTaskQuery baseAccAdjApplyTaskQuery = new BaseAccAdjApplyTaskQuery(); |
||||
|
BeanUtil.copyProperties(query, baseAccAdjApplyTaskQuery); |
||||
|
ResultBean resultBean = baseAccadjApplyFeign.breakProcess(baseAccAdjApplyTaskQuery); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
public ResultBean<String> getFlowOperateTitle(CompanyAdjustQuery query) { |
||||
|
ResultBean<String> rb = ResultBean.fireFail(); |
||||
|
//0 上一环节 1下一环节
|
||||
|
int next = query.getNext(); |
||||
|
GetNodeQuery getNodeQuery = new GetNodeQuery(); |
||||
|
BeanUtil.copyProperties(query, getNodeQuery); |
||||
|
String data = ""; |
||||
|
if (next == 0) { |
||||
|
ResultBean<List<GetNodeVo>> getPreviousNodesForReject = baseAccadjApplyFeign.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<List<GetNodeVo>> getNextNodesForSubmit = baseAccadjApplyFeign.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); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue