diff --git a/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java index d21fdf8daa..c5de7f4850 100644 --- a/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java +++ b/anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/utils/ProcDefEnum.java @@ -38,10 +38,10 @@ public enum ProcDefEnum { QKBUSDELIVEREDAPPLY("欠款出库申请", "process_161otrwo:3:7192504"), BASESHUNINVOICAPPLY("调车开票申请", "process_u4xrvaso:1:400008"), BASEVEHINSTALLMODPRICE("上装调价申请", "process_s0a0svth:1:492508"), - SCMVEHREBATEWITHAPPLY("单车返利预提申请", "process_qegarc7r:4:16412508"), - SCMVEHREBATECHECKAPPLY("单车返利核对申请", "process_3xtbbru8:4:16412512"), - SCMSPECIALREBATEWITHAPPLY("专项返利预提申请", "process_l0yxpgs2:4:16412520"), - SCMSPECIALREBATECHECKAPPLY("专项返利核对申请", "process_qw22vupn:4:16412516"), + SCMVEHREBATEWITHAPPLY("单车返利预提申请", "process_qegarc7r:5:17935004"), + SCMVEHREBATECHECKAPPLY("单车返利核对申请", "process_3xtbbru8:5:17935008"), + SCMSPECIALREBATEWITHAPPLY("专项返利预提申请", "process_l0yxpgs2:5:17935012"), + SCMSPECIALREBATECHECKAPPLY("专项返利核对申请", "process_qw22vupn:5:17935016"), SCMSPECIALREBATECHEDISTRIBUTE("专项返利分配申请", "process_h3w1aval:4:16412524"), SCMCOLLECTIONREBATEWITHAPPLY("回款返利预提申请", "process_k4lodiyg:4:16412532"), SCMCOLLECTIONREBATECHECKAPPLY("回款返利核对申请", "process_fgrv1mbv:4:16412528"), diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/api/AdFeesReimbursableApplyRest.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/api/AdFeesReimbursableApplyRest.java new file mode 100644 index 0000000000..77b6dc43c0 --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/api/AdFeesReimbursableApplyRest.java @@ -0,0 +1,91 @@ +package com.yxt.anrui.oa.api; + +import com.yxt.anrui.oa.biz.adfeesreimbursableapply.AdFeesReimbursableApplyDetailVo; +import com.yxt.anrui.oa.biz.adfeesreimbursableapply.AdFeesReimbursableApplyDto; +import com.yxt.anrui.oa.biz.adfeesreimbursableapply.AdFeesReimbursableApplyService; +import com.yxt.anrui.oa.biz.adfeesreimbursableapply.AdFeesReimbursableApplyVo; +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.result.ResultBean; +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; + +@RestController +@RequestMapping("v1/AdFeesReimbursableApply") +public class AdFeesReimbursableApplyRest { + + + @Autowired + private AdFeesReimbursableApplyService adFeesReimbursableApplyService; + + @ApiOperation("初始化(新增或修改)") + @GetMapping({"/getInit", "/getInit/{sid}"}) + public ResultBean getInit( + @PathVariable(value = "sid", required = false) String sid, + @RequestParam(value = "userSid", required = false) String userSid, + @RequestParam(value = "orgPath", required = false) String orgPath) { + ResultBean rb = ResultBean.fireFail(); + if (sid == null || sid.isEmpty()) { + // 执行新增初始化 + if (userSid == null || orgPath == null) { + return rb.setMsg("userSid和orgPath不能为空"); + } + return adFeesReimbursableApplyService.getSaveInit(userSid, orgPath); + } else { + // 执行修改初始化 + return adFeesReimbursableApplyService.getUpdateInit(sid); + } + } + + @ApiOperation("新增或修改") + @PostMapping("/save") + public ResultBean save(@RequestBody AdFeesReimbursableApplyDto dto) { + return adFeesReimbursableApplyService.saveOrUpdateDto(dto); + } + + @ApiOperation("根据sid批量删除") + @DeleteMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids) { + ResultBean rb = ResultBean.fireFail(); + adFeesReimbursableApplyService.delAll(sids); + return rb.success(); + } + + @ApiOperation("详情") + @GetMapping("/details/{sid}") + ResultBean details(@PathVariable("sid") String sid + , @RequestParam(value = "application", required = false) String application) { + return adFeesReimbursableApplyService.details(sid,application); + } + + @ApiOperation("提交审批流程") + @PostMapping("/submit") + public ResultBean submit(@RequestBody @Valid AdFeesReimbursableApplyDto dto) { + return adFeesReimbursableApplyService.submit(dto); + } + + @ApiOperation(value = "办理(同意)") + @PutMapping("/complete") + public ResultBean complete(@Valid @RequestBody CompleteDto dto) { + return adFeesReimbursableApplyService.complete(dto); + } + + @ApiOperation(value = "驳回任务") + @PutMapping(value = "/reject") + public ResultBean reject(@Valid @RequestBody TaskDto dto) { + return adFeesReimbursableApplyService.reject(dto); + } + + @ApiOperation("获取流程操作标题") + @GetMapping("/getFlowOperateTitle") + @ResponseBody + ResultBean getFlowOperateTitle(@SpringQueryMap NodeQuery query) { + return adFeesReimbursableApplyService.getFlowOperateTitle(query); + } + +} diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApply.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApply.java new file mode 100644 index 0000000000..9ecdc41536 --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApply.java @@ -0,0 +1,89 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.oa.biz.adfeesreimbursableapply; + +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; + +import java.math.BigDecimal; +import java.util.Date; + +@Data +@ApiModel(value = "行政类费用报销", description = "行政类费用报销") +@TableName("ad_fees_reimbursable_apply") +public class AdFeesReimbursableApply extends BaseEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("基础表单sid") + private String formSid; // 基础表单sid + @ApiModelProperty("关联审批sid列表,英文逗号分隔") + private String linkFormSids; // 关联审批sid列表,英文逗号分隔 + + @ApiModelProperty("报销人sid") + private String reimbursementSid; // 报销人sid + @ApiModelProperty("报销人") + private String reimbursement; // 报销人 + @ApiModelProperty("销售区域") + private String salesZone; // 销售区域 + @ApiModelProperty("报销人岗位") + private String post; // 报销人岗位 + @ApiModelProperty("是否乘坐交通工具特殊坐席(1是,0否)") + private String isSpecialSeatKey; // 是否乘坐交通工具特殊坐席(1是,0否) + @ApiModelProperty("是否乘坐交通工具特殊坐席(1是,0否)") + private String isSpecialSeatValue; // 是否乘坐交通工具特殊坐席(1是,0否) + @ApiModelProperty("出差出发日期及具体时间") + private Date departureTime; // 出差出发日期及具体时间 + @ApiModelProperty("出差返程到达日期及时间") + private Date returnTime; // 出差返程到达日期及时间 + + @ApiModelProperty("是否涉及高消费招待(1是,0否)") + private String isExpensiveKey; // 是否涉及高消费招待(1是,0否) + @ApiModelProperty("是否涉及高消费招待(1是,0否)") + private String isExpensiveValue; // 是否涉及高消费招待(1是,0否) + + @ApiModelProperty("是否超事前审批额度(1是,0否)") + private String isBeyondQuotaKey; // 是否超事前审批额度(1是,0否) + @ApiModelProperty("是否超事前审批额度(1是,0否)") + private String isBeyondQuotaValue; // 是否超事前审批额度(1是,0否) + + @ApiModelProperty("费用明细") + private String feeBreakdown; // 费用明细 + @ApiModelProperty("报销金额") + private BigDecimal reimbursedAmount; // 报销金额 + @ApiModelProperty("现金、打卡或平借款") + private String reimbursedWay; // 现金、打卡或平借款 + @ApiModelProperty("打卡请输入(姓名、卡号、开户行)") + private String reimbursedInfo; // 打卡请输入(姓名、卡号、开户行) + + + + + + +} diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyDetailVo.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyDetailVo.java new file mode 100644 index 0000000000..63cd5f8698 --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyDetailVo.java @@ -0,0 +1,61 @@ +package com.yxt.anrui.oa.biz.adfeesreimbursableapply; + +import com.yxt.anrui.oa.biz.adfeesreimbursabledetails.AdFeesReimbursableListDetailsVo; +import com.yxt.anrui.oa.biz.oaform.OaFormCommonVo; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @description: + * @author: dimengzhe + * @date: 2025/1/21 + **/ +@Data +public class AdFeesReimbursableApplyDetailVo extends OaFormCommonVo { + + + + + + @ApiModelProperty("报销人") + private String reimbursement; // 报销人 + @ApiModelProperty("销售区域") + private String salesZone; // 销售区域 + @ApiModelProperty("报销人岗位") + private String post; // 报销人岗位 + + @ApiModelProperty("是否乘坐交通工具特殊坐席(1是,0否)") + private String isSpecialSeatValue; // 是否乘坐交通工具特殊坐席(1是,0否) + @ApiModelProperty("出差出发日期及具体时间") + private String departureTime; // 出差出发日期及具体时间 + @ApiModelProperty("出差返程到达日期及时间") + private String returnTime; // 出差返程到达日期及时间 + + + @ApiModelProperty("是否涉及高消费招待(1是,0否)") + private String isExpensiveValue; // 是否涉及高消费招待(1是,0否) + + + @ApiModelProperty("是否超事前审批额度(1是,0否)") + private String isBeyondQuotaValue; // 是否超事前审批额度(1是,0否) + + @ApiModelProperty("费用明细") + private String feeBreakdown; // 费用明细 + @ApiModelProperty("报销金额") + private String reimbursedAmount; // 报销金额 + @ApiModelProperty("现金、打卡或平借款") + private String reimbursedWay; // 现金、打卡或平借款 + @ApiModelProperty("打卡请输入(姓名、卡号、开户行)") + private String reimbursedInfo; // 打卡请输入(姓名、卡号、开户行) + @ApiModelProperty("图片") + private List files = new ArrayList<>(); + @ApiModelProperty("附件") + private List appes = new ArrayList<>(); + + + private List list = new ArrayList<>(); + +} diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyDto.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyDto.java new file mode 100644 index 0000000000..01bbfc38fc --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyDto.java @@ -0,0 +1,108 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.oa.biz.adfeesreimbursableapply; + + +import com.yxt.anrui.oa.biz.adfeesreimbursabledetails.AdFeesReimbursableDetailsDto; +import com.yxt.anrui.oa.biz.oaform.FormCommon; +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; + +/** + * Project: oa(驻外人员认定申请)
+ * File: AdExpatriatesApplyDto.java
+ * Class: com.yxt.anrui.oa.api.adexpatriatesapply.AdExpatriatesApplyDto
+ * Description: 驻外人员认定申请 数据传输对象.
+ * Copyright: Copyright (c) 2011
+ * Company: https://gitee.com/liuzp315
+ * Makedate: 2025-01-16 15:22:53
+ * + * @author liupopo + * @version 1.0 + * @since 1.0 + */ +@Data +@ApiModel(value = "行政类费用报销 数据传输对象", description = "行政类费用报销 数据传输对象") +public class AdFeesReimbursableApplyDto extends OaFormDto { + + + + + @ApiModelProperty("报销人sid") + private String reimbursementSid; // 报销人sid + @ApiModelProperty("报销人") + private String reimbursement; // 报销人 + @ApiModelProperty("销售区域") + private String salesZone; // 销售区域 + @ApiModelProperty("报销人岗位") + private String post; // 报销人岗位 + + private FormCommon isSpecialSeatObj; + @ApiModelProperty("是否乘坐交通工具特殊坐席(1是,0否)") + private String isSpecialSeatKey; // 是否乘坐交通工具特殊坐席(1是,0否) + @ApiModelProperty("是否乘坐交通工具特殊坐席(1是,0否)") + private String isSpecialSeatValue; // 是否乘坐交通工具特殊坐席(1是,0否) + + @ApiModelProperty("出差出发日期及具体时间") + private String departureTime; // 出差出发日期及具体时间 + @ApiModelProperty("出差返程到达日期及时间") + private String returnTime; // 出差返程到达日期及时间 + + private FormCommon isExpensiveObj; + @ApiModelProperty("是否涉及高消费招待(1是,0否)") + private String isExpensiveKey; // 是否涉及高消费招待(1是,0否) + @ApiModelProperty("是否涉及高消费招待(1是,0否)") + private String isExpensiveValue; // 是否涉及高消费招待(1是,0否) + + private FormCommon isBeyondQuotaObj; + @ApiModelProperty("是否超事前审批额度(1是,0否)") + private String isBeyondQuotaKey; // 是否超事前审批额度(1是,0否) + @ApiModelProperty("是否超事前审批额度(1是,0否)") + private String isBeyondQuotaValue; // 是否超事前审批额度(1是,0否) + + @ApiModelProperty("费用明细") + private String feeBreakdown; // 费用明细 + @ApiModelProperty("报销金额") + private String reimbursedAmount; // 报销金额 + @ApiModelProperty("现金、打卡或平借款") + private String reimbursedWay; // 现金、打卡或平借款 + @ApiModelProperty("打卡请输入(姓名、卡号、开户行)") + private String reimbursedInfo; // 打卡请输入(姓名、卡号、开户行) + + + @ApiModelProperty("图片") + private List files = new ArrayList<>(); + @ApiModelProperty("附件") + private List appes = new ArrayList<>(); + + private List list = new ArrayList<>(); + +} \ No newline at end of file diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyMapper.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyMapper.java new file mode 100644 index 0000000000..9019aa7daa --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyMapper.java @@ -0,0 +1,37 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.oa.biz.adfeesreimbursableapply; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface AdFeesReimbursableApplyMapper extends BaseMapper { + + int selectBySid(String join); + + AdFeesReimbursableApplyDetailVo details(String sid); +} \ No newline at end of file diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyMapper.xml b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyMapper.xml new file mode 100644 index 0000000000..deb0aefe0c --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyService.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyService.java new file mode 100644 index 0000000000..0960d39d3c --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyService.java @@ -0,0 +1,352 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.oa.biz.adfeesreimbursableapply; + +import cn.hutool.core.bean.BeanUtil; +import com.yxt.anrui.oa.biz.adfeesreimbursabledetails.AdFeesReimbursableDetailsDto; +import com.yxt.anrui.oa.biz.adfeesreimbursabledetails.AdFeesReimbursableDetailsService; +import com.yxt.anrui.oa.biz.adfeesreimbursabledetails.AdFeesReimbursableDetailsVo; +import com.yxt.anrui.oa.biz.adfeesreimbursabledetails.AdFeesReimbursableListDetailsVo; +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.anrui.oa.feign.sysuser.SysUserFeign; +import com.yxt.anrui.oa.feign.sysuser.SysUserVo; +import com.yxt.common.base.service.MybatisBaseService; +import com.yxt.common.core.result.ResultBean; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service +public class AdFeesReimbursableApplyService extends MybatisBaseService { + + @Autowired + private OaAppendixService oaAppendixService; + @Autowired + private OaFormService oaFormService; + @Autowired + private AdFeesReimbursableDetailsService adFeesReimbursableDetailsService; + @Autowired + private SysOrganizationFeign sysOrganizationFeign; + @Autowired + private SysUserFeign sysUserFeign; + + public ResultBean getSaveInit(String userSid, String orgPath) { + ResultBean rb = ResultBean.fireFail(); + AdFeesReimbursableApplyVo applyVo = new AdFeesReimbursableApplyVo(); + applyVo.setCreateBySid(userSid); + applyVo.setOrgSidPath(orgPath); + applyVo.setReimbursementSid(userSid); + SysUserVo userVo = sysUserFeign.fetchBySid(userSid).getData(); + if (null != userVo) { + applyVo.setReimbursement(userVo.getName()); + } + return rb.success().setData(applyVo); + } + + public ResultBean getUpdateInit(String sid) { + ResultBean rb = ResultBean.fireFail(); + AdFeesReimbursableApplyVo applyVo = new AdFeesReimbursableApplyVo(); + AdFeesReimbursableApply apply = fetchBySid(sid); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + if (apply == null) { + return rb.setMsg("该申请不存在"); + } + OaForm oaForm = oaFormService.fetchBySid(sid); + applyVo.setTaskId(oaForm.getTaskId()); + applyVo.setProcInsId(oaForm.getProcInstId()); + //根据部门sid获取orgPath并赋值 + SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(oaForm.getDeptSid()).getData(); + String orgSidPath = organizationVo.getOrgSidPath(); + applyVo.setOrgSidPath(orgSidPath); + applyVo.setCreateBySid(oaForm.getCreateBySid()); + BeanUtil.copyProperties(apply, applyVo); + if (null != apply.getDepartureTime()) { + applyVo.setDepartureTime(sdf.format(apply.getDepartureTime())); + } + if (null != apply.getReturnTime()) { + applyVo.setReturnTime(sdf.format(apply.getReturnTime())); + } + FormCommon obj1 = FormCommon.of(apply.getIsSpecialSeatKey(), apply.getIsSpecialSeatValue()); + applyVo.setIsSpecialSeatObj(obj1); + FormCommon obj2 = FormCommon.of(apply.getIsExpensiveKey(), apply.getIsExpensiveValue()); + applyVo.setIsExpensiveObj(obj2); + FormCommon obj3 = FormCommon.of(apply.getIsBeyondQuotaKey(), apply.getIsBeyondQuotaValue()); + applyVo.setIsBeyondQuotaObj(obj3); + List list = adFeesReimbursableDetailsService.getUpdateInit(sid); + list.removeAll(Collections.singleton(null)); + if (!list.isEmpty()) { + list.stream().forEach(details -> { + FormCommon objv1 = FormCommon.of(details.getBelongsDeptSid(), details.getBelongsDept()); + details.setBelongsDeptObj(objv1); + FormCommon objv2 = FormCommon.of(details.getFeesTypeKey(), details.getFeesTypeValue()); + details.setFeesTypeObj(objv2); + List appes = oaAppendixService.selectByLinkSid(details.getSid(), "文件"); + applyVo.setAppes(appes); + }); + } + List files = oaAppendixService.selectByLinkSid(sid, "图片"); + applyVo.setFiles(files); + List appes = oaAppendixService.selectByLinkSid(sid, "文件"); + applyVo.setAppes(appes); + applyVo.setList(list); + applyVo.setSid(sid); + return rb.success().setData(applyVo); + } + + public ResultBean saveOrUpdateDto(AdFeesReimbursableApplyDto dto) { + ResultBean rb = ResultBean.fireFail(); + String sid = dto.getSid(); + if (StringUtils.isBlank(sid)) { + // 新建操作 + AdFeesReimbursableApply entity = new AdFeesReimbursableApply(); + BeanUtil.copyProperties(dto, entity, "sid"); + dto.setBillNo("XZLFYBXSQ"); + dto.setSid(entity.getSid()); + ResultBean resultBean = oaFormService.saveOaForm(dto); + if (!resultBean.getSuccess()) { + return rb; + } + entity.setFormSid(resultBean.getData()); + baseMapper.insert(entity); + sid = entity.getSid(); + } else { + // 更新操作 + AdFeesReimbursableApply entity = fetchBySid(sid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + } + List list = dto.getList(); + if (!list.isEmpty()) { + adFeesReimbursableDetailsService.saveDetails(list, sid); + } + List files = dto.getFiles(); + List appes = dto.getAppes(); + // 处理附件 + saveFiles(sid, files, OaFileEnum.ADALLOCATEASSETAPPLY.getAttachType(), "图片"); + saveFiles(sid, appes, OaFileEnum.ADALLOCATEASSETAPPLY.getAttachType(), "文件"); + return rb.success().setData(sid); + } + + // 保存文件 + private void saveFiles(String sid, List files, String attachType, String fileType) { + files.removeAll(Collections.singleton(null)); + oaAppendixService.saveFile(sid, files, attachType, fileType); + } + + public ResultBean delAll(String[] sids) { + ResultBean rb = ResultBean.fireFail(); + //查询该sid中是否有流程不是待提交的 + int count = baseMapper.selectBySid(StringUtils.join(sids, ",")); + if (count > 0) { + return rb.setMsg("删除的数据中包含已提交或已办结审批的数据,删除失败"); + } + delBySids(sids); + return rb.success(); + } + + public ResultBean details(String sid, String application) { + ResultBean rb = ResultBean.fireFail(); + AdFeesReimbursableApplyDetailVo applyDetailVo = baseMapper.details(sid); + if (applyDetailVo == null) { + return rb.setMsg("该申请不存在"); + } + List files = oaAppendixService.selectByLinkSid(sid, "图片"); + List appes = oaAppendixService.selectByLinkSid(sid, "文件"); + applyDetailVo.setFiles(files); + applyDetailVo.setAppes(appes); + List list = applyDetailVo.getList(); + if (!list.isEmpty()) { + for (AdFeesReimbursableListDetailsVo l : list) { + List listAppes = oaAppendixService.selectByLinkSid(l.getSid(), "文件"); + l.setAppesList(listAppes); + } + } + //基础字段赋值 + BeanUtil.copyProperties(oaFormService.getDetails(sid), applyDetailVo); + return rb.success().setData(applyDetailVo); + } + + /** + * 提交 + * + * @param dto + * @return + */ + public ResultBean submit(AdFeesReimbursableApplyDto dto) { + ResultBean rb = ResultBean.fireFail(); + ResultBean 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 formVariables = new HashMap<>(); + 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 complete(CompleteDto dto) { + Map formVariables = dto.getFormVariables(); + formVariables = getMap(formVariables, dto.getBusinessSid()); + dto.setFormVariables(formVariables); + BusinessVariablesDto businessVariablesDto = new BusinessVariablesDto(); + BeanUtil.copyProperties(dto, businessVariablesDto); + return oaFormService.complete(businessVariablesDto); + } + + /** + * 驳回 + * + * @param dto + * @return + */ + public ResultBean reject(TaskDto dto) { + Map formVariables = dto.getFormVariables(); + formVariables = getMap(formVariables, dto.getBusinessSid()); + dto.setFormVariables(formVariables); + return oaFormService.reject(dto); + } + + public ResultBean getFlowOperateTitle(NodeQuery query) { + // 默认失败返回 + ResultBean rb = ResultBean.fireFail(); + + // 获取next值和formVariables + int next = query.getNext(); + + // 获取并更新formVariables + Map formVariables = getMap(query.getFormVariables(), query.getBusinessSid()); + query.setFormVariables(formVariables); + + // 校验next参数是否有效(只允许0或1) + if (next != 0 && next != 1) { + return rb.setMsg("参数错误:next"); // 如果next不是0或1,返回错误信息 + } + + // 获取节点名称 + String data = getNodeName(query, next); + + // 如果data为null,表示未获取到有效的节点信息 + if (data == null) { + return rb.setMsg("没有获取到节点信息"); // 返回错误消息 + } + + // 返回成功的结果和获取到的节点名称 + return rb.success().setData(data); + } + + /** + * 网关参数组成 + * + * @param formVariables + * @param sid + * @return + */ + public Map getMap(Map formVariables, String sid) { + Map 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=" + sid); + appMap.put(OaFormUrlEnum.HRHIREAPPLY_DETAIL.getType(), OaFormUrlEnum.HRHIREAPPLY_DETAIL.getUrl() + "?sid=" + 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); + AdFeesReimbursableApply adExpatriatesApply = fetchBySid(sid); + SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(oaForm.getUseOrgSid()).getData(); + //是否是分公司 + formVariables.put("isTrue", sysOrganization.getIsDept() == 0); + return formVariables; + } + + /** + * 根据next的值获取前一个节点或下一个节点的名称。 + * + * @param query 包含查询所需参数的NodeQuery对象 + * @param next 参数,0表示上一环节,1表示下一环节 + * @return 节点名称,如果失败则返回null + */ + private String getNodeName(NodeQuery query, int next) { + // 根据next值选择相应的服务方法获取节点信息 + ResultBean> resultBean = (next == 0) + ? oaFormService.getPreviousNodesForReject(query) // 获取上一环节的节点 + : oaFormService.getNextNodesForSubmit(query); // 获取下一环节的节点 + // 如果服务调用成功 + if (resultBean.getSuccess()) { + // 清除结果列表中的null值,避免空节点 + resultBean.getData().removeAll(Collections.singleton(null)); + // 如果结果列表非空,返回第一个节点的名称 + if (!resultBean.getData().isEmpty()) { + return resultBean.getData().get(0).getName(); + } + } else { + // 如果服务调用失败,返回null + return null; + } + // 如果结果为空,返回null + return null; + } +} \ No newline at end of file diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyVo.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyVo.java new file mode 100644 index 0000000000..0968b819c6 --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursableapply/AdFeesReimbursableApplyVo.java @@ -0,0 +1,98 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.oa.biz.adfeesreimbursableapply; + +import com.yxt.anrui.oa.biz.adfeesreimbursabledetails.AdFeesReimbursableDetailsVo; +import com.yxt.anrui.oa.biz.oaform.FormCommon; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class AdFeesReimbursableApplyVo { + + private String sid; + /* private String userSid; + private String orgPath;*/ + private String orgSidPath; + private String createBySid; + + @ApiModelProperty("报销人sid") + private String reimbursementSid; // 报销人sid + @ApiModelProperty("报销人") + private String reimbursement; // 报销人 + @ApiModelProperty("销售区域") + private String salesZone; // 销售区域 + @ApiModelProperty("报销人岗位") + private String post; // 报销人岗位 + + private FormCommon isSpecialSeatObj; + @ApiModelProperty("是否乘坐交通工具特殊坐席(1是,0否)") + private String isSpecialSeatKey; // 是否乘坐交通工具特殊坐席(1是,0否) + @ApiModelProperty("是否乘坐交通工具特殊坐席(1是,0否)") + private String isSpecialSeatValue; // 是否乘坐交通工具特殊坐席(1是,0否) + + @ApiModelProperty("出差出发日期及具体时间") + private String departureTime; // 出差出发日期及具体时间 + @ApiModelProperty("出差返程到达日期及时间") + private String returnTime; // 出差返程到达日期及时间 + + private FormCommon isExpensiveObj; + @ApiModelProperty("是否涉及高消费招待(1是,0否)") + private String isExpensiveKey; // 是否涉及高消费招待(1是,0否) + @ApiModelProperty("是否涉及高消费招待(1是,0否)") + private String isExpensiveValue; // 是否涉及高消费招待(1是,0否) + + private FormCommon isBeyondQuotaObj; + @ApiModelProperty("是否超事前审批额度(1是,0否)") + private String isBeyondQuotaKey; // 是否超事前审批额度(1是,0否) + @ApiModelProperty("是否超事前审批额度(1是,0否)") + private String isBeyondQuotaValue; // 是否超事前审批额度(1是,0否) + + @ApiModelProperty("费用明细") + private String feeBreakdown; // 费用明细 + @ApiModelProperty("报销金额") + private String reimbursedAmount; // 报销金额 + @ApiModelProperty("现金、打卡或平借款") + private String reimbursedWay; // 现金、打卡或平借款 + @ApiModelProperty("打卡请输入(姓名、卡号、开户行)") + private String reimbursedInfo; // 打卡请输入(姓名、卡号、开户行) + + + @ApiModelProperty("图片") + private List files = new ArrayList<>(); + @ApiModelProperty("附件") + private List appes = new ArrayList<>(); + + private List list = new ArrayList<>(); + + private String taskId; + @ApiModelProperty("流程实例id") + private String procInsId; + +} diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetails.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetails.java new file mode 100644 index 0000000000..9bb884c019 --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetails.java @@ -0,0 +1,57 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.oa.biz.adfeesreimbursabledetails; + +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; + +import java.math.BigDecimal; + +@Data +@ApiModel(value = "行政类费用报销列表", description = "行政类费用报销") +@TableName("ad_fees_reimbursable_details") +public class AdFeesReimbursableDetails extends BaseEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("申请sid") + private String mainSid; // 申请sid + @ApiModelProperty("所属部门") + private String belongsDeptSid; // 所属部门 + @ApiModelProperty("所属部门") + private String belongsDept; // 所属部门 + + @ApiModelProperty("费用类别") + private String feesTypeKey; // 费用类别 + @ApiModelProperty("费用类别") + private String feesTypeValue; // 费用类别 + + @ApiModelProperty("金额") + private BigDecimal amount; // 金额 + +} diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsDto.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsDto.java new file mode 100644 index 0000000000..d66d43eef9 --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsDto.java @@ -0,0 +1,62 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.oa.biz.adfeesreimbursabledetails; + + +import com.yxt.anrui.oa.biz.oaform.FormCommon; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + + +@Data +@ApiModel(value = "行政类费用报销列表 视图数据对象", description = "行政类费用报销列表 视图数据对象") +public class AdFeesReimbursableDetailsDto { + + private FormCommon belongsDeptObj; + @ApiModelProperty("所属部门") + private String belongsDeptSid; // 所属部门 + @ApiModelProperty("所属部门") + private String belongsDept; // 所属部门 + + private FormCommon feesTypeObj; + @ApiModelProperty("费用类别") + private String feesTypeKey; // 费用类别 + @ApiModelProperty("费用类别") + private String feesTypeValue; // 费用类别 + + @ApiModelProperty("金额") + private String amount; // 金额 + private String remarks; // 备注 + @ApiModelProperty("附件") + private List appesList = new ArrayList<>(); + + + +} diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsMapper.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsMapper.java new file mode 100644 index 0000000000..a51bd0c171 --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsMapper.java @@ -0,0 +1,42 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.oa.biz.adfeesreimbursabledetails; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +@Mapper +public interface AdFeesReimbursableDetailsMapper extends BaseMapper { + + @Select("select * from ad_fees_reimbursable_details where mainSid = #{mainSid}") + List selectByMainSid(String mainSid); + + @Select("select * from ad_fees_reimbursable_details where mainSid = #{mainSid}") + List getUpdateInit(String mainSid); +} \ No newline at end of file diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsMapper.xml b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsMapper.xml new file mode 100644 index 0000000000..4e432864f2 --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsService.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsService.java new file mode 100644 index 0000000000..b23c136c27 --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsService.java @@ -0,0 +1,78 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.oa.biz.adfeesreimbursabledetails; + +import cn.hutool.core.bean.BeanUtil; +import com.yxt.anrui.oa.biz.oaappendix.OaAppendixService; +import com.yxt.anrui.oa.feign.file.OaFileEnum; +import com.yxt.common.base.service.MybatisBaseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Collections; +import java.util.List; + +@Service +public class AdFeesReimbursableDetailsService extends MybatisBaseService { + + @Autowired + private OaAppendixService oaAppendixService; + + public void saveDetails(List list, String sid) { + //根据sid查询明细并删除 + List list2 = baseMapper.selectByMainSid(sid); + list2.removeAll(Collections.singleton(null)); + if (!list2.isEmpty()) { + list2.stream().forEach(v -> { + deleteBySid(v.getSid()); + oaAppendixService.deleteByLinkSid(v.getSid(),"文件"); + }); + } + list.removeAll(Collections.singleton(null)); + if (!list.isEmpty()) { + list.stream().forEach(details -> { + AdFeesReimbursableDetails entity = new AdFeesReimbursableDetails(); + BeanUtil.copyProperties(details, entity); + entity.setMainSid(sid); + baseMapper.insert(entity); + List appes = details.getAppesList(); + if (!appes.isEmpty()) { + saveFiles(entity.getSid(), appes, OaFileEnum.ADFEESREIMBURSABLEAPPLY.getAttachType(), "文件"); + } + }); + } + } + + public List getUpdateInit(String mainSid) { + return baseMapper.getUpdateInit(mainSid); + } + + // 保存文件 + private void saveFiles(String sid, List files, String attachType, String fileType) { + files.removeAll(Collections.singleton(null)); + oaAppendixService.saveFile(sid, files, attachType, fileType); + } +} \ No newline at end of file diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsVo.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsVo.java new file mode 100644 index 0000000000..5d7e209425 --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableDetailsVo.java @@ -0,0 +1,33 @@ +package com.yxt.anrui.oa.biz.adfeesreimbursabledetails; + +import com.yxt.anrui.oa.biz.oaform.FormCommon; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class AdFeesReimbursableDetailsVo { + + private String sid; + + private FormCommon belongsDeptObj; + @ApiModelProperty("所属部门") + private String belongsDeptSid; // 所属部门 + @ApiModelProperty("所属部门") + private String belongsDept; // 所属部门 + + private FormCommon feesTypeObj; + @ApiModelProperty("费用类别") + private String feesTypeKey; // 费用类别 + @ApiModelProperty("费用类别") + private String feesTypeValue; // 费用类别 + + @ApiModelProperty("金额") + private String amount; // 金额 + @ApiModelProperty("附件") + private List appesList = new ArrayList<>(); + private String remarks; // 备注 + +} diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableListDetailsVo.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableListDetailsVo.java new file mode 100644 index 0000000000..2e2d3c3646 --- /dev/null +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/adfeesreimbursabledetails/AdFeesReimbursableListDetailsVo.java @@ -0,0 +1,57 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.oa.biz.adfeesreimbursabledetails; + + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + + +@Data +@ApiModel(value = "行政类费用报销列表 视图数据对象", description = "行政类费用报销列表 视图数据对象") +public class AdFeesReimbursableListDetailsVo implements Vo { + + private String sid; + + + + + @ApiModelProperty("所属部门") + private String belongsDept; // 所属部门 + @ApiModelProperty("费用类别") + private String feesTypeValue; // 费用类别 + @ApiModelProperty("金额") + private String amount; // 金额 + @ApiModelProperty("附件") + private List appesList = new ArrayList<>(); + private String remarks; // 备注 + +} diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/oaappendix/OaAppendixService.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/oaappendix/OaAppendixService.java index bc9193834a..bafbcb2e26 100644 --- a/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/oaappendix/OaAppendixService.java +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/biz/oaappendix/OaAppendixService.java @@ -43,8 +43,8 @@ public class OaAppendixService extends MybatisBaseService oaAppendixList,String fileType) { - baseMapper.deleteByLinkSid(sid,fileType); + public void saveOrUpdateFile(String sid, List oaAppendixList, String fileType) { + baseMapper.deleteByLinkSid(sid, fileType); if (!oaAppendixList.isEmpty()) { oaAppendixList.forEach(v -> { baseMapper.insert(v); @@ -52,6 +52,10 @@ public class OaAppendixService extends MybatisBaseService files, String attachType, String fileType) { List oaAppendixList = new ArrayList<>(); if (!files.isEmpty()) { @@ -78,7 +82,7 @@ public class OaAppendixService extends MybatisBaseService selectByLinkSid(String sid) { diff --git a/yxt-oa/src/main/java/com/yxt/anrui/oa/feign/file/OaFileEnum.java b/yxt-oa/src/main/java/com/yxt/anrui/oa/feign/file/OaFileEnum.java index d8de751667..d45957e759 100644 --- a/yxt-oa/src/main/java/com/yxt/anrui/oa/feign/file/OaFileEnum.java +++ b/yxt-oa/src/main/java/com/yxt/anrui/oa/feign/file/OaFileEnum.java @@ -26,6 +26,7 @@ public enum OaFileEnum { ADFETEAPPLY("017", "商务宴请事前附件"), ADTEAMAPPLY("018", "团建附件"), ADSEATAPPLY("019", "乘坐交通工具特殊坐席附件"), + ADFEESREIMBURSABLEAPPLY("020", "行政类费用报销附件"), ;