
21 changed files with 1017 additions and 1 deletions
@ -0,0 +1,91 @@ |
|||
DROP TABLE IF EXISTS `warehousing_pledge`; |
|||
CREATE TABLE `warehousing_pledge` |
|||
( |
|||
`id` int(32) NOT NULL AUTO_INCREMENT COMMENT 'id', |
|||
`sid` varchar(64) NOT NULL COMMENT 'sid', |
|||
`lockVersion` int(32) DEFAULT '0' COMMENT '版本锁', |
|||
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
|||
`modifyTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', |
|||
`isEnable` int(32) DEFAULT '1' COMMENT '是否可用:1可用,0不可用', |
|||
`state` int(32) DEFAULT '1' COMMENT '状态', |
|||
`isDelete` int(32) DEFAULT '0' COMMENT '是否删除:0未删除,1已删除', |
|||
`remarks` varchar(255) DEFAULT NULL COMMENT '备注', |
|||
`createBySid` varchar(64) DEFAULT NULL COMMENT '创建人sid', |
|||
`updateBySid` varchar(64) DEFAULT NULL COMMENT '修改人sid', |
|||
`createByName` varchar(64) DEFAULT NULL COMMENT '创建人名称', |
|||
`projectName` varchar(255) DEFAULT NULL COMMENT '项目名称', |
|||
`projectSid` varchar(255) DEFAULT NULL COMMENT '项目sid', |
|||
`warehouseName` varchar(255) DEFAULT NULL COMMENT '仓库名称', |
|||
`warehouseSid` varchar(255) DEFAULT NULL COMMENT '仓库sid', |
|||
`goodsValue` varchar(255) DEFAULT NULL COMMENT '货物价值', |
|||
`procDefId` varchar(255) DEFAULT NULL COMMENT '流程id', |
|||
`procInstId` varchar(255) DEFAULT NULL COMMENT '实例id', |
|||
`taskId` varchar(255) DEFAULT NULL COMMENT '任务id', |
|||
`nodeState` varchar(255) DEFAULT NULL COMMENT '流程状态', |
|||
`taskDefKey` varchar(255) DEFAULT NULL COMMENT '环节id', |
|||
PRIMARY KEY (`id`), |
|||
KEY `id` (`id`) |
|||
) ENGINE = INNODB |
|||
DEFAULT CHARSET = utf8 COMMENT ='入库质押申请'; |
|||
|
|||
DROP TABLE IF EXISTS `quality_release`; |
|||
CREATE TABLE `quality_release` |
|||
( |
|||
`id` int(32) NOT NULL AUTO_INCREMENT COMMENT 'id', |
|||
`sid` varchar(64) NOT NULL COMMENT 'sid', |
|||
`lockVersion` int(32) DEFAULT '0' COMMENT '版本锁', |
|||
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
|||
`modifyTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', |
|||
`isEnable` int(32) DEFAULT '1' COMMENT '是否可用:1可用,0不可用', |
|||
`state` int(32) DEFAULT '1' COMMENT '状态', |
|||
`isDelete` int(32) DEFAULT '0' COMMENT '是否删除:0未删除,1已删除', |
|||
`remarks` varchar(255) DEFAULT NULL COMMENT '备注', |
|||
`createBySid` varchar(64) DEFAULT NULL COMMENT '创建人sid', |
|||
`updateBySid` varchar(64) DEFAULT NULL COMMENT '修改人sid', |
|||
`createByName` varchar(64) DEFAULT NULL COMMENT '创建人名称', |
|||
`projectName` varchar(255) DEFAULT NULL COMMENT '项目名称', |
|||
`projectSid` varchar(255) DEFAULT NULL COMMENT '项目sid', |
|||
`warehouseName` varchar(255) DEFAULT NULL COMMENT '仓库名称', |
|||
`warehouseSid` varchar(255) DEFAULT NULL COMMENT '仓库sid', |
|||
`goodsValue` varchar(255) DEFAULT NULL COMMENT '货物价值', |
|||
`procDefId` varchar(255) DEFAULT NULL COMMENT '流程id', |
|||
`procInstId` varchar(255) DEFAULT NULL COMMENT '实例id', |
|||
`taskId` varchar(255) DEFAULT NULL COMMENT '任务id', |
|||
`nodeState` varchar(255) DEFAULT NULL COMMENT '流程状态', |
|||
`taskDefKey` varchar(255) DEFAULT NULL COMMENT '环节id', |
|||
PRIMARY KEY (`id`), |
|||
KEY `id` (`id`) |
|||
) ENGINE = INNODB |
|||
DEFAULT CHARSET = utf8 COMMENT ='解质出库申请'; |
|||
|
|||
DROP TABLE IF EXISTS `payment_apply`; |
|||
CREATE TABLE `payment_apply` |
|||
( |
|||
`id` int(32) NOT NULL AUTO_INCREMENT COMMENT 'id', |
|||
`sid` varchar(64) NOT NULL COMMENT 'sid', |
|||
`lockVersion` int(32) DEFAULT '0' COMMENT '版本锁', |
|||
`createTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', |
|||
`modifyTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间', |
|||
`isEnable` int(32) DEFAULT '1' COMMENT '是否可用:1可用,0不可用', |
|||
`state` int(32) DEFAULT '1' COMMENT '状态', |
|||
`isDelete` int(32) DEFAULT '0' COMMENT '是否删除:0未删除,1已删除', |
|||
`remarks` varchar(255) DEFAULT NULL COMMENT '备注', |
|||
`createBySid` varchar(64) DEFAULT NULL COMMENT '创建人sid', |
|||
`updateBySid` varchar(64) DEFAULT NULL COMMENT '修改人sid', |
|||
`createByName` varchar(64) DEFAULT NULL COMMENT '创建人名称', |
|||
`projectName` varchar(255) DEFAULT NULL COMMENT '项目名称', |
|||
`projectSid` varchar(255) DEFAULT NULL COMMENT '项目sid', |
|||
`enterpriseName` varchar(255) DEFAULT NULL COMMENT '用款企业', |
|||
`enterpriseSid` varchar(255) DEFAULT NULL COMMENT '用款企业sid', |
|||
`applyUse` varchar(255) DEFAULT NULL COMMENT '用款申请用途', |
|||
`money` decimal(10, 2) DEFAULT NULL COMMENT '用款金额', |
|||
`voucherUrl` text DEFAULT NULL COMMENT '回款凭证', |
|||
`procDefId` varchar(255) DEFAULT NULL COMMENT '流程id', |
|||
`procInstId` varchar(255) DEFAULT NULL COMMENT '实例id', |
|||
`taskId` varchar(255) DEFAULT NULL COMMENT '任务id', |
|||
`nodeState` varchar(255) DEFAULT NULL COMMENT '流程状态', |
|||
`taskDefKey` varchar(255) DEFAULT NULL COMMENT '环节id', |
|||
PRIMARY KEY (`id`), |
|||
KEY `id` (`id`) |
|||
) ENGINE = INNODB |
|||
DEFAULT CHARSET = utf8 COMMENT ='用款申请'; |
@ -0,0 +1,44 @@ |
|||
package com.yxt.supervise.enterprisecentre.api.paymentapply; |
|||
|
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@Data |
|||
public class PaymentApply extends BaseEntity { |
|||
private static final long serialVersionUID = 5724305377756638094L; |
|||
@ApiModelProperty("创建人名称") |
|||
private String createByName; |
|||
@ApiModelProperty("项目名称") |
|||
private String projectName; |
|||
@ApiModelProperty("项目sid") |
|||
private String projectSid; |
|||
@ApiModelProperty("用款企业") |
|||
private String enterpriseName; |
|||
@ApiModelProperty("用款企业sid") |
|||
private String enterpriseSid; |
|||
@ApiModelProperty("用款申请用途") |
|||
private String applyUse; |
|||
@ApiModelProperty("用款金额") |
|||
private BigDecimal money; |
|||
@ApiModelProperty("回款凭证") |
|||
private String voucherUrl; |
|||
|
|||
@ApiModelProperty("流程id") |
|||
private String procDefId; |
|||
@ApiModelProperty("实例id") |
|||
private String procInstId; |
|||
@ApiModelProperty("任务id") |
|||
private String taskId; |
|||
@ApiModelProperty("流程环节") |
|||
private String nodeState; |
|||
@ApiModelProperty("环节id") |
|||
private String taskDefKey; |
|||
} |
@ -0,0 +1,39 @@ |
|||
package com.yxt.supervise.enterprisecentre.api.qualityrelease; |
|||
|
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@Data |
|||
public class QualityRelease extends BaseEntity { |
|||
private static final long serialVersionUID = 1491905607832350029L; |
|||
|
|||
@ApiModelProperty("创建人名称") |
|||
private String createByName; |
|||
@ApiModelProperty("项目名称") |
|||
private String projectName; |
|||
@ApiModelProperty("项目sid") |
|||
private String projectSid; |
|||
@ApiModelProperty("仓库名称") |
|||
private String warehouseName; |
|||
@ApiModelProperty("仓库sid") |
|||
private String warehouseSid; |
|||
@ApiModelProperty("货物价值") |
|||
private String goodsValue; |
|||
|
|||
@ApiModelProperty("流程id") |
|||
private String procDefId; |
|||
@ApiModelProperty("实例id") |
|||
private String procInstId; |
|||
@ApiModelProperty("任务id") |
|||
private String taskId; |
|||
@ApiModelProperty("流程环节") |
|||
private String nodeState; |
|||
@ApiModelProperty("环节id") |
|||
private String taskDefKey; |
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.yxt.supervise.enterprisecentre.api.warehousingpledge; |
|||
|
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@Data |
|||
public class WarehousingPledge extends BaseEntity { |
|||
private static final long serialVersionUID = -4271197867978438659L; |
|||
@ApiModelProperty("创建人名称") |
|||
private String createByName; |
|||
@ApiModelProperty("项目名称") |
|||
private String projectName; |
|||
@ApiModelProperty("项目sid") |
|||
private String projectSid; |
|||
@ApiModelProperty("仓库名称") |
|||
private String warehouseName; |
|||
@ApiModelProperty("仓库sid") |
|||
private String warehouseSid; |
|||
@ApiModelProperty("货物价值") |
|||
private String goodsValue; |
|||
@ApiModelProperty("流程id") |
|||
private String procDefId; |
|||
@ApiModelProperty("实例id") |
|||
private String procInstId; |
|||
@ApiModelProperty("任务id") |
|||
private String taskId; |
|||
@ApiModelProperty("流程环节") |
|||
private String nodeState; |
|||
@ApiModelProperty("环节id") |
|||
private String taskDefKey; |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.yxt.supervise.enterprisecentre.api.warehousingpledge; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@Data |
|||
public class WarehousingPledgeDetailsVo implements Vo { |
|||
private static final long serialVersionUID = -1952900512756836125L; |
|||
private String sid; |
|||
private String userSid; |
|||
@ApiModelProperty("创建人名称") |
|||
private String createByName; |
|||
@ApiModelProperty("项目名称") |
|||
private String projectName; |
|||
@ApiModelProperty("项目sid") |
|||
private String projectSid; |
|||
@ApiModelProperty("仓库名称") |
|||
private String warehouseName; |
|||
@ApiModelProperty("仓库sid") |
|||
private String warehouseSid; |
|||
@ApiModelProperty("货物价值") |
|||
private String goodsValue; |
|||
@ApiModelProperty("实例id") |
|||
private String procInstId; |
|||
@ApiModelProperty("任务id") |
|||
private String taskId; |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.yxt.supervise.enterprisecentre.api.warehousingpledge; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@Data |
|||
public class WarehousingPledgeDto implements Dto { |
|||
private static final long serialVersionUID = -7783276640547964225L; |
|||
|
|||
private String sid; |
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
@ApiModelProperty("创建人名称") |
|||
private String createByName; |
|||
@ApiModelProperty("项目名称") |
|||
private String projectName; |
|||
@ApiModelProperty("项目sid") |
|||
private String projectSid; |
|||
@ApiModelProperty("仓库名称") |
|||
private String warehouseName; |
|||
@ApiModelProperty("仓库sid") |
|||
private String warehouseSid; |
|||
@ApiModelProperty("货物价值") |
|||
private String goodsValue; |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.yxt.supervise.enterprisecentre.api.warehousingpledge; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@Data |
|||
public class WarehousingPledgeQuery implements Query { |
|||
private static final long serialVersionUID = -8106702755592169951L; |
|||
|
|||
@ApiModelProperty("项目名称") |
|||
private String projectName; |
|||
@ApiModelProperty("仓库名称") |
|||
private String warehouseName; |
|||
@ApiModelProperty("创建时间开始") |
|||
private String createTimeStart; |
|||
@ApiModelProperty("创建时间结束") |
|||
private String createTimeEnd; |
|||
@ApiModelProperty("用户sid") |
|||
private String userSid; |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.yxt.supervise.enterprisecentre.api.warehousingpledge; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@Data |
|||
public class WarehousingPledgeVo implements Vo { |
|||
private static final long serialVersionUID = -5939570054956972879L; |
|||
|
|||
private String sid; |
|||
@ApiModelProperty("流程状态") |
|||
private String nodeState; |
|||
@ApiModelProperty("申请人") |
|||
private String createByName; |
|||
|
|||
@ApiModelProperty("项目名称") |
|||
private String projectName; |
|||
|
|||
@ApiModelProperty("仓库名称") |
|||
private String warehouseName; |
|||
|
|||
@ApiModelProperty("货物价值") |
|||
private String goodsValue; |
|||
|
|||
@ApiModelProperty("创建时间") |
|||
private String createTime; |
|||
|
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.yxt.supervise.enterprisecentre.api.warehousingpledge.flowable; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@Data |
|||
public class CompletePledgeDto { |
|||
|
|||
@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") |
|||
@NotBlank(message = "参数错误:instanceId") |
|||
private String instanceId; |
|||
@ApiModelProperty(value = "意见") |
|||
private String comment; |
|||
@ApiModelProperty(value = "业务sid") |
|||
@NotBlank(message = "参数错误:businessSid") |
|||
private String businessSid; |
|||
} |
@ -0,0 +1,43 @@ |
|||
package com.yxt.supervise.enterprisecentre.api.warehousingpledge.flowable; |
|||
|
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@Data |
|||
public class PledgeTaskQuery { |
|||
|
|||
/** |
|||
* 终止、驳回、撤回 |
|||
*/ |
|||
@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; |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.yxt.supervise.enterprisecentre.api.warehousingpledge.flowable; |
|||
|
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.WarehousingPledgeDto; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@Data |
|||
public class SubmitPledgeDto extends WarehousingPledgeDto { |
|||
|
|||
private static final long serialVersionUID = -2202726987908396889L; |
|||
@ApiModelProperty("流程实例id") |
|||
private String instanceId; |
|||
@ApiModelProperty("任务id") |
|||
private String taskId; |
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.yxt.supervise.enterprisecentre.biz.warehousingpledge; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.WarehousingPledge; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.WarehousingPledgeDetailsVo; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.WarehousingPledgeVo; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@Mapper |
|||
public interface WarehousingPledgeMapper extends BaseMapper<WarehousingPledge> { |
|||
/** |
|||
* 分页列表 |
|||
* |
|||
* @param page |
|||
* @param qw |
|||
* @return |
|||
*/ |
|||
IPage<WarehousingPledgeVo> selectPageVo(IPage<WarehousingPledge> page, @Param(Constants.WRAPPER) QueryWrapper<WarehousingPledge> qw); |
|||
|
|||
WarehousingPledgeDetailsVo details(String sid); |
|||
|
|||
int selectBySid(String join); |
|||
|
|||
int updateFlowFiled(Map<String, Object> map); |
|||
} |
@ -0,0 +1,56 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.supervise.enterprisecentre.biz.warehousingpledge.WarehousingPledgeMapper"> |
|||
<select id="selectPageVo" resultType="com.yxt.supervise.enterprisecentre.api.warehousingpledge.WarehousingPledgeVo"> |
|||
select sid, |
|||
warehouseName, |
|||
projectName, |
|||
createByName, |
|||
DATE_FORMAT(createTime, '%Y-%m-%d') as createTime, |
|||
if(length(nodeState) > 0, nodeState, '待提交') as nodeState |
|||
from warehousing_pledge |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
order by id desc |
|||
</select> |
|||
|
|||
<select id="details" |
|||
resultType="com.yxt.supervise.enterprisecentre.api.warehousingpledge.WarehousingPledgeDetailsVo"> |
|||
select sid, |
|||
createBySid as userSid, |
|||
projectName, |
|||
projectSid, |
|||
warehouseName, |
|||
warehouseSid, |
|||
procInstId, |
|||
taskId, |
|||
createByName, |
|||
goodsValue |
|||
from warehousing_pledge |
|||
where sid = #{sid} |
|||
</select> |
|||
|
|||
<select id="selectBySid" resultType="int"> |
|||
select count(*) |
|||
from warehousing_pledge |
|||
where length(nodeState) > 0 |
|||
and find_in_set(sid, #{list}) |
|||
</select> |
|||
|
|||
<update id="updateFlowFiled"> |
|||
UPDATE warehousing_pledge |
|||
SET nodeState=#{nodeState} |
|||
, taskDefKey=#{taskDefKey} |
|||
<if test="procDefId != null and procDefId != ''"> |
|||
, procDefId=#{procDefId} |
|||
</if> |
|||
<if test="procInsId != null and procInsId != ''"> |
|||
, procInstId=#{procInsId} |
|||
</if> |
|||
<if test="taskId != null and taskId != ''"> |
|||
, taskId=#{taskId} |
|||
</if> |
|||
WHERE sid = #{sid} |
|||
</update> |
|||
</mapper> |
@ -0,0 +1,106 @@ |
|||
package com.yxt.supervise.enterprisecentre.biz.warehousingpledge; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.supervise.enterprisecentre.api.flowable.BusinessVariables; |
|||
import com.yxt.supervise.enterprisecentre.api.flowable.GetNodeQuery; |
|||
import com.yxt.supervise.enterprisecentre.api.flowable.GetNodeVo; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.WarehousingPledgeDetailsVo; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.WarehousingPledgeDto; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.WarehousingPledgeQuery; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.WarehousingPledgeVo; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.flowable.CompletePledgeDto; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.flowable.PledgeTaskQuery; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.flowable.SubmitPledgeDto; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.cloud.openfeign.SpringQueryMap; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@RestController |
|||
@RequestMapping("v1/WarehousingPledge") |
|||
public class WarehousingPledgeRest { |
|||
|
|||
@Autowired |
|||
private WarehousingPledgeService warehousingPledgeService; |
|||
|
|||
@ApiOperation("新增或修改") |
|||
@PostMapping("/saveorUpdate") |
|||
ResultBean<String> saveorUpdate(@RequestBody WarehousingPledgeDto dto) { |
|||
return warehousingPledgeService.saveorUpdatePledge(dto); |
|||
} |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
ResultBean<PagerVo<WarehousingPledgeVo>> listPage(PagerQuery<WarehousingPledgeQuery> pagerQuery) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
PagerVo<WarehousingPledgeVo> pv = warehousingPledgeService.listPageVo(pagerQuery); |
|||
return rb.success().setData(pv); |
|||
} |
|||
|
|||
@ApiOperation("详情") |
|||
@GetMapping("/details") |
|||
ResultBean<WarehousingPledgeDetailsVo> details(@RequestParam("sid") String sid) { |
|||
return warehousingPledgeService.details(sid); |
|||
} |
|||
|
|||
@ApiOperation("删除") |
|||
@DeleteMapping("/delete") |
|||
ResultBean delete(@RequestBody String[] sids) { |
|||
return warehousingPledgeService.delete(sids); |
|||
} |
|||
|
|||
@ApiOperation("提交") |
|||
@PostMapping("/submit") |
|||
ResultBean submit(@RequestBody SubmitPledgeDto dto) { |
|||
return warehousingPledgeService.submit(dto); |
|||
} |
|||
|
|||
@ApiOperation("办理") |
|||
@PostMapping("/complete") |
|||
ResultBean complete(@RequestBody CompletePledgeDto dto) { |
|||
BusinessVariables bv = new BusinessVariables(); |
|||
BeanUtil.copyProperties(dto, bv); |
|||
return warehousingPledgeService.complete(bv); |
|||
} |
|||
|
|||
@ApiOperation("获取上一环节") |
|||
@GetMapping(value = "/getPreviousNodesForReject") |
|||
ResultBean<List<GetNodeVo>> getPreviousNodesForReject(@SpringQueryMap GetNodeQuery query) { |
|||
return warehousingPledgeService.getPreviousNodesForReject(query); |
|||
} |
|||
|
|||
@ApiOperation("获取下一环节") |
|||
@GetMapping(value = "/getNextNodesForSubmit") |
|||
ResultBean<List<GetNodeVo>> getNextNodesForSubmit(@SpringQueryMap GetNodeQuery query) { |
|||
return warehousingPledgeService.getNextNodesForSubmit(query); |
|||
} |
|||
@ApiOperation("驳回") |
|||
@PostMapping(value = "/taskReject") |
|||
public ResultBean taskReject(PledgeTaskQuery query) { |
|||
return warehousingPledgeService.taskReject(query); |
|||
} |
|||
@ApiOperation("撤回") |
|||
@PostMapping(value = "/revokeProcess") |
|||
public ResultBean revokeProcess(PledgeTaskQuery query) { |
|||
return warehousingPledgeService.revokeProcess(query); |
|||
} |
|||
@ApiOperation("终止") |
|||
@PostMapping(value = "/breakProcess") |
|||
public ResultBean breakProcess(PledgeTaskQuery query) { |
|||
return warehousingPledgeService.breakProcess(query); |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,359 @@ |
|||
package com.yxt.supervise.enterprisecentre.biz.warehousingpledge; |
|||
|
|||
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.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
import com.yxt.common.base.utils.StringUtils; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.supervise.enterprisecentre.api.flowable.*; |
|||
import com.yxt.supervise.enterprisecentre.api.sealrecord.SysUserVo; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.*; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.flowable.PledgeTaskQuery; |
|||
import com.yxt.supervise.enterprisecentre.api.warehousingpledge.flowable.SubmitPledgeDto; |
|||
import com.yxt.supervise.enterprisecentre.biz.feign.FlowTaskFeign; |
|||
import com.yxt.supervise.enterprisecentre.biz.feign.FlowableFeign; |
|||
import com.yxt.supervise.enterprisecentre.biz.feign.SysUserFeign; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.*; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* @description: |
|||
* @author: dimengzhe |
|||
* @date: 2023/11/21 |
|||
**/ |
|||
@Service |
|||
public class WarehousingPledgeService extends MybatisBaseService<WarehousingPledgeMapper, WarehousingPledge> { |
|||
|
|||
@Autowired |
|||
private SysUserFeign sysUserFeign; |
|||
@Autowired |
|||
private FlowableFeign flowableFeign; |
|||
@Autowired |
|||
private FlowTaskFeign flowTaskFeign; |
|||
|
|||
/** |
|||
* 新增修改 |
|||
* |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
public ResultBean<String> saveorUpdatePledge(WarehousingPledgeDto dto) { |
|||
ResultBean<String> rb = ResultBean.fireFail(); |
|||
String sid = dto.getSid(); |
|||
if (StringUtils.isBlank(sid)) {//新增
|
|||
WarehousingPledge warehousingPledge = new WarehousingPledge(); |
|||
BeanUtil.copyProperties(dto, warehousingPledge, "sid"); |
|||
String userSid = dto.getUserSid(); |
|||
warehousingPledge.setCreateBySid(userSid); |
|||
//根据userSid查询申请人的名称
|
|||
ResultBean<SysUserVo> resultBean = sysUserFeign.getUserByUserSid(userSid); |
|||
if (resultBean.getData() != null) { |
|||
SysUserVo sysUserVo = resultBean.getData(); |
|||
String name = sysUserVo.getName(); |
|||
warehousingPledge.setCreateByName(name); |
|||
} |
|||
|
|||
baseMapper.insert(warehousingPledge); |
|||
sid = warehousingPledge.getSid(); |
|||
|
|||
} else {//修改
|
|||
WarehousingPledge warehousingPledge = fetchBySid(sid); |
|||
if (warehousingPledge == null) { |
|||
return rb.setMsg("该入库质押申请不存在"); |
|||
} |
|||
BeanUtil.copyProperties(dto, warehousingPledge, "sid"); |
|||
baseMapper.updateById(warehousingPledge); |
|||
} |
|||
return rb.success().setData(sid); |
|||
} |
|||
|
|||
/** |
|||
* 分页列表 |
|||
* |
|||
* @param pagerQuery |
|||
* @return |
|||
*/ |
|||
public PagerVo<WarehousingPledgeVo> listPageVo(PagerQuery<WarehousingPledgeQuery> pagerQuery) { |
|||
WarehousingPledgeQuery query = pagerQuery.getParams(); |
|||
QueryWrapper<WarehousingPledge> qw = new QueryWrapper<>(); |
|||
if (query != null) { |
|||
if (StringUtils.isNotBlank(query.getUserSid())) { |
|||
qw.eq("createBySid", query.getUserSid()); |
|||
} |
|||
//仓库名称
|
|||
if (StringUtils.isNotBlank(query.getWarehouseName())) { |
|||
qw.like("warehouseName", query.getWarehouseName()); |
|||
} |
|||
//项目名称
|
|||
if (StringUtils.isNotBlank(query.getProjectName())) { |
|||
qw.like("projectName", query.getProjectName()); |
|||
} |
|||
//创建时间开始、创建时间结束
|
|||
qw.apply(StringUtils.isNotBlank(query.getCreateTimeStart()), "date_format (createTime,'%Y-%m-%d') >= date_format('" + query.getCreateTimeStart() + "','%Y-%m-%d')"). |
|||
apply(StringUtils.isNotBlank(query.getCreateTimeEnd()), "date_format (createTime,'%Y-%m-%d') <= date_format('" + query.getCreateTimeEnd() + "','%Y-%m-%d')" |
|||
); |
|||
} |
|||
IPage<WarehousingPledge> page = PagerUtil.queryToPage(pagerQuery); |
|||
IPage<WarehousingPledgeVo> pagging = baseMapper.selectPageVo(page, qw); |
|||
PagerVo<WarehousingPledgeVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return p; |
|||
} |
|||
|
|||
public ResultBean<WarehousingPledgeDetailsVo> details(String sid) { |
|||
ResultBean<WarehousingPledgeDetailsVo> rb = ResultBean.fireFail(); |
|||
WarehousingPledge warehousingPledge = fetchBySid(sid); |
|||
if (warehousingPledge == null) { |
|||
return rb.setMsg("该入库质押申请不存在"); |
|||
} |
|||
WarehousingPledgeDetailsVo warehousingPledgeDetailsVo = baseMapper.details(sid); |
|||
return rb.success().setData(warehousingPledgeDetailsVo); |
|||
} |
|||
|
|||
public ResultBean delete(String[] sids) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
//查询该sid中是否有流程不是待提交的
|
|||
int count = baseMapper.selectBySid(StringUtils.join(sids, ",")); |
|||
if (count > 0) { |
|||
return rb.setMsg("删除的数据中包含已经提交审批的数据,删除失败"); |
|||
} |
|||
delBySids(sids); |
|||
return rb.success(); |
|||
} |
|||
|
|||
public ResultBean submit(SubmitPledgeDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
WarehousingPledge warehousingPledge = fetchBySid(dto.getSid()); |
|||
int r = submitBusinessData(dto, warehousingPledge); |
|||
if (r == 3) { |
|||
return rb.setMsg("该申请不存在"); |
|||
} |
|||
if (r == 0) { |
|||
return rb.setMsg("操作失败!提交的数据不一致"); |
|||
} |
|||
ResultBean<String> resultBean = saveorUpdatePledge(dto); |
|||
if (!resultBean.getSuccess()) { |
|||
return rb.setMsg(resultBean.getMsg()); |
|||
} |
|||
String businessSid = resultBean.getData(); |
|||
//创建BusinessVariables实体对象
|
|||
BusinessVariables bv = new BusinessVariables(); |
|||
//业务sid
|
|||
bv.setBusinessSid(businessSid); |
|||
//用户sid
|
|||
bv.setUserSid(dto.getUserSid()); |
|||
bv.setProjectSid(dto.getProjectSid()); |
|||
if (r == 1) { |
|||
bv.setModelId(ProcDefEnum.WAREHOUSINGPLEDGE.getProDefId()); |
|||
ResultBean<UpdateFlowFieldVo> voResultBean = flowableFeign.startProcess(bv); |
|||
if (!voResultBean.getSuccess()) { |
|||
return rb.setMsg(voResultBean.getMsg()); |
|||
} |
|||
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|||
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
|||
return voResultBean; |
|||
} |
|||
if (r == 2) { |
|||
warehousingPledge = fetchBySid(businessSid); |
|||
// ToDo:驳回到发起人后再次提交
|
|||
if (StringUtils.isBlank(dto.getInstanceId())) { |
|||
return rb.setMsg("参数错误:procInstId"); |
|||
} |
|||
bv.setTaskId(warehousingPledge.getTaskId()); |
|||
bv.setTaskDefKey(warehousingPledge.getTaskDefKey()); |
|||
bv.setComment("重新提交"); |
|||
bv.setInstanceId(dto.getInstanceId()); |
|||
return complete(bv); |
|||
} |
|||
return rb; |
|||
} |
|||
|
|||
public ResultBean complete(BusinessVariables bv) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String businessSid = bv.getBusinessSid(); |
|||
WarehousingPledge warehousingPledge = fetchBySid(businessSid); |
|||
if (warehousingPledge == null) { |
|||
return rb.setMsg("该入库质押申请不存在"); |
|||
} |
|||
Map<String, Object> variables = new HashMap<>(); |
|||
bv.setModelId(warehousingPledge.getProcDefId()); |
|||
bv.setProjectSid(warehousingPledge.getProjectSid()); |
|||
if (bv.getTaskId().equals(warehousingPledge.getTaskId())) { |
|||
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.handleProsess(bv); |
|||
if (!resultBean.getSuccess()) { |
|||
return rb.setMsg(resultBean.getMsg()); |
|||
} |
|||
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|||
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|||
return rb.success().setData(resultBean.getData()); |
|||
} else { |
|||
return rb.setMsg("操作失败!提交的数据不一致"); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* 更新流程相关的状态 |
|||
* |
|||
* @param map |
|||
* @return |
|||
*/ |
|||
private int updateFlowFiled(Map<String, Object> map) { |
|||
return baseMapper.updateFlowFiled(map); |
|||
} |
|||
|
|||
/** |
|||
* 判断提交的流程是否被允许 |
|||
* |
|||
* @param dto |
|||
* @return |
|||
*/ |
|||
private synchronized int submitBusinessData(SubmitPledgeDto dto, WarehousingPledge warehousingPledge) { |
|||
int r = 0; |
|||
if (StringUtils.isBlank(dto.getSid())) { |
|||
r = 1; |
|||
} else { |
|||
if (warehousingPledge != null) { |
|||
String businessTaskId = warehousingPledge.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; |
|||
} |
|||
|
|||
public ResultBean<List<GetNodeVo>> getPreviousNodesForReject(GetNodeQuery query) { |
|||
ResultBean<List<GetNodeVo>> rb = ResultBean.fireFail(); |
|||
BusinessVariables bv = new BusinessVariables(); |
|||
BeanUtil.copyProperties(query, bv); |
|||
WarehousingPledge warehousingPledge = fetchBySid(query.getBusinessSid()); |
|||
bv.setModelId(warehousingPledge.getProcDefId()); |
|||
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); |
|||
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|||
List<GetNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); |
|||
return rb.success().setData(voList); |
|||
} |
|||
|
|||
public ResultBean<List<GetNodeVo>> getNextNodesForSubmit(GetNodeQuery query) { |
|||
ResultBean<List<GetNodeVo>> rb = ResultBean.fireFail(); |
|||
BusinessVariables bv = new BusinessVariables(); |
|||
BeanUtil.copyProperties(query, bv); |
|||
WarehousingPledge warehousingPledge = fetchBySid(query.getBusinessSid()); |
|||
bv.setModelId(warehousingPledge.getProcDefId()); |
|||
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); |
|||
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|||
List<GetNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); |
|||
return rb.success().setData(voList); |
|||
} |
|||
|
|||
public ResultBean taskReject(PledgeTaskQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
String businessSid = query.getBusinessSid(); |
|||
WarehousingPledge warehousingPledge = fetchBySid(businessSid); |
|||
if (warehousingPledge == null) { |
|||
return rb.setMsg("该入库质押申请不存在"); |
|||
} |
|||
String businessTaskId = warehousingPledge.getTaskId(); |
|||
if (StringUtils.isNotBlank(businessTaskId)) { |
|||
if (businessTaskId.equals(query.getTaskId())) { |
|||
if (StringUtils.isBlank(query.getComment())) { |
|||
return rb.setMsg("请填写意见"); |
|||
} |
|||
if (StringUtils.isBlank(query.getUserSid())) { |
|||
return rb.setMsg("参数错误:userSid"); |
|||
} |
|||
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|||
BeanUtil.copyProperties(query, flowTaskVo); |
|||
Map<String, Object> variables = new HashMap<>(); |
|||
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.taskReject(flowTaskVo); |
|||
if (!resultBean.getSuccess()) { |
|||
return rb.setMsg(resultBean.getMsg()); |
|||
} |
|||
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|||
Map<String, Object> map = BeanUtil.beanToMap(ufVo); |
|||
//更新业务中的流程相关的参数
|
|||
updateFlowFiled(map); |
|||
return rb.success(); |
|||
} |
|||
} |
|||
return rb.setMsg("操作失败!提交的数据不一致!"); |
|||
} |
|||
|
|||
public ResultBean revokeProcess(PledgeTaskQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
if (StringUtils.isNotBlank(query.getUserSid())) { |
|||
return rb.setMsg("参数错误:userSid"); |
|||
} |
|||
WarehousingPledge warehousingPledge = fetchBySid(query.getBusinessSid()); |
|||
String businessTaskId = warehousingPledge.getTaskId(); |
|||
if (StringUtils.isNotBlank(businessTaskId)) { |
|||
if (businessTaskId.equals(query.getTaskId())) { |
|||
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|||
BeanUtil.copyProperties(query, flowTaskVo); |
|||
ResultBean<UpdateFlowFieldVo> 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 breakProcess(PledgeTaskQuery query) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
if (StringUtils.isBlank(query.getInstanceId())) { |
|||
return rb.setMsg("参数错误:instanceId"); |
|||
} |
|||
if (StringUtils.isBlank(query.getUserSid())) { |
|||
return rb.setMsg("参数错误:userSid"); |
|||
} |
|||
if (StringUtils.isBlank(query.getComment())) { |
|||
return rb.setMsg("请填写意见"); |
|||
} |
|||
WarehousingPledge warehousingPledge = fetchBySid(query.getBusinessSid()); |
|||
String businessTaskId = warehousingPledge.getTaskId(); |
|||
if (StringUtils.isNotBlank(businessTaskId)) { |
|||
if (query.getUserSid().equals(warehousingPledge.getCreateBySid())) { |
|||
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|||
BeanUtil.copyProperties(query, flowTaskVo); |
|||
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.breakProcess(flowTaskVo); |
|||
if (!resultBean.getSuccess()) { |
|||
return rb.setMsg(resultBean.getMsg()); |
|||
} |
|||
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|||
updateFlowFiled(map); |
|||
return rb.success().setData(resultBean.getData()); |
|||
} else { |
|||
if (businessTaskId.equals(query.getTaskId())) { |
|||
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|||
BeanUtil.copyProperties(query, flowTaskVo); |
|||
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.breakProcess(flowTaskVo); |
|||
if (!resultBean.getSuccess()) { |
|||
return rb.setMsg(resultBean.getMsg()); |
|||
} |
|||
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|||
updateFlowFiled(map); |
|||
return rb.success().setData(resultBean.getData()); |
|||
} |
|||
} |
|||
|
|||
} |
|||
return rb.setMsg("操作失败!提交的数据不一致!"); |
|||
} |
|||
} |
Loading…
Reference in new issue