
30 changed files with 1187 additions and 503 deletions
@ -1,77 +0,0 @@ |
|||||
/********************************************************* |
|
||||
********************************************************* |
|
||||
******************** ******************* |
|
||||
************* ************ |
|
||||
******* _oo0oo_ ******* |
|
||||
*** o8888888o *** |
|
||||
* 88" . "88 * |
|
||||
* (| -_- |) * |
|
||||
* 0\ = /0 * |
|
||||
* ___/`---'\___ * |
|
||||
* .' \\| |// '. *
|
|
||||
* / \\||| : |||// \ *
|
|
||||
* / _||||| -:- |||||- \ * |
|
||||
* | | \\\ - /// | | *
|
|
||||
* | \_| ''\---/'' |_/ | * |
|
||||
* \ .-\__ '-' ___/-. / * |
|
||||
* ___'. .' /--.--\ `. .'___ * |
|
||||
* ."" '< `.___\_<|>_/___.' >' "". * |
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|
||||
* `=---=' * |
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|
||||
*********************************************************/ |
|
||||
package com.yxt.anrui.scm.api.scmstandrecordapply; |
|
||||
|
|
||||
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 org.springframework.cloud.openfeign.FeignClient; |
|
||||
import org.springframework.web.bind.annotation.*; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* Project: anrui-scm(合作二级站备案申请) <br/> |
|
||||
* File: ScmStandRecordApplyFeign.java <br/> |
|
||||
* Class: com.yxt.anrui.scm.api.scmstandrecordapply.ScmStandRecordApplyFeign <br/> |
|
||||
* Description: 合作二级站备案申请. <br/> |
|
||||
* Copyright: Copyright (c) 2011 <br/> |
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
|
||||
* Makedate: 2024-10-22 16:05:59 <br/> |
|
||||
* |
|
||||
* @author liupopo |
|
||||
* @version 1.0 |
|
||||
* @since 1.0 |
|
||||
*/ |
|
||||
@Api(tags = "合作二级站备案申请") |
|
||||
@FeignClient( |
|
||||
contextId = "anrui-scm-ScmStandRecordApply", |
|
||||
name = "anrui-scm", |
|
||||
path = "v1/scmstandrecordapply") |
|
||||
public interface ScmStandRecordApplyFeign { |
|
||||
|
|
||||
@ApiOperation("根据条件分页查询数据的列表") |
|
||||
@PostMapping("/listPage") |
|
||||
@ResponseBody |
|
||||
public ResultBean<PagerVo<ScmStandRecordApplyVo>> listPage(@RequestBody PagerQuery<ScmStandRecordApplyQuery> pq); |
|
||||
|
|
||||
@ApiOperation("新增或修改") |
|
||||
@PostMapping("/save") |
|
||||
@ResponseBody |
|
||||
public ResultBean save(@RequestBody ScmStandRecordApplyDto dto); |
|
||||
|
|
||||
@ApiOperation("根据sid删除记录") |
|
||||
@DeleteMapping("/delBySids") |
|
||||
@ResponseBody |
|
||||
public ResultBean delBySids(@RequestBody String[] sids); |
|
||||
|
|
||||
@ApiOperation("根据SID获取一条记录") |
|
||||
@GetMapping("/fetchDetailsBySid/{sid}") |
|
||||
@ResponseBody |
|
||||
public ResultBean<ScmStandRecordApplyDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid); |
|
||||
} |
|
@ -1,11 +0,0 @@ |
|||||
<?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.anrui.scm.biz.scmstandrecordapply.ScmStandRecordApplyMapper"> |
|
||||
<!-- <where> ${ew.sqlSegment} </where>--> |
|
||||
<!-- ${ew.customSqlSegment} --> |
|
||||
<select id="selectPageVo" resultType="com.yxt.anrui.scm.api.scmstandrecordapply.ScmStandRecordApplyVo"> |
|
||||
SELECT * FROM scm_stand_record_apply sa |
|
||||
LEFT JOIN anrui_portal.sys_organization so ON sa.useOrgSid = so.sid |
|
||||
<where> ${ew.sqlSegment} </where> |
|
||||
</select> |
|
||||
</mapper> |
|
@ -1,92 +0,0 @@ |
|||||
/********************************************************* |
|
||||
********************************************************* |
|
||||
******************** ******************* |
|
||||
************* ************ |
|
||||
******* _oo0oo_ ******* |
|
||||
*** o8888888o *** |
|
||||
* 88" . "88 * |
|
||||
* (| -_- |) * |
|
||||
* 0\ = /0 * |
|
||||
* ___/`---'\___ * |
|
||||
* .' \\| |// '. *
|
|
||||
* / \\||| : |||// \ *
|
|
||||
* / _||||| -:- |||||- \ * |
|
||||
* | | \\\ - /// | | *
|
|
||||
* | \_| ''\---/'' |_/ | * |
|
||||
* \ .-\__ '-' ___/-. / * |
|
||||
* ___'. .' /--.--\ `. .'___ * |
|
||||
* ."" '< `.___\_<|>_/___.' >' "". * |
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|
||||
* `=---=' * |
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|
||||
*********************************************************/ |
|
||||
package com.yxt.anrui.scm.biz.scmstandrecordapply; |
|
||||
|
|
||||
import com.yxt.common.core.query.PagerQuery; |
|
||||
import com.yxt.common.core.result.ResultBean; |
|
||||
import com.yxt.common.core.vo.PagerVo; |
|
||||
import io.swagger.annotations.Api; |
|
||||
import io.swagger.annotations.ApiOperation; |
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.web.bind.annotation.*; |
|
||||
|
|
||||
import java.util.List; |
|
||||
import com.yxt.anrui.scm.api.scmstandrecordapply.ScmStandRecordApply; |
|
||||
import com.yxt.anrui.scm.api.scmstandrecordapply.ScmStandRecordApplyQuery; |
|
||||
import com.yxt.anrui.scm.api.scmstandrecordapply.ScmStandRecordApplyVo; |
|
||||
import com.yxt.anrui.scm.api.scmstandrecordapply.ScmStandRecordApplyDetailsVo; |
|
||||
import com.yxt.anrui.scm.api.scmstandrecordapply.ScmStandRecordApplyDto; |
|
||||
import com.yxt.anrui.scm.api.scmstandrecordapply.ScmStandRecordApplyFeign; |
|
||||
|
|
||||
/** |
|
||||
* Project: anrui-scm(合作二级站备案申请) <br/> |
|
||||
* File: ScmStandRecordApplyFeignFallback.java <br/> |
|
||||
* Class: com.yxt.anrui.scm.biz.scmstandrecordapply.ScmStandRecordApplyRest <br/> |
|
||||
* Description: 合作二级站备案申请. <br/> |
|
||||
* Copyright: Copyright (c) 2011 <br/> |
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
|
||||
* Makedate: 2024-10-22 16:05:59 <br/> |
|
||||
* |
|
||||
* @author liupopo |
|
||||
* @version 1.0 |
|
||||
* @since 1.0 |
|
||||
*/ |
|
||||
@Api(tags = "合作二级站备案申请") |
|
||||
@RestController |
|
||||
@RequestMapping("v1/scmstandrecordapply") |
|
||||
public class ScmStandRecordApplyRest implements ScmStandRecordApplyFeign { |
|
||||
|
|
||||
@Autowired |
|
||||
private ScmStandRecordApplyService scmStandRecordApplyService; |
|
||||
|
|
||||
@Override |
|
||||
public ResultBean<PagerVo<ScmStandRecordApplyVo>> listPage(@RequestBody PagerQuery<ScmStandRecordApplyQuery> pq){ |
|
||||
ResultBean rb = ResultBean.fireFail(); |
|
||||
PagerVo<ScmStandRecordApplyVo> pv = scmStandRecordApplyService.listPageVo(pq); |
|
||||
return rb.success().setData(pv); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public ResultBean save(@RequestBody ScmStandRecordApplyDto dto){ |
|
||||
ResultBean rb = ResultBean.fireFail(); |
|
||||
scmStandRecordApplyService.saveOrUpdateDto(dto); |
|
||||
return rb.success(); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public ResultBean delBySids(@RequestBody String[] sids){ |
|
||||
ResultBean rb = ResultBean.fireFail(); |
|
||||
scmStandRecordApplyService.delBySids(sids); |
|
||||
return rb.success(); |
|
||||
} |
|
||||
|
|
||||
@Override |
|
||||
public ResultBean<ScmStandRecordApplyDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
|
||||
ResultBean rb = ResultBean.fireFail(); |
|
||||
ScmStandRecordApplyDetailsVo vo = scmStandRecordApplyService.fetchDetailsVoBySid(sid); |
|
||||
return rb.success().setData(vo); |
|
||||
} |
|
||||
} |
|
@ -1,210 +0,0 @@ |
|||||
/********************************************************* |
|
||||
********************************************************* |
|
||||
******************** ******************* |
|
||||
************* ************ |
|
||||
******* _oo0oo_ ******* |
|
||||
*** o8888888o *** |
|
||||
* 88" . "88 * |
|
||||
* (| -_- |) * |
|
||||
* 0\ = /0 * |
|
||||
* ___/`---'\___ * |
|
||||
* .' \\| |// '. *
|
|
||||
* / \\||| : |||// \ *
|
|
||||
* / _||||| -:- |||||- \ * |
|
||||
* | | \\\ - /// | | *
|
|
||||
* | \_| ''\---/'' |_/ | * |
|
||||
* \ .-\__ '-' ___/-. / * |
|
||||
* ___'. .' /--.--\ `. .'___ * |
|
||||
* ."" '< `.___\_<|>_/___.' >' "". * |
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / * |
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== * |
|
||||
* `=---=' * |
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
|
||||
*********************************************************/ |
|
||||
package com.yxt.anrui.scm.biz.scmstandrecordapply; |
|
||||
|
|
||||
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 com.yxt.anrui.base.common.utils.Rule; |
|
||||
import com.yxt.anrui.flowable.api.flow.FlowableFeign; |
|
||||
import com.yxt.anrui.flowable.api.flow2.FlowFeign; |
|
||||
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; |
|
||||
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
||||
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
||||
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
||||
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
||||
import com.yxt.anrui.scm.api.scmstandrecordapply.*; |
|
||||
import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapplyVo; |
|
||||
import org.apache.commons.lang3.StringUtils; |
|
||||
import com.yxt.common.base.service.MybatisBaseService; |
|
||||
import com.yxt.common.base.utils.PagerUtil; |
|
||||
import com.yxt.common.core.query.PagerQuery; |
|
||||
import com.yxt.common.core.result.ResultBean; |
|
||||
import com.yxt.common.core.vo.PagerVo; |
|
||||
|
|
||||
import org.springframework.beans.factory.annotation.Autowired; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
|
|
||||
import java.util.List; |
|
||||
|
|
||||
/** |
|
||||
* Project: anrui-scm(合作二级站备案申请) <br/> |
|
||||
* File: ScmStandRecordApplyService.java <br/> |
|
||||
* Class: com.yxt.anrui.scm.biz.scmstandrecordapply.ScmStandRecordApplyService <br/> |
|
||||
* Description: 合作二级站备案申请 业务逻辑. <br/> |
|
||||
* Copyright: Copyright (c) 2011 <br/> |
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
|
||||
* Makedate: 2024-10-22 16:05:59 <br/> |
|
||||
* |
|
||||
* @author liupopo |
|
||||
* @version 1.0 |
|
||||
* @since 1.0 |
|
||||
*/ |
|
||||
@Service |
|
||||
public class ScmStandRecordApplyService extends MybatisBaseService<ScmStandRecordApplyMapper, ScmStandRecordApply> { |
|
||||
|
|
||||
@Autowired |
|
||||
private FlowableFeign flowableFeign; |
|
||||
@Autowired |
|
||||
private FlowTaskFeign flowTaskFeign; |
|
||||
@Autowired |
|
||||
private SysUserFeign sysUserFeign; |
|
||||
@Autowired |
|
||||
private FlowFeign flowFeign; |
|
||||
@Autowired |
|
||||
private SysOrganizationFeign sysOrganizationFeign; |
|
||||
|
|
||||
public PagerVo<ScmStandRecordApplyVo> listPageVo(PagerQuery<ScmStandRecordApplyQuery> pq) { |
|
||||
ScmStandRecordApplyQuery query = pq.getParams(); |
|
||||
QueryWrapper<ScmStandRecordApply> qw = new QueryWrapper<>(); |
|
||||
//========================================数据授权开始
|
|
||||
if (StringUtils.isNotBlank(query.getMenuUrl())) { |
|
||||
PrivilegeQuery privilegeQuery = new PrivilegeQuery(); |
|
||||
privilegeQuery.setOrgPath(query.getOrgPath()); |
|
||||
privilegeQuery.setMenuUrl(query.getMenuUrl()); |
|
||||
privilegeQuery.setMenuSid(query.getMenuSid()); |
|
||||
privilegeQuery.setUserSid(query.getUserSid()); |
|
||||
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); |
|
||||
if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { |
|
||||
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
|
||||
String orgSidPath = query.getOrgPath(); |
|
||||
orgSidPath = orgSidPath + "/"; |
|
||||
int i1 = orgSidPath.indexOf("/"); |
|
||||
int i2 = orgSidPath.indexOf("/", i1 + 1); |
|
||||
int i3 = orgSidPath.indexOf("/", i2 + 1); |
|
||||
int i4 = orgSidPath.indexOf("/", i3 + 1); |
|
||||
String orgLevelKey = defaultIdReltBean.getData(); |
|
||||
if ("1".equals(orgLevelKey)) { |
|
||||
orgSidPath = orgSidPath.substring(0, i1); |
|
||||
qw.like("so.orgSidPath", orgSidPath); |
|
||||
} else if ("2".equals(orgLevelKey)) { |
|
||||
orgSidPath = orgSidPath.substring(0, i2); |
|
||||
qw.like("so.orgSidPath", orgSidPath); |
|
||||
} else if ("3".equals(orgLevelKey)) { |
|
||||
orgSidPath = orgSidPath.substring(0, i3); |
|
||||
qw.like("so.orgSidPath", orgSidPath); |
|
||||
} else if ("4".equals(orgLevelKey)) { |
|
||||
orgSidPath = orgSidPath.substring(0, i4); |
|
||||
qw.like("so.orgSidPath", orgSidPath); |
|
||||
} else if ("5".equals(orgLevelKey)) { |
|
||||
qw.eq("sa.createBySid", query.getUserSid()); |
|
||||
} else { |
|
||||
PagerVo<ScmStandRecordApplyVo> p = new PagerVo<>(); |
|
||||
return p; |
|
||||
} |
|
||||
} else { |
|
||||
PagerVo<ScmStandRecordApplyVo> p = new PagerVo<>(); |
|
||||
return p; |
|
||||
} |
|
||||
} |
|
||||
if (StringUtils.isNotBlank(query.getUseOrgName())) { |
|
||||
qw.eq("sa.useOrgName", query.getUseOrgName()); |
|
||||
} |
|
||||
if (StringUtils.isNotBlank(query.getDeptName())) { |
|
||||
qw.like("sa.deptName", query.getDeptName()); |
|
||||
} |
|
||||
if (StringUtils.isNotBlank(query.getCreateByName())) { |
|
||||
qw.like("sa.createByName", query.getCreateByName()); |
|
||||
} |
|
||||
if (StringUtils.isNotBlank(query.getSiteName())) { |
|
||||
qw.like("sa.siteName", query.getSiteName()); |
|
||||
} |
|
||||
if (StringUtils.isNotBlank(query.getLegalPerson())) { |
|
||||
qw.like("sa.legalPerson", query.getLegalPerson()); |
|
||||
} |
|
||||
String createStartTime = query.getCreateTimeStart(); |
|
||||
String createEndTime = query.getCreateTimeEnd(); |
|
||||
qw.apply(StringUtils.isNotBlank(createStartTime), "date_format (sa.createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). |
|
||||
apply(StringUtils.isNotBlank(createEndTime), "date_format (sa.createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" |
|
||||
); |
|
||||
String finishTimeStart = query.getFinishTimeStart(); |
|
||||
String finishTimeEnd = query.getFinishTimeEnd(); |
|
||||
qw.apply(StringUtils.isNotBlank(finishTimeStart), "date_format (sa.finishTime,'%Y-%m-%d') >= date_format('" + finishTimeStart + "','%Y-%m-%d')"). |
|
||||
apply(StringUtils.isNotBlank(finishTimeEnd), "date_format (sa.finishTim,'%Y-%m-%d') <= date_format('" + finishTimeEnd + "','%Y-%m-%d')" |
|
||||
); |
|
||||
String limitedTermStart = query.getLimitedTermStart(); |
|
||||
String limitedTermEnd = query.getLimitedTermEnd(); |
|
||||
qw.apply(StringUtils.isNotBlank(limitedTermStart), "sa.limitedTerm >=" + "'" + limitedTermStart + "'"). |
|
||||
apply(StringUtils.isNotBlank(limitedTermEnd), "sa.limitedTerm <=" + "'" + limitedTermEnd + "'"); |
|
||||
IPage<ScmStandRecordApply> page = PagerUtil.queryToPage(pq); |
|
||||
IPage<ScmStandRecordApplyVo> pagging = baseMapper.selectPageVo(page, qw); |
|
||||
PagerVo<ScmStandRecordApplyVo> p = PagerUtil.pageToVo(pagging, null); |
|
||||
return p; |
|
||||
} |
|
||||
|
|
||||
public void saveOrUpdateDto(ScmStandRecordApplyDto dto){ |
|
||||
String dtoSid = dto.getSid(); |
|
||||
SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(dto.getUseOrgSid()).getData(); |
|
||||
List<ScmStandRecordApplyUrl> businessLicenseFile = dto.getBusinessLicenseFile(); |
|
||||
List<ScmStandRecordApplyUrl> agreementFile = dto.getAgreementFile(); |
|
||||
List<ScmStandRecordApplyUrl> otherFile = dto.getOtherFile(); |
|
||||
if (StringUtils.isBlank(dtoSid)) { |
|
||||
//生成单据编号
|
|
||||
String billNo = ""; |
|
||||
String date = DateUtil.format(DateUtil.date(), "yyyyMM"); |
|
||||
billNo = "WXJSBA" + organizationVo.getOrgCode() + date; |
|
||||
/*String i = baseMapper.selectNum(billNo); |
|
||||
if (StringUtils.isNotBlank(i)) { |
|
||||
billNo = Rule.getBillNo(billNo, Integer.valueOf(i).intValue()); |
|
||||
} else { |
|
||||
billNo = Rule.getBillNo(billNo, 0); |
|
||||
}*/ |
|
||||
dto.setBillNo(billNo); |
|
||||
String sid = this.insertByDto(dto); |
|
||||
for (ScmStandRecordApplyUrl scmStandRecordApplyUrl : businessLicenseFile) { |
|
||||
|
|
||||
} |
|
||||
return; |
|
||||
} |
|
||||
this.updateByDto(dto); |
|
||||
} |
|
||||
|
|
||||
public String insertByDto(ScmStandRecordApplyDto dto){ |
|
||||
ScmStandRecordApply entity = new ScmStandRecordApply(); |
|
||||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
||||
entity.setNodeState("待提交"); |
|
||||
baseMapper.insert(entity); |
|
||||
return entity.getSid(); |
|
||||
} |
|
||||
|
|
||||
public void updateByDto(ScmStandRecordApplyDto dto){ |
|
||||
String dtoSid = dto.getSid(); |
|
||||
if (StringUtils.isBlank(dtoSid)) { |
|
||||
return; |
|
||||
} |
|
||||
ScmStandRecordApply entity = fetchBySid(dtoSid); |
|
||||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
||||
baseMapper.updateById(entity); |
|
||||
} |
|
||||
|
|
||||
public ScmStandRecordApplyDetailsVo fetchDetailsVoBySid(String sid){ |
|
||||
ScmStandRecordApply entity = fetchBySid(sid); |
|
||||
ScmStandRecordApplyDetailsVo vo = new ScmStandRecordApplyDetailsVo(); |
|
||||
BeanUtil.copyProperties(entity, vo); |
|
||||
return vo; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,35 @@ |
|||||
|
package com.yxt.anrui.as.api.asstandrecordapply.flowable; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/5/11 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class CompleteStandRecordApplyDto { |
||||
|
|
||||
|
@ApiModelProperty(value = "用户sid") |
||||
|
@NotBlank(message = "参数错误:userSid") |
||||
|
private String userSid; |
||||
|
@ApiModelProperty(value = "用户全路径sid") |
||||
|
private String orgSidPath; |
||||
|
@ApiModelProperty(value = "节点id") |
||||
|
@NotBlank(message = "参数错误:taskDefKey") |
||||
|
private String taskDefKey; |
||||
|
@ApiModelProperty(value = "任务id") |
||||
|
@NotBlank(message = "参数错误:taskId") |
||||
|
private String taskId; |
||||
|
@ApiModelProperty(value = "流程id") |
||||
|
@NotBlank(message = "参数错误:instanceId") |
||||
|
private String instanceId; |
||||
|
@ApiModelProperty(value = "意见") |
||||
|
private String comment; |
||||
|
@ApiModelProperty(value = "业务sid") |
||||
|
@NotBlank(message = "参数错误:businessSid") |
||||
|
private String businessSid; |
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
package com.yxt.anrui.as.api.asstandrecordapply.flowable; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/5/11 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class StandRecordApplyDelegateQuery { |
||||
|
|
||||
|
private String userSid; |
||||
|
@ApiModelProperty("流程实例id") |
||||
|
private String instanceId; |
||||
|
@ApiModelProperty("任务Id") |
||||
|
private String taskId; |
||||
|
@ApiModelProperty("审批人sid") |
||||
|
private String assignee; |
||||
|
@ApiModelProperty("填写意见") |
||||
|
private String views; |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.yxt.anrui.as.api.asstandrecordapply.flowable; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/5/11 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class StandRecordApplyNodeQuery { |
||||
|
|
||||
|
@ApiModelProperty(value = "环节定义id") |
||||
|
private String taskDefKey; |
||||
|
@ApiModelProperty(value = "业务sid") |
||||
|
private String businessSid; |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package com.yxt.anrui.as.api.asstandrecordapply.flowable; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/5/11 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class StandRecordApplyNodeVo { |
||||
|
|
||||
|
@ApiModelProperty(value = "节点名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty(value = "节点id") |
||||
|
private String id; |
||||
|
@ApiModelProperty(value = "审批组") |
||||
|
private List<String> candidateGroups; |
||||
|
@ApiModelProperty(value = "是否是最后环节") |
||||
|
private String endTask; |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
package com.yxt.anrui.as.api.asstandrecordapply.flowable; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/5/11 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class StandRecordApplyTaskQuery { |
||||
|
|
||||
|
/** |
||||
|
* 终止、驳回、撤回 |
||||
|
*/ |
||||
|
@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,19 @@ |
|||||
|
package com.yxt.anrui.as.api.asstandrecordapply.flowable; |
||||
|
|
||||
|
import com.yxt.anrui.as.api.asstandrecordapply.AsStandRecordApplyDto; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @description: |
||||
|
* @author: dimengzhe |
||||
|
* @date: 2024/5/11 |
||||
|
**/ |
||||
|
@Data |
||||
|
public class SubmitStandRecordApplyDto extends AsStandRecordApplyDto { |
||||
|
|
||||
|
@ApiModelProperty("流程实例id") |
||||
|
private String instanceId; |
||||
|
@ApiModelProperty("任务id") |
||||
|
private String taskId; |
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
<?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.anrui.as.biz.asstandrecordapply.AsStandRecordApplyMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="selectPageVo" resultType="com.yxt.anrui.as.api.asstandrecordapply.AsStandRecordApplyVo"> |
||||
|
SELECT * FROM as_stand_record_apply sa |
||||
|
LEFT JOIN anrui_portal.sys_organization so ON sa.useOrgSid = so.sid |
||||
|
<where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectNum" resultType="java.lang.String"> |
||||
|
select RIGHT (billNo, 4) |
||||
|
from as_stand_record_apply |
||||
|
where billNo LIKE concat(#{billNo}, '%') |
||||
|
order by billNo desc |
||||
|
limit 1 |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectBySid" resultType="int"> |
||||
|
SELECT COUNT(*) |
||||
|
FROM as_stand_record_apply |
||||
|
WHERE nodeState != '待提交' |
||||
|
and find_in_set(sid, #{list}) |
||||
|
</select> |
||||
|
|
||||
|
<update id="updateFlowFiled"> |
||||
|
UPDATE as_stand_record_apply |
||||
|
SET nodeState=#{nodeState}, nodeId=#{taskDefKey} |
||||
|
<if test="nodeState == '已办结' or nodeState == '终止'"> |
||||
|
, finishTime = NOW() |
||||
|
</if> |
||||
|
<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,139 @@ |
|||||
|
/********************************************************* |
||||
|
********************************************************* |
||||
|
******************** ******************* |
||||
|
************* ************ |
||||
|
******* _oo0oo_ ******* |
||||
|
*** o8888888o *** |
||||
|
* 88" . "88 * |
||||
|
* (| -_- |) * |
||||
|
* 0\ = /0 * |
||||
|
* ___/`---'\___ * |
||||
|
* .' \\| |// '. *
|
||||
|
* / \\||| : |||// \ *
|
||||
|
* / _||||| -:- |||||- \ * |
||||
|
* | | \\\ - /// | | *
|
||||
|
* | \_| ''\---/'' |_/ | * |
||||
|
* \ .-\__ '-' ___/-. / * |
||||
|
* ___'. .' /--.--\ `. .'___ * |
||||
|
* ."" '< `.___\_<|>_/___.' >' "". * |
||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / * |
||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== * |
||||
|
* `=---=' * |
||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
||||
|
*********************************************************/ |
||||
|
package com.yxt.anrui.as.biz.asstandrecordapply; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.yxt.anrui.as.api.asstandrecordapply.AsStandRecordApplyDetailsVo; |
||||
|
import com.yxt.anrui.as.api.asstandrecordapply.AsStandRecordApplyDto; |
||||
|
import com.yxt.anrui.as.api.asstandrecordapply.AsStandRecordApplyQuery; |
||||
|
import com.yxt.anrui.as.api.asstandrecordapply.AsStandRecordApplyVo; |
||||
|
import com.yxt.anrui.as.api.asstandrecordapply.flowable.*; |
||||
|
import com.yxt.anrui.as.feign.flowable.flow.BusinessVariables; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
import java.util.List; |
||||
|
|
||||
|
@Api(tags = "合作二级站备案申请") |
||||
|
@RestController |
||||
|
@RequestMapping("v1/secondaryCooperativeStation") |
||||
|
public class AsStandRecordApplyRest { |
||||
|
|
||||
|
@Autowired |
||||
|
private AsStandRecordApplyService asStandRecordApplyService; |
||||
|
|
||||
|
@ApiOperation("根据条件分页查询数据的列表") |
||||
|
@PostMapping("/listPage") |
||||
|
@ResponseBody |
||||
|
public ResultBean<PagerVo<AsStandRecordApplyVo>> listPage(@RequestBody PagerQuery<AsStandRecordApplyQuery> pq){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PagerVo<AsStandRecordApplyVo> pv = asStandRecordApplyService.listPageVo(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("新增或修改") |
||||
|
@PostMapping("/save") |
||||
|
@ResponseBody |
||||
|
public ResultBean save(@RequestBody AsStandRecordApplyDto dto){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
asStandRecordApplyService.saveOrUpdateDto(dto); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("根据sid删除记录") |
||||
|
@DeleteMapping("/delBySids") |
||||
|
@ResponseBody |
||||
|
public ResultBean delBySids(@RequestBody String[] sids){ |
||||
|
return asStandRecordApplyService.delByAll(sids); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("根据SID获取一条记录") |
||||
|
@GetMapping("/fetchDetailsBySid/{sid}") |
||||
|
@ResponseBody |
||||
|
public ResultBean<AsStandRecordApplyDetailsVo> fetchDetailsBySid(@PathVariable("sid") String sid){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
AsStandRecordApplyDetailsVo vo = asStandRecordApplyService.fetchDetailsVoBySid(sid); |
||||
|
return rb.success().setData(vo); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("提交") |
||||
|
@PostMapping("/submit") |
||||
|
public ResultBean submit(@Valid @RequestBody SubmitStandRecordApplyDto dto) { |
||||
|
return asStandRecordApplyService.submit(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "办理(同意)") |
||||
|
@PostMapping("/complete") |
||||
|
public ResultBean complete(@Valid @RequestBody CompleteStandRecordApplyDto query) { |
||||
|
BusinessVariables bv = new BusinessVariables(); |
||||
|
BeanUtil.copyProperties(query, bv); |
||||
|
bv.setModelId(""); |
||||
|
return asStandRecordApplyService.complete(bv); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "驳回任务") |
||||
|
@PostMapping(value = "/reject") |
||||
|
public ResultBean taskReject(@Valid @RequestBody StandRecordApplyTaskQuery query) { |
||||
|
return asStandRecordApplyService.taskReject(query); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "撤回流程") |
||||
|
@PostMapping(value = "/revokeProcess") |
||||
|
public ResultBean revokeProcess(@Valid @RequestBody StandRecordApplyTaskQuery query) { |
||||
|
return asStandRecordApplyService.revokeProcess(query); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "终止任务") |
||||
|
@PostMapping(value = "/breakProcess") |
||||
|
public ResultBean breakProcess(@Valid @RequestBody StandRecordApplyTaskQuery query) { |
||||
|
return asStandRecordApplyService.breakProcess(query); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "获取上一个环节") |
||||
|
@GetMapping(value = "/getPreviousNodesForReject") |
||||
|
public ResultBean<List<StandRecordApplyNodeVo>> getNextNodesForSubmit(StandRecordApplyNodeQuery query) { |
||||
|
return asStandRecordApplyService.getNextNodesForSubmit(query); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "获取下一个环节") |
||||
|
@GetMapping(value = "/getNextNodesForSubmit") |
||||
|
public ResultBean<List<StandRecordApplyNodeVo>> getPreviousNodesForReject(StandRecordApplyNodeQuery query) { |
||||
|
return asStandRecordApplyService.getPreviousNodesForReject(query); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "加签") |
||||
|
@PostMapping(value = "/delegate") |
||||
|
@ResponseBody |
||||
|
public ResultBean delegate(@RequestBody StandRecordApplyDelegateQuery query) { |
||||
|
return asStandRecordApplyService.delegate(query); |
||||
|
} |
||||
|
} |
@ -0,0 +1,653 @@ |
|||||
|
/********************************************************* |
||||
|
********************************************************* |
||||
|
******************** ******************* |
||||
|
************* ************ |
||||
|
******* _oo0oo_ ******* |
||||
|
*** o8888888o *** |
||||
|
* 88" . "88 * |
||||
|
* (| -_- |) * |
||||
|
* 0\ = /0 * |
||||
|
* ___/`---'\___ * |
||||
|
* .' \\| |// '. *
|
||||
|
* / \\||| : |||// \ *
|
||||
|
* / _||||| -:- |||||- \ * |
||||
|
* | | \\\ - /// | | *
|
||||
|
* | \_| ''\---/'' |_/ | * |
||||
|
* \ .-\__ '-' ___/-. / * |
||||
|
* ___'. .' /--.--\ `. .'___ * |
||||
|
* ."" '< `.___\_<|>_/___.' >' "". * |
||||
|
* | | : `- \`.;`\ _ /`;.`/ - ` : | | * |
||||
|
* \ \ `_. \_ __\ /__ _/ .-` / / * |
||||
|
* =====`-.____`.___ \_____/___.-`___.-'===== * |
||||
|
* `=---=' * |
||||
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * |
||||
|
*********__佛祖保佑__永无BUG__验收通过__钞票多多__********* |
||||
|
*********************************************************/ |
||||
|
package com.yxt.anrui.as.biz.asstandrecordapply; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import cn.hutool.core.date.DateUtil; |
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.google.common.util.concurrent.ThreadFactoryBuilder; |
||||
|
import com.yxt.anrui.as.api.asappendix.AsAppendix; |
||||
|
import com.yxt.anrui.as.api.asstandrecordapply.*; |
||||
|
import com.yxt.anrui.as.api.asstandrecordapply.flowable.*; |
||||
|
import com.yxt.anrui.as.biz.asappendix.AsAppendixService; |
||||
|
import com.yxt.anrui.as.biz.astechtitle.AsTechTitleService; |
||||
|
import com.yxt.anrui.as.biz.astechtitledetail.AsTechTitleDetailService; |
||||
|
import com.yxt.anrui.as.feign.base.billno.Rule; |
||||
|
import com.yxt.anrui.as.feign.file.AsFileEnum; |
||||
|
import com.yxt.anrui.as.feign.flowable.flow.BusinessVariables; |
||||
|
import com.yxt.anrui.as.feign.flowable.flow.FlowableFeign; |
||||
|
import com.yxt.anrui.as.feign.flowable.flow.ProcDefEnum; |
||||
|
import com.yxt.anrui.as.feign.flowable.flow.UpdateFlowFieldVo; |
||||
|
import com.yxt.anrui.as.feign.flowable.flow2.FlowDelegateQuery; |
||||
|
import com.yxt.anrui.as.feign.flowable.flow2.FlowFeign; |
||||
|
import com.yxt.anrui.as.feign.flowable.flowtask.FlowTaskFeign; |
||||
|
import com.yxt.anrui.as.feign.flowable.flowtask.FlowTaskVo; |
||||
|
import com.yxt.anrui.as.feign.flowable.flowtask.LatestTaskVo; |
||||
|
import com.yxt.anrui.as.feign.message.MessageFeign; |
||||
|
import com.yxt.anrui.as.feign.message.MessageFlowVo; |
||||
|
import com.yxt.anrui.as.feign.message.MessageFlowableQuery; |
||||
|
import com.yxt.anrui.as.feign.portal.privilege.PrivilegeQuery; |
||||
|
import com.yxt.anrui.as.feign.portal.sysorganization.SysOrganizationFeign; |
||||
|
import com.yxt.anrui.as.feign.portal.sysorganization.SysOrganizationVo; |
||||
|
import com.yxt.anrui.as.feign.portal.sysstafforg.SysStaffOrgFeign; |
||||
|
import com.yxt.anrui.as.feign.portal.sysuser.SysUserFeign; |
||||
|
import com.yxt.anrui.as.feign.portal.sysuserrole.SysUserRoleFeign; |
||||
|
import com.yxt.common.base.config.component.FileUploadComponent; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.base.utils.PagerUtil; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.apache.tomcat.util.threads.ThreadPoolExecutor; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.*; |
||||
|
import java.util.concurrent.*; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
@Service |
||||
|
public class AsStandRecordApplyService extends MybatisBaseService<AsStandRecordApplyMapper, AsStandRecordApply> { |
||||
|
|
||||
|
@Autowired |
||||
|
private FileUploadComponent fileUploadComponent; |
||||
|
@Autowired |
||||
|
private SysOrganizationFeign sysOrganizationFeign; |
||||
|
@Autowired |
||||
|
private SysStaffOrgFeign sysStaffOrgFeign; |
||||
|
@Autowired |
||||
|
private SysUserFeign sysUserFeign; |
||||
|
@Autowired |
||||
|
private FlowableFeign flowableFeign; |
||||
|
@Autowired |
||||
|
private FlowTaskFeign flowTaskFeign; |
||||
|
@Autowired |
||||
|
private FlowFeign flowFeign; |
||||
|
@Autowired |
||||
|
private MessageFeign messageFeign; |
||||
|
@Autowired |
||||
|
private AsTechTitleDetailService asTechTitleDetailService; |
||||
|
@Autowired |
||||
|
private AsTechTitleService asTechTitleService; |
||||
|
@Autowired |
||||
|
private AsAppendixService asAppendixService; |
||||
|
@Autowired |
||||
|
private SysUserRoleFeign sysUserRoleFeign; |
||||
|
|
||||
|
public PagerVo<AsStandRecordApplyVo> listPageVo(PagerQuery<AsStandRecordApplyQuery> pq) { |
||||
|
AsStandRecordApplyQuery query = pq.getParams(); |
||||
|
QueryWrapper<AsStandRecordApply> qw = new QueryWrapper<>(); |
||||
|
//========================================数据授权开始
|
||||
|
if (StringUtils.isNotBlank(query.getMenuUrl())) { |
||||
|
PrivilegeQuery privilegeQuery = new PrivilegeQuery(); |
||||
|
privilegeQuery.setOrgPath(query.getOrgPath()); |
||||
|
privilegeQuery.setMenuUrl(query.getMenuUrl()); |
||||
|
privilegeQuery.setMenuSid(query.getMenuSid()); |
||||
|
privilegeQuery.setUserSid(query.getUserSid()); |
||||
|
ResultBean<String> defaultIdReltBean = sysUserFeign.selectPrivilegeLevel(privilegeQuery); |
||||
|
if (StringUtils.isNotBlank(defaultIdReltBean.getData())) { |
||||
|
//数据权限ID(1集团、2事业部、3分公司、4部门、5个人)
|
||||
|
String orgSidPath = query.getOrgPath(); |
||||
|
orgSidPath = orgSidPath + "/"; |
||||
|
int i1 = orgSidPath.indexOf("/"); |
||||
|
int i2 = orgSidPath.indexOf("/", i1 + 1); |
||||
|
int i3 = orgSidPath.indexOf("/", i2 + 1); |
||||
|
int i4 = orgSidPath.indexOf("/", i3 + 1); |
||||
|
String orgLevelKey = defaultIdReltBean.getData(); |
||||
|
if ("1".equals(orgLevelKey)) { |
||||
|
orgSidPath = orgSidPath.substring(0, i1); |
||||
|
qw.like("so.orgSidPath", orgSidPath); |
||||
|
} else if ("2".equals(orgLevelKey)) { |
||||
|
orgSidPath = orgSidPath.substring(0, i2); |
||||
|
qw.like("so.orgSidPath", orgSidPath); |
||||
|
} else if ("3".equals(orgLevelKey)) { |
||||
|
orgSidPath = orgSidPath.substring(0, i3); |
||||
|
qw.like("so.orgSidPath", orgSidPath); |
||||
|
} else if ("4".equals(orgLevelKey)) { |
||||
|
orgSidPath = orgSidPath.substring(0, i4); |
||||
|
qw.like("so.orgSidPath", orgSidPath); |
||||
|
} else if ("5".equals(orgLevelKey)) { |
||||
|
qw.eq("sa.createBySid", query.getUserSid()); |
||||
|
} else { |
||||
|
PagerVo<AsStandRecordApplyVo> p = new PagerVo<>(); |
||||
|
return p; |
||||
|
} |
||||
|
} else { |
||||
|
PagerVo<AsStandRecordApplyVo> p = new PagerVo<>(); |
||||
|
return p; |
||||
|
} |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getUseOrgName())) { |
||||
|
qw.eq("sa.useOrgName", query.getUseOrgName()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getDeptName())) { |
||||
|
qw.like("sa.deptName", query.getDeptName()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getCreateByName())) { |
||||
|
qw.like("sa.createByName", query.getCreateByName()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getSiteName())) { |
||||
|
qw.like("sa.siteName", query.getSiteName()); |
||||
|
} |
||||
|
if (StringUtils.isNotBlank(query.getLegalPerson())) { |
||||
|
qw.like("sa.legalPerson", query.getLegalPerson()); |
||||
|
} |
||||
|
String createStartTime = query.getCreateTimeStart(); |
||||
|
String createEndTime = query.getCreateTimeEnd(); |
||||
|
qw.apply(StringUtils.isNotBlank(createStartTime), "date_format (sa.createTime,'%Y-%m-%d') >= date_format('" + createStartTime + "','%Y-%m-%d')"). |
||||
|
apply(StringUtils.isNotBlank(createEndTime), "date_format (sa.createTime,'%Y-%m-%d') <= date_format('" + createEndTime + "','%Y-%m-%d')" |
||||
|
); |
||||
|
String finishTimeStart = query.getFinishTimeStart(); |
||||
|
String finishTimeEnd = query.getFinishTimeEnd(); |
||||
|
qw.apply(StringUtils.isNotBlank(finishTimeStart), "date_format (sa.finishTime,'%Y-%m-%d') >= date_format('" + finishTimeStart + "','%Y-%m-%d')"). |
||||
|
apply(StringUtils.isNotBlank(finishTimeEnd), "date_format (sa.finishTim,'%Y-%m-%d') <= date_format('" + finishTimeEnd + "','%Y-%m-%d')" |
||||
|
); |
||||
|
String limitedTermStart = query.getLimitedTermStart(); |
||||
|
String limitedTermEnd = query.getLimitedTermEnd(); |
||||
|
qw.apply(StringUtils.isNotBlank(limitedTermStart), "sa.limitedTerm >=" + "'" + limitedTermStart + "'"). |
||||
|
apply(StringUtils.isNotBlank(limitedTermEnd), "sa.limitedTerm <=" + "'" + limitedTermEnd + "'"); |
||||
|
IPage<AsStandRecordApply> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<AsStandRecordApplyVo> pagging = baseMapper.selectPageVo(page, qw); |
||||
|
PagerVo<AsStandRecordApplyVo> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
public String saveOrUpdateDto(AsStandRecordApplyDto dto){ |
||||
|
String dtoSid = dto.getSid(); |
||||
|
SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(dto.getUseOrgSid()).getData(); |
||||
|
List<AsStandRecordApplyUrl> businessLicenseFile = dto.getBusinessLicenseFile(); |
||||
|
List<AsStandRecordApplyUrl> agreementFile = dto.getAgreementFile(); |
||||
|
List<AsStandRecordApplyUrl> otherFile = dto.getOtherFile(); |
||||
|
if (StringUtils.isBlank(dtoSid)) { |
||||
|
//生成单据编号
|
||||
|
String billNo = ""; |
||||
|
String date = DateUtil.format(DateUtil.date(), "yyyyMM"); |
||||
|
billNo = "HZEJZBA" + organizationVo.getOrgCode() + date; |
||||
|
String i = baseMapper.selectNum(billNo); |
||||
|
if (StringUtils.isNotBlank(i)) { |
||||
|
billNo = Rule.getBillNo(billNo, Integer.valueOf(i).intValue()); |
||||
|
} else { |
||||
|
billNo = Rule.getBillNo(billNo, 0); |
||||
|
} |
||||
|
dto.setBillNo(billNo); |
||||
|
String sid = this.insertByDto(dto); |
||||
|
for (AsStandRecordApplyUrl AsStandRecordApplyUrl : businessLicenseFile) { |
||||
|
String filePath = AsStandRecordApplyUrl.getUrl().replace(fileUploadComponent.getUrlPrefix(), ""); |
||||
|
AsAppendix asAppendix = new AsAppendix(); |
||||
|
asAppendix.setLinkSid(sid); |
||||
|
asAppendix.setAttachType(AsFileEnum.YYZZ.getAttachType()); |
||||
|
asAppendix.setFilePath(filePath); |
||||
|
asAppendixService.save(asAppendix); |
||||
|
} |
||||
|
for (AsStandRecordApplyUrl AsStandRecordApplyUrl : agreementFile) { |
||||
|
String filePath = AsStandRecordApplyUrl.getUrl().replace(fileUploadComponent.getUrlPrefix(), ""); |
||||
|
AsAppendix asAppendix = new AsAppendix(); |
||||
|
asAppendix.setLinkSid(sid); |
||||
|
asAppendix.setAttachType(AsFileEnum.HZXY.getAttachType()); |
||||
|
asAppendix.setFilePath(filePath); |
||||
|
asAppendixService.save(asAppendix); |
||||
|
} |
||||
|
for (AsStandRecordApplyUrl AsStandRecordApplyUrl : otherFile) { |
||||
|
String filePath = AsStandRecordApplyUrl.getUrl().replace(fileUploadComponent.getUrlPrefix(), ""); |
||||
|
AsAppendix asAppendix = new AsAppendix(); |
||||
|
asAppendix.setLinkSid(sid); |
||||
|
asAppendix.setAttachType(AsFileEnum.QTZL.getAttachType()); |
||||
|
asAppendix.setFilePath(filePath); |
||||
|
asAppendixService.save(asAppendix); |
||||
|
} |
||||
|
return sid; |
||||
|
} |
||||
|
this.updateByDto(dto); |
||||
|
asAppendixService.delByLinkSid(dtoSid); |
||||
|
for (AsStandRecordApplyUrl AsStandRecordApplyUrl : businessLicenseFile) { |
||||
|
String filePath = AsStandRecordApplyUrl.getUrl().replace(fileUploadComponent.getUrlPrefix(), ""); |
||||
|
AsAppendix asAppendix = new AsAppendix(); |
||||
|
asAppendix.setLinkSid(dtoSid); |
||||
|
asAppendix.setAttachType(AsFileEnum.YYZZ.getAttachType()); |
||||
|
asAppendix.setFilePath(filePath); |
||||
|
asAppendixService.save(asAppendix); |
||||
|
} |
||||
|
for (AsStandRecordApplyUrl AsStandRecordApplyUrl : agreementFile) { |
||||
|
String filePath = AsStandRecordApplyUrl.getUrl().replace(fileUploadComponent.getUrlPrefix(), ""); |
||||
|
AsAppendix asAppendix = new AsAppendix(); |
||||
|
asAppendix.setLinkSid(dtoSid); |
||||
|
asAppendix.setAttachType(AsFileEnum.HZXY.getAttachType()); |
||||
|
asAppendix.setFilePath(filePath); |
||||
|
asAppendixService.save(asAppendix); |
||||
|
} |
||||
|
for (AsStandRecordApplyUrl AsStandRecordApplyUrl : otherFile) { |
||||
|
String filePath = AsStandRecordApplyUrl.getUrl().replace(fileUploadComponent.getUrlPrefix(), ""); |
||||
|
AsAppendix asAppendix = new AsAppendix(); |
||||
|
asAppendix.setLinkSid(dtoSid); |
||||
|
asAppendix.setAttachType(AsFileEnum.QTZL.getAttachType()); |
||||
|
asAppendix.setFilePath(filePath); |
||||
|
asAppendixService.save(asAppendix); |
||||
|
} |
||||
|
return dtoSid; |
||||
|
} |
||||
|
|
||||
|
public String insertByDto(AsStandRecordApplyDto dto){ |
||||
|
AsStandRecordApply entity = new AsStandRecordApply(); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
entity.setNodeState("待提交"); |
||||
|
baseMapper.insert(entity); |
||||
|
return entity.getSid(); |
||||
|
} |
||||
|
|
||||
|
public void updateByDto(AsStandRecordApplyDto dto){ |
||||
|
String dtoSid = dto.getSid(); |
||||
|
if (StringUtils.isBlank(dtoSid)) { |
||||
|
return; |
||||
|
} |
||||
|
AsStandRecordApply entity = fetchBySid(dtoSid); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
baseMapper.updateById(entity); |
||||
|
} |
||||
|
|
||||
|
public AsStandRecordApplyDetailsVo fetchDetailsVoBySid(String sid){ |
||||
|
AsStandRecordApply entity = fetchBySid(sid); |
||||
|
AsStandRecordApplyDetailsVo vo = new AsStandRecordApplyDetailsVo(); |
||||
|
BeanUtil.copyProperties(entity, vo); |
||||
|
List<AsAppendix> b = asAppendixService.fetchByLinkSidAndType(sid, AsFileEnum.YYZZ.getAttachType()); |
||||
|
List<AsAppendix> a = asAppendixService.fetchByLinkSidAndType(sid, AsFileEnum.HZXY.getAttachType()); |
||||
|
List<AsAppendix> o = asAppendixService.fetchByLinkSidAndType(sid, AsFileEnum.QTZL.getAttachType()); |
||||
|
List<AsStandRecordApplyUrl> businessLicenseFile = new ArrayList<>(); |
||||
|
List<AsStandRecordApplyUrl> agreementFile = new ArrayList<>(); |
||||
|
List<AsStandRecordApplyUrl> otherFile = new ArrayList<>(); |
||||
|
for (AsAppendix AsFile : b) { |
||||
|
AsStandRecordApplyUrl AsStandRecordApplyUrl = new AsStandRecordApplyUrl(); |
||||
|
String url = fileUploadComponent.getUrlPrefix() + AsFile.getFilePath(); |
||||
|
AsStandRecordApplyUrl.setUrl(url); |
||||
|
businessLicenseFile.add(AsStandRecordApplyUrl); |
||||
|
} |
||||
|
for (AsAppendix AsFile : a) { |
||||
|
AsStandRecordApplyUrl AsStandRecordApplyUrl = new AsStandRecordApplyUrl(); |
||||
|
String url = fileUploadComponent.getUrlPrefix() + AsFile.getFilePath(); |
||||
|
AsStandRecordApplyUrl.setUrl(url); |
||||
|
agreementFile.add(AsStandRecordApplyUrl); |
||||
|
} |
||||
|
for (AsAppendix AsFile : o) { |
||||
|
AsStandRecordApplyUrl AsStandRecordApplyUrl = new AsStandRecordApplyUrl(); |
||||
|
String url = fileUploadComponent.getUrlPrefix() + AsFile.getFilePath(); |
||||
|
AsStandRecordApplyUrl.setUrl(url); |
||||
|
otherFile.add(AsStandRecordApplyUrl); |
||||
|
} |
||||
|
vo.setBusinessLicenseFile(businessLicenseFile); |
||||
|
vo.setAgreementFile(agreementFile); |
||||
|
vo.setOtherFile(otherFile); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public ResultBean delByAll(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) { |
||||
|
asAppendixService.delByLinkSid(sid); |
||||
|
} |
||||
|
return rb.success(); |
||||
|
} |
||||
|
|
||||
|
public ResultBean submit(SubmitStandRecordApplyDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
AsStandRecordApply AsStandRecordApply = fetchBySid(dto.getSid()); |
||||
|
int r = submitBusinessData(dto, AsStandRecordApply); |
||||
|
if (r == 3) { |
||||
|
return rb.setMsg("该申请不存在"); |
||||
|
} |
||||
|
if (r == 0) { |
||||
|
return rb.setMsg("操作失败!提交的数据不一致"); |
||||
|
} |
||||
|
String businessSid = saveOrUpdateDto(dto); |
||||
|
AsStandRecordApply = fetchBySid(businessSid); |
||||
|
//创建BusinessVariables实体对象
|
||||
|
BusinessVariables bv = new BusinessVariables(); |
||||
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
||||
|
Map<String, Object> variables = new HashMap<>(); |
||||
|
Map<String, Object> appMap = new HashMap<>(); |
||||
|
appMap.put("sid", businessSid); |
||||
|
variables.put("app", appMap); |
||||
|
//判断发起人是否为前台主管
|
||||
|
String createBySid = AsStandRecordApply.getCreateBySid(); |
||||
|
List<String> list = sysUserRoleFeign.getUserRoleSidByUserSid(createBySid).getData(); |
||||
|
variables.put("iszg", list.contains("f00a7338-a6a4-4712-ab85-ca211d56fb1f")); |
||||
|
//用户的部门全路径sid
|
||||
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(AsStandRecordApply.getDeptSid()).getData(); |
||||
|
if (sysOrganization != null) { |
||||
|
bv.setOrgSidPath(sysOrganization.getOrgSidPath()); |
||||
|
} |
||||
|
bv.setBusinessSid(businessSid); |
||||
|
bv.setUserSid(dto.getCreateBySid()); |
||||
|
bv.setFormVariables(variables); |
||||
|
if (r == 1) { |
||||
|
//ToDo:流程定义id
|
||||
|
bv.setModelId(ProcDefEnum.ASSTANDRECORDAPPLY.getProDefId()); |
||||
|
ResultBean<UpdateFlowFieldVo> voResultBean = flowFeign.startProcess(bv); |
||||
|
if (!voResultBean.getSuccess()) { |
||||
|
return rb.setMsg(voResultBean.getMsg()); |
||||
|
} |
||||
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
||||
|
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
||||
|
AsStandRecordApply = fetchBySid(businessSid); |
||||
|
//==================================添加线程
|
||||
|
try { |
||||
|
ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() |
||||
|
.setNameFormat("demo-pool-%d").build(); |
||||
|
ExecutorService pool = new ThreadPoolExecutor(2, 100, |
||||
|
0L, TimeUnit.MILLISECONDS, |
||||
|
new LinkedBlockingQueue<Runnable>(1024), namedThreadFactory, new ThreadPoolExecutor.AbortPolicy()); |
||||
|
AsStandRecordApply finalAsStandRecordApply = AsStandRecordApply; |
||||
|
Future future1 = pool.submit(() -> { |
||||
|
//极光推送
|
||||
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
||||
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
||||
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
||||
|
messageFlowableQuery.setUfVo(messageFlowVo); |
||||
|
messageFlowableQuery.setAppMap(appMap); |
||||
|
messageFlowableQuery.setBusinessSid(businessSid); |
||||
|
messageFlowableQuery.setModuleName("合作二级站备案申请"); |
||||
|
messageFlowableQuery.setMsgContent(finalAsStandRecordApply.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
||||
|
messageFlowableQuery.setMsgTitle("合作二级站备案申请"); |
||||
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
||||
|
}); |
||||
|
} catch (Exception e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
//==================================添加线程
|
||||
|
return voResultBean; |
||||
|
} |
||||
|
if (r == 2) { |
||||
|
// ToDo:驳回到发起人后再次提交
|
||||
|
if (StringUtils.isBlank(dto.getInstanceId())) { |
||||
|
return rb.setMsg("参数错误:instanceId"); |
||||
|
} |
||||
|
bv.setTaskId(AsStandRecordApply.getTaskId()); |
||||
|
bv.setTaskDefKey(AsStandRecordApply.getNodeSid()); |
||||
|
bv.setComment("重新提交"); |
||||
|
bv.setInstanceId(dto.getInstanceId()); |
||||
|
return complete(bv); |
||||
|
} |
||||
|
return rb; |
||||
|
} |
||||
|
|
||||
|
private int updateFlowFiled(Map<String, Object> beanToMap) { |
||||
|
return baseMapper.updateFlowFiled(beanToMap); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
private int submitBusinessData(SubmitStandRecordApplyDto dto, AsStandRecordApply AsStandRecordApply) { |
||||
|
int r = 0; |
||||
|
if (StringUtils.isBlank(dto.getSid())) { |
||||
|
r = 1; |
||||
|
} else { |
||||
|
if (AsStandRecordApply != null) { |
||||
|
String businessTaskId = AsStandRecordApply.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 complete(BusinessVariables bv) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
String businessSid = bv.getBusinessSid(); |
||||
|
AsStandRecordApply AsStandRecordApply = fetchBySid(businessSid); |
||||
|
Map<String, Object> variables = new HashMap<>(); |
||||
|
//判断发起人是否为前台主管
|
||||
|
String createBySid = AsStandRecordApply.getCreateBySid(); |
||||
|
List<String> list = sysUserRoleFeign.getUserRoleSidByUserSid(createBySid).getData(); |
||||
|
variables.put("iszg", list.contains("f00a7338-a6a4-4712-ab85-ca211d56fb1f")); |
||||
|
Map<String, Object> appMap = new HashMap<>(); |
||||
|
appMap.put("sid", businessSid); |
||||
|
variables.put("app", appMap); |
||||
|
bv.setFormVariables(variables); |
||||
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(AsStandRecordApply.getDeptSid()).getData(); |
||||
|
if (sysOrganization != null) { |
||||
|
bv.setOrgSidPath(sysOrganization.getOrgSidPath()); |
||||
|
} |
||||
|
bv.setModelId(AsStandRecordApply.getProcDefId()); |
||||
|
if (bv.getTaskId().equals(AsStandRecordApply.getTaskId())) { |
||||
|
ResultBean<UpdateFlowFieldVo> resultBean = flowFeign.handleProsess(bv); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
||||
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
||||
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
||||
|
} else { |
||||
|
//极光推送
|
||||
|
AsStandRecordApply = fetchBySid(businessSid); |
||||
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
||||
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
||||
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
||||
|
messageFlowVo.setProcDefId(AsStandRecordApply.getProcDefId()); |
||||
|
messageFlowVo.setProcInsId(AsStandRecordApply.getProcInstId()); |
||||
|
messageFlowableQuery.setUfVo(messageFlowVo); |
||||
|
messageFlowableQuery.setAppMap(appMap); |
||||
|
messageFlowableQuery.setBusinessSid(businessSid); |
||||
|
messageFlowableQuery.setModuleName("合作二级站备案申请"); |
||||
|
messageFlowableQuery.setMsgContent(AsStandRecordApply.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
||||
|
messageFlowableQuery.setMsgTitle("合作二级站备案申请"); |
||||
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
||||
|
} |
||||
|
return rb.success().setData(resultBean.getData()); |
||||
|
} else { |
||||
|
return rb.setMsg("操作失败!提交的数据不一致"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public ResultBean<List<StandRecordApplyNodeVo>> getPreviousNodesForReject(StandRecordApplyNodeQuery query) { |
||||
|
ResultBean<List<StandRecordApplyNodeVo>> rb = ResultBean.fireFail(); |
||||
|
BusinessVariables bv = new BusinessVariables(); |
||||
|
BeanUtil.copyProperties(query, bv); |
||||
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
||||
|
Map<String, Object> variables = new HashMap<>(); |
||||
|
//查询业务信息
|
||||
|
AsStandRecordApply AsStandRecordApply = fetchBySid(query.getBusinessSid()); |
||||
|
//判断发起人是否为前台主管
|
||||
|
String createBySid = AsStandRecordApply.getCreateBySid(); |
||||
|
List<String> list = sysUserRoleFeign.getUserRoleSidByUserSid(createBySid).getData(); |
||||
|
variables.put("iszg", list.contains("f00a7338-a6a4-4712-ab85-ca211d56fb1f")); |
||||
|
bv.setModelId(AsStandRecordApply.getProcDefId()); |
||||
|
bv.setFormVariables(variables); |
||||
|
//=======================================
|
||||
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); |
||||
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给TemplateApplyNodeVo
|
||||
|
List<StandRecordApplyNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), StandRecordApplyNodeVo.class)).collect(Collectors.toList()); |
||||
|
return rb.success().setData(voList); |
||||
|
} |
||||
|
|
||||
|
public ResultBean<List<StandRecordApplyNodeVo>> getNextNodesForSubmit(StandRecordApplyNodeQuery query) { |
||||
|
ResultBean<List<StandRecordApplyNodeVo>> rb = ResultBean.fireFail(); |
||||
|
BusinessVariables bv = new BusinessVariables(); |
||||
|
BeanUtil.copyProperties(query, bv); |
||||
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
||||
|
Map<String, Object> variables = new HashMap<>(); |
||||
|
//查询业务信息
|
||||
|
AsStandRecordApply AsStandRecordApply = fetchBySid(query.getBusinessSid()); |
||||
|
//判断发起人是否为前台主管
|
||||
|
String createBySid = AsStandRecordApply.getCreateBySid(); |
||||
|
List<String> list = sysUserRoleFeign.getUserRoleSidByUserSid(createBySid).getData(); |
||||
|
variables.put("iszg", list.contains("f00a7338-a6a4-4712-ab85-ca211d56fb1f")); |
||||
|
bv.setModelId(AsStandRecordApply.getProcDefId()); |
||||
|
bv.setFormVariables(variables); |
||||
|
//=======================================
|
||||
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); |
||||
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给TemplateApplyNodeVo
|
||||
|
List<StandRecordApplyNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), StandRecordApplyNodeVo.class)).collect(Collectors.toList()); |
||||
|
return rb.success().setData(voList); |
||||
|
} |
||||
|
|
||||
|
public ResultBean taskReject(StandRecordApplyTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
String businessSid = query.getBusinessSid(); |
||||
|
AsStandRecordApply AsStandRecordApply = fetchBySid(businessSid); |
||||
|
if (AsStandRecordApply == null) { |
||||
|
return rb.setMsg("该申请不存在"); |
||||
|
} |
||||
|
String businessTaskId = AsStandRecordApply.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<>(); |
||||
|
Map<String, Object> appMap = new HashMap<>(); |
||||
|
appMap.put("sid", businessSid); |
||||
|
variables.put("app", appMap); |
||||
|
//判断发起人是否为前台主管
|
||||
|
String createBySid = AsStandRecordApply.getCreateBySid(); |
||||
|
List<String> list = sysUserRoleFeign.getUserRoleSidByUserSid(createBySid).getData(); |
||||
|
variables.put("iszg", list.contains("f00a7338-a6a4-4712-ab85-ca211d56fb1f")); |
||||
|
flowTaskVo.setValues(variables); |
||||
|
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); |
||||
|
//极光推送
|
||||
|
AsStandRecordApply = fetchBySid(businessSid); |
||||
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
||||
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
||||
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
||||
|
String procId = AsStandRecordApply.getProcInstId(); |
||||
|
messageFlowVo.setProcInsId(procId); |
||||
|
messageFlowVo.setProcDefId(AsStandRecordApply.getProcDefId()); |
||||
|
messageFlowableQuery.setUfVo(messageFlowVo); |
||||
|
messageFlowableQuery.setAppMap(appMap); |
||||
|
messageFlowableQuery.setBusinessSid(businessSid); |
||||
|
messageFlowableQuery.setModuleName("合作二级站备案申请"); |
||||
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(procId); |
||||
|
String nextName = listResultBean.getData().get(0).getName_(); |
||||
|
String nextNodeUserSids = listResultBean.getData().get(0).getASSIGNEE_(); |
||||
|
if ("发起申请".equals(nextName)) { |
||||
|
messageFlowableQuery.setMsgContent("您提交的" + messageFlowableQuery.getModuleName() + "已被驳回,请重新提交"); |
||||
|
} else { |
||||
|
messageFlowableQuery.setMsgContent(AsStandRecordApply.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
||||
|
} |
||||
|
|
||||
|
messageFlowableQuery.setMsgTitle("合作二级站备案申请"); |
||||
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
} |
||||
|
return rb.setMsg("操作失败!提交的数据不一致!"); |
||||
|
} |
||||
|
|
||||
|
public ResultBean revokeProcess(StandRecordApplyTaskQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
if (StringUtils.isBlank(query.getUserSid())) { |
||||
|
return rb.setMsg("参数错误:userSid"); |
||||
|
} |
||||
|
AsStandRecordApply AsStandRecordApply = fetchBySid(query.getBusinessSid()); |
||||
|
String businessTaskId = query.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(StandRecordApplyTaskQuery 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("请填写意见"); |
||||
|
} |
||||
|
AsStandRecordApply AsStandRecordApply = fetchBySid(query.getBusinessSid()); |
||||
|
String businessTaskId = AsStandRecordApply.getTaskId(); |
||||
|
if (StringUtils.isNotBlank(businessTaskId)) { |
||||
|
if (query.getUserSid().equals(AsStandRecordApply.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("操作失败!提交的数据不一致!"); |
||||
|
} |
||||
|
|
||||
|
public ResultBean delegate(StandRecordApplyDelegateQuery query) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
FlowDelegateQuery delegateQuery = new FlowDelegateQuery(); |
||||
|
BeanUtil.copyProperties(query, delegateQuery); |
||||
|
flowFeign.delegate(delegateQuery); |
||||
|
return rb.success(); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue