Merge branch 'dev' of http://47.97.8.94:19527/yj/zn-cloud into dev
This commit is contained in:
commit
4823c60146
@ -5,7 +5,12 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashCreateRe
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOACashConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashItemDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOACashService;
|
||||
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 io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -14,8 +19,11 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
/**
|
||||
@ -33,6 +41,12 @@ public class BpmOACashController {
|
||||
@Resource
|
||||
private BpmOACashService cashService;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private BankApi bankApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createCash(@Valid @RequestBody BpmOACashCreateReqVO createReqVO) {
|
||||
@ -47,6 +61,15 @@ public class BpmOACashController {
|
||||
|
||||
BpmOACashDO cash = cashService.getCash(id);
|
||||
|
||||
return success(BpmOACashConvert.INSTANCE.convert(cash));
|
||||
// 获取明细数据
|
||||
List<BpmOACashItemDO> cashItemDOs = cashService.getCashItem(cash.getId());
|
||||
|
||||
//获取部门信息map
|
||||
Map<Long, DeptRespDTO> deptMap = deptApi.getDeptMap(convertSet(cashItemDOs, BpmOACashItemDO::getDeptId));
|
||||
|
||||
// 获取银行卡信息
|
||||
BankRespDTO bankRespDTO = bankApi.getBank(cash.getBankId()).getCheckedData();
|
||||
|
||||
return success(BpmOACashConvert.INSTANCE.convert1(cash, cashItemDOs, deptMap, bankRespDTO));
|
||||
}
|
||||
}
|
||||
|
@ -5,15 +5,11 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
|
||||
/**
|
||||
* 现金支出 创建 Request VO
|
||||
*
|
||||
@ -25,35 +21,15 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOACashCreateReqVO {
|
||||
|
||||
@Schema(description = "申请事由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "申请事由不能为空")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "费用类型 | 字典值参照bpm_oa_cash_type", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "费用类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "费用产生部门", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "费用产生部门不能为空")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "采购申请编号")
|
||||
private Long procureId;
|
||||
|
||||
@Schema(description = "支出金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "申请金额不能为空")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "申请日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "申请日期不能为空")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate applicationDate;
|
||||
|
||||
@Schema(description = "收款人信息")
|
||||
private Long bankId;
|
||||
|
||||
@Schema(description = "备注说明", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String notes;
|
||||
@Schema(description = "现金支出明细")
|
||||
private List<Cash> cashItem;
|
||||
|
||||
@Schema(description = "报销总金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销总金额不能为空")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
|
@ -6,15 +6,10 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
|
||||
/**
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@ -24,28 +19,8 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOACashRespVO extends BpmOABaseRespVO {
|
||||
|
||||
@Schema(description = "申请事由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "申请事由不能为空")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "费用类型 | 字典值参照bpm_oa_cash_type", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "费用类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "采购申请编号")
|
||||
private Long procureId;
|
||||
|
||||
@Schema(description = "支出金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "申请金额不能为空")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "申请日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "申请日期不能为空")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate applicationDate;
|
||||
@Schema(description = "收款人信息编号")
|
||||
private Long bankId;
|
||||
|
||||
@Schema(description = "收款人名称")
|
||||
private String payeeName;
|
||||
@ -56,8 +31,11 @@ public class BpmOACashRespVO extends BpmOABaseRespVO {
|
||||
@Schema(description = "开户行名称")
|
||||
private String bankName;
|
||||
|
||||
@Schema(description = "备注说明", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String notes;
|
||||
@Schema(description = "现金支出明细")
|
||||
private List<Cash> cashItem;
|
||||
|
||||
@Schema(description = "报销总金额")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
|
@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
|
||||
/**
|
||||
* 功能描述 现金支出项目明细
|
||||
*/
|
||||
@Data
|
||||
public class Cash {
|
||||
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "申请事由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "申请事由不能为空")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "费用类型 | 字典值参照bpm_oa_cash_type", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "费用类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "费用产生部门", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "费用产生部门不能为空")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "费用产生部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "采购申请编号")
|
||||
private Long procureId;
|
||||
|
||||
@Schema(description = "支出金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "申请金额不能为空")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "申请日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "申请日期不能为空")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate applicationDate;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String notes;
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
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.cash.BpmOACashRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 现金支出打印数回数据 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOACashPrintDataRespVO extends BpmOABaseRespVO {
|
||||
|
||||
@Schema(description = "现金支出业务数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private BpmOACashRespVO bpmOACashRespVO ;
|
||||
|
||||
@Schema(description = "流程审批节点信息【包含人员签名地址】", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
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;
|
||||
}
|
||||
}
|
@ -1,12 +1,9 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.print;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
|
||||
@Schema(description = "管理后台 - 流程打印响应数据 Item Response VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@ -21,4 +18,6 @@ public class BpmProcessInstancePrintDataRespVO {
|
||||
@Schema(description = "报销业务打印数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private BpmOAReimbursementPrintDataRespVO bpmOAReimbursementPrintDataRespVO ;
|
||||
|
||||
@Schema(description = "现金支出业务打印数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private BpmOACashPrintDataRespVO bpmOACashPrintDataRespVO;
|
||||
}
|
||||
|
@ -1,11 +1,20 @@
|
||||
package cn.iocoder.yudao.module.bpm.convert.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.Cash;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashItemDO;
|
||||
import cn.iocoder.yudao.module.system.api.bank.dto.BankRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 现金支出 Convert
|
||||
*
|
||||
@ -19,4 +28,39 @@ public interface BpmOACashConvert {
|
||||
BpmOACashDO convert(BpmOACashCreateReqVO bean);
|
||||
|
||||
BpmOACashRespVO convert(BpmOACashDO bean);
|
||||
|
||||
default BpmOACashRespVO convert1(BpmOACashDO cashDO, List<BpmOACashItemDO> cashItemDOs,
|
||||
Map<Long, DeptRespDTO> deptMap, BankRespDTO bankRespDTO) {
|
||||
|
||||
BpmOACashRespVO respVO = BeanUtils.toBean(cashDO, BpmOACashRespVO.class);
|
||||
|
||||
List<Cash> cashItems = BeanUtils.toBean(cashItemDOs, Cash.class);
|
||||
if (deptMap != null) {
|
||||
|
||||
cashItems = convertList(cashItems, deptMap);
|
||||
}
|
||||
|
||||
if (bankRespDTO != null) {
|
||||
respVO.setBankNo(bankRespDTO.getBankNo());
|
||||
respVO.setBankName(bankRespDTO.getBankName());
|
||||
respVO.setPayeeName(bankRespDTO.getNickname());
|
||||
}
|
||||
|
||||
respVO.setCashItem(cashItems);
|
||||
return respVO;
|
||||
}
|
||||
|
||||
default List<Cash> convertList(List<Cash> list, Map<Long, DeptRespDTO> deptMap) {
|
||||
|
||||
return CollectionUtils.convertList(list, cash -> convert(cash, deptMap.get(cash.getDeptId())));
|
||||
}
|
||||
|
||||
default Cash convert(Cash cashItem, DeptRespDTO dept) {
|
||||
|
||||
if (dept != null) {
|
||||
cashItem.setDeptName(dept.getName());
|
||||
}
|
||||
|
||||
return cashItem;
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -40,36 +39,6 @@ public class BpmOACashDO extends BaseDO {
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 申请理由
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 费用类型 字典值参照 BPM_OA_REIMBURSEMENT_TYPE
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 费用产生部门
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 采购申请 业务编号
|
||||
*/
|
||||
private Long procureId;
|
||||
|
||||
/**
|
||||
* 现金支出金额
|
||||
*/
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
/**
|
||||
* 申请日期
|
||||
*/
|
||||
private LocalDate applicationDate;
|
||||
|
||||
/**
|
||||
* 收款人信息
|
||||
* system_bank 编号
|
||||
@ -77,9 +46,9 @@ public class BpmOACashDO extends BaseDO {
|
||||
private Long bankId;
|
||||
|
||||
/**
|
||||
* 备注说明
|
||||
* 支出总金额
|
||||
*/
|
||||
private String notes;
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
/**
|
||||
* 用章的结果
|
||||
|
@ -0,0 +1,70 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* OA 现金支出明细 DO
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@TableName(value ="bpm_oa_cash_item", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmOACashItemDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 出差表单主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 现金支出业务编号
|
||||
*/
|
||||
private Long cashId;
|
||||
|
||||
/**
|
||||
* 申请理由
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 费用类型 字典值参照 BPM_OA_REIMBURSEMENT_TYPE
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 费用产生部门
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 采购申请 业务编号
|
||||
*/
|
||||
private Long procureId;
|
||||
|
||||
/**
|
||||
* 现金支出金额
|
||||
*/
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
/**
|
||||
* 申请日期
|
||||
*/
|
||||
private LocalDate applicationDate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String notes;
|
||||
}
|
@ -49,11 +49,6 @@ public class BpmOAImprestDO extends BaseDO {
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门id
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 费用类型
|
||||
*/
|
||||
|
@ -0,0 +1,15 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 现金支出 Mapper
|
||||
*
|
||||
* @author 符溶馨
|
||||
|
||||
*/
|
||||
@Mapper
|
||||
public interface BpmOACashItemMapper extends BaseMapperX<BpmOACashItemDO> {
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
package cn.iocoder.yudao.module.bpm.framework.rpc.config;
|
||||
|
||||
import cn.iocoder.yudao.module.infra.api.config.ConfigApi;
|
||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||
import cn.iocoder.yudao.module.system.api.attendance.AttendanceApi;
|
||||
import cn.iocoder.yudao.module.system.api.bank.BankApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.PostApi;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
@ -17,7 +19,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {FileApi.class, RoleApi.class, DeptApi.class, PostApi.class, AdminUserApi.class, SmsSendApi.class, DictDataApi.class, NotifyMessageSendApi.class,
|
||||
SubscribeMessageSendApi.class, SocialClientApi.class, UsersExtApi.class, AttendanceApi.class
|
||||
SubscribeMessageSendApi.class, SocialClientApi.class, UsersExtApi.class, AttendanceApi.class, BankApi.class, ConfigApi.class
|
||||
})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
@ -2,8 +2,10 @@ package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.BpmOACashCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashItemDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
public interface BpmOACashService {
|
||||
|
||||
@ -31,4 +33,11 @@ public interface BpmOACashService {
|
||||
* @return 现金支出申请
|
||||
*/
|
||||
BpmOACashDO getCash(Long id);
|
||||
|
||||
/**
|
||||
* 获得指定得现金支出明细
|
||||
* @param cashId 现金支出 编号
|
||||
* @return 明细
|
||||
*/
|
||||
List<BpmOACashItemDO> getCashItem(Long cashId);
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
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.controller.admin.oa.vo.cash.BpmOACashCreateReqVO;
|
||||
@ -8,7 +10,9 @@ import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOACashConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOACashItemDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOACashItemMapper;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOACashMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
@ -20,7 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -45,6 +49,9 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
@Resource
|
||||
private BpmOACashMapper cashMapper;
|
||||
|
||||
@Resource
|
||||
private BpmOACashItemMapper cashItemMapper;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceApi processInstanceApi;
|
||||
|
||||
@ -65,6 +72,11 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
cashMapper.insert(cash);
|
||||
|
||||
// 批量插入现金支出明细数据
|
||||
List<BpmOACashItemDO> bpmOACashItemDOS = BeanUtils.toBean(createReqVO.getCashItem(), BpmOACashItemDO.class);
|
||||
bpmOACashItemDOS.forEach(item -> item.setCashId(cash.getId()));
|
||||
cashItemMapper.insertBatch(bpmOACashItemDOS);
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||
@ -74,14 +86,21 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
// 将工作流的编号,更新到 OA 现金支出单中
|
||||
cashMapper.updateById(new BpmOACashDO().setId(cash.getId()).setProcessInstanceId(processInstanceId));
|
||||
|
||||
List<Long> procureIds = new ArrayList<>();
|
||||
for (BpmOACashItemDO cashItemDO : bpmOACashItemDOS) {
|
||||
//报销类别为 采购费时
|
||||
if (cash.getType() == 4) {
|
||||
if (cashItemDO.getType() == 4) {
|
||||
procureIds.add(cashItemDO.getProcureId());
|
||||
}
|
||||
}
|
||||
|
||||
if (!CollectionUtil.isEmpty(procureIds)) {
|
||||
|
||||
//所有关联的采购申请改为 进行中状态
|
||||
bpmOAProcureService.updatePayFlagByIds(
|
||||
new BpmOAProcureListEditReqVO()
|
||||
.setPayFlag(BpmOAProcureDO.IN_PROGRESS)
|
||||
.setProcureIds(Collections.singletonList(cash.getProcureId()))
|
||||
.setProcureIds(procureIds)
|
||||
);
|
||||
}
|
||||
|
||||
@ -98,6 +117,14 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
public void updateCashResult(String processInstanceId, Long id, Integer result) {
|
||||
|
||||
validateLeaveExists(id);
|
||||
|
||||
// 获得现金支出业务数据
|
||||
BpmOACashDO cash = getCash(id);
|
||||
|
||||
// 获取现金支出明细
|
||||
List<BpmOACashItemDO> cashItemDOs = getCashItem(id);
|
||||
|
||||
List<Long> procureIds = new ArrayList<>();
|
||||
//审核通过 (最后节点)
|
||||
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
||||
|
||||
@ -106,16 +133,22 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
if (instance.isEnded()) {
|
||||
|
||||
//判断是否有采购报销
|
||||
BpmOACashDO cash = getCash(id);
|
||||
StringBuilder reason = new StringBuilder();
|
||||
for (BpmOACashItemDO cashItemDO : cashItemDOs) {
|
||||
|
||||
if (cashItemDO.getType() == 4) {
|
||||
procureIds.add(cashItemDO.getProcureId());
|
||||
}
|
||||
reason.append(cashItemDO.getReason()).append(",");
|
||||
}
|
||||
//报销类别为 采购费时
|
||||
if (cash.getType() == 4) {
|
||||
if (!CollectionUtil.isEmpty(procureIds)) {
|
||||
|
||||
//所有关联的采购申请改为 已支付状态
|
||||
bpmOAProcureService.updatePayFlagByIds(
|
||||
new BpmOAProcureListEditReqVO()
|
||||
.setPayFlag(BpmOAProcureDO.FLAG_TRUE)
|
||||
.setProcureIds(Collections.singletonList(cash.getProcureId()))
|
||||
.setProcureIds(procureIds)
|
||||
);
|
||||
}
|
||||
|
||||
@ -123,7 +156,7 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(cash.getUserId())
|
||||
.setProcessInstanceId(cash.getProcessInstanceId())
|
||||
.setReason(cash.getReason())
|
||||
.setReason(reason.toString())
|
||||
.setObjectId(id)
|
||||
.setType(1)
|
||||
.setStatus(0)
|
||||
@ -141,16 +174,20 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
||||
|
||||
//判断是否有采购报销
|
||||
BpmOACashDO cash = getCash(id);
|
||||
for (BpmOACashItemDO cashItemDO : cashItemDOs) {
|
||||
|
||||
if (cashItemDO.getType() == 4) {
|
||||
procureIds.add(cashItemDO.getProcureId());
|
||||
}
|
||||
}
|
||||
//报销类别为 采购费时
|
||||
if (cash.getType() == 4) {
|
||||
if (!CollectionUtil.isEmpty(procureIds)) {
|
||||
|
||||
//所有关联的采购申请改为 未支付状态
|
||||
bpmOAProcureService.updatePayFlagByIds(
|
||||
new BpmOAProcureListEditReqVO()
|
||||
.setPayFlag(BpmOAProcureDO.FLAG_FALSE)
|
||||
.setProcureIds(Collections.singletonList(cash.getProcureId()))
|
||||
.setProcureIds(procureIds)
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -169,4 +206,10 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
|
||||
return cashMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BpmOACashItemDO> getCashItem(Long cashId) {
|
||||
|
||||
return cashItemMapper.selectList(BpmOACashItemDO::getCashId, cashId);
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,23 @@
|
||||
package cn.iocoder.yudao.module.system.api.bank;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.bank.dto.BankRespDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
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.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 银行卡")
|
||||
public interface BankApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/bank";
|
||||
|
||||
@GetMapping(PREFIX + "/get")
|
||||
@Operation(summary = "获得银行卡信息")
|
||||
@Parameter(name = "bankId", description = "编号", example = "1", required = true)
|
||||
CommonResult<BankRespDTO> getBank(@RequestParam("bankId") Long bankId);
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.system.api.bank.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "RPC 服务 - 银行卡 Response DTO")
|
||||
@Data
|
||||
public class BankRespDTO {
|
||||
|
||||
@Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "银行卡号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String bankNo;
|
||||
|
||||
@Schema(description = "银行卡用户名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "开户行信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String bankName;
|
||||
}
|
@ -70,4 +70,9 @@ public interface AdminUserApi {
|
||||
@PostMapping(PREFIX + "/create")
|
||||
@Operation(summary = "创建用户")
|
||||
CommonResult<Long> createUser(@RequestBody UserSaveRespDTO saveRespDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/getUserIdsByUserNature")
|
||||
@Operation(summary = "获取所有用户性质为外勤的用户")
|
||||
@Parameter(name = "userNature", description = "用户性质", example = "3", required = true)
|
||||
CommonResult<List<Long>> getUserIdsByUserNature(@RequestParam("userNature") Integer userNature);
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.system.api.bank;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.api.bank.dto.BankRespDTO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.bank.BankDO;
|
||||
import cn.iocoder.yudao.module.system.service.bank.UserBankService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class BankApiImpl implements BankApi{
|
||||
|
||||
@Resource
|
||||
private UserBankService userBankService;
|
||||
|
||||
@Override
|
||||
public CommonResult<BankRespDTO> getBank(Long bankId) {
|
||||
|
||||
BankDO bankDO = userBankService.getBank(bankId);
|
||||
return success(BeanUtils.toBean(bankDO, BankRespDTO.class));
|
||||
}
|
||||
}
|
@ -17,6 +17,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
@ -69,4 +70,11 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||
return success(userService.createUser(BeanUtils.toBean(saveRespDTO, UserSaveReqVO.class)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<Long>> getUserIdsByUserNature(Integer userNature) {
|
||||
|
||||
List<AdminUserDO> userDOS = userService.getListByNature(userNature);
|
||||
return success(convertList(userDOS, AdminUserDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -108,6 +108,13 @@ public class AdminUserDO extends TenantBaseDO {
|
||||
* 1:公司用户 2:工厂用户
|
||||
*/
|
||||
private Integer userType;
|
||||
|
||||
/**
|
||||
* 用户性质
|
||||
* 3:正式 4:外勤
|
||||
*/
|
||||
private Integer userNature;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
|
@ -317,4 +317,10 @@ public interface AdminUserService {
|
||||
*/
|
||||
IPage<UserSimpleRespVO> getAllUserListByGroupIds(UserPageDTO dto);
|
||||
|
||||
/**
|
||||
* 获取指令性质得用户列表
|
||||
* @param userNature 用户性质
|
||||
* @return 用户列表
|
||||
*/
|
||||
List<AdminUserDO> getListByNature(Integer userNature);
|
||||
}
|
||||
|
@ -624,4 +624,10 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
return userMapper.getAllUserListByGroupIds(MyBatisUtils.buildPage(dto), dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUserDO> getListByNature(Integer userNature) {
|
||||
|
||||
return userMapper.selectList(AdminUserDO::getUserNature, userNature);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,12 +7,12 @@ import cn.iocoder.yudao.module.smartfactory.controller.admin.hik.vo.CameraReplay
|
||||
import cn.iocoder.yudao.module.smartfactory.service.hik.HikService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
|
||||
/**
|
||||
* 工厂管理-工厂列表
|
||||
@ -29,8 +29,8 @@ public class HikController {
|
||||
|
||||
@GetMapping("/getCameraUrl")
|
||||
@Operation(summary = "视频播放->查询播放地址")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:camera:view')")
|
||||
// @PermitAll
|
||||
// @PreAuthorize("@ss.hasPermission('smartfactory:camera:view')")
|
||||
@PermitAll
|
||||
public CommonResult<String> getCameraUrl(String cameraCode) {
|
||||
String url = hikService.getPreviewUrlsApi(cameraCode, 0);
|
||||
return CommonResult.success(url);
|
||||
@ -38,7 +38,7 @@ public class HikController {
|
||||
|
||||
@GetMapping("/m-getCameraUrl")
|
||||
@Operation(summary = "视频播放->查询播放地址(微信用)")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:camera:view')")
|
||||
// @PreAuthorize("@ss.hasPermission('smartfactory:camera:view')")
|
||||
public CommonResult<String> getMCameraUrl(String cameraCode) {
|
||||
|
||||
String url = hikService.getPreviewUrlsApiHttps(cameraCode);
|
||||
@ -48,8 +48,8 @@ public class HikController {
|
||||
|
||||
@GetMapping("/replayUrl")
|
||||
@Operation(summary = "视频播放->回放流")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:camera:view')")
|
||||
// @PermitAll
|
||||
// @PreAuthorize("@ss.hasPermission('smartfactory:camera:view')")
|
||||
@PermitAll
|
||||
public CommonResult<JSONObject> getReplayUrl(CameraReplayDTO cameraReplayDTO) {
|
||||
JSONObject replayUrl = hikService.getReplayUrl(cameraReplayDTO);
|
||||
return CommonResult.success(replayUrl);
|
||||
@ -57,8 +57,8 @@ public class HikController {
|
||||
|
||||
@GetMapping("/operate")
|
||||
@Operation(summary = "视频->云台操作")
|
||||
@PreAuthorize("@ss.hasPermission('smartfactory:camera:view')")
|
||||
// @PermitAll
|
||||
// @PreAuthorize("@ss.hasPermission('smartfactory:camera:view')")
|
||||
@PermitAll
|
||||
public CommonResult<String> operate(CameraOperateDTO dto) {
|
||||
|
||||
String msg = hikService.operateCamera(dto);
|
||||
|
@ -34,4 +34,11 @@ public interface CameraDeviceMapper extends BaseMapperX<CameraDeviceDO> {
|
||||
.inIfPresent(CameraDeviceDO::getFactoryId, factoryIds)
|
||||
.eq(CameraDeviceDO::getStatus, CommonStatusEnum.ENABLE.getStatus()));
|
||||
}
|
||||
|
||||
default List<CameraDeviceDO> selectListCameraByFactoryId(Long factoryId) {
|
||||
return selectList(new LambdaQueryWrapperX<CameraDeviceDO>()
|
||||
.eq(CameraDeviceDO::getFactoryId, factoryId)
|
||||
.eq(CameraDeviceDO::getStatus, CommonStatusEnum.ENABLE.getStatus())
|
||||
.eq(CameraDeviceDO::getIsShow, 1));
|
||||
}
|
||||
}
|
@ -73,7 +73,7 @@ public class CameraDeviceServiceImpl implements CameraDeviceService {
|
||||
@Override
|
||||
public List<CameraDeviceDO> getListCameraByFactoryId(Long factoryId) {
|
||||
|
||||
return cameraDeviceMapper.selectList(CameraDeviceDO::getFactoryId, factoryId);
|
||||
return cameraDeviceMapper.selectListCameraByFactoryId(factoryId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -164,8 +164,8 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
|
||||
Area area = AreaUtils.getArea(Integer.valueOf(code));
|
||||
List<ProvincesDataRespVO> vos = new ArrayList<>();
|
||||
LambdaQueryWrapperX<FactoryInfoDO> lambdaQueryWrapperX = new LambdaQueryWrapperX<FactoryInfoDO>();
|
||||
//去除中鼐总部
|
||||
lambdaQueryWrapperX.ne(FactoryInfoDO::getId, 1L);
|
||||
// 只查询 type为工厂类型的 工厂信息
|
||||
lambdaQueryWrapperX.eq(FactoryInfoDO::getType, 3L);
|
||||
//去除关闭状态工厂
|
||||
lambdaQueryWrapperX.eq(FactoryInfoDO::getStatus, CommonStatusEnum.ENABLE.getStatus());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user