Compare commits
No commits in common. "99b5ff9efc63ee8b89bf74857a92635b6b62d3e8" and "8097eb2ea9f4428f31dce302b2e524dd168214f1" have entirely different histories.
99b5ff9efc
...
8097eb2ea9
@ -60,7 +60,6 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode OA_REFUND_NOT_EXISTS = new ErrorCode(1_009_001_123, "退款申请不存在");
|
ErrorCode OA_REFUND_NOT_EXISTS = new ErrorCode(1_009_001_123, "退款申请不存在");
|
||||||
ErrorCode OA_PROJECT_NOT_EXISTS = new ErrorCode(1_009_001_124, "项目申请不存在");
|
ErrorCode OA_PROJECT_NOT_EXISTS = new ErrorCode(1_009_001_124, "项目申请不存在");
|
||||||
ErrorCode OA_CONTRACT_INVOICE_AMOUNT_LACK = new ErrorCode(1_009_001_125, "该合同的开票余额不足!");
|
ErrorCode OA_CONTRACT_INVOICE_AMOUNT_LACK = new ErrorCode(1_009_001_125, "该合同的开票余额不足!");
|
||||||
ErrorCode OA_PAYMENT_NOT_EXISTS = new ErrorCode(1_009_001_126, "付款申请不存在");
|
|
||||||
|
|
||||||
// ========== 流程模型 1-009-002-000 ==========
|
// ========== 流程模型 1-009-002-000 ==========
|
||||||
ErrorCode MODEL_KEY_EXISTS = new ErrorCode(1_009_002_000, "已经存在流程标识为【{}】的流程");
|
ErrorCode MODEL_KEY_EXISTS = new ErrorCode(1_009_002_000, "已经存在流程标识为【{}】的流程");
|
||||||
|
@ -1,143 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentCreateReqVO;
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentRespVO;
|
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAPaymentDO;
|
|
||||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAPaymentService;
|
|
||||||
import cn.iocoder.yudao.module.system.api.bank.BankApi;
|
|
||||||
import cn.iocoder.yudao.module.system.api.bank.dto.BankRespDTO;
|
|
||||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
|
||||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
|
||||||
import cn.iocoder.yudao.module.system.api.project.ProjectApi;
|
|
||||||
import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OA 付款申请 Controller
|
|
||||||
*
|
|
||||||
* @author 符溶馨
|
|
||||||
|
|
||||||
*/
|
|
||||||
@Tag(name = "管理后台 - OA 付款申请")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/bpm/oa/payment")
|
|
||||||
@Validated
|
|
||||||
public class BpmOAPaymentController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private BpmOAPaymentService paymentService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ProjectApi projectApi;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private DeptApi deptApi;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private BankApi bankApi;
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建付款申请")
|
|
||||||
public CommonResult<Long> createPayment(@Valid @RequestBody BpmOAPaymentCreateReqVO createReqVO) {
|
|
||||||
|
|
||||||
return success(paymentService.createPayment(getLoginUserId(), createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获得付款申请")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
public CommonResult<BpmOAPaymentRespVO> getPayment(@RequestParam("id") Long id) {
|
|
||||||
|
|
||||||
BpmOAPaymentDO payment = paymentService.getPayment(id);
|
|
||||||
BpmOAPaymentRespVO respVO = BeanUtils.toBean(payment, BpmOAPaymentRespVO.class);
|
|
||||||
if (respVO != null) {
|
|
||||||
// 获取部门信息Map
|
|
||||||
List<Long> deptIds = Arrays.asList(payment.getDeptId(), payment.getPaymentCompany());
|
|
||||||
Map<Long, DeptRespDTO> dtoMap = deptApi.getDeptMap(new HashSet<>(deptIds));
|
|
||||||
|
|
||||||
// 设置部门名称
|
|
||||||
respVO.setDeptName(dtoMap.get(payment.getDeptId()).getName());
|
|
||||||
// 设置付款公司名称
|
|
||||||
respVO.setPaymentCompanyName(dtoMap.get(payment.getPaymentCompany()).getName());
|
|
||||||
|
|
||||||
if (payment.getProjectNo() != null) {
|
|
||||||
// 获取项目信息
|
|
||||||
ProjectDTO project = projectApi.getProject(payment.getProjectNo()).getCheckedData();
|
|
||||||
// 设置项目名称
|
|
||||||
respVO.setProjectName(project.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (payment.getBankId() != null) {
|
|
||||||
// 获取银行卡信息
|
|
||||||
BankRespDTO bankResp = bankApi.getBank(payment.getBankId()).getCheckedData();
|
|
||||||
// 设置银行卡信息
|
|
||||||
respVO.setBankName(bankResp.getBankName());
|
|
||||||
respVO.setBankNo(bankResp.getBankNo());
|
|
||||||
respVO.setNickname(bankResp.getNickname());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return success(respVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/getByProcessInstanceId")
|
|
||||||
@Operation(summary = "获得付款申请")
|
|
||||||
@Parameter(name = "BpmOAPaymentRespVO", description = "流程实例编号", required = true, example = "1024")
|
|
||||||
public CommonResult<BpmOAPaymentRespVO> getByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {
|
|
||||||
|
|
||||||
BpmOAPaymentDO payment = paymentService.getByProcessInstanceId(processInstanceId);
|
|
||||||
BpmOAPaymentRespVO respVO = BeanUtils.toBean(payment, BpmOAPaymentRespVO.class);
|
|
||||||
if (respVO != null) {
|
|
||||||
// 获取部门信息Map
|
|
||||||
List<Long> deptIds = Arrays.asList(payment.getDeptId(), payment.getPaymentCompany());
|
|
||||||
Map<Long, DeptRespDTO> dtoMap = deptApi.getDeptMap(new HashSet<>(deptIds));
|
|
||||||
|
|
||||||
// 设置部门名称
|
|
||||||
respVO.setDeptName(dtoMap.get(payment.getDeptId()).getName());
|
|
||||||
// 设置付款公司名称
|
|
||||||
respVO.setPaymentCompanyName(dtoMap.get(payment.getPaymentCompany()).getName());
|
|
||||||
|
|
||||||
if (payment.getProjectNo() != null) {
|
|
||||||
// 获取项目信息
|
|
||||||
ProjectDTO project = projectApi.getProject(payment.getProjectNo()).getCheckedData();
|
|
||||||
// 设置项目名称
|
|
||||||
respVO.setProjectName(project.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (payment.getBankId() != null) {
|
|
||||||
// 获取银行卡信息
|
|
||||||
BankRespDTO bankResp = bankApi.getBank(payment.getBankId()).getCheckedData();
|
|
||||||
// 设置银行卡信息
|
|
||||||
respVO.setBankName(bankResp.getBankName());
|
|
||||||
respVO.setBankNo(bankResp.getBankNo());
|
|
||||||
respVO.setNickname(bankResp.getNickname());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return success(respVO);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get-list")
|
|
||||||
@Operation(summary = "获得指定条件的付款申请")
|
|
||||||
@Parameter(name = "type", description = "付款类型", required = true, example = "1")
|
|
||||||
public CommonResult<List<BpmOAPaymentRespVO>> getPayment(@RequestParam("type") Integer type) {
|
|
||||||
|
|
||||||
return success(paymentService.getPaymentList(type));
|
|
||||||
}
|
|
||||||
}
|
|
@ -78,8 +78,8 @@ public class BpmOAProcurePayController {
|
|||||||
|
|
||||||
@GetMapping("/getAvailablePurchaseOrders")
|
@GetMapping("/getAvailablePurchaseOrders")
|
||||||
@Operation(summary = "获取可用采购单列表")
|
@Operation(summary = "获取可用采购单列表")
|
||||||
public CommonResult<List<BpmOAProcureRespVO>> getAvailablePurchaseOrders(@RequestParam(name = "type", required = false) Integer type) {
|
public CommonResult<List<BpmOAProcureRespVO>> getAvailablePurchaseOrders() {
|
||||||
List<BpmOAProcureDO> list = oAProcurePayService.getAvailablePurchaseOrders(type);
|
List<BpmOAProcureDO> list = oAProcurePayService.getAvailablePurchaseOrders();
|
||||||
return success(BeanUtils.toBean(list, BpmOAProcureRespVO.class));
|
return success(BeanUtils.toBean(list, BpmOAProcureRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,68 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 付款申请 创建 Request VO
|
|
||||||
*
|
|
||||||
* @author 符溶馨
|
|
||||||
*/
|
|
||||||
@Schema(description = "管理后台 - 付款申请创建 Request VO")
|
|
||||||
@Data
|
|
||||||
public class BpmOAPaymentCreateReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "申请事由", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "申请事由不能为空")
|
|
||||||
private String reason;
|
|
||||||
|
|
||||||
@Schema(description = "付款类型 | 字典值参考 bpm_oa_payment_type", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "付款类型不能为空")
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "费用产生部门编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
||||||
private Long deptId;
|
|
||||||
|
|
||||||
@Schema(description = "项目编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
||||||
private String projectNo;
|
|
||||||
|
|
||||||
@Schema(description = "采购单编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
||||||
private Long procureId;
|
|
||||||
|
|
||||||
@Schema(description = "银行编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
||||||
private Long bankId;
|
|
||||||
|
|
||||||
@Schema(description = "付款方式 | 1预付款 2分期付款 3全额付款", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
||||||
private Integer paymentMethod;
|
|
||||||
|
|
||||||
@Schema(description = "付款总额 | 针对预付款、分期付款情况", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
||||||
private BigDecimal totalAmount;
|
|
||||||
|
|
||||||
@Schema(description = "付款比例 | 针对分期付款情况", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
||||||
private Integer paymentRatio;
|
|
||||||
|
|
||||||
@Schema(description = "付款金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "付款金额不能为空")
|
|
||||||
private BigDecimal amount;
|
|
||||||
|
|
||||||
@Schema(description = "付款公司编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "付款公司编号不能为空")
|
|
||||||
private Long paymentCompany;
|
|
||||||
|
|
||||||
@Schema(description = "父级审批编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
||||||
private Long parentId;
|
|
||||||
|
|
||||||
@Schema(description = "流程实例编号")
|
|
||||||
private String processInstanceId;
|
|
||||||
|
|
||||||
@Schema(description = "状态-参见 bpm_process_instance_result 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Integer result;
|
|
||||||
|
|
||||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private List<UploadUserFile> fileItems;
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author 符溶馨
|
|
||||||
*/
|
|
||||||
@Schema(description = "管理后台 - 付款申请 请求Request VO")
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ToString(callSuper = true)
|
|
||||||
public class BpmOAPaymentRespVO extends BpmOABaseRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "申请事由")
|
|
||||||
private String reason;
|
|
||||||
|
|
||||||
@Schema(description = "付款类型 | 字典值参考 bpm_oa_payment_type")
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "费用产生部门编号")
|
|
||||||
private Long deptId;
|
|
||||||
|
|
||||||
@Schema(description = "费用产生部门名称")
|
|
||||||
private String deptName;
|
|
||||||
|
|
||||||
@Schema(description = "项目编号")
|
|
||||||
private String projectNo;
|
|
||||||
|
|
||||||
@Schema(description = "采购单编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
|
||||||
private Long procureId;
|
|
||||||
|
|
||||||
@Schema(description = "项目名称")
|
|
||||||
private String projectName;
|
|
||||||
|
|
||||||
@Schema(description = "银行编号")
|
|
||||||
private Long bankId;
|
|
||||||
|
|
||||||
@Schema(description = "付款人昵称")
|
|
||||||
private String nickname;
|
|
||||||
|
|
||||||
@Schema(description = "银行名称")
|
|
||||||
private String bankName;
|
|
||||||
|
|
||||||
@Schema(description = "银行账号")
|
|
||||||
private String bankNo;
|
|
||||||
|
|
||||||
@Schema(description = "付款方式 | 1预付款 2分期付款 3全额付款")
|
|
||||||
private Integer paymentMethod;
|
|
||||||
|
|
||||||
@Schema(description = "付款总额 | 针对预付款、分期付款情况")
|
|
||||||
private BigDecimal totalAmount;
|
|
||||||
|
|
||||||
@Schema(description = "付款比例 | 针对分期付款情况")
|
|
||||||
private Integer paymentRatio;
|
|
||||||
|
|
||||||
@Schema(description = "付款金额")
|
|
||||||
private BigDecimal amount;
|
|
||||||
|
|
||||||
@Schema(description = "付款公司编号")
|
|
||||||
private Long paymentCompany;
|
|
||||||
|
|
||||||
@Schema(description = "付款公司名称")
|
|
||||||
private String paymentCompanyName;
|
|
||||||
|
|
||||||
@Schema(description = "父级审批编号")
|
|
||||||
private Long parentId;
|
|
||||||
|
|
||||||
@Schema(description = "累计付款比列")
|
|
||||||
private Integer ratio;
|
|
||||||
|
|
||||||
@Schema(description = "上传文件")
|
|
||||||
private List<UploadUserFile> fileItems;
|
|
||||||
}
|
|
@ -1,121 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
|
||||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
|
||||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
|
||||||
import lombok.*;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 付款申请 DO
|
|
||||||
*
|
|
||||||
* @author 艾楷
|
|
||||||
*/
|
|
||||||
@TableName("bpm_oa_payment")
|
|
||||||
@KeySequence("bpm_oa_payment") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ToString(callSuper = true)
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class BpmOAPaymentDO extends BaseDO {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 付款申请表单主键
|
|
||||||
*/
|
|
||||||
@TableId
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请人的用户编号
|
|
||||||
* 关联 AdminUserDO 的 id 属性
|
|
||||||
*/
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 申请事由
|
|
||||||
*/
|
|
||||||
private String reason;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 付款类型 | 字典值参考 bpm_oa_payment_type
|
|
||||||
*/
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 费用产生部门编号
|
|
||||||
*/
|
|
||||||
private Long deptId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目编号
|
|
||||||
*/
|
|
||||||
private String projectNo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 采购计划编号
|
|
||||||
*/
|
|
||||||
private Long procureId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 银行编号
|
|
||||||
*/
|
|
||||||
private Long bankId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 付款方式 | 1预付款 2分期付款 3全额付款
|
|
||||||
*/
|
|
||||||
private Integer paymentMethod;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 付款总额 | 针对预付款、分期付款情况
|
|
||||||
*/
|
|
||||||
private BigDecimal totalAmount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 付款比例 | 百分比数字
|
|
||||||
*/
|
|
||||||
private Integer paymentRatio;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 付款金额
|
|
||||||
*/
|
|
||||||
private BigDecimal amount;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 付款公司
|
|
||||||
*/
|
|
||||||
private Long paymentCompany;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父级审批
|
|
||||||
*/
|
|
||||||
private Long parentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 出差的结果
|
|
||||||
* 枚举 {@link BpmProcessInstanceResultEnum}
|
|
||||||
* 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈
|
|
||||||
*/
|
|
||||||
private Integer result;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对应的流程编号
|
|
||||||
* 关联 ProcessInstance 的 id 属性
|
|
||||||
*/
|
|
||||||
private String processInstanceId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 附件基本信息
|
|
||||||
*/
|
|
||||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
|
||||||
private List<UploadUserFile> fileItems ;
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentRespVO;
|
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAPaymentDO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface BpmOAPaymentMapper extends BaseMapperX<BpmOAPaymentDO> {
|
|
||||||
|
|
||||||
List<BpmOAPaymentRespVO> selectPaymentList(@Param("type") Integer type);
|
|
||||||
}
|
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
|||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure.BpmOAProcurePageReqVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure.BpmOAProcurePageReqVO;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
@ -33,6 +34,5 @@ public interface BpmOAProcureMapper extends BaseMapperX<BpmOAProcureDO> {
|
|||||||
.orderByDesc(BpmOAProcureDO::getId));
|
.orderByDesc(BpmOAProcureDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<BpmOAProcureDO> selectListByDeptId(@Param("companyDeptId") Long companyDeptId,
|
List<BpmOAProcureDO> selectListByDeptId(@Param("companyDeptId") Long companyDeptId);
|
||||||
@Param("type") Integer type);
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,9 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
@ -89,9 +91,7 @@ public class BpmOAEvectionServiceImpl extends BpmOABaseService implements BpmOAE
|
|||||||
// 发起出差申请后,判断是否是当天的出差
|
// 发起出差申请后,判断是否是当天的出差
|
||||||
if (evection.getStartTime().toLocalDate().isEqual(LocalDate.now())) {
|
if (evection.getStartTime().toLocalDate().isEqual(LocalDate.now())) {
|
||||||
// 设置外勤打卡权限
|
// 设置外勤打卡权限
|
||||||
Set<Long> userIds = evection.getTogetherUserIds();
|
userApi.updateFieldworkType(getLoginUserId(), 1);
|
||||||
userIds.add(userId);
|
|
||||||
userApi.updateFieldworkType(userIds, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return evection.getId();
|
return evection.getId();
|
||||||
@ -100,7 +100,7 @@ public class BpmOAEvectionServiceImpl extends BpmOABaseService implements BpmOAE
|
|||||||
@Override
|
@Override
|
||||||
public void updateEvectionResult(Long id, Integer result) {
|
public void updateEvectionResult(Long id, Integer result) {
|
||||||
|
|
||||||
BpmOAEvectionDO evectionDO = validateLeaveExists(id);
|
validateLeaveExists(id);
|
||||||
evectionMapper.updateById(new BpmOAEvectionDO().setId(id).setResult(result));
|
evectionMapper.updateById(new BpmOAEvectionDO().setId(id).setResult(result));
|
||||||
|
|
||||||
// -- 自己取消
|
// -- 自己取消
|
||||||
@ -109,19 +109,15 @@ public class BpmOAEvectionServiceImpl extends BpmOABaseService implements BpmOAE
|
|||||||
|| BpmProcessInstanceResultEnum.CANCEL.getResult().equals(result)
|
|| BpmProcessInstanceResultEnum.CANCEL.getResult().equals(result)
|
||||||
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
||||||
|
|
||||||
// 设置关闭外勤打卡权限
|
// 发起外出申请后,设置关闭外勤打卡权限
|
||||||
Set<Long> userIds = evectionDO.getTogetherUserIds();
|
userApi.updateFieldworkType(getLoginUserId(), 0);
|
||||||
userIds.add(evectionDO.getUserId());
|
|
||||||
userApi.updateFieldworkType(userIds, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private BpmOAEvectionDO validateLeaveExists(Long id) {
|
private void validateLeaveExists(Long id) {
|
||||||
BpmOAEvectionDO evectionDO = evectionMapper.selectById(id);
|
if (evectionMapper.selectById(id) == null) {
|
||||||
if (evectionDO == null) {
|
|
||||||
throw exception(OA_EVECTION_NOT_EXISTS);
|
throw exception(OA_EVECTION_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
return evectionDO;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -17,7 +17,9 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.*;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
@ -82,7 +84,7 @@ public class BpmOAGoOutServiceImpl extends BpmOABaseService implements BpmOAGoOu
|
|||||||
// 发起外出申请后,判断是否是当天的外出
|
// 发起外出申请后,判断是否是当天的外出
|
||||||
if (goOut.getStartTime().toLocalDate().isEqual(LocalDate.now())) {
|
if (goOut.getStartTime().toLocalDate().isEqual(LocalDate.now())) {
|
||||||
// 设置外勤打卡权限
|
// 设置外勤打卡权限
|
||||||
userApi.updateFieldworkType(Collections.singletonList(userId), 1);
|
userApi.updateFieldworkType(getLoginUserId(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return goOut.getId();
|
return goOut.getId();
|
||||||
@ -100,7 +102,7 @@ public class BpmOAGoOutServiceImpl extends BpmOABaseService implements BpmOAGoOu
|
|||||||
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
||||||
|
|
||||||
// 发起外出申请后,设置关闭外勤打卡权限
|
// 发起外出申请后,设置关闭外勤打卡权限
|
||||||
userApi.updateFieldworkType(Collections.singletonList(getLoginUserId()), 0);
|
userApi.updateFieldworkType(getLoginUserId(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
goOutMapper.updateById(new BpmOAGoOutDO().setId(id).setResult(result));
|
goOutMapper.updateById(new BpmOAGoOutDO().setId(id).setResult(result));
|
||||||
|
@ -1,49 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentCreateReqVO;
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentRespVO;
|
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAPaymentDO;
|
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface BpmOAPaymentService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建付款申请
|
|
||||||
*
|
|
||||||
* @param userId 用户编号
|
|
||||||
* @param createReqVO 创建信息
|
|
||||||
* @return 编号
|
|
||||||
*/
|
|
||||||
Long createPayment(Long userId, @Valid BpmOAPaymentCreateReqVO createReqVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新付款申请的状态
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
* @param result 结果
|
|
||||||
*/
|
|
||||||
void updatePaymentResult(String processInstanceId, Long id, Integer result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得付款申请
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
* @return 退款申请
|
|
||||||
*/
|
|
||||||
BpmOAPaymentDO getPayment(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得指定的付款申请
|
|
||||||
* @param processInstanceId 流程实例编号
|
|
||||||
* @return 退款申请
|
|
||||||
*/
|
|
||||||
BpmOAPaymentDO getByProcessInstanceId(String processInstanceId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得付款申请列表
|
|
||||||
* @return 付款申请列表
|
|
||||||
*/
|
|
||||||
List<BpmOAPaymentRespVO> getPaymentList(Integer type);
|
|
||||||
}
|
|
@ -1,108 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentCreateReqVO;
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentRespVO;
|
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAPaymentDO;
|
|
||||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAPaymentMapper;
|
|
||||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
|
||||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
|
||||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
||||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_PAYMENT_NOT_EXISTS;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OA 付款申请 Service 实现类
|
|
||||||
*
|
|
||||||
* @author 符溶馨
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Validated
|
|
||||||
public class BpmOAPaymentServiceImpl extends BpmOABaseService implements BpmOAPaymentService{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OA 付款对应的流程定义 KEY
|
|
||||||
*/
|
|
||||||
public static final String PROCESS_KEY = "oa_payment_2";
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private BpmOAPaymentMapper paymentMapper;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private BpmProcessInstanceService processInstanceService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private BpmHistoryProcessInstanceService historyProcessInstanceService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Long createPayment(Long userId, BpmOAPaymentCreateReqVO createReqVO) {
|
|
||||||
|
|
||||||
//插入OA 付款申请
|
|
||||||
BpmOAPaymentDO paymentDO = BeanUtils.toBean(createReqVO, BpmOAPaymentDO.class).setUserId(userId)
|
|
||||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
|
||||||
paymentMapper.insert(paymentDO);
|
|
||||||
|
|
||||||
// 发起 BPM 流程
|
|
||||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
|
||||||
String processInstanceId = processInstanceService.createProcessInstance(userId,
|
|
||||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
|
||||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(paymentDO.getId())));
|
|
||||||
|
|
||||||
// 将工作流的编号,更新到 OA 付款申请单中
|
|
||||||
paymentMapper.updateById(new BpmOAPaymentDO().setId(paymentDO.getId()).setProcessInstanceId(processInstanceId));
|
|
||||||
|
|
||||||
// 判断是否为重新发起的流程
|
|
||||||
if (createReqVO.getProcessInstanceId() != null && createReqVO.getResult() == 3) {
|
|
||||||
|
|
||||||
historyProcessInstanceService.createHistoryProcessInstance(processInstanceId, createReqVO.getProcessInstanceId());
|
|
||||||
}
|
|
||||||
|
|
||||||
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
|
||||||
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
|
||||||
if (fileItems != null && !fileItems.isEmpty()) {
|
|
||||||
uploadBpmFileProcessInstanceId(processInstanceId,fileItems) ;
|
|
||||||
}
|
|
||||||
return paymentDO.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updatePaymentResult(String processInstanceId, Long id, Integer result) {
|
|
||||||
|
|
||||||
validateLeaveExists(id);
|
|
||||||
paymentMapper.updateById(new BpmOAPaymentDO().setId(id).setResult(result));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BpmOAPaymentDO getPayment(Long id) {
|
|
||||||
|
|
||||||
return paymentMapper.selectById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BpmOAPaymentDO getByProcessInstanceId(String processInstanceId) {
|
|
||||||
|
|
||||||
return paymentMapper.selectOne(BpmOAPaymentDO::getProcessInstanceId, processInstanceId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BpmOAPaymentRespVO> getPaymentList(Integer type) {
|
|
||||||
|
|
||||||
return paymentMapper.selectPaymentList(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void validateLeaveExists(Long id) {
|
|
||||||
if (paymentMapper.selectById(id) == null) {
|
|
||||||
throw exception(OA_PAYMENT_NOT_EXISTS);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -59,7 +59,7 @@ public interface BpmOAProcurePayService {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<BpmOAProcureDO> getAvailablePurchaseOrders(Integer type);
|
List<BpmOAProcureDO> getAvailablePurchaseOrders();
|
||||||
|
|
||||||
void updateEvectionResult(String processInstanceExtId, Long id, Integer result);
|
void updateEvectionResult(String processInstanceExtId, Long id, Integer result);
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -157,7 +158,7 @@ public class BpmOAProcurePayServiceImpl extends BpmOABaseService implements BpmO
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BpmOAProcureDO> getAvailablePurchaseOrders(Integer type) {
|
public List<BpmOAProcureDO> getAvailablePurchaseOrders() {
|
||||||
//获取当前登录用户id
|
//获取当前登录用户id
|
||||||
Long userId = WebFrameworkUtils.getLoginUserId();
|
Long userId = WebFrameworkUtils.getLoginUserId();
|
||||||
// 获取当前登录用的部门信息
|
// 获取当前登录用的部门信息
|
||||||
@ -170,7 +171,7 @@ public class BpmOAProcurePayServiceImpl extends BpmOABaseService implements BpmO
|
|||||||
DeptRespDTO company = deptApi.getUserCompanyDept(userId).getCheckedData();
|
DeptRespDTO company = deptApi.getUserCompanyDept(userId).getCheckedData();
|
||||||
|
|
||||||
// 查询当前用户所在公司下,所有部门可用的采购单
|
// 查询当前用户所在公司下,所有部门可用的采购单
|
||||||
return oaProcureMapper.selectListByDeptId(company.getId(), type);
|
return oaProcureMapper.selectListByDeptId(company.getId());
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
|
|
||||||
@ -183,7 +184,6 @@ public class BpmOAProcurePayServiceImpl extends BpmOABaseService implements BpmO
|
|||||||
.in(BpmOAProcureDO::getUserId, userIds)
|
.in(BpmOAProcureDO::getUserId, userIds)
|
||||||
.eq(BpmOAProcureDO::getResult, BpmProcessInstanceResultEnum.APPROVE.getResult())
|
.eq(BpmOAProcureDO::getResult, BpmProcessInstanceResultEnum.APPROVE.getResult())
|
||||||
.eq(BpmOAProcureDO::getPayFlag, BpmOAProcureDO.FLAG_FALSE)
|
.eq(BpmOAProcureDO::getPayFlag, BpmOAProcureDO.FLAG_FALSE)
|
||||||
.eqIfPresent(BpmOAProcureDO::getProcureType, type)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.service.oa.listener;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
|
|
||||||
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
|
||||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAPaymentService;
|
|
||||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAPaymentServiceImpl;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OA 签呈的结果的监听器实现类
|
|
||||||
*
|
|
||||||
* @author 符溶馨
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class BpmOAPaymentResultListener extends BpmProcessInstanceResultEventListener {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private BpmOAPaymentService paymentService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getProcessDefinitionKey() {
|
|
||||||
return BpmOAPaymentServiceImpl.PROCESS_KEY;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onEvent(BpmProcessInstanceResultEvent event) {
|
|
||||||
paymentService.updatePaymentResult(event.getId() ,Long.parseLong(event.getBusinessKey()), event.getResult());
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAPaymentMapper">
|
|
||||||
|
|
||||||
<!--
|
|
||||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
|
||||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
|
||||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
|
||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
|
||||||
-->
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectPaymentList" resultType="cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.payment.BpmOAPaymentRespVO">
|
|
||||||
SELECT
|
|
||||||
a.*,
|
|
||||||
COALESCE(SUM( b.payment_ratio ), 0) + COALESCE(a.payment_ratio,0) AS ratio
|
|
||||||
FROM
|
|
||||||
bpm_oa_payment a
|
|
||||||
LEFT JOIN bpm_oa_payment b ON b.parent_id = a.id AND b.result = 2
|
|
||||||
WHERE
|
|
||||||
ISNULL( a.parent_id )
|
|
||||||
AND a.result = 2
|
|
||||||
AND a.payment_method = #{type}
|
|
||||||
GROUP BY
|
|
||||||
a.id
|
|
||||||
HAVING
|
|
||||||
ratio < 100
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
@ -29,8 +29,5 @@
|
|||||||
a.result = 2
|
a.result = 2
|
||||||
AND a.pay_flag = 0
|
AND a.pay_flag = 0
|
||||||
AND a.deleted = 0
|
AND a.deleted = 0
|
||||||
<if test="type != null">
|
|
||||||
AND a.procure_type = #{type}
|
|
||||||
</if>
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
--- #################### 注册中心相关配置 ####################
|
|
||||||
|
|
||||||
spring:
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
server-addr: 127.0.0.1:8848
|
|
||||||
discovery:
|
|
||||||
namespace: dev # 命名空间。这里使用 dev 开发环境
|
|
||||||
metadata:
|
|
||||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
|
||||||
|
|
||||||
--- #################### 配置中心相关配置 ####################
|
|
||||||
|
|
||||||
spring:
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
|
||||||
config:
|
|
||||||
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
|
|
||||||
namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
|
||||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
|
||||||
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
|
||||||
file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties
|
|
@ -1,23 +0,0 @@
|
|||||||
--- #################### 注册中心相关配置 ####################
|
|
||||||
|
|
||||||
spring:
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
server-addr: 127.0.0.1:8848
|
|
||||||
discovery:
|
|
||||||
namespace: prod # 命名空间。这里使用 dev 开发环境
|
|
||||||
metadata:
|
|
||||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
|
||||||
|
|
||||||
--- #################### 配置中心相关配置 ####################
|
|
||||||
|
|
||||||
spring:
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
|
||||||
config:
|
|
||||||
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
|
|
||||||
namespace: prod # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
|
||||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
|
||||||
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
|
||||||
file-extension: yaml # 使用的 Nacos 配置集的 dataId 的文件拓展名,同时也是 Nacos 配置集的配置格式,默认为 properties
|
|
@ -73,6 +73,10 @@ public interface DeptApi {
|
|||||||
@Parameter(name = "factoryId", description = "工厂编号", example = "100001", required = true)
|
@Parameter(name = "factoryId", description = "工厂编号", example = "100001", required = true)
|
||||||
CommonResult<DeptRespDTO> getDeptByFactoryId(@RequestParam("factoryId") Long factoryId);
|
CommonResult<DeptRespDTO> getDeptByFactoryId(@RequestParam("factoryId") Long factoryId);
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/getListByLeader")
|
||||||
|
@Operation(summary = "获取所有部门信息")
|
||||||
|
@Parameter(name = "userId", description = "用户编号", example = "146", required = true)
|
||||||
|
CommonResult<List<DeptRespDTO>> getDeptListByLeader(@RequestParam("userId") Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得指定编号的部门 Map
|
* 获得指定编号的部门 Map
|
||||||
|
@ -85,7 +85,7 @@ public interface AdminUserApi {
|
|||||||
@Operation(summary = "修改用户外勤打卡权限")
|
@Operation(summary = "修改用户外勤打卡权限")
|
||||||
@Parameter(name = "userId", description = "用户id", example = "1024", required = true)
|
@Parameter(name = "userId", description = "用户id", example = "1024", required = true)
|
||||||
@Parameter(name = "fieldworkFlag", description = "是否可外勤打卡 | 0否 1是", example = "1", required = true)
|
@Parameter(name = "fieldworkFlag", description = "是否可外勤打卡 | 0否 1是", example = "1", required = true)
|
||||||
void updateFieldworkType(@RequestParam("userId") Collection<Long> userId,
|
void updateFieldworkType(@RequestParam("userId") Long userId,
|
||||||
@RequestParam("fieldworkFlag") Integer fieldworkFlag);
|
@RequestParam("fieldworkFlag") Integer fieldworkFlag);
|
||||||
|
|
||||||
@PostMapping(PREFIX + "/updateUserStaffing")
|
@PostMapping(PREFIX + "/updateUserStaffing")
|
||||||
|
@ -108,6 +108,13 @@ public class DeptApiImpl implements DeptApi {
|
|||||||
return success(BeanUtils.toBean(deptDO, DeptRespDTO.class));
|
return success(BeanUtils.toBean(deptDO, DeptRespDTO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CommonResult<List<DeptRespDTO>> getDeptListByLeader(Long userId) {
|
||||||
|
|
||||||
|
List<DeptDO> deptDOS = deptService.getDeptByLeaderId(userId);
|
||||||
|
return success(BeanUtils.toBean(deptDOS, DeptRespDTO.class));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@DataPermission(enable = false)
|
@DataPermission(enable = false)
|
||||||
public CommonResult<List<Long>> getChildDeptList(Long deptId) {
|
public CommonResult<List<Long>> getChildDeptList(Long deptId) {
|
||||||
|
@ -100,7 +100,7 @@ public class AdminUserApiImpl implements AdminUserApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateFieldworkType(Collection<Long> userId, Integer fieldworkFlag) {
|
public void updateFieldworkType(Long userId, Integer fieldworkFlag) {
|
||||||
|
|
||||||
userService.updateFieldworkType(userId, fieldworkFlag);
|
userService.updateFieldworkType(userId, fieldworkFlag);
|
||||||
}
|
}
|
||||||
|
@ -164,15 +164,6 @@ public class DeptController {
|
|||||||
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping(value = { "/get-factory-dept"})
|
|
||||||
@Operation(summary = "获取工厂部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
|
||||||
@DataPermission(enable = false)
|
|
||||||
public CommonResult<List<DeptSimpleRespVO>> getFactoryDept() {
|
|
||||||
List<DeptDO> list = deptService.getFactoryDept();
|
|
||||||
|
|
||||||
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping(value = {"/getListByType"})
|
@GetMapping(value = {"/getListByType"})
|
||||||
@Operation(summary = "获取指定类型的部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
@Operation(summary = "获取指定类型的部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
||||||
@Parameter(name = "type", description = "类型", required = true, example = "1")
|
@Parameter(name = "type", description = "类型", required = true, example = "1")
|
||||||
|
@ -25,7 +25,4 @@ public class DeptSimpleRespVO {
|
|||||||
|
|
||||||
@Schema(description = "是否为虚机构 | 0否 1是")
|
@Schema(description = "是否为虚机构 | 0否 1是")
|
||||||
private Integer virtuallyStatus;
|
private Integer virtuallyStatus;
|
||||||
|
|
||||||
@Schema(description = "工厂编号")
|
|
||||||
private Long factoryId;
|
|
||||||
}
|
}
|
||||||
|
@ -117,10 +117,8 @@ public class RentalOrderController {
|
|||||||
if (CollectionUtil.isNotEmpty(refundMap)) {
|
if (CollectionUtil.isNotEmpty(refundMap)) {
|
||||||
// 设置对应的订单号中的 申请退款和扣款金额
|
// 设置对应的订单号中的 申请退款和扣款金额
|
||||||
pageResult.getList().forEach(item -> {
|
pageResult.getList().forEach(item -> {
|
||||||
if (refundMap.get(item.getOrderNo()) != null) {
|
item.setApplyRefundAmount(refundMap.get(item.getOrderNo()).getRefundAmount());
|
||||||
item.setApplyRefundAmount(refundMap.get(item.getOrderNo()).getRefundAmount());
|
item.setApplyChargebacksAmount(refundMap.get(item.getOrderNo()).getChargebacksAmount());
|
||||||
item.setApplyChargebacksAmount(refundMap.get(item.getOrderNo()).getChargebacksAmount());
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
|||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.file.vo.FileRespVO;
|
import cn.iocoder.yudao.module.system.controller.admin.file.vo.FileRespVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractRespVO;
|
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.laborcontract.LaborContractDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.laborcontract.LaborContractDO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@ -39,6 +38,4 @@ public interface LaborContractMapper extends BaseMapperX<LaborContractDO> {
|
|||||||
LaborContractDO getTheEarliestContract(@Param("userId") Long userId);
|
LaborContractDO getTheEarliestContract(@Param("userId") Long userId);
|
||||||
|
|
||||||
List<LaborContractDO> selectListByRemindDate(@Param("remindDate")LocalDate remindDate);
|
List<LaborContractDO> selectListByRemindDate(@Param("remindDate")LocalDate remindDate);
|
||||||
|
|
||||||
List<LaborContractRespVO> selectContractCount(@Param("userIds") List<Long> userIds);
|
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,8 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
|||||||
.selectAs("a.contractDuration", LaborContractRespVO::getContractDuration)
|
.selectAs("a.contractDuration", LaborContractRespVO::getContractDuration)
|
||||||
.selectAs("a.probationPeriodTime", LaborContractRespVO::getProbationPeriodTime)
|
.selectAs("a.probationPeriodTime", LaborContractRespVO::getProbationPeriodTime)
|
||||||
.selectAs("a.status", LaborContractRespVO::getStatus)
|
.selectAs("a.status", LaborContractRespVO::getStatus)
|
||||||
.selectAs("a.createTime", LaborContractRespVO::getCreateTime);
|
.selectAs("a.createTime", LaborContractRespVO::getCreateTime)
|
||||||
|
.selectCount("a.id", LaborContractRespVO::getSigningCount);
|
||||||
queryWrapper.innerJoin(DeptDO.class, DeptDO::getId, AdminUserDO::getDeptId)
|
queryWrapper.innerJoin(DeptDO.class, DeptDO::getId, AdminUserDO::getDeptId)
|
||||||
.leftJoin("(SELECT\n" +
|
.leftJoin("(SELECT\n" +
|
||||||
" id,\n" +
|
" id,\n" +
|
||||||
@ -155,6 +156,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
|||||||
queryWrapper.between("a.expiration_date", pageReqVO.getExpirationDate()[0], pageReqVO.getExpirationDate()[1]);
|
queryWrapper.between("a.expiration_date", pageReqVO.getExpirationDate()[0], pageReqVO.getExpirationDate()[1]);
|
||||||
}
|
}
|
||||||
queryWrapper.eq(Objects.nonNull(pageReqVO.getStatus()), "a.status", pageReqVO.getStatus());
|
queryWrapper.eq(Objects.nonNull(pageReqVO.getStatus()), "a.status", pageReqVO.getStatus());
|
||||||
|
queryWrapper.groupBy(AdminUserDO::getId);
|
||||||
queryWrapper.orderByAsc("a.status");
|
queryWrapper.orderByAsc("a.status");
|
||||||
queryWrapper.orderByAsc(AdminUserDO::getId);
|
queryWrapper.orderByAsc(AdminUserDO::getId);
|
||||||
|
|
||||||
|
@ -191,10 +191,4 @@ public interface DeptService {
|
|||||||
* @return 部门列表
|
* @return 部门列表
|
||||||
*/
|
*/
|
||||||
List<DeptDO> getDeptListByType(String type);
|
List<DeptDO> getDeptListByType(String type);
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取工厂部门
|
|
||||||
* @return 部门列表
|
|
||||||
*/
|
|
||||||
List<DeptDO> getFactoryDept();
|
|
||||||
}
|
}
|
||||||
|
@ -392,14 +392,6 @@ public class DeptServiceImpl implements DeptService {
|
|||||||
.eq(DeptDO::getStatus, CommonStatusEnum.ENABLE.getStatus()));
|
.eq(DeptDO::getStatus, CommonStatusEnum.ENABLE.getStatus()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<DeptDO> getFactoryDept() {
|
|
||||||
|
|
||||||
return deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
|
|
||||||
.eq(DeptDO::getStatus, CommonStatusEnum.ENABLE.getStatus())
|
|
||||||
.isNotNull(DeptDO::getFactoryId));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeptDO> getDeptList(DeptApiDTO dto) {
|
public List<DeptDO> getDeptList(DeptApiDTO dto) {
|
||||||
List<DeptDO> list = deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
|
List<DeptDO> list = deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
|
||||||
|
@ -22,12 +22,10 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
|
||||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.LABOR_CONTRACT_NOT_EXISTS;
|
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.LABOR_CONTRACT_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -128,21 +126,6 @@ public class LaborContractServiceImpl implements LaborContractService {
|
|||||||
|
|
||||||
Page<LaborContractRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
Page<LaborContractRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||||
IPage<LaborContractRespVO> pageList = userMapper.selectContractPage(page, pageReqVO);
|
IPage<LaborContractRespVO> pageList = userMapper.selectContractPage(page, pageReqVO);
|
||||||
if (CollectionUtil.isNotEmpty(pageList.getRecords())) {
|
|
||||||
|
|
||||||
List<Long> userIds = convertList(pageList.getRecords(), LaborContractRespVO::getUserId);
|
|
||||||
List<LaborContractRespVO> countRespVOs = laborContractMapper.selectContractCount(userIds);
|
|
||||||
Map<Long, LaborContractRespVO> countMap = convertMap(countRespVOs, LaborContractRespVO::getUserId);
|
|
||||||
|
|
||||||
pageList.getRecords().forEach(item -> {
|
|
||||||
LaborContractRespVO respVO = countMap.get(item.getUserId());
|
|
||||||
if (respVO != null) {
|
|
||||||
item.setSigningCount(respVO.getSigningCount());
|
|
||||||
}else {
|
|
||||||
item.setSigningCount(0);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return new PageResult<>(pageList.getRecords(), pageList.getTotal());
|
return new PageResult<>(pageList.getRecords(), pageList.getTotal());
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ public interface AdminUserService {
|
|||||||
* @param id 用户编号
|
* @param id 用户编号
|
||||||
* @param fieldworkFlag 状态
|
* @param fieldworkFlag 状态
|
||||||
*/
|
*/
|
||||||
void updateFieldworkType(Collection<Long> id, Integer fieldworkFlag);
|
void updateFieldworkType(Long id, Integer fieldworkFlag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除用户
|
* 删除用户
|
||||||
|
@ -289,13 +289,14 @@ public class AdminUserServiceImpl implements AdminUserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateFieldworkType(Collection<Long> id, Integer fieldworkFlag) {
|
public void updateFieldworkType(Long id, Integer fieldworkFlag) {
|
||||||
// 更新状态
|
// 更新状态
|
||||||
AdminUserDO updateObj = new AdminUserDO();
|
AdminUserDO updateObj = new AdminUserDO();
|
||||||
|
updateObj.setId(id);
|
||||||
updateObj.setFieldworkFlag(fieldworkFlag);
|
updateObj.setFieldworkFlag(fieldworkFlag);
|
||||||
updateObj.setFieldworkType(fieldworkFlag == 1 ? 2 : 0); //设置为 临时外勤类型
|
updateObj.setFieldworkType(fieldworkFlag == 1 ? 2 : 0); //设置为 临时外勤类型
|
||||||
userMapper.update(updateObj, new LambdaQueryWrapperX<AdminUserDO>()
|
userMapper.update(updateObj, new LambdaQueryWrapper<AdminUserDO>()
|
||||||
.in(AdminUserDO::getId, id)
|
.eq(AdminUserDO::getId, id)
|
||||||
.ne(AdminUserDO::getFieldworkType, 1));
|
.ne(AdminUserDO::getFieldworkType, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,20 +39,4 @@
|
|||||||
AND status = 1
|
AND status = 1
|
||||||
AND deleted = 0
|
AND deleted = 0
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectContractCount" resultType="cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractRespVO">
|
|
||||||
SELECT
|
|
||||||
user_id AS userId,
|
|
||||||
COUNT(1) AS signingCount
|
|
||||||
FROM
|
|
||||||
system_labor_contract
|
|
||||||
WHERE
|
|
||||||
deleted = 0
|
|
||||||
AND user_id in
|
|
||||||
<foreach collection="userIds" item="userId" separator="," open="(" close=")">
|
|
||||||
#{userId}
|
|
||||||
</foreach>
|
|
||||||
GROUP BY
|
|
||||||
user_id
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -238,7 +238,7 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
|
|||||||
// 如果当前登录用户数据权限 不是查看全部数据
|
// 如果当前登录用户数据权限 不是查看全部数据
|
||||||
if (!deptDataPermission.getAll()) {
|
if (!deptDataPermission.getAll()) {
|
||||||
|
|
||||||
List<DeptRespDTO> deptRespDTO = deptApi.getDeptByLeaderId(getLoginUserId()).getCheckedData();
|
List<DeptRespDTO> deptRespDTO = deptApi.getDeptListByLeader(getLoginUserId()).getCheckedData();
|
||||||
|
|
||||||
if (deptRespDTO != null) {
|
if (deptRespDTO != null) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user