Merge branch 'dev' of http://47.97.8.94:19527/yj/zn-cloud into dev
This commit is contained in:
commit
b530c9f977
@ -1,4 +1,5 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.print;
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.print;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementRespVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementRespVO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
|
||||||
@ -21,4 +22,22 @@ public class BpmOAReimbursementPrintDataRespVO extends BpmOABaseRespVO {
|
|||||||
@Schema(description = "流程审批节点信息【包含人员签名地址】", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "流程审批节点信息【包含人员签名地址】", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
List<BpmTaskRespVO> processTasks ;
|
List<BpmTaskRespVO> processTasks ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抄送用户信息
|
||||||
|
*/
|
||||||
|
private List<CCUser> ccUsers;
|
||||||
|
|
||||||
|
@Schema(description = "抄送用户信息")
|
||||||
|
@Data
|
||||||
|
public static class CCUser {
|
||||||
|
|
||||||
|
@Schema(description = "抄送用户编号", example = "146,128")
|
||||||
|
private Long ccUserId;
|
||||||
|
|
||||||
|
@Schema(description = "抄送用户名称", example = "张三")
|
||||||
|
private String ccUserName;
|
||||||
|
|
||||||
|
@Schema(description = "抄送用户部门名称", example = "研发部")
|
||||||
|
private String ccDeptName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,15 @@ import java.util.List;
|
|||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class BpmOAReimbursementCreateReqVO {
|
public class BpmOAReimbursementCreateReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "收款人名称")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@Schema(description = "收款人卡号")
|
||||||
|
private String bankNo;
|
||||||
|
|
||||||
|
@Schema(description = "开户行信息")
|
||||||
|
private String bankName;
|
||||||
|
|
||||||
@Schema(description = "报销项目明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "报销项目明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotNull(message = "报销项目不能为空")
|
@NotNull(message = "报销项目不能为空")
|
||||||
private List<Reimbursement> reimbursements;
|
private List<Reimbursement> reimbursements;
|
||||||
@ -40,5 +49,4 @@ public class BpmOAReimbursementCreateReqVO {
|
|||||||
|
|
||||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private List<UploadUserFile> fileItems ;
|
private List<UploadUserFile> fileItems ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,14 @@ public class BpmOAReimbursementRespVO extends BpmOABaseRespVO {
|
|||||||
/**
|
/**
|
||||||
* 收款人信息
|
* 收款人信息
|
||||||
*/
|
*/
|
||||||
private PayeeUser payeeUser;
|
@Schema(description = "收款人名称")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
@Schema(description = "报销费用归属部门ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "开户行信息")
|
||||||
private Long belongDeptId ;
|
private String bankName;
|
||||||
|
|
||||||
|
@Schema(description = "收款人卡号")
|
||||||
|
private String bankNo;
|
||||||
|
|
||||||
@Schema(description = "报销项目明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "报销项目明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotNull(message = "报销项目不能为空")
|
@NotNull(message = "报销项目不能为空")
|
||||||
@ -39,7 +43,10 @@ public class BpmOAReimbursementRespVO extends BpmOABaseRespVO {
|
|||||||
@NotNull(message = "报销类型不能为空")
|
@NotNull(message = "报销类型不能为空")
|
||||||
private BigDecimal reimbursementType ;
|
private BigDecimal reimbursementType ;
|
||||||
|
|
||||||
@Schema(description = "备用金差额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
@Schema(description = "备用金金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private BigDecimal amount ;
|
||||||
|
|
||||||
|
@Schema(description = "备用金差额 = 备用金额 - 报销总金额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
private BigDecimal difference ;
|
private BigDecimal difference ;
|
||||||
|
|
||||||
@Schema(description = "报销发票总数", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "报销发票总数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@ -48,33 +55,4 @@ public class BpmOAReimbursementRespVO extends BpmOABaseRespVO {
|
|||||||
|
|
||||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private List<UploadUserFile> fileItems ;
|
private List<UploadUserFile> fileItems ;
|
||||||
|
|
||||||
@Schema(description = "收款人信息")
|
|
||||||
@Data
|
|
||||||
public static class PayeeUser {
|
|
||||||
|
|
||||||
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
|
||||||
private String nickname;
|
|
||||||
|
|
||||||
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
private Long deptId;
|
|
||||||
|
|
||||||
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "研发部")
|
|
||||||
private String deptName;
|
|
||||||
|
|
||||||
@Schema(description = "电子签名", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://xxx.jpg")
|
|
||||||
private String signURL;
|
|
||||||
|
|
||||||
@Schema(description = "用户银行卡业务表ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private Long bankId;
|
|
||||||
|
|
||||||
@Schema(description = "开户行信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private String bankNName;
|
|
||||||
|
|
||||||
@Schema(description = "银行卡号", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private String bankNo;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -15,11 +15,17 @@ import java.util.Date;
|
|||||||
@Data
|
@Data
|
||||||
public class Reimbursement {
|
public class Reimbursement {
|
||||||
|
|
||||||
|
@Schema(description = "所属部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "128")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "所属部门名称", example = "研发部")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
@Schema(description = "报销金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "23.45")
|
@Schema(description = "报销金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "23.45")
|
||||||
private BigDecimal money;
|
private BigDecimal money;
|
||||||
|
|
||||||
@Schema(description = "报销类别", requiredMode = Schema.RequiredMode.REQUIRED, example = "如:住宿、火车票、宴请等")
|
@Schema(description = "报销类别 字典值 参考 bpm_oa_reimbursement_type", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
private String type;
|
private Integer type;
|
||||||
|
|
||||||
@Schema(description = "发生时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-02-09 12:31:12")
|
@Schema(description = "发生时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-02-09 12:31:12")
|
||||||
private Date happenTime;
|
private Date happenTime;
|
||||||
@ -29,4 +35,7 @@ public class Reimbursement {
|
|||||||
|
|
||||||
@Schema(description = "费用明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "请吃饭")
|
@Schema(description = "费用明细", requiredMode = Schema.RequiredMode.REQUIRED, example = "请吃饭")
|
||||||
private String detail ;
|
private String detail ;
|
||||||
|
|
||||||
|
@Schema(description = "采购计划编号", example = "1")
|
||||||
|
private Long procureId;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,17 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.convert.oa;
|
package cn.iocoder.yudao.module.bpm.convert.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementCreateReqVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementCreateReqVO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementRespVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.Reimbursement;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报销申请 Convert
|
* 报销申请 Convert
|
||||||
*
|
*
|
||||||
@ -19,9 +25,19 @@ public interface BpmOAReimbursementConvert {
|
|||||||
BpmOAReimbursementDO convert(BpmOAReimbursementCreateReqVO bean);
|
BpmOAReimbursementDO convert(BpmOAReimbursementCreateReqVO bean);
|
||||||
|
|
||||||
BpmOAReimbursementRespVO convert(BpmOAReimbursementDO bean);
|
BpmOAReimbursementRespVO convert(BpmOAReimbursementDO bean);
|
||||||
//
|
|
||||||
// List<BpmOALeaveRespVO> convertList(List<BpmOALeaveDO> list);
|
default List<Reimbursement> convertList(List<Reimbursement> list, Map<Long, DeptRespDTO> deptMap) {
|
||||||
//
|
|
||||||
// PageResult<BpmOALeaveRespVO> convertPage(PageResult<BpmOALeaveDO> page);
|
return CollectionUtils.convertList(list, reimbursement -> convert(reimbursement, deptMap.get(reimbursement.getDeptId())));
|
||||||
|
}
|
||||||
|
|
||||||
|
default Reimbursement convert(Reimbursement reimbursement, DeptRespDTO dept) {
|
||||||
|
|
||||||
|
if (dept != null) {
|
||||||
|
reimbursement.setDeptName(dept.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return reimbursement;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
|||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,6 +50,21 @@ public class BpmOAReimbursementDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收款人名称
|
||||||
|
*/
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收款人卡号
|
||||||
|
*/
|
||||||
|
private String bankNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户行信息
|
||||||
|
*/
|
||||||
|
private String bankName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 报销明细数据JSON
|
* 报销明细数据JSON
|
||||||
*/
|
*/
|
||||||
|
@ -1,16 +1,22 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||||
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure.BpmOAProcureListEditReqVO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementCreateReqVO;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.Reimbursement;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAReimbursementConvert;
|
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAReimbursementConvert;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAImprestDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAImprestDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO;
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAImprestMapper;
|
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAImprestMapper;
|
||||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAReimbursementMapper;
|
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAReimbursementMapper;
|
||||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||||
|
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||||
import org.flowable.engine.runtime.ProcessInstance;
|
import org.flowable.engine.runtime.ProcessInstance;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -18,11 +24,13 @@ 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;
|
||||||
|
|
||||||
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.convertSet;
|
||||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_REIMBURSEMENT_NOT_EXISTS;
|
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_REIMBURSEMENT_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -57,6 +65,12 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
|||||||
@Resource
|
@Resource
|
||||||
private BpmOAImprestMapper bpmOAImprestMapper;
|
private BpmOAImprestMapper bpmOAImprestMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOAProcureService bpmOAProcureService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DeptApi deptApi;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createReimbursement(Long userId, BpmOAReimbursementCreateReqVO createReqVO) {
|
public Long createReimbursement(Long userId, BpmOAReimbursementCreateReqVO createReqVO) {
|
||||||
BpmOAReimbursementDO reimbursement = BpmOAReimbursementConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
BpmOAReimbursementDO reimbursement = BpmOAReimbursementConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
||||||
@ -78,6 +92,31 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
|||||||
bpmOAImprestMapper.updateById(new BpmOAImprestDO().setId(bpmOAImprestDO.getId()).setReimbursementId(reimbursement.getId()).setStatus(BpmOAImprestDO.IN_PROGRESS));
|
bpmOAImprestMapper.updateById(new BpmOAImprestDO().setId(bpmOAImprestDO.getId()).setReimbursementId(reimbursement.getId()).setStatus(BpmOAImprestDO.IN_PROGRESS));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//判断是否有 采购报销
|
||||||
|
List<Long> procureIds = new ArrayList<>();
|
||||||
|
for (Reimbursement data : reimbursement.getReimbursements()) {
|
||||||
|
|
||||||
|
//报销类别为 采购费时
|
||||||
|
if (data.getType() == 4) {
|
||||||
|
|
||||||
|
BpmOAProcureDO procureDO = bpmOAProcureService.getOaProcure(data.getProcureId());
|
||||||
|
if (procureDO != null) {
|
||||||
|
|
||||||
|
procureIds.add(procureDO.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!procureIds.isEmpty()) {
|
||||||
|
|
||||||
|
//所有关联的采购申请改为 进行中状态
|
||||||
|
bpmOAProcureService.updatePayFlagByIds(
|
||||||
|
new BpmOAProcureListEditReqVO()
|
||||||
|
.setPayFlag(BpmOAProcureDO.IN_PROGRESS)
|
||||||
|
.setProcureIds(procureIds)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
||||||
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||||
if (fileItems != null && !fileItems.isEmpty()) {
|
if (fileItems != null && !fileItems.isEmpty()) {
|
||||||
@ -95,13 +134,50 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
|||||||
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
||||||
|
|
||||||
ProcessInstance instance = bpmProcessInstanceService.getProcessInstance(processInstanceId);
|
ProcessInstance instance = bpmProcessInstanceService.getProcessInstance(processInstanceId);
|
||||||
BpmOAImprestDO bpmOAImprestDO = bpmOAImprestMapper.selectOne(BpmOAImprestDO::getReimbursementId, id);
|
|
||||||
|
|
||||||
if (instance.isEnded() && bpmOAImprestDO != null) {
|
if (instance.isEnded()) {
|
||||||
|
|
||||||
|
//获得备用金信息
|
||||||
|
BpmOAImprestDO bpmOAImprestDO = bpmOAImprestMapper.selectOne(BpmOAImprestDO::getReimbursementId, id);
|
||||||
|
if (bpmOAImprestDO != null) {
|
||||||
|
|
||||||
//将相应备用金申请状态改为 已报销
|
//将相应备用金申请状态改为 已报销
|
||||||
bpmOAImprestMapper.updateById(new BpmOAImprestDO().setId(bpmOAImprestDO.getId()).setStatus(BpmOAImprestDO.FLAG_TRUE));
|
bpmOAImprestMapper.updateById(new BpmOAImprestDO().setId(bpmOAImprestDO.getId()).setStatus(BpmOAImprestDO.FLAG_TRUE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//判断是否有采购报销
|
||||||
|
List<Long> procureIds = new ArrayList<>();
|
||||||
|
BpmOAReimbursementDO bpmOAReimbursementDO = getReimbursement(id);
|
||||||
|
List<Reimbursement> reimbursements = bpmOAReimbursementDO.getReimbursements();
|
||||||
|
|
||||||
|
//直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
|
||||||
|
//将list再次转为json串,然后由json串再转为list
|
||||||
|
String json = JsonUtils.toJsonString(reimbursements);
|
||||||
|
reimbursements = JsonUtils.parseArray(json, Reimbursement.class);
|
||||||
|
|
||||||
|
for (Reimbursement reimbursement : reimbursements) {
|
||||||
|
|
||||||
|
//报销类别为 采购费时
|
||||||
|
if (reimbursement.getType() == 4) {
|
||||||
|
|
||||||
|
BpmOAProcureDO procureDO = bpmOAProcureService.getOaProcure(reimbursement.getProcureId());
|
||||||
|
if (procureDO != null) {
|
||||||
|
|
||||||
|
procureIds.add(procureDO.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!procureIds.isEmpty()) {
|
||||||
|
|
||||||
|
//所有关联的采购申请改为 已支付状态
|
||||||
|
bpmOAProcureService.updatePayFlagByIds(
|
||||||
|
new BpmOAProcureListEditReqVO()
|
||||||
|
.setPayFlag(BpmOAProcureDO.FLAG_TRUE)
|
||||||
|
.setProcureIds(procureIds)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// -- 自己取消
|
// -- 自己取消
|
||||||
@ -118,6 +194,39 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
|||||||
//将相应备用金申请状态改为 未报销
|
//将相应备用金申请状态改为 未报销
|
||||||
bpmOAImprestMapper.updateById(new BpmOAImprestDO().setId(bpmOAImprestDO.getId()).setStatus(BpmOAImprestDO.FLAG_FALSE));
|
bpmOAImprestMapper.updateById(new BpmOAImprestDO().setId(bpmOAImprestDO.getId()).setStatus(BpmOAImprestDO.FLAG_FALSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//判断是否有采购报销
|
||||||
|
List<Long> procureIds = new ArrayList<>();
|
||||||
|
BpmOAReimbursementDO bpmOAReimbursementDO = getReimbursement(id);
|
||||||
|
List<Reimbursement> reimbursements = bpmOAReimbursementDO.getReimbursements();
|
||||||
|
|
||||||
|
//直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
|
||||||
|
//将list再次转为json串,然后由json串再转为list
|
||||||
|
String json = JsonUtils.toJsonString(reimbursements);
|
||||||
|
reimbursements = JsonUtils.parseArray(json, Reimbursement.class);
|
||||||
|
|
||||||
|
for (Reimbursement reimbursement : reimbursements) {
|
||||||
|
|
||||||
|
//报销类别为 采购费时
|
||||||
|
if (reimbursement.getType() == 4) {
|
||||||
|
|
||||||
|
BpmOAProcureDO procureDO = bpmOAProcureService.getOaProcure(reimbursement.getProcureId());
|
||||||
|
if (procureDO != null) {
|
||||||
|
|
||||||
|
procureIds.add(procureDO.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!procureIds.isEmpty()) {
|
||||||
|
|
||||||
|
//所有关联的采购申请改为 未支付状态
|
||||||
|
bpmOAProcureService.updatePayFlagByIds(
|
||||||
|
new BpmOAProcureListEditReqVO()
|
||||||
|
.setPayFlag(BpmOAProcureDO.FLAG_FALSE)
|
||||||
|
.setProcureIds(procureIds)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reimbursementMapper.updateById(new BpmOAReimbursementDO().setId(id).setResult(result));
|
reimbursementMapper.updateById(new BpmOAReimbursementDO().setId(id).setResult(result));
|
||||||
@ -131,6 +240,20 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BpmOAReimbursementDO getReimbursement(Long id) {
|
public BpmOAReimbursementDO getReimbursement(Long id) {
|
||||||
return reimbursementMapper.selectById(id);
|
|
||||||
|
BpmOAReimbursementDO reimbursementDO = reimbursementMapper.selectById(id);
|
||||||
|
List<Reimbursement> reimbursement = reimbursementDO.getReimbursements();
|
||||||
|
|
||||||
|
//直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
|
||||||
|
//将list再次转为json串,然后由json串再转为list
|
||||||
|
String json = JsonUtils.toJsonString(reimbursement);
|
||||||
|
reimbursement = JsonUtils.parseArray(json, Reimbursement.class);
|
||||||
|
|
||||||
|
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(reimbursement, Reimbursement::getDeptId));
|
||||||
|
|
||||||
|
//插入部门名称
|
||||||
|
reimbursementDO.setReimbursements(BpmOAReimbursementConvert.INSTANCE.convertList(reimbursement, deptMap));
|
||||||
|
|
||||||
|
return reimbursementDO;
|
||||||
}
|
}
|
||||||
}
|
}
|
File diff suppressed because one or more lines are too long
@ -418,6 +418,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|||||||
paramMap.put("post_id", postId.toString());
|
paramMap.put("post_id", postId.toString());
|
||||||
paramMap.put("user_id", userId.toString());
|
paramMap.put("user_id", userId.toString());
|
||||||
paramMap.put("dept_id", startUser.getDeptId().toString()); //配置发起人部门id
|
paramMap.put("dept_id", startUser.getDeptId().toString()); //配置发起人部门id
|
||||||
|
paramMap.put("dept_flag", startDeptInfo.getFlag()); //配置发起人部门flag
|
||||||
|
|
||||||
paramMap.put("approve_reason", reqVO.getReason()); //通过原因---因为Task任务的通过,是通过监听事件处理的,reason数据无法传递给监听函数。所以通过此中方法传递
|
paramMap.put("approve_reason", reqVO.getReason()); //通过原因---因为Task任务的通过,是通过监听事件处理的,reason数据无法传递给监听函数。所以通过此中方法传递
|
||||||
taskService.complete(task.getId(), paramMap);
|
taskService.complete(task.getId(), paramMap);
|
||||||
@ -718,6 +719,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void updateTaskExtAssign(Task task) {
|
public void updateTaskExtAssign(Task task) {
|
||||||
// BpmTaskExtDO taskExtDO =
|
// BpmTaskExtDO taskExtDO =
|
||||||
// new BpmTaskExtDO().setAssigneeUserId(NumberUtils.parseLong(task.getAssignee())).setTaskId(task.getId());
|
// new BpmTaskExtDO().setAssigneeUserId(NumberUtils.parseLong(task.getAssignee())).setTaskId(task.getId());
|
||||||
|
@ -193,4 +193,10 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode LOG_NOT_DATE = new ErrorCode(1_009_010_007, "只能修改当天提交的日志");
|
ErrorCode LOG_NOT_DATE = new ErrorCode(1_009_010_007, "只能修改当天提交的日志");
|
||||||
|
|
||||||
ErrorCode LOG_NOT_UPDATE = new ErrorCode(1_009_010_008, "已过了提交时间,不能修改");
|
ErrorCode LOG_NOT_UPDATE = new ErrorCode(1_009_010_008, "已过了提交时间,不能修改");
|
||||||
|
|
||||||
|
ErrorCode BANK_NOT_EXISTS = new ErrorCode(1_009_020_001, "银行卡信息不存在");
|
||||||
|
|
||||||
|
ErrorCode BANK_EXISTS = new ErrorCode(1_009_020_003, "银行卡号已存在");
|
||||||
|
|
||||||
|
ErrorCode BANK_NOT_CREATOR = new ErrorCode(1_009_020_002, "你不是当前银行卡信息的创建者,不能进行修改!");
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,130 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.bank;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.bank.vo.UserBankPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.bank.vo.UserBankRespVO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.bank.vo.UserBankSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.bank.BankDO;
|
||||||
|
import cn.iocoder.yudao.module.system.service.bank.UserBankService;
|
||||||
|
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.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 用户银行卡信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/user-bank")
|
||||||
|
@Validated
|
||||||
|
public class UserBankController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserBankService userBankService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建银行卡信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:user-bank:create')")
|
||||||
|
public CommonResult<Long> createBank(@Valid @RequestBody UserBankSaveReqVO createReqVO) {
|
||||||
|
|
||||||
|
return success(userBankService.createBank(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create-bank")
|
||||||
|
@Operation(summary = "创建银行卡信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:user-bank:create')")
|
||||||
|
public CommonResult<Boolean> createPayBank(@Valid @RequestBody UserBankSaveReqVO createReqVO) {
|
||||||
|
|
||||||
|
userBankService.createPayBank(createReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/create-user")
|
||||||
|
@Operation(summary = "创建用户和银行卡关联信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:user-bank:create')")
|
||||||
|
public CommonResult<Boolean> createUserBank(@RequestBody List<Long> bankId) {
|
||||||
|
|
||||||
|
userBankService.createUserBank(bankId);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新银行卡信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:user-bank:update')")
|
||||||
|
public CommonResult<Boolean> updateBank(@Valid @RequestBody UserBankSaveReqVO updateReqVO) {
|
||||||
|
userBankService.updateBank(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除用户和银行卡关联信息")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:user-bank:delete')")
|
||||||
|
public CommonResult<Boolean> deleteUserBank(@RequestParam("id") Long id) {
|
||||||
|
userBankService.deleteUserBank(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得银行卡信息")
|
||||||
|
@Parameter(name = "bankId", description = "银行卡信息编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:user-bank:query')")
|
||||||
|
public CommonResult<UserBankRespVO> getBank(@RequestParam("bankId") Long bankId) {
|
||||||
|
|
||||||
|
BankDO userBank = userBankService.getBank(bankId);
|
||||||
|
return success(BeanUtils.toBean(userBank, UserBankRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page-bank")
|
||||||
|
@Operation(summary = "获得银行卡信息分页列表")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:user-bank:query')")
|
||||||
|
public CommonResult<PageResult<UserBankRespVO>> getBankPage(@Valid UserBankPageReqVO pageReqVO) {
|
||||||
|
|
||||||
|
PageResult<BankDO> pageResult = new PageResult<BankDO>();
|
||||||
|
List<Long> bankIds = userBankService.getBankIds(getLoginUserId());
|
||||||
|
if (bankIds.isEmpty()) {
|
||||||
|
|
||||||
|
pageResult = userBankService.getBankPageIn(pageReqVO, null);
|
||||||
|
}else {
|
||||||
|
pageResult = userBankService.getBankPageNotIn(pageReqVO, bankIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return success(BeanUtils.toBean(pageResult, UserBankRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得用户和银行卡关联信息分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:user-bank:query')")
|
||||||
|
public CommonResult<PageResult<UserBankRespVO>> getUserBankPage(@Valid UserBankPageReqVO pageReqVO) {
|
||||||
|
|
||||||
|
PageResult<BankDO> pageResult = new PageResult<BankDO>();
|
||||||
|
List<Long> bankIds = userBankService.getBankIds(getLoginUserId());
|
||||||
|
if (!bankIds.isEmpty()) {
|
||||||
|
|
||||||
|
pageResult = userBankService.getBankPageIn(pageReqVO, bankIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return success(BeanUtils.toBean(pageResult, UserBankRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@Operation(summary = "获得用户和银行卡关联信息列表")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:user-bank:query')")
|
||||||
|
public CommonResult<List<UserBankRespVO>> getUserBankList() {
|
||||||
|
|
||||||
|
List<BankDO> bankDOS = userBankService.getBankListByUserId(getLoginUserId());
|
||||||
|
|
||||||
|
return success(BeanUtils.toBean(bankDOS, UserBankRespVO.class));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.bank.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 用户银行卡信息分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class UserBankPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "用户编号", example = "31665")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "银行卡用户名称", example = "芋艿")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@Schema(description = "银行卡号")
|
||||||
|
private String bankNo;
|
||||||
|
|
||||||
|
@Schema(description = "开户行信息", example = "赵六")
|
||||||
|
private String bankName;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.bank.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 用户银行卡信息 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class UserBankRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3548")
|
||||||
|
@ExcelProperty("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "31665")
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
@Schema(description = "银行卡用户名称", example = "芋艿")
|
||||||
|
@ExcelProperty("银行卡用户名称")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@Schema(description = "银行卡号")
|
||||||
|
@ExcelProperty("银行卡号")
|
||||||
|
private String bankNo;
|
||||||
|
|
||||||
|
@Schema(description = "开户行信息", example = "赵六")
|
||||||
|
@ExcelProperty("开户行信息")
|
||||||
|
private String bankName;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.bank.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 用户银行卡信息新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class UserBankSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3548")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "银行卡用户名称", example = "芋艿")
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@Schema(description = "银行卡号")
|
||||||
|
private String bankNo;
|
||||||
|
|
||||||
|
@Schema(description = "开户行信息", example = "赵六")
|
||||||
|
private String bankName;
|
||||||
|
|
||||||
|
}
|
@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.controller.admin.dept;
|
|||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
||||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptRespVO;
|
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptRespVO;
|
||||||
@ -78,6 +79,15 @@ public class DeptController {
|
|||||||
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = {"/all-list"})
|
||||||
|
@Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
||||||
|
@DataPermission(enable = false)
|
||||||
|
public CommonResult<List<DeptSimpleRespVO>> getAllDeptList() {
|
||||||
|
List<DeptDO> list = deptService.getDeptList(
|
||||||
|
new DeptListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()));
|
||||||
|
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得部门信息")
|
@Operation(summary = "获得部门信息")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@ -87,7 +97,6 @@ public class DeptController {
|
|||||||
return success(BeanUtils.toBean(dept, DeptRespVO.class));
|
return success(BeanUtils.toBean(dept, DeptRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/getUserDept")
|
@GetMapping("/getUserDept")
|
||||||
@Operation(summary = "获取当前登录用户部门信息")
|
@Operation(summary = "获取当前登录用户部门信息")
|
||||||
public CommonResult<DeptRespVO> getUserDept() {
|
public CommonResult<DeptRespVO> getUserDept() {
|
||||||
|
@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
||||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO;
|
||||||
@ -83,6 +84,17 @@ public class PostController {
|
|||||||
return success(BeanUtils.toBean(list, PostSimpleRespVO.class));
|
return success(BeanUtils.toBean(list, PostSimpleRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = {"/all-list"})
|
||||||
|
@Operation(summary = "获取岗位全列表", description = "只包含被开启的岗位,主要用于前端的下拉选项")
|
||||||
|
@DataPermission(enable = false)
|
||||||
|
public CommonResult<List<PostSimpleRespVO>> getAllPostList() {
|
||||||
|
// 获得岗位列表,只要开启状态的
|
||||||
|
List<PostDO> list = postService.getPostList(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus()));
|
||||||
|
// 排序后,返回给前端
|
||||||
|
list.sort(Comparator.comparing(PostDO::getSort));
|
||||||
|
return success(BeanUtils.toBean(list, PostSimpleRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得岗位分页列表")
|
@Operation(summary = "获得岗位分页列表")
|
||||||
@PreAuthorize("@ss.hasPermission('system:post:query')")
|
@PreAuthorize("@ss.hasPermission('system:post:query')")
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.system.controller.admin.notice;
|
package cn.iocoder.yudao.module.system.controller.admin.notice;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
package cn.iocoder.yudao.module.system.convert.notice;
|
package cn.iocoder.yudao.module.system.convert.notice;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||||
import cn.iocoder.yudao.module.system.api.sms.dto.send.SmsSendSingleToUserReqDTO;
|
|
||||||
import cn.iocoder.yudao.module.system.api.subscribe.dto.MsgData;
|
import cn.iocoder.yudao.module.system.api.subscribe.dto.MsgData;
|
||||||
import cn.iocoder.yudao.module.system.api.subscribe.dto.SubscribeMessageReqDTO;
|
import cn.iocoder.yudao.module.system.api.subscribe.dto.SubscribeMessageReqDTO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.notice.NoticeDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.notice.NoticeDO;
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
import org.mapstruct.Mapping;
|
|
||||||
import org.mapstruct.factory.Mappers;
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功能描述
|
* 功能描述
|
||||||
@ -41,9 +38,14 @@ public interface NoticeConvert {
|
|||||||
message.addData(noticeType);
|
message.addData(noticeType);
|
||||||
|
|
||||||
//公告标题
|
//公告标题
|
||||||
|
String value = notice.getTitle();
|
||||||
|
if (value.length() > 10) {
|
||||||
|
value = value.substring(0,10) + ". . . . ";
|
||||||
|
}
|
||||||
|
|
||||||
MsgData title = new MsgData();
|
MsgData title = new MsgData();
|
||||||
title.setName("thing6");
|
title.setName("thing6");
|
||||||
title.setValue(notice.getTitle());
|
title.setValue(value);
|
||||||
message.addData(title);
|
message.addData(title);
|
||||||
|
|
||||||
//通知内容
|
//通知内容
|
||||||
|
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.dataobject.bank;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理后台的用户银行卡信息 DO
|
||||||
|
*/
|
||||||
|
@TableName(value = "system_bank", autoResultMap = true)
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BankDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银行卡用户名称
|
||||||
|
*/
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银行卡号
|
||||||
|
*/
|
||||||
|
private String bankNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户行信息
|
||||||
|
*/
|
||||||
|
private String bankName;
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.dataobject.bank;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户和银行卡关联 DO
|
||||||
|
*/
|
||||||
|
@TableName(value = "system_user_bank", autoResultMap = true)
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserBankDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银行卡信息 ID
|
||||||
|
*/
|
||||||
|
private Long bankId;
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.mysql.bank;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.bank.vo.UserBankPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.bank.BankDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银行卡信息 Mapper
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BankMapper extends BaseMapperX<BankDO> {
|
||||||
|
|
||||||
|
default PageResult<BankDO> selectPageIn(UserBankPageReqVO reqVO, List<Long> bankId) {
|
||||||
|
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BankDO>()
|
||||||
|
.likeIfPresent(BankDO::getNickname, reqVO.getNickname())
|
||||||
|
.inIfPresent(BankDO::getId, bankId)
|
||||||
|
.orderByDesc(BankDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
default PageResult<BankDO> selectPageNotIn(UserBankPageReqVO reqVO, List<Long> bankId) {
|
||||||
|
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BankDO>()
|
||||||
|
.likeIfPresent(BankDO::getNickname, reqVO.getNickname())
|
||||||
|
.notIn(BankDO::getId, bankId)
|
||||||
|
.orderByDesc(BankDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<BankDO> selectBankList(List<Long> bankId) {
|
||||||
|
|
||||||
|
return selectList(new LambdaQueryWrapperX<BankDO>()
|
||||||
|
.in(BankDO::getId, bankId));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.mysql.bank;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.bank.UserBankDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户和银行卡关联 Mapper
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserBankMapper extends BaseMapperX<UserBankDO> {
|
||||||
|
|
||||||
|
default UserBankDO selectByBankId(Long userId, Long bankId) {
|
||||||
|
|
||||||
|
return selectOne(new LambdaQueryWrapperX<UserBankDO>()
|
||||||
|
.eq(UserBankDO::getUserId, userId)
|
||||||
|
.eq(UserBankDO::getBankId, bankId));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.framework.ThreadPool.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
|
@Configuration(proxyBeanMethods = false)
|
||||||
|
public class AsyncConfig {
|
||||||
|
|
||||||
|
public static final String NOTIFY_THREAD_POOL_TASK_EXECUTOR = "NOTIFY_THREAD_POOL_TASK_EXECUTOR";
|
||||||
|
|
||||||
|
@Bean(NOTIFY_THREAD_POOL_TASK_EXECUTOR)
|
||||||
|
public ThreadPoolTaskExecutor notifyThreadPoolTaskExecutor() {
|
||||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||||
|
executor.setCorePoolSize(2); // 设置核心线程数
|
||||||
|
executor.setMaxPoolSize(4); // 设置最大线程数
|
||||||
|
executor.setKeepAliveSeconds(60); // 设置空闲时间
|
||||||
|
executor.setQueueCapacity(100); // 设置队列大小
|
||||||
|
executor.setThreadNamePrefix("notify-"); // 配置线程池的前缀
|
||||||
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||||
|
// 进行加载
|
||||||
|
executor.initialize();
|
||||||
|
return executor;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* 占位
|
||||||
|
*/
|
||||||
|
package cn.iocoder.yudao.module.system.framework.ThreadPool.core;
|
@ -0,0 +1,86 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.bank;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.bank.vo.UserBankPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.bank.vo.UserBankSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.bank.BankDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户银行卡信息 Service 接口
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
public interface UserBankService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户银行卡信息
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createBank(@Valid UserBankSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户银行卡信息
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
*/
|
||||||
|
void createPayBank(@Valid UserBankSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建用户和银行卡关联信息
|
||||||
|
*
|
||||||
|
* @param bankId 银行卡信息编号组
|
||||||
|
*/
|
||||||
|
void createUserBank(List<Long> bankId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新银行卡信息
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateBank(@Valid UserBankSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户银行卡信息
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteUserBank(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得用户银行卡信息
|
||||||
|
*
|
||||||
|
* @param bankId 银行卡信息编号
|
||||||
|
* @return 银行卡信息
|
||||||
|
*/
|
||||||
|
BankDO getBank(Long bankId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得银行卡信息编号组
|
||||||
|
* @param userId 用户ID
|
||||||
|
* @return 银行卡信息编号组
|
||||||
|
*/
|
||||||
|
List<Long> getBankIds(Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得银行卡信息分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 银行卡信息分页
|
||||||
|
*/
|
||||||
|
PageResult<BankDO> getBankPageIn(UserBankPageReqVO pageReqVO, List<Long> bankId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得银行卡信息分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 银行卡信息分页
|
||||||
|
*/
|
||||||
|
PageResult<BankDO> getBankPageNotIn(UserBankPageReqVO pageReqVO, List<Long> bankId);
|
||||||
|
|
||||||
|
List<BankDO> getBankListByUserId(Long userId);
|
||||||
|
}
|
@ -0,0 +1,190 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.bank;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.bank.vo.UserBankPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.bank.vo.UserBankSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.bank.BankDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.bank.UserBankDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.mysql.bank.BankMapper;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.mysql.bank.UserBankMapper;
|
||||||
|
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
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.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户银行卡信息 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class UserBankServiceImpl implements UserBankService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserBankMapper userBankMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BankMapper bankMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AdminUserService adminUserService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createBank(UserBankSaveReqVO createReqVO) {
|
||||||
|
|
||||||
|
//校验银行卡号是否已存在
|
||||||
|
Long count = bankMapper.selectCount(BankDO::getBankNo, createReqVO.getBankNo());
|
||||||
|
if (count > 0L) {
|
||||||
|
throw exception(BANK_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 插入
|
||||||
|
BankDO bank = BeanUtils.toBean(createReqVO, BankDO.class);
|
||||||
|
bankMapper.insert(bank);
|
||||||
|
// 返回
|
||||||
|
return bank.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createPayBank(UserBankSaveReqVO createReqVO) {
|
||||||
|
|
||||||
|
//校验银行卡号是否已存在
|
||||||
|
BankDO bankDO = bankMapper.selectOne(BankDO::getBankNo, createReqVO.getBankNo());
|
||||||
|
if (bankDO != null) {
|
||||||
|
|
||||||
|
UserBankDO userBankDO = userBankMapper.selectByBankId(getLoginUserId(), bankDO.getId());
|
||||||
|
if (userBankDO == null) {
|
||||||
|
|
||||||
|
userBankDO = new UserBankDO();
|
||||||
|
userBankDO.setUserId(getLoginUserId());
|
||||||
|
userBankDO.setBankId(bankDO.getId());
|
||||||
|
userBankDO.setCreator(Objects.requireNonNull(getLoginUserId()).toString());
|
||||||
|
|
||||||
|
userBankMapper.insert(userBankDO);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
|
||||||
|
// 插入
|
||||||
|
BankDO bank = BeanUtils.toBean(createReqVO, BankDO.class);
|
||||||
|
bankMapper.insert(bank);
|
||||||
|
|
||||||
|
UserBankDO userBankDO = new UserBankDO();
|
||||||
|
userBankDO.setUserId(getLoginUserId());
|
||||||
|
userBankDO.setBankId(bank.getId());
|
||||||
|
userBankDO.setCreator(Objects.requireNonNull(getLoginUserId()).toString());
|
||||||
|
|
||||||
|
userBankMapper.insert(userBankDO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void createUserBank(List<Long> bankId) {
|
||||||
|
|
||||||
|
//获取当前登录用户信息
|
||||||
|
AdminUserDO adminUserDO = adminUserService.getUser(getLoginUserId());
|
||||||
|
|
||||||
|
List<UserBankDO> useDOs = bankId.stream()
|
||||||
|
.map(id -> {
|
||||||
|
UserBankDO userBankDO = new UserBankDO();
|
||||||
|
userBankDO.setUserId(adminUserDO.getId());
|
||||||
|
userBankDO.setBankId(id);
|
||||||
|
userBankDO.setCreator(String.valueOf(adminUserDO.getId()));
|
||||||
|
return userBankDO;
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
userBankMapper.insertBatch(useDOs);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateBank(UserBankSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateBankExists(updateReqVO.getId());
|
||||||
|
|
||||||
|
// 更新
|
||||||
|
BankDO updateObj = BeanUtils.toBean(updateReqVO, BankDO.class);
|
||||||
|
bankMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteUserBank(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
UserBankDO userBankDO = userBankMapper.selectByBankId(getLoginUserId(), id);
|
||||||
|
if (userBankDO == null) {
|
||||||
|
throw exception(BANK_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
userBankMapper.deleteById(userBankDO);
|
||||||
|
|
||||||
|
BankDO bankDO = bankMapper.selectById(userBankDO.getBankId());
|
||||||
|
//校验当前登录用户是否是 该银行卡信息的创建者
|
||||||
|
if (bankDO.getCreator().equals(userBankDO.getUserId().toString())) {
|
||||||
|
|
||||||
|
// 同步删除 银行卡信息
|
||||||
|
bankMapper.deleteById(bankDO.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateBankExists(Long id) {
|
||||||
|
|
||||||
|
BankDO bankDO = bankMapper.selectById(id);
|
||||||
|
|
||||||
|
if (bankDO == null) {
|
||||||
|
throw exception(BANK_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
//校验当前登录用户是否是 该银行卡信息的创建者
|
||||||
|
if (!Long.valueOf(bankDO.getCreator()).equals(getLoginUserId())) {
|
||||||
|
throw exception(BANK_NOT_CREATOR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BankDO getBank(Long id) {
|
||||||
|
|
||||||
|
return bankMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Long> getBankIds(Long userId) {
|
||||||
|
|
||||||
|
List<UserBankDO> userBankDOS = userBankMapper.selectList(UserBankDO::getUserId, userId);
|
||||||
|
|
||||||
|
return convertList(userBankDOS, UserBankDO::getBankId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BankDO> getBankPageIn(UserBankPageReqVO pageReqVO, List<Long> bankId) {
|
||||||
|
|
||||||
|
return bankMapper.selectPageIn(pageReqVO, bankId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BankDO> getBankPageNotIn(UserBankPageReqVO pageReqVO, List<Long> bankId) {
|
||||||
|
|
||||||
|
return bankMapper.selectPageNotIn(pageReqVO, bankId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BankDO> getBankListByUserId(Long userId) {
|
||||||
|
|
||||||
|
if (getBankIds(userId).isEmpty()) {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return bankMapper.selectBankList(getBankIds(userId));
|
||||||
|
}
|
||||||
|
}
|
@ -14,14 +14,15 @@ import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
|||||||
import cn.iocoder.yudao.module.system.dal.mysql.notice.NoticeMapper;
|
import cn.iocoder.yudao.module.system.dal.mysql.notice.NoticeMapper;
|
||||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
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.module.system.enums.ErrorCodeConstants.NOTICE_NOT_FOUND;
|
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.NOTICE_NOT_FOUND;
|
||||||
|
import static cn.iocoder.yudao.module.system.framework.ThreadPool.config.AsyncConfig.NOTIFY_THREAD_POOL_TASK_EXECUTOR;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知公告 Service 实现类
|
* 通知公告 Service 实现类
|
||||||
@ -34,6 +35,9 @@ public class NoticeServiceImpl implements NoticeService {
|
|||||||
@Resource
|
@Resource
|
||||||
private NoticeMapper noticeMapper;
|
private NoticeMapper noticeMapper;
|
||||||
|
|
||||||
|
@Resource(name = NOTIFY_THREAD_POOL_TASK_EXECUTOR)
|
||||||
|
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createNotice(NoticeSaveReqVO createReqVO) {
|
public Long createNotice(NoticeSaveReqVO createReqVO) {
|
||||||
NoticeDO notice = BeanUtils.toBean(createReqVO, NoticeDO.class);
|
NoticeDO notice = BeanUtils.toBean(createReqVO, NoticeDO.class);
|
||||||
@ -94,12 +98,16 @@ public class NoticeServiceImpl implements NoticeService {
|
|||||||
//查询所有状态是开启的用户
|
//查询所有状态是开启的用户
|
||||||
List<AdminUserDO> list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
List<AdminUserDO> list = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||||
for(AdminUserDO adminUserDO : list) {
|
for(AdminUserDO adminUserDO : list) {
|
||||||
if( adminUserDO.getOpenId() != null && !adminUserDO.getOpenId().equals("") ) {
|
if( adminUserDO.getOpenId() != null && !adminUserDO.getOpenId().isEmpty()) {
|
||||||
System.out.println("====" + adminUserDO.getNickname());
|
// System.out.println("====" + adminUserDO.getNickname());
|
||||||
|
|
||||||
|
threadPoolTaskExecutor.execute(() -> {
|
||||||
|
|
||||||
//获取openId有值的用户
|
//获取openId有值的用户
|
||||||
subscribeMessageSendApi.sendCompanyNotice(NoticeConvert.INSTANCE.convertCompanyNotice(
|
subscribeMessageSendApi.sendCompanyNotice(NoticeConvert.INSTANCE.convertCompanyNotice(
|
||||||
adminUserDO.getOpenId(), notice , currentUser.getNickname(),
|
adminUserDO.getOpenId(), notice , currentUser.getNickname(),
|
||||||
"formal"));
|
"formal"));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user