Compare commits
3 Commits
b58459b434
...
8d220f7c30
Author | SHA1 | Date |
---|---|---|
|
8d220f7c30 | 3 months ago |
|
176a026214 | 4 months ago |
|
3f53272f78 | 4 months ago |
19 changed files with 1042 additions and 0 deletions
@ -0,0 +1,94 @@ |
|||||
|
package com.yxt.anrui.oa.api; |
||||
|
|
||||
|
import com.yxt.anrui.oa.biz.adgroupdocumentsapply.AdGroupDocumentsApplyDto; |
||||
|
import com.yxt.anrui.oa.biz.adgroupdocumentsapply.AdGroupDocumentsApplyQuery; |
||||
|
import com.yxt.anrui.oa.biz.adgroupdocumentsapply.AdGroupDocumentsApplyService; |
||||
|
import com.yxt.anrui.oa.biz.adgroupdocumentsapply.AdGroupDocumentsApplyVo; |
||||
|
import com.yxt.anrui.oa.biz.adgroupsystemapply.AdGroupSystemApplyVo; |
||||
|
import com.yxt.anrui.oa.biz.oaform.flowable.CompleteDto; |
||||
|
import com.yxt.anrui.oa.biz.oaform.flowable.NodeQuery; |
||||
|
import com.yxt.anrui.oa.biz.oaform.flowable.TaskDto; |
||||
|
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.cloud.openfeign.SpringQueryMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/8 14:56 |
||||
|
*/ |
||||
|
@Api(tags = "集团文件审批") |
||||
|
@RestController |
||||
|
@RequestMapping("v1/adgroupdocumentsapply") |
||||
|
public class AdGroupDocumentsApplyRest { |
||||
|
|
||||
|
@Autowired |
||||
|
AdGroupDocumentsApplyService AdGroupDocumentsApplyService; |
||||
|
@ApiOperation("根据条件分页查询数据的列表") |
||||
|
@PostMapping("/listPage") |
||||
|
public ResultBean<PagerVo<AdGroupDocumentsApplyVo>> listPage(@RequestBody PagerQuery<AdGroupDocumentsApplyQuery> pq) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PagerVo<AdGroupDocumentsApplyVo> pv = AdGroupDocumentsApplyService.listPageVo(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("新增或修改") |
||||
|
@PostMapping("/save") |
||||
|
public ResultBean<String> saveOrUpdate(@RequestBody AdGroupDocumentsApplyDto dto) { |
||||
|
return AdGroupDocumentsApplyService.saveOrUpdateDto(dto); |
||||
|
} |
||||
|
@ApiOperation("初始化(新增或修改)") |
||||
|
@GetMapping({"/getInit", "/getInit/{sid}"}) |
||||
|
public ResultBean<AdGroupDocumentsApplyVo> getInit( |
||||
|
@PathVariable(value = "sid", required = false) String sid, |
||||
|
@RequestParam(value = "userSid", required = false) String userSid, |
||||
|
@RequestParam(value = "orgPath", required = false) String orgPath) { |
||||
|
ResultBean<AdGroupDocumentsApplyVo> rb = ResultBean.fireFail(); |
||||
|
if (sid == null || sid.isEmpty()) { |
||||
|
// 执行新增初始化
|
||||
|
if (userSid == null || orgPath == null) { |
||||
|
return rb.setMsg("userSid和orgPath不能为空"); |
||||
|
} |
||||
|
return AdGroupDocumentsApplyService.getSaveInit(userSid, orgPath); |
||||
|
} else { |
||||
|
// 执行修改初始化
|
||||
|
return AdGroupDocumentsApplyService.getUpdateInit(sid); |
||||
|
} |
||||
|
} |
||||
|
@ApiOperation("详情") |
||||
|
@GetMapping("/details/{sid}") |
||||
|
ResultBean<AdGroupSystemApplyVo> details(@PathVariable("sid") String sid |
||||
|
, @RequestParam(value = "application", required = false) String application) { |
||||
|
return AdGroupDocumentsApplyService.details(sid,application); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("提交审批流程") |
||||
|
@PostMapping("/submit") |
||||
|
public ResultBean submit(@RequestBody AdGroupDocumentsApplyDto dto) { |
||||
|
return AdGroupDocumentsApplyService.submit(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "驳回任务") |
||||
|
@PutMapping(value = "/reject") |
||||
|
public ResultBean reject(@Valid @RequestBody TaskDto dto) { |
||||
|
return AdGroupDocumentsApplyService.reject(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "办理(同意)") |
||||
|
@PutMapping("/complete") |
||||
|
public ResultBean complete(@Valid @RequestBody CompleteDto dto) { |
||||
|
return AdGroupDocumentsApplyService.complete(dto); |
||||
|
} |
||||
|
@ApiOperation("获取流程操作标题") |
||||
|
@GetMapping("/getFlowOperateTitle") |
||||
|
@ResponseBody |
||||
|
ResultBean<String> getFlowOperateTitle(@SpringQueryMap NodeQuery query) { |
||||
|
return AdGroupDocumentsApplyService.getFlowOperateTitle(query); |
||||
|
} |
||||
|
} |
@ -0,0 +1,93 @@ |
|||||
|
package com.yxt.anrui.oa.api; |
||||
|
|
||||
|
import com.yxt.anrui.oa.biz.adgroupsystemapply.AdGroupSystemApplyDto; |
||||
|
import com.yxt.anrui.oa.biz.adgroupsystemapply.AdGroupSystemApplyQuery; |
||||
|
import com.yxt.anrui.oa.biz.adgroupsystemapply.AdGroupSystemApplyService; |
||||
|
import com.yxt.anrui.oa.biz.adgroupsystemapply.AdGroupSystemApplyVo; |
||||
|
import com.yxt.anrui.oa.biz.oaform.flowable.CompleteDto; |
||||
|
import com.yxt.anrui.oa.biz.oaform.flowable.NodeQuery; |
||||
|
import com.yxt.anrui.oa.biz.oaform.flowable.TaskDto; |
||||
|
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.cloud.openfeign.SpringQueryMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
import javax.validation.Valid; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/7 14:30 |
||||
|
*/ |
||||
|
@Api(tags = "集团制度会签审批") |
||||
|
@RestController |
||||
|
@RequestMapping("v1/adgroupsystemapply") |
||||
|
public class AdGroupSystemApplyRest { |
||||
|
@Autowired |
||||
|
AdGroupSystemApplyService adGroupSystemApplyService; |
||||
|
@ApiOperation("根据条件分页查询数据的列表") |
||||
|
@PostMapping("/listPage") |
||||
|
public ResultBean<PagerVo<AdGroupSystemApplyVo>> listPage(@RequestBody PagerQuery<AdGroupSystemApplyQuery> pq) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PagerVo<AdGroupSystemApplyVo> pv = adGroupSystemApplyService.listPageVo(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("新增或修改") |
||||
|
@PostMapping("/save") |
||||
|
public ResultBean<String> saveOrUpdate(@RequestBody AdGroupSystemApplyDto dto) { |
||||
|
return adGroupSystemApplyService.saveOrUpdateDto(dto); |
||||
|
} |
||||
|
@ApiOperation("初始化(新增或修改)") |
||||
|
@GetMapping({"/getInit", "/getInit/{sid}"}) |
||||
|
public ResultBean<AdGroupSystemApplyVo> getInit( |
||||
|
@PathVariable(value = "sid", required = false) String sid, |
||||
|
@RequestParam(value = "userSid", required = false) String userSid, |
||||
|
@RequestParam(value = "orgPath", required = false) String orgPath) { |
||||
|
ResultBean<AdGroupSystemApplyVo> rb = ResultBean.fireFail(); |
||||
|
if (sid == null || sid.isEmpty()) { |
||||
|
// 执行新增初始化
|
||||
|
if (userSid == null || orgPath == null) { |
||||
|
return rb.setMsg("userSid和orgPath不能为空"); |
||||
|
} |
||||
|
return adGroupSystemApplyService.getSaveInit(userSid, orgPath); |
||||
|
} else { |
||||
|
// 执行修改初始化
|
||||
|
return adGroupSystemApplyService.getUpdateInit(sid); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("详情") |
||||
|
@GetMapping("/details/{sid}") |
||||
|
ResultBean<AdGroupSystemApplyVo> details(@PathVariable("sid") String sid |
||||
|
, @RequestParam(value = "application", required = false) String application) { |
||||
|
return adGroupSystemApplyService.details(sid,application); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation("提交审批流程") |
||||
|
@PostMapping("/submit") |
||||
|
public ResultBean submit(@RequestBody AdGroupSystemApplyDto dto) { |
||||
|
return adGroupSystemApplyService.submit(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "驳回任务") |
||||
|
@PutMapping(value = "/reject") |
||||
|
public ResultBean reject(@Valid @RequestBody TaskDto dto) { |
||||
|
return adGroupSystemApplyService.reject(dto); |
||||
|
} |
||||
|
|
||||
|
@ApiOperation(value = "办理(同意)") |
||||
|
@PutMapping("/complete") |
||||
|
public ResultBean complete(@Valid @RequestBody CompleteDto dto) { |
||||
|
return adGroupSystemApplyService.complete(dto); |
||||
|
} |
||||
|
@ApiOperation("获取流程操作标题") |
||||
|
@GetMapping("/getFlowOperateTitle") |
||||
|
@ResponseBody |
||||
|
ResultBean<String> getFlowOperateTitle(@SpringQueryMap NodeQuery query) { |
||||
|
return adGroupSystemApplyService.getFlowOperateTitle(query); |
||||
|
} |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.yxt.anrui.oa.biz.adgroupdocumentsapply; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/8 14:58 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "集团文件审批", description = "集团文件审批") |
||||
|
@TableName("ad_group_documents_apply") |
||||
|
public class AdGroupDocumentsApply extends BaseEntity { |
||||
|
@ApiModelProperty("签发部门") |
||||
|
private String departmentSid; |
||||
|
@ApiModelProperty("签发部门") |
||||
|
private String departmentName; |
||||
|
@ApiModelProperty("是否需要会签") |
||||
|
private String isCountersign; |
||||
|
@ApiModelProperty("是否需要总裁办审批") |
||||
|
private String isExamine; |
||||
|
@ApiModelProperty("拟发布文件标题") |
||||
|
private String title; |
||||
|
@ApiModelProperty("说明") |
||||
|
private String context; |
||||
|
@ApiModelProperty("基础表单sid") |
||||
|
private String formSid; |
||||
|
|
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
package com.yxt.anrui.oa.biz.adgroupdocumentsapply; |
||||
|
|
||||
|
import com.yxt.anrui.oa.biz.oaform.OaFormDto; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/8 14:58 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "集团制度会签审批 数据传输对象", description = "集团制度会签审批 数据传输对象") |
||||
|
public class AdGroupDocumentsApplyDto extends OaFormDto { |
||||
|
@ApiModelProperty("签发部门") |
||||
|
private String departmentSid; |
||||
|
@ApiModelProperty("签发部门") |
||||
|
private String departmentName; |
||||
|
@ApiModelProperty("是否需要会签") |
||||
|
private String isCountersign; |
||||
|
@ApiModelProperty("是否需要总裁办审批") |
||||
|
private String isExamine; |
||||
|
@ApiModelProperty("拟发布文件标题") |
||||
|
private String title; |
||||
|
@ApiModelProperty("说明") |
||||
|
private String context; |
||||
|
@ApiModelProperty("基础表单sid") |
||||
|
private String formSid; |
||||
|
@ApiModelProperty("图片") |
||||
|
private List<String> files = new ArrayList<>(); |
||||
|
@ApiModelProperty("文件") |
||||
|
private List<String> appes = new ArrayList<>(); |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.anrui.oa.biz.adgroupdocumentsapply; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.anrui.oa.biz.adgroupsystemapply.AdGroupSystemApplyVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/8 14:58 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface AdGroupDocumentsApplyMapper extends BaseMapper<AdGroupDocumentsApply> { |
||||
|
AdGroupDocumentsApplyVo details(String sid); |
||||
|
IPage<AdGroupDocumentsApplyVo> selectPageVo(IPage<AdGroupDocumentsApply> page, @Param(Constants.WRAPPER) Wrapper<AdGroupDocumentsApply> qw); |
||||
|
|
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
<?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.oa.biz.adgroupdocumentsapply.AdGroupDocumentsApplyMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="selectPageVo" resultType="com.yxt.anrui.oa.biz.adgroupdocumentsapply.AdGroupDocumentsApplyVo"> |
||||
|
SELECT * from ad_group_documentsapply_apply |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
<select id="details" resultType="com.yxt.anrui.oa.biz.adgroupdocumentsapply.AdGroupDocumentsApplyVo"> |
||||
|
select * |
||||
|
from ad_group_documentsapply_apply |
||||
|
where sid = #{sid} |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,10 @@ |
|||||
|
package com.yxt.anrui.oa.biz.adgroupdocumentsapply; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/8 14:58 |
||||
|
*/ |
||||
|
public class AdGroupDocumentsApplyQuery implements Query { |
||||
|
} |
@ -0,0 +1,266 @@ |
|||||
|
package com.yxt.anrui.oa.biz.adgroupdocumentsapply; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.yxt.anrui.oa.biz.adgroupsystemapply.AdGroupSystemApplyVo; |
||||
|
import com.yxt.anrui.oa.biz.oaappendix.OaAppendixService; |
||||
|
import com.yxt.anrui.oa.biz.oaform.OaForm; |
||||
|
import com.yxt.anrui.oa.biz.oaform.OaFormRuleEnum; |
||||
|
import com.yxt.anrui.oa.biz.oaform.OaFormService; |
||||
|
import com.yxt.anrui.oa.biz.oaform.flowable.*; |
||||
|
import com.yxt.anrui.oa.feign.file.OaFileEnum; |
||||
|
import com.yxt.anrui.oa.feign.flowable.flow.ProcDefEnum; |
||||
|
import com.yxt.anrui.oa.feign.portal.sysorganization.SysOrganizationFeign; |
||||
|
import com.yxt.anrui.oa.feign.portal.sysorganization.SysOrganizationVo; |
||||
|
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.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.Collections; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/8 14:58 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class AdGroupDocumentsApplyService extends MybatisBaseService<AdGroupDocumentsApplyMapper, AdGroupDocumentsApply> { |
||||
|
@Autowired |
||||
|
OaFormService oaFormService; |
||||
|
@Autowired |
||||
|
SysOrganizationFeign sysOrganizationFeign; |
||||
|
@Autowired |
||||
|
OaAppendixService oaAppendixService; |
||||
|
|
||||
|
|
||||
|
public PagerVo<AdGroupDocumentsApplyVo> listPageVo(PagerQuery<AdGroupDocumentsApplyQuery> pq) { |
||||
|
AdGroupDocumentsApplyQuery query = pq.getParams(); |
||||
|
QueryWrapper<AdGroupDocumentsApply> qw = new QueryWrapper<>(); |
||||
|
if (query != null) { |
||||
|
} |
||||
|
IPage<AdGroupDocumentsApply> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<AdGroupDocumentsApplyVo> pagging = baseMapper.selectPageVo(page, qw); |
||||
|
for (AdGroupDocumentsApplyVo record : pagging.getRecords()) { |
||||
|
List<String> files = oaAppendixService.selectByLinkSid(record.getSid()); |
||||
|
record.setFiles(files); |
||||
|
} |
||||
|
PagerVo<AdGroupDocumentsApplyVo> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
public ResultBean<String> saveOrUpdateDto(AdGroupDocumentsApplyDto dto) { |
||||
|
ResultBean<String> rb = ResultBean.fireFail(); |
||||
|
String sid = dto.getSid(); |
||||
|
List<String> files = dto.getFiles(); |
||||
|
List<String> appes = dto.getAppes(); |
||||
|
if (StringUtils.isBlank(sid)) { |
||||
|
// 新建操作
|
||||
|
AdGroupDocumentsApply entity = new AdGroupDocumentsApply(); |
||||
|
BeanUtil.copyProperties(dto, entity, "sid"); |
||||
|
dto.setBillNo("JTZDHQ"); |
||||
|
dto.setSid(entity.getSid()); |
||||
|
dto.setCreateBySid(dto.getCreateBySid()); |
||||
|
ResultBean<String> resultBean = oaFormService.saveOaForm(dto); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb; |
||||
|
} |
||||
|
entity.setFormSid(resultBean.getData()); |
||||
|
entity.setCreateBySid(dto.getCreateBySid()); |
||||
|
baseMapper.insert(entity); |
||||
|
sid = entity.getSid(); |
||||
|
} else { |
||||
|
// 更新操作
|
||||
|
AdGroupDocumentsApply entity = fetchBySid(sid); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
baseMapper.updateById(entity); |
||||
|
} |
||||
|
saveFiles(sid, files, OaFileEnum.ADEXPATRIATESAPPLY.getAttachType(), "图片"); |
||||
|
saveFiles(sid, appes, OaFileEnum.ADEXPATRIATESAPPLY.getAttachType(), "文件"); |
||||
|
return rb.success().setData(sid); |
||||
|
} |
||||
|
public ResultBean<AdGroupDocumentsApplyVo> getSaveInit(String userSid, String orgPath) { |
||||
|
ResultBean<AdGroupDocumentsApplyVo> rb = ResultBean.fireFail(); |
||||
|
AdGroupDocumentsApplyVo AdGroupDocumentsApplyVo = new AdGroupDocumentsApplyVo(); |
||||
|
AdGroupDocumentsApplyVo.setCreateBySid(userSid); |
||||
|
AdGroupDocumentsApplyVo.setOrgSidPath(orgPath); |
||||
|
return rb.success().setData(AdGroupDocumentsApplyVo); |
||||
|
} |
||||
|
|
||||
|
public ResultBean<AdGroupDocumentsApplyVo> getUpdateInit(String sid) { |
||||
|
ResultBean<AdGroupDocumentsApplyVo> rb = ResultBean.fireFail(); |
||||
|
AdGroupDocumentsApplyVo AdGroupDocumentsApplyVo = new AdGroupDocumentsApplyVo(); |
||||
|
AdGroupDocumentsApply AdGroupDocumentsApply = fetchBySid(sid); |
||||
|
if (AdGroupDocumentsApply == null) { |
||||
|
return rb.setMsg("该申请不存在"); |
||||
|
} |
||||
|
// hrHireApplyVo.setTestPage(hrHireApply.getTestPage());
|
||||
|
OaForm oaForm = oaFormService.fetchBySid(sid); |
||||
|
AdGroupDocumentsApplyVo.setTaskId(oaForm.getTaskId()); |
||||
|
AdGroupDocumentsApplyVo.setProcInsId(oaForm.getProcInstId()); |
||||
|
//根据部门sid获取orgPath并赋值
|
||||
|
SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(oaForm.getDeptSid()).getData(); |
||||
|
String orgSidPath = organizationVo.getOrgSidPath(); |
||||
|
AdGroupDocumentsApplyVo.setOrgSidPath(orgSidPath); |
||||
|
AdGroupDocumentsApplyVo.setCreateBySid(oaForm.getCreateBySid()); |
||||
|
BeanUtil.copyProperties(AdGroupDocumentsApply, AdGroupDocumentsApplyVo); |
||||
|
// FormCommon isFinanceObj = FormCommon.of(AdGroupDocumentsApply.getIsFinanceKey(), AdGroupDocumentsApply.getIsFinanceValue());
|
||||
|
// AdGroupDocumentsApplyVo.setIsFinanceObj(isFinanceObj);
|
||||
|
|
||||
|
List<String> files = oaAppendixService.selectByLinkSid(sid); |
||||
|
AdGroupDocumentsApplyVo.setFiles(files); |
||||
|
AdGroupDocumentsApplyVo.setSid(sid); |
||||
|
return rb.success().setData(AdGroupDocumentsApplyVo); |
||||
|
} |
||||
|
// 保存文件
|
||||
|
private void saveFiles(String sid, List<String> files, String attachType, String fileType) { |
||||
|
files.removeAll(Collections.singleton(null)); |
||||
|
oaAppendixService.saveFile(sid, files, attachType, fileType); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 详情 |
||||
|
* |
||||
|
* @param sid |
||||
|
* @return |
||||
|
*/ |
||||
|
public ResultBean<AdGroupDocumentsApplyVo> details(String sid, String application) { |
||||
|
ResultBean<AdGroupDocumentsApplyVo> rb = ResultBean.fireFail(); |
||||
|
AdGroupDocumentsApplyVo adGroupDocumentsApplyVo = baseMapper.details(sid); |
||||
|
if (adGroupDocumentsApplyVo == null) { |
||||
|
return rb.setMsg("该申请不存在"); |
||||
|
} |
||||
|
|
||||
|
// List<String> files = oaAppendixService.selectByLinkSid(adGroupDocumentsApplyVo.getSid(), "图片");
|
||||
|
List<String> appes= oaAppendixService.selectByLinkSid(adGroupDocumentsApplyVo.getSid(), "文件"); |
||||
|
// adGroupDocumentsApplyVo.setFiles(files);
|
||||
|
adGroupDocumentsApplyVo.setAppes(appes); |
||||
|
//基础字段赋值
|
||||
|
BeanUtil.copyProperties(oaFormService.getDetails(sid), adGroupDocumentsApplyVo); |
||||
|
return rb.success().setData(adGroupDocumentsApplyVo); |
||||
|
} |
||||
|
/** |
||||
|
* 提交 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return |
||||
|
*/ |
||||
|
public ResultBean submit(AdGroupDocumentsApplyDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
ResultBean<String> stringResultBean = saveOrUpdateDto(dto); |
||||
|
if (!stringResultBean.getSuccess()) { |
||||
|
return rb.setMsg(stringResultBean.getData()); |
||||
|
} |
||||
|
String businessSid = stringResultBean.getData(); |
||||
|
|
||||
|
SubmitDto submitDto = new SubmitDto(); |
||||
|
submitDto.setUserSid(dto.getCreateBySid()); |
||||
|
submitDto.setBusinessSid(businessSid); |
||||
|
|
||||
|
Map<String, Object> formVariables = new HashMap<>(); |
||||
|
Map<String, Object> appMap = new HashMap<>(); |
||||
|
// appMap.put("sid", businessSid);
|
||||
|
formVariables = getMap(formVariables, businessSid); |
||||
|
submitDto.setFormVariables(formVariables); |
||||
|
submitDto.setProcDefId(ProcDefEnum.HIHIREAPPLY.getProDefId()); |
||||
|
submitDto.setNextTaskId(dto.getTaskId()); |
||||
|
submitDto.setRule(OaFormRuleEnum.DIRECTLY_UNDER.getRule()); |
||||
|
return oaFormService.submit(submitDto); |
||||
|
} |
||||
|
/** |
||||
|
* 驳回 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return |
||||
|
*/ |
||||
|
public ResultBean reject(TaskDto dto) { |
||||
|
Map<String, Object> formVariables = dto.getFormVariables(); |
||||
|
formVariables = getMap(formVariables, dto.getBusinessSid()); |
||||
|
dto.setFormVariables(formVariables); |
||||
|
|
||||
|
return oaFormService.reject(dto); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 办理(同意) |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return |
||||
|
*/ |
||||
|
public ResultBean complete(CompleteDto dto) { |
||||
|
Map<String, Object> formVariables = dto.getFormVariables(); |
||||
|
formVariables = getMap(formVariables, dto.getBusinessSid()); |
||||
|
dto.setFormVariables(formVariables); |
||||
|
BusinessVariablesDto businessVariablesDto = new BusinessVariablesDto(); |
||||
|
BeanUtil.copyProperties(dto, businessVariablesDto); |
||||
|
return oaFormService.complete(businessVariablesDto); |
||||
|
} |
||||
|
|
||||
|
public ResultBean<String> getFlowOperateTitle(NodeQuery query) { |
||||
|
ResultBean<String> rb = ResultBean.fireFail(); |
||||
|
//0 上一环节 1下一环节
|
||||
|
int next = query.getNext(); |
||||
|
Map<String, Object> formVariables = query.getFormVariables(); |
||||
|
formVariables = getMap(formVariables, query.getBusinessSid()); |
||||
|
query.setFormVariables(formVariables); |
||||
|
String data = ""; |
||||
|
if (next == 0) { |
||||
|
ResultBean<List<NodeVo>> resultBean = oaFormService.getPreviousNodesForReject(query); |
||||
|
if (resultBean.getSuccess()) { |
||||
|
resultBean.getData().removeAll(Collections.singleton(null)); |
||||
|
data = resultBean.getData().get(0).getName(); |
||||
|
} else { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
} else if (next == 1) { |
||||
|
ResultBean<List<NodeVo>> resultBean = oaFormService.getNextNodesForSubmit(query); |
||||
|
if (resultBean.getSuccess()) { |
||||
|
resultBean.getData().removeAll(Collections.singleton(null)); |
||||
|
data = resultBean.getData().get(0).getName(); |
||||
|
} else { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
} else { |
||||
|
return rb.setMsg("参数错误:next"); |
||||
|
} |
||||
|
return rb.success().setData(data); |
||||
|
} |
||||
|
public Map<String, Object> getMap(Map<String, Object> formVariables, String sid) { |
||||
|
Map<String, Object> appMap = new HashMap<>(); |
||||
|
appMap.put("sid", sid); |
||||
|
/*appMap.put("editUrl", "approval/#/pages/EditOnboradingApplyActivity?sid=" + sid); |
||||
|
appMap.put("detailUrl", "approval/#/pages/DetailOnboradingApplyActivity?sid=" + sid); |
||||
|
appMap.put("flowOperateUrl", "oa/v1/HrHireApply/getFlowOperateTitle"); |
||||
|
appMap.put("agreeUrl", "oa/v1/HrHireApply/complete"); |
||||
|
appMap.put("stopUrl", "oa/v1/oaform/breakProcess"); |
||||
|
appMap.put("rejectUrl", "oa/v1/HrHireApply/reject"); |
||||
|
appMap.put("recallUrl", "oa/v1/oaform/revokeProcess"); |
||||
|
appMap.put("signUrl", "oa/v1/oaform/delegate"); |
||||
|
appMap.put("transferUrl", "oa/v1/oaform/assignTask");*/ |
||||
|
// appMap.put(OaFormUrlEnum.HRHIREAPPLY_EDIT.getType(), OaFormUrlEnum.HRHIREAPPLY_EDIT.getUrl() + sid);
|
||||
|
// appMap.put(OaFormUrlEnum.HRHIREAPPLY_DETAIL.getType(), OaFormUrlEnum.HRHIREAPPLY_DETAIL.getUrl() + sid);
|
||||
|
// appMap.put(OaFormUrlEnum.HRHIREAPPLY_FLOWOPERATEURL.getType(), OaFormUrlEnum.HRHIREAPPLY_FLOWOPERATEURL.getUrl());
|
||||
|
// appMap.put(OaFormUrlEnum.HRHIREAPPLY_AGREEURL.getType(), OaFormUrlEnum.HRHIREAPPLY_AGREEURL.getUrl());
|
||||
|
// appMap.put(OaFormUrlEnum.STOPURL.getType(), OaFormUrlEnum.STOPURL.getUrl());
|
||||
|
// appMap.put(OaFormUrlEnum.HRHIREAPPLY_REJECTURL.getType(), OaFormUrlEnum.HRHIREAPPLY_REJECTURL.getUrl());
|
||||
|
// appMap.put(OaFormUrlEnum.RECALLURL.getType(), OaFormUrlEnum.RECALLURL.getUrl());
|
||||
|
// appMap.put(OaFormUrlEnum.SIGNURL.getType(), OaFormUrlEnum.SIGNURL.getUrl());
|
||||
|
// appMap.put(OaFormUrlEnum.TRANSFERURL.getType(), OaFormUrlEnum.TRANSFERURL.getUrl());
|
||||
|
// formVariables.put("app", appMap);
|
||||
|
// //根据组织查询是否是分公司
|
||||
|
OaForm oaForm = oaFormService.fetchBySid(sid); |
||||
|
AdGroupDocumentsApply adPermissionApply = fetchBySid(sid); |
||||
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(oaForm.getUseOrgSid()).getData(); |
||||
|
//是否是分公司
|
||||
|
// formVariables.put("isTrue", sysOrganization.getIsDept() == 0);
|
||||
|
|
||||
|
return formVariables; |
||||
|
} |
||||
|
} |
@ -0,0 +1,41 @@ |
|||||
|
package com.yxt.anrui.oa.biz.adgroupdocumentsapply; |
||||
|
|
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/8 14:58 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "集团制度会签审批 视图数据对象", description = "集团制度会签审批 视图数据对象") |
||||
|
public class AdGroupDocumentsApplyVo { |
||||
|
private String sid; |
||||
|
@ApiModelProperty("签发部门") |
||||
|
private String departmentSid; |
||||
|
@ApiModelProperty("签发部门") |
||||
|
private String departmentName; |
||||
|
@ApiModelProperty("是否需要会签") |
||||
|
private String isCountersign; |
||||
|
@ApiModelProperty("是否需要总裁办审批") |
||||
|
private String isExamine; |
||||
|
@ApiModelProperty("拟发布文件标题") |
||||
|
private String title; |
||||
|
@ApiModelProperty("说明") |
||||
|
private String context; |
||||
|
@ApiModelProperty("基础表单sid") |
||||
|
private String formSid; |
||||
|
@ApiModelProperty("图片") |
||||
|
private List<String> files = new ArrayList<>(); |
||||
|
@ApiModelProperty("附件") |
||||
|
private List<String> appes = new ArrayList<>(); |
||||
|
private String orgSidPath; |
||||
|
private String createBySid; |
||||
|
private String taskId; |
||||
|
@ApiModelProperty("流程实例id") |
||||
|
private String procInsId; |
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.yxt.anrui.oa.biz.adgroupsystemapply; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/7 15:30 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "集团制度会签审批", description = "集团制度会签审批") |
||||
|
@TableName("ad_group_system_apply") |
||||
|
public class AdGroupSystemApply extends BaseEntity { |
||||
|
@ApiModelProperty("拟发布制度标题") |
||||
|
private String title; |
||||
|
@ApiModelProperty("起草修订说明") |
||||
|
private String describes; |
||||
|
@ApiModelProperty("会签制度内容") |
||||
|
private String content; |
||||
|
@ApiModelProperty("基础表单sid") |
||||
|
private String formSid; |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package com.yxt.anrui.oa.biz.adgroupsystemapply; |
||||
|
|
||||
|
import com.yxt.anrui.oa.biz.oaform.OaFormDto; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/7 15:30 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "集团制度会签审批 数据传输对象", description = "集团制度会签审批 数据传输对象") |
||||
|
public class AdGroupSystemApplyDto extends OaFormDto { |
||||
|
private String sid; |
||||
|
@ApiModelProperty("拟发布制度标题") |
||||
|
private String title; |
||||
|
@ApiModelProperty("起草修订说明") |
||||
|
private String describes; |
||||
|
@ApiModelProperty("会签制度内容") |
||||
|
private String content; |
||||
|
@ApiModelProperty("基础表单sid") |
||||
|
private String formSid; |
||||
|
@ApiModelProperty("图片") |
||||
|
private List<String> files = new ArrayList<>(); |
||||
|
@ApiModelProperty("文件") |
||||
|
private List<String> appes = new ArrayList<>(); |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.anrui.oa.biz.adgroupsystemapply; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.anrui.oa.biz.hrhireapply.HrHireApplyDetailVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/7 15:32 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface AdGroupSystemApplyMapper extends BaseMapper<AdGroupSystemApply> { |
||||
|
AdGroupSystemApplyVo details(String sid); |
||||
|
IPage<AdGroupSystemApplyVo> selectPageVo(IPage<AdGroupSystemApply> page, @Param(Constants.WRAPPER) Wrapper<AdGroupSystemApply> qw); |
||||
|
|
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
<?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.oa.biz.adgroupsystemapply.AdGroupSystemApplyMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="selectPageVo" resultType="com.yxt.anrui.oa.biz.adgroupsystemapply.AdGroupSystemApplyVo"> |
||||
|
SELECT * from ad_group_system_apply |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
<select id="details" resultType="com.yxt.anrui.oa.biz.adgroupsystemapply.AdGroupSystemApplyVo"> |
||||
|
select * |
||||
|
from ad_group_system_apply |
||||
|
where sid = #{sid} |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,14 @@ |
|||||
|
package com.yxt.anrui.oa.biz.adgroupsystemapply; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/7 15:31 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "集团制度会签审批 查询条件", description = "集团制度会签审批 查询条件") |
||||
|
public class AdGroupSystemApplyQuery implements Query { |
||||
|
} |
@ -0,0 +1,264 @@ |
|||||
|
package com.yxt.anrui.oa.biz.adgroupsystemapply; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.yxt.anrui.oa.biz.oaappendix.OaAppendixService; |
||||
|
import com.yxt.anrui.oa.biz.oaform.*; |
||||
|
import com.yxt.anrui.oa.biz.oaform.flowable.*; |
||||
|
import com.yxt.anrui.oa.feign.file.OaFileEnum; |
||||
|
import com.yxt.anrui.oa.feign.flowable.flow.ProcDefEnum; |
||||
|
import com.yxt.anrui.oa.feign.portal.sysorganization.SysOrganizationFeign; |
||||
|
import com.yxt.anrui.oa.feign.portal.sysorganization.SysOrganizationVo; |
||||
|
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.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.Collections; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/7 15:31 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class AdGroupSystemApplyService extends MybatisBaseService<AdGroupSystemApplyMapper, AdGroupSystemApply> { |
||||
|
@Autowired |
||||
|
OaFormService oaFormService; |
||||
|
@Autowired |
||||
|
SysOrganizationFeign sysOrganizationFeign; |
||||
|
@Autowired |
||||
|
OaAppendixService oaAppendixService; |
||||
|
|
||||
|
|
||||
|
public PagerVo<AdGroupSystemApplyVo> listPageVo(PagerQuery<AdGroupSystemApplyQuery> pq) { |
||||
|
AdGroupSystemApplyQuery query = pq.getParams(); |
||||
|
QueryWrapper<AdGroupSystemApply> qw = new QueryWrapper<>(); |
||||
|
if (query != null) { |
||||
|
} |
||||
|
IPage<AdGroupSystemApply> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<AdGroupSystemApplyVo> pagging = baseMapper.selectPageVo(page, qw); |
||||
|
for (AdGroupSystemApplyVo record : pagging.getRecords()) { |
||||
|
List<String> files = oaAppendixService.selectByLinkSid(record.getSid()); |
||||
|
record.setFiles(files); |
||||
|
} |
||||
|
PagerVo<AdGroupSystemApplyVo> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
|
||||
|
public ResultBean<String> saveOrUpdateDto(AdGroupSystemApplyDto dto) { |
||||
|
ResultBean<String> rb = ResultBean.fireFail(); |
||||
|
String sid = dto.getSid(); |
||||
|
List<String> files = dto.getFiles(); |
||||
|
List<String> appes = dto.getAppes(); |
||||
|
if (StringUtils.isBlank(sid)) { |
||||
|
// 新建操作
|
||||
|
AdGroupSystemApply entity = new AdGroupSystemApply(); |
||||
|
BeanUtil.copyProperties(dto, entity, "sid"); |
||||
|
dto.setBillNo("JTZDHQ"); |
||||
|
dto.setSid(entity.getSid()); |
||||
|
dto.setCreateBySid(dto.getCreateBySid()); |
||||
|
ResultBean<String> resultBean = oaFormService.saveOaForm(dto); |
||||
|
if (!resultBean.getSuccess()) { |
||||
|
return rb; |
||||
|
} |
||||
|
entity.setFormSid(resultBean.getData()); |
||||
|
entity.setCreateBySid(dto.getCreateBySid()); |
||||
|
baseMapper.insert(entity); |
||||
|
sid = entity.getSid(); |
||||
|
} else { |
||||
|
// 更新操作
|
||||
|
AdGroupSystemApply entity = fetchBySid(sid); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
baseMapper.updateById(entity); |
||||
|
} |
||||
|
saveFiles(sid, files, OaFileEnum.GROUPSYSTEMAPPLY.getAttachType(), "图片"); |
||||
|
saveFiles(sid, appes, OaFileEnum.GROUPSYSTEMAPPLY.getAttachType(), "文件"); |
||||
|
return rb.success().setData(sid); |
||||
|
} |
||||
|
public ResultBean<AdGroupSystemApplyVo> getSaveInit(String userSid, String orgPath) { |
||||
|
ResultBean<AdGroupSystemApplyVo> rb = ResultBean.fireFail(); |
||||
|
AdGroupSystemApplyVo AdGroupSystemApplyVo = new AdGroupSystemApplyVo(); |
||||
|
AdGroupSystemApplyVo.setCreateBySid(userSid); |
||||
|
AdGroupSystemApplyVo.setOrgSidPath(orgPath); |
||||
|
return rb.success().setData(AdGroupSystemApplyVo); |
||||
|
} |
||||
|
|
||||
|
public ResultBean<AdGroupSystemApplyVo> getUpdateInit(String sid) { |
||||
|
ResultBean<AdGroupSystemApplyVo> rb = ResultBean.fireFail(); |
||||
|
AdGroupSystemApplyVo AdGroupSystemApplyVo = new AdGroupSystemApplyVo(); |
||||
|
AdGroupSystemApply AdGroupSystemApply = fetchBySid(sid); |
||||
|
if (AdGroupSystemApply == null) { |
||||
|
return rb.setMsg("该申请不存在"); |
||||
|
} |
||||
|
// hrHireApplyVo.setTestPage(hrHireApply.getTestPage());
|
||||
|
OaForm oaForm = oaFormService.fetchBySid(sid); |
||||
|
AdGroupSystemApplyVo.setTaskId(oaForm.getTaskId()); |
||||
|
AdGroupSystemApplyVo.setProcInsId(oaForm.getProcInstId()); |
||||
|
//根据部门sid获取orgPath并赋值
|
||||
|
SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(oaForm.getDeptSid()).getData(); |
||||
|
String orgSidPath = organizationVo.getOrgSidPath(); |
||||
|
AdGroupSystemApplyVo.setOrgSidPath(orgSidPath); |
||||
|
AdGroupSystemApplyVo.setCreateBySid(oaForm.getCreateBySid()); |
||||
|
BeanUtil.copyProperties(AdGroupSystemApply, AdGroupSystemApplyVo); |
||||
|
// FormCommon isFinanceObj = FormCommon.of(AdGroupSystemApply.getIsFinanceKey(), AdGroupSystemApply.getIsFinanceValue());
|
||||
|
// AdGroupSystemApplyVo.setIsFinanceObj(isFinanceObj);
|
||||
|
|
||||
|
List<String> files = oaAppendixService.selectByLinkSid(sid); |
||||
|
AdGroupSystemApplyVo.setFiles(files); |
||||
|
AdGroupSystemApplyVo.setSid(sid); |
||||
|
return rb.success().setData(AdGroupSystemApplyVo); |
||||
|
} |
||||
|
// 保存文件
|
||||
|
private void saveFiles(String sid, List<String> files, String attachType, String fileType) { |
||||
|
files.removeAll(Collections.singleton(null)); |
||||
|
oaAppendixService.saveFile(sid, files, attachType, fileType); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 详情 |
||||
|
* |
||||
|
* @param sid |
||||
|
* @return |
||||
|
*/ |
||||
|
public ResultBean<AdGroupSystemApplyVo> details(String sid, String application) { |
||||
|
ResultBean<AdGroupSystemApplyVo> rb = ResultBean.fireFail(); |
||||
|
AdGroupSystemApplyVo AdGroupSystemApplyVo = baseMapper.details(sid); |
||||
|
if (AdGroupSystemApplyVo == null) { |
||||
|
return rb.setMsg("该申请不存在"); |
||||
|
} |
||||
|
|
||||
|
List<String> files = oaAppendixService.selectByLinkSid(AdGroupSystemApplyVo.getSid(), "图片"); |
||||
|
List<String> appes= oaAppendixService.selectByLinkSid(AdGroupSystemApplyVo.getSid(), "文件"); |
||||
|
AdGroupSystemApplyVo.setFiles(files); |
||||
|
AdGroupSystemApplyVo.setAppes(appes); |
||||
|
//基础字段赋值
|
||||
|
BeanUtil.copyProperties(oaFormService.getDetails(sid), AdGroupSystemApplyVo); |
||||
|
return rb.success().setData(AdGroupSystemApplyVo); |
||||
|
} |
||||
|
/** |
||||
|
* 提交 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return |
||||
|
*/ |
||||
|
public ResultBean submit(AdGroupSystemApplyDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
ResultBean<String> stringResultBean = saveOrUpdateDto(dto); |
||||
|
if (!stringResultBean.getSuccess()) { |
||||
|
return rb.setMsg(stringResultBean.getData()); |
||||
|
} |
||||
|
String businessSid = stringResultBean.getData(); |
||||
|
|
||||
|
SubmitDto submitDto = new SubmitDto(); |
||||
|
submitDto.setUserSid(dto.getCreateBySid()); |
||||
|
submitDto.setBusinessSid(businessSid); |
||||
|
|
||||
|
Map<String, Object> formVariables = new HashMap<>(); |
||||
|
Map<String, Object> appMap = new HashMap<>(); |
||||
|
// appMap.put("sid", businessSid);
|
||||
|
formVariables = getMap(formVariables, businessSid); |
||||
|
submitDto.setFormVariables(formVariables); |
||||
|
submitDto.setProcDefId(ProcDefEnum.GROUPSYSTEMAPPLY.getProDefId()); |
||||
|
submitDto.setNextTaskId(dto.getTaskId()); |
||||
|
submitDto.setRule(OaFormRuleEnum.DIRECTLY_UNDER.getRule()); |
||||
|
return oaFormService.submit(submitDto); |
||||
|
} |
||||
|
/** |
||||
|
* 驳回 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return |
||||
|
*/ |
||||
|
public ResultBean reject(TaskDto dto) { |
||||
|
Map<String, Object> formVariables = dto.getFormVariables(); |
||||
|
formVariables = getMap(formVariables, dto.getBusinessSid()); |
||||
|
dto.setFormVariables(formVariables); |
||||
|
|
||||
|
return oaFormService.reject(dto); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 办理(同意) |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return |
||||
|
*/ |
||||
|
public ResultBean complete(CompleteDto dto) { |
||||
|
Map<String, Object> formVariables = dto.getFormVariables(); |
||||
|
formVariables = getMap(formVariables, dto.getBusinessSid()); |
||||
|
dto.setFormVariables(formVariables); |
||||
|
BusinessVariablesDto businessVariablesDto = new BusinessVariablesDto(); |
||||
|
BeanUtil.copyProperties(dto, businessVariablesDto); |
||||
|
return oaFormService.complete(businessVariablesDto); |
||||
|
} |
||||
|
|
||||
|
public ResultBean<String> getFlowOperateTitle(NodeQuery query) { |
||||
|
ResultBean<String> rb = ResultBean.fireFail(); |
||||
|
//0 上一环节 1下一环节
|
||||
|
int next = query.getNext(); |
||||
|
Map<String, Object> formVariables = query.getFormVariables(); |
||||
|
formVariables = getMap(formVariables, query.getBusinessSid()); |
||||
|
query.setFormVariables(formVariables); |
||||
|
String data = ""; |
||||
|
if (next == 0) { |
||||
|
ResultBean<List<NodeVo>> resultBean = oaFormService.getPreviousNodesForReject(query); |
||||
|
if (resultBean.getSuccess()) { |
||||
|
resultBean.getData().removeAll(Collections.singleton(null)); |
||||
|
data = resultBean.getData().get(0).getName(); |
||||
|
} else { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
} else if (next == 1) { |
||||
|
ResultBean<List<NodeVo>> resultBean = oaFormService.getNextNodesForSubmit(query); |
||||
|
if (resultBean.getSuccess()) { |
||||
|
resultBean.getData().removeAll(Collections.singleton(null)); |
||||
|
data = resultBean.getData().get(0).getName(); |
||||
|
} else { |
||||
|
return rb.setMsg(resultBean.getMsg()); |
||||
|
} |
||||
|
} else { |
||||
|
return rb.setMsg("参数错误:next"); |
||||
|
} |
||||
|
return rb.success().setData(data); |
||||
|
} |
||||
|
public Map<String, Object> getMap(Map<String, Object> formVariables, String sid) { |
||||
|
Map<String, Object> appMap = new HashMap<>(); |
||||
|
appMap.put("sid", sid); |
||||
|
/*appMap.put("editUrl", "approval/#/pages/EditOnboradingApplyActivity?sid=" + sid); |
||||
|
appMap.put("detailUrl", "approval/#/pages/DetailOnboradingApplyActivity?sid=" + sid); |
||||
|
appMap.put("flowOperateUrl", "oa/v1/HrHireApply/getFlowOperateTitle"); |
||||
|
appMap.put("agreeUrl", "oa/v1/HrHireApply/complete"); |
||||
|
appMap.put("stopUrl", "oa/v1/oaform/breakProcess"); |
||||
|
appMap.put("rejectUrl", "oa/v1/HrHireApply/reject"); |
||||
|
appMap.put("recallUrl", "oa/v1/oaform/revokeProcess"); |
||||
|
appMap.put("signUrl", "oa/v1/oaform/delegate"); |
||||
|
appMap.put("transferUrl", "oa/v1/oaform/assignTask");*/ |
||||
|
appMap.put(OaFormUrlEnum.GROUPSYSTEM_EDIT.getType(), OaFormUrlEnum.GROUPSYSTEM_EDIT.getUrl() + sid); |
||||
|
appMap.put(OaFormUrlEnum.GROUPSYSTEM_DETAIL.getType(), OaFormUrlEnum.GROUPSYSTEM_DETAIL.getUrl() + sid); |
||||
|
appMap.put(OaFormUrlEnum.GROUPSYSTEM_FLOWOPERATEURL.getType(), OaFormUrlEnum.GROUPSYSTEM_FLOWOPERATEURL.getUrl()); |
||||
|
appMap.put(OaFormUrlEnum.GROUPSYSTEM_AGREEURL.getType(), OaFormUrlEnum.GROUPSYSTEM_AGREEURL.getUrl()); |
||||
|
appMap.put(OaFormUrlEnum.STOPURL.getType(), OaFormUrlEnum.STOPURL.getUrl()); |
||||
|
appMap.put(OaFormUrlEnum.GROUPSYSTEM_REJECTURL.getType(), OaFormUrlEnum.GROUPSYSTEM_REJECTURL.getUrl()); |
||||
|
appMap.put(OaFormUrlEnum.RECALLURL.getType(), OaFormUrlEnum.RECALLURL.getUrl()); |
||||
|
appMap.put(OaFormUrlEnum.SIGNURL.getType(), OaFormUrlEnum.SIGNURL.getUrl()); |
||||
|
appMap.put(OaFormUrlEnum.TRANSFERURL.getType(), OaFormUrlEnum.TRANSFERURL.getUrl()); |
||||
|
formVariables.put("app", appMap); |
||||
|
// //根据组织查询是否是分公司
|
||||
|
OaForm oaForm = oaFormService.fetchBySid(sid); |
||||
|
AdGroupSystemApply adPermissionApply = fetchBySid(sid); |
||||
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(oaForm.getUseOrgSid()).getData(); |
||||
|
//是否是分公司
|
||||
|
// formVariables.put("isTrue", sysOrganization.getIsDept() == 0);
|
||||
|
|
||||
|
return formVariables; |
||||
|
} |
||||
|
} |
@ -0,0 +1,37 @@ |
|||||
|
package com.yxt.anrui.oa.biz.adgroupsystemapply; |
||||
|
|
||||
|
import com.yxt.anrui.oa.biz.oaform.FormCommon; |
||||
|
import com.yxt.anrui.oa.biz.oaform.OaFormCommonVo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2025/2/7 15:31 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "集团制度会签审批 视图数据对象", description = "集团制度会签审批 视图数据对象") |
||||
|
public class AdGroupSystemApplyVo extends OaFormCommonVo { |
||||
|
private String sid; |
||||
|
@ApiModelProperty("拟发布制度标题") |
||||
|
private String title; |
||||
|
@ApiModelProperty("起草修订说明") |
||||
|
private String describes; |
||||
|
@ApiModelProperty("会签制度内容") |
||||
|
private String content; |
||||
|
@ApiModelProperty("基础表单sid") |
||||
|
private String formSid; |
||||
|
@ApiModelProperty("图片") |
||||
|
private List<String> files = new ArrayList<>(); |
||||
|
@ApiModelProperty("附件") |
||||
|
private List<String> appes = new ArrayList<>(); |
||||
|
private String orgSidPath; |
||||
|
private String createBySid; |
||||
|
private String taskId; |
||||
|
@ApiModelProperty("流程实例id") |
||||
|
private String procInsId; |
||||
|
} |
Loading…
Reference in new issue