Compare commits
No commits in common. "dev" and "dev-跟进用户调整" have entirely different histories.
dev
...
dev-跟进用户调整
1
pom.xml
1
pom.xml
@ -24,7 +24,6 @@
|
||||
<module>yudao-module-wms</module>
|
||||
<module>yudao-module-hrm</module>
|
||||
<module>yudao-module-crm</module>
|
||||
<module>yudao-module-erp</module>
|
||||
</modules>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
|
@ -137,12 +137,6 @@
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
</dependency>
|
||||
<!-- 中文转换大写 -->
|
||||
<dependency>
|
||||
<groupId>com.belerweb</groupId>
|
||||
<artifactId>pinyin4j</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
|
@ -1,15 +0,0 @@
|
||||
package cn.iocoder.yudao.framework.common.core;
|
||||
|
||||
/**
|
||||
* 可生成 T 数组的接口
|
||||
*
|
||||
* @author HUIHUI
|
||||
*/
|
||||
public interface ArrayValuable<T> {
|
||||
|
||||
/**
|
||||
* @return 数组
|
||||
*/
|
||||
T[] array();
|
||||
|
||||
}
|
@ -22,14 +22,6 @@ public class AssetsTypeCodeEnum {
|
||||
* 叉车 电
|
||||
*/
|
||||
public static final String FORKLIFT_ELECTRICITY = "FORKLIFT_ELECTRICITY";
|
||||
/**
|
||||
* 叉车 油转电
|
||||
*/
|
||||
public static final String FORKLIFT_OIL_TO_ELECTRICITY = "FORKLIFT_OIL_TO_ELECTRICITY";
|
||||
/**
|
||||
* 拖拉机
|
||||
*/
|
||||
public static final String FORKLIFT_TRACTOR = "FORKLIFT_TRACTOR";
|
||||
/**
|
||||
* 托盘
|
||||
*/
|
||||
@ -38,9 +30,4 @@ public class AssetsTypeCodeEnum {
|
||||
* 绑带
|
||||
*/
|
||||
public static final String STRAPS = "STRAPS";
|
||||
|
||||
/**
|
||||
* 生产机械
|
||||
*/
|
||||
public static final String PRODUCTION_MACHINERY = "PRODUCTION_MACHINERY";
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.framework.common.enums;
|
||||
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@ -14,12 +14,12 @@ import java.util.Arrays;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CommonStatusEnum implements ArrayValuable<Integer> {
|
||||
public enum CommonStatusEnum implements IntArrayValuable {
|
||||
|
||||
ENABLE(0, "开启"),
|
||||
DISABLE(1, "关闭");
|
||||
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(CommonStatusEnum::getStatus).toArray(Integer[]::new);
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(CommonStatusEnum::getStatus).toArray();
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
@ -31,7 +31,7 @@ public enum CommonStatusEnum implements ArrayValuable<Integer> {
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public Integer[] array() {
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ public enum DeptTypeEnum {
|
||||
FINANCE_DEPT("FINANCE_DEPT", "财务部门"),
|
||||
HR_DEPT("HR_DEPT", "人力部门"),
|
||||
PURCHASING_DEPT("PURCHASING_DEPT", "采购部门"),
|
||||
PROJECT_DEPT("PROJECT_DEPT", "项目部门"),
|
||||
OTHER("OTHER", "其他部门");
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.framework.common.enums;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@ -14,7 +14,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SocialTypeEnum implements ArrayValuable<Integer> {
|
||||
public enum SocialTypeEnum implements IntArrayValuable {
|
||||
|
||||
/**
|
||||
* Gitee
|
||||
@ -61,7 +61,7 @@ public enum SocialTypeEnum implements ArrayValuable<Integer> {
|
||||
WECHAT_MINI_APP_CRM(35, "WECHAT_MINI_APP_CRM"),
|
||||
;
|
||||
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(SocialTypeEnum::getType).toArray(Integer[]::new);;
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(SocialTypeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 类型
|
||||
@ -73,7 +73,7 @@ public enum SocialTypeEnum implements ArrayValuable<Integer> {
|
||||
private final String source;
|
||||
|
||||
@Override
|
||||
public Integer[] array() {
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.framework.common.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@ -13,7 +13,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Getter
|
||||
public enum TerminalEnum implements ArrayValuable<Integer> {
|
||||
public enum TerminalEnum implements IntArrayValuable {
|
||||
|
||||
WECHAT_MINI_PROGRAM(10, "微信小程序"),
|
||||
WECHAT_WAP(11, "微信公众号"),
|
||||
@ -21,7 +21,7 @@ public enum TerminalEnum implements ArrayValuable<Integer> {
|
||||
APP(31, "手机 App"),
|
||||
;
|
||||
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(TerminalEnum::getTerminal).toArray(Integer[]::new);
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(TerminalEnum::getTerminal).toArray();
|
||||
|
||||
/**
|
||||
* 终端
|
||||
@ -33,7 +33,7 @@ public enum TerminalEnum implements ArrayValuable<Integer> {
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public Integer[] array() {
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.framework.common.enums;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@ -12,13 +12,13 @@ import java.util.Arrays;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum UserTypeEnum implements ArrayValuable<Integer> {
|
||||
public enum UserTypeEnum implements IntArrayValuable {
|
||||
|
||||
MEMBER(1, "会员"), // 面向 c 端,普通用户
|
||||
ADMIN(2, "管理员"), // 面向 b 端,管理后台
|
||||
CUSTOMER(3, "客户"); //客户
|
||||
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(UserTypeEnum::getValue).toArray(Integer[]::new);
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(UserTypeEnum::getValue).toArray();
|
||||
|
||||
/**
|
||||
* 类型
|
||||
@ -34,7 +34,7 @@ public enum UserTypeEnum implements ArrayValuable<Integer> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer[] array() {
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
|
@ -3,9 +3,7 @@ package cn.iocoder.yudao.framework.common.template;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.SocialTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.template.dto.ApprovalResultNotificationMessageDTO;
|
||||
import cn.iocoder.yudao.framework.common.template.dto.PerformanceResultConfirmationReminderDTO;
|
||||
import cn.iocoder.yudao.framework.common.template.dto.ProcessToDoReminderDTO;
|
||||
import cn.iocoder.yudao.framework.common.template.dto.StaffCertificateInformationDTO;
|
||||
import cn.iocoder.yudao.framework.common.template.vo.MsgData;
|
||||
import cn.iocoder.yudao.framework.common.template.vo.SubscribeMessageReqDTO;
|
||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
||||
@ -24,10 +22,6 @@ public class WxMpMsgTemplateUtils {
|
||||
* OA流程待办提醒
|
||||
*/
|
||||
String OA_PROCESS_TO_DO_REMINDER = "rV94N8PbUOz4EQyjpJcucPQOTrBPx2icOZ5F2KNgD40";
|
||||
/**
|
||||
* 绩效结果确认提醒
|
||||
*/
|
||||
String PERFORMANCE_RESULT_CONFIRMATION_REMINDER = "56VcBVdG__KGmYQzq2q3KUbijUlKwz6KaaK0mzfPQtc";
|
||||
|
||||
|
||||
/**
|
||||
@ -121,75 +115,4 @@ public class WxMpMsgTemplateUtils {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绩效结果确认提醒
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public SubscribeMessageReqDTO convertPerformanceResultConfirmationReminder(PerformanceResultConfirmationReminderDTO dto) {
|
||||
SubscribeMessageReqDTO message = new SubscribeMessageReqDTO();
|
||||
message.setToUser(dto.getOpenId());
|
||||
message.setTemplateId(PERFORMANCE_RESULT_CONFIRMATION_REMINDER);
|
||||
//待办标题
|
||||
MsgData processType = new MsgData();
|
||||
processType.setName("thing1");
|
||||
processType.setValue(dto.getUserName());
|
||||
message.addData(processType);
|
||||
|
||||
//申请人
|
||||
MsgData applicant = new MsgData();
|
||||
applicant.setName("time2");
|
||||
applicant.setValue(dto.getTime());
|
||||
message.addData(applicant);
|
||||
|
||||
message.setJumpWxMaFlag(true);
|
||||
message.setMiniProgramState(dto.getMiniProgramState());
|
||||
message.setPage(dto.getPage());
|
||||
message.setSocialType(SocialTypeEnum.WECHAT_MINI_APP_CRM.getType());
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 叉车年检过期提醒
|
||||
*
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public SubscribeMessageReqDTO forkliftAnnualInspectionExpiredReminder(StaffCertificateInformationDTO dto) {
|
||||
SubscribeMessageReqDTO message = new SubscribeMessageReqDTO();
|
||||
message.setToUser(dto.getOpenId());
|
||||
message.setTemplateId(PERFORMANCE_RESULT_CONFIRMATION_REMINDER);
|
||||
//证件类型
|
||||
MsgData certificateName = new MsgData();
|
||||
certificateName.setName("thing1");
|
||||
certificateName.setValue(dto.getCertificateName());
|
||||
message.addData(certificateName);
|
||||
|
||||
//到期时间
|
||||
MsgData time = new MsgData();
|
||||
time.setName("time2");
|
||||
time.setValue(dto.getTime());
|
||||
message.addData(time);
|
||||
|
||||
//姓名
|
||||
MsgData name = new MsgData();
|
||||
name.setName("thing4");
|
||||
name.setValue(dto.getTime());
|
||||
message.addData(name);
|
||||
|
||||
//备注
|
||||
MsgData remarks = new MsgData();
|
||||
remarks.setName("thing3");
|
||||
remarks.setValue(dto.getTime());
|
||||
message.addData(remarks);
|
||||
|
||||
message.setJumpWxMaFlag(false);
|
||||
// message.setMiniProgramState(dto.getMiniProgramState());
|
||||
// message.setPage(dto.getPage());
|
||||
message.setSocialType(SocialTypeEnum.WECHAT_MINI_APP.getType());
|
||||
return message;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,20 +0,0 @@
|
||||
package cn.iocoder.yudao.framework.common.template.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PerformanceResultConfirmationReminderDTO {
|
||||
@Schema(description = "接收者(用户)的 openid")
|
||||
private String openId;
|
||||
@Schema(description = "被考核人")
|
||||
private String userName;
|
||||
@Schema(description = "考核时间")
|
||||
private String time;
|
||||
@Schema(description = "跳转小程序类型")
|
||||
private String miniProgramState = "formal";
|
||||
@Schema(description = "小程序页面地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "pages/home/index")
|
||||
private String page;
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package cn.iocoder.yudao.framework.common.template.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class StaffCertificateInformationDTO {
|
||||
@Schema(description = "接收者(用户)的 openid")
|
||||
private String openId;
|
||||
@Schema(description = "工人名称")
|
||||
private String userName;
|
||||
@Schema(description = "证书名称")
|
||||
private String certificateName;
|
||||
@Schema(description = "到期时间")
|
||||
private String time;
|
||||
@Schema(description = "备注")
|
||||
private String remarks;
|
||||
@Schema(description = "跳转小程序类型")
|
||||
private String miniProgramState = "formal";
|
||||
@Schema(description = "小程序页面地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "pages/home/index")
|
||||
private String page;
|
||||
}
|
@ -304,18 +304,13 @@ public class CollectionUtils {
|
||||
return valueFunc.apply(t);
|
||||
}
|
||||
|
||||
public static <T, V extends Comparable<? super V>> V getSumValue(Collection<T> from, Function<T, V> valueFunc,
|
||||
public static <T, V extends Comparable<? super V>> V getSumValue(List<T> from, Function<T, V> valueFunc,
|
||||
BinaryOperator<V> accumulator) {
|
||||
return getSumValue(from, valueFunc, accumulator, null);
|
||||
}
|
||||
|
||||
public static <T, V extends Comparable<? super V>> V getSumValue(Collection<T> from, Function<T, V> valueFunc,
|
||||
BinaryOperator<V> accumulator, V defaultValue) {
|
||||
if (CollUtil.isEmpty(from)) {
|
||||
return defaultValue;
|
||||
return null;
|
||||
}
|
||||
assert !from.isEmpty(); // 断言,避免告警
|
||||
return from.stream().map(valueFunc).filter(Objects::nonNull).reduce(accumulator).orElse(defaultValue);
|
||||
assert from.size() > 0; // 断言,避免告警
|
||||
return from.stream().map(valueFunc).reduce(accumulator).get();
|
||||
}
|
||||
|
||||
public static <T> void addIfNotNull(Collection<T> coll, T item) {
|
||||
@ -328,7 +323,5 @@ public class CollectionUtils {
|
||||
public static <T> Collection<T> singleton(T deptId) {
|
||||
return deptId == null ? Collections.emptyList() : Collections.singleton(deptId);
|
||||
}
|
||||
public static <T> List<T> newArrayList(List<List<T>> list) {
|
||||
return list.stream().filter(Objects::nonNull).flatMap(Collection::stream).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -214,39 +214,4 @@ public class LocalDateTimeUtils {
|
||||
return !end.isBefore(otherStart) && !otherEnd.isBefore(start);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取今天的开始时间
|
||||
*
|
||||
* @return 今天
|
||||
*/
|
||||
public static LocalDateTime getToday() {
|
||||
return LocalDateTimeUtil.beginOfDay(LocalDateTime.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取昨天的开始时间
|
||||
*
|
||||
* @return 昨天
|
||||
*/
|
||||
public static LocalDateTime getYesterday() {
|
||||
return LocalDateTimeUtil.beginOfDay(LocalDateTime.now().minusDays(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本月的开始时间
|
||||
*
|
||||
* @return 本月
|
||||
*/
|
||||
public static LocalDateTime getMonth() {
|
||||
return beginOfMonth(LocalDateTime.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取本年的开始时间
|
||||
*
|
||||
* @return 本年
|
||||
*/
|
||||
public static LocalDateTime getYear() {
|
||||
return LocalDateTime.now().with(TemporalAdjusters.firstDayOfYear()).with(LocalTime.MIN);
|
||||
}
|
||||
}
|
||||
|
@ -1,322 +0,0 @@
|
||||
package cn.iocoder.yudao.framework.common.util.number;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
|
||||
/**
|
||||
* @Desc:
|
||||
* @Author: aikai
|
||||
* @Date: 2025/04/11
|
||||
*/
|
||||
public class BigDecimalUtil {
|
||||
|
||||
// 默认除法运算精度
|
||||
private static final int DEF_DIV_SCALE = 2;
|
||||
private static final BigDecimal ZERO = new BigDecimal(0);
|
||||
|
||||
// 这个类不能实例化
|
||||
private BigDecimalUtil() {
|
||||
}
|
||||
|
||||
// 是否大于0
|
||||
public static boolean isGreaterThanZero(Object value) {
|
||||
if (null == value) {
|
||||
value = BigDecimal.ZERO;
|
||||
}
|
||||
return getBigDecimal(value).compareTo(ZERO) > 0;
|
||||
}
|
||||
|
||||
// 是否大于0
|
||||
public static boolean isGreaterThanOrEqualToZero(Object value) {
|
||||
if (null == value) {
|
||||
value = BigDecimal.ZERO;
|
||||
}
|
||||
return getBigDecimal(value).compareTo(ZERO) >= 0;
|
||||
}
|
||||
|
||||
// 是否小于0
|
||||
public static boolean isLessThanZero(Object value) {
|
||||
if (null == value) {
|
||||
value = BigDecimal.ZERO;
|
||||
}
|
||||
return getBigDecimal(value).compareTo(ZERO) < 0;
|
||||
}
|
||||
|
||||
// 是否小于等于0
|
||||
public static boolean isLessThanOrEqualToZero(Object value) {
|
||||
if (null == value) {
|
||||
value = BigDecimal.ZERO;
|
||||
}
|
||||
return getBigDecimal(value).compareTo(ZERO) <= 0;
|
||||
}
|
||||
|
||||
// 是否大于
|
||||
public static boolean isGreaterThan(Object v1, Object v2) {
|
||||
if (null == v1) {
|
||||
v1 = BigDecimal.ZERO;
|
||||
}
|
||||
if (null == v2) {
|
||||
v2 = BigDecimal.ZERO;
|
||||
}
|
||||
return getBigDecimal(v1).compareTo(getBigDecimal(v2)) > 0;
|
||||
}
|
||||
|
||||
// 是否大于等于
|
||||
public static boolean isGreaterThanOrEqualTo(Object v1, Object v2) {
|
||||
if (null == v1) {
|
||||
v1 = BigDecimal.ZERO;
|
||||
}
|
||||
if (null == v2) {
|
||||
v2 = BigDecimal.ZERO;
|
||||
}
|
||||
return getBigDecimal(v1).compareTo(getBigDecimal(v2)) >= 0;
|
||||
}
|
||||
|
||||
|
||||
// 是否小于
|
||||
public static boolean isLessThan(Object v1, Object v2) {
|
||||
if (null == v1) {
|
||||
v1 = BigDecimal.ZERO;
|
||||
}
|
||||
if (null == v2) {
|
||||
v2 = BigDecimal.ZERO;
|
||||
}
|
||||
return getBigDecimal(v1).compareTo(getBigDecimal(v2)) < 0;
|
||||
}
|
||||
|
||||
// 是否小于等于
|
||||
public static boolean isLessThanOrEqualTo(Object v1, Object v2) {
|
||||
if (null == v1) {
|
||||
v1 = BigDecimal.ZERO;
|
||||
}
|
||||
if (null == v2) {
|
||||
v2 = BigDecimal.ZERO;
|
||||
}
|
||||
return getBigDecimal(v1).compareTo(getBigDecimal(v2)) <= 0;
|
||||
}
|
||||
|
||||
// 是否等于
|
||||
public static boolean isEqualTo(Object v1, Object v2) {
|
||||
if (null == v1) {
|
||||
v1 = BigDecimal.ZERO;
|
||||
}
|
||||
if (null == v2) {
|
||||
v2 = BigDecimal.ZERO;
|
||||
}
|
||||
BigDecimal var1 = getBigDecimal(v1);
|
||||
BigDecimal var2 = getBigDecimal(v2);
|
||||
return var1.compareTo(var2) == 0;
|
||||
}
|
||||
|
||||
public static boolean isEqZero(Object v1) {
|
||||
if (null == v1) {
|
||||
v1 = BigDecimal.ZERO;
|
||||
}
|
||||
BigDecimal var1 = getBigDecimal(v1);
|
||||
return var1.compareTo(BigDecimal.ZERO) == 0;
|
||||
}
|
||||
|
||||
// 是否为空 /
|
||||
public static boolean isEmpty(Object obj) {
|
||||
if (null == obj) {
|
||||
return true;
|
||||
}
|
||||
if (isEqualTo(BigDecimal.ZERO, obj)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isNotEmpty(Object obj) {
|
||||
if (null == obj) {
|
||||
return false;
|
||||
}
|
||||
if (isEqualTo(BigDecimal.ZERO, obj)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的加法运算。
|
||||
*
|
||||
* @param v1 被加数
|
||||
* @param v2 加数
|
||||
* @return 两个参数的和
|
||||
*/
|
||||
public static BigDecimal add(Object v1, Object v2) {
|
||||
if (null == v1) {
|
||||
v1 = BigDecimal.ZERO;
|
||||
}
|
||||
if (null == v2) {
|
||||
v2 = BigDecimal.ZERO;
|
||||
}
|
||||
return getBigDecimal(v1).add(getBigDecimal(v2));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的减法运算。
|
||||
*
|
||||
* @param v1 被减数
|
||||
* @param v2 减数
|
||||
* @return 两个参数的差
|
||||
*/
|
||||
public static BigDecimal sub(Object v1, Object v2) {
|
||||
if (null == v1) {
|
||||
v1 = BigDecimal.ZERO;
|
||||
}
|
||||
if (null == v2) {
|
||||
v2 = BigDecimal.ZERO;
|
||||
}
|
||||
return getBigDecimal(v1).subtract(getBigDecimal(v2));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的乘法运算。
|
||||
*
|
||||
* @param v1 被乘数
|
||||
* @param v2 乘数
|
||||
* @return 两个参数的积
|
||||
*/
|
||||
public static BigDecimal mul(Object v1, Object v2) {
|
||||
if (null == v1) {
|
||||
v1 = BigDecimal.ZERO;
|
||||
}
|
||||
if (null == v2) {
|
||||
v2 = BigDecimal.ZERO;
|
||||
}
|
||||
return getBigDecimal(v1).multiply(getBigDecimal(v2));
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供精确的乘法运算
|
||||
*
|
||||
* @param v1
|
||||
* @param arg
|
||||
* @return 多数
|
||||
*/
|
||||
public static BigDecimal mostMul(Object v1, Object... arg) {
|
||||
if (v1 == null) {
|
||||
v1 = BigDecimal.ZERO;
|
||||
}
|
||||
for (Object obj : arg) {
|
||||
if (obj == null) {
|
||||
obj = BigDecimal.ZERO;
|
||||
}
|
||||
v1 = getBigDecimal(v1).multiply(getBigDecimal(obj));
|
||||
|
||||
}
|
||||
return (BigDecimal) v1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供(相对)精确的除法运算,当发生除不尽的情况时, 精确到小数点以后10位,以后的数字四舍五入。
|
||||
*
|
||||
* @param v1 被除数
|
||||
* @param v2 除数
|
||||
* @return 两个参数的商
|
||||
*/
|
||||
public static BigDecimal div(Object v1, Object v2) {
|
||||
return div(getBigDecimal(v1), getBigDecimal(v2), DEF_DIV_SCALE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提供(相对)精确的除法运算。 当发生除不尽的情况时,由scale参数指定精度,以后的数字四舍五入。
|
||||
*
|
||||
* @param v1 被除数
|
||||
* @param v2 除数
|
||||
* @param scale 表示表示需要精确到小数点以后几位。
|
||||
* @return 两个参数的商
|
||||
*/
|
||||
public static BigDecimal div(Object v1, Object v2, int scale) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
}
|
||||
return getBigDecimal(v1).divide(getBigDecimal(v2), scale, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
|
||||
public static BigDecimal div(Object v1, Object v2, int scale, int roundingMode) {
|
||||
if (scale < 0) {
|
||||
throw new IllegalArgumentException("The scale must be a positive integer or zero");
|
||||
}
|
||||
return getBigDecimal(v1).divide(getBigDecimal(v2), scale, roundingMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Object转BigDecimal类型
|
||||
*
|
||||
* @param value 要转的object类型
|
||||
* @return 转成的BigDecimal类型数据
|
||||
*/
|
||||
public static BigDecimal getBigDecimal(Object value) {
|
||||
BigDecimal ret = null;
|
||||
if (value != null) {
|
||||
if (value instanceof BigDecimal) {
|
||||
ret = (BigDecimal) value;
|
||||
} else if (value instanceof String) {
|
||||
if (StrUtil.isEmpty((String) value)) {
|
||||
value = "0";
|
||||
}
|
||||
ret = new BigDecimal((String) value);
|
||||
} else if (value instanceof BigInteger) {
|
||||
ret = new BigDecimal((BigInteger) value);
|
||||
} else if (value instanceof Number) {
|
||||
ret = new BigDecimal(value.toString());
|
||||
} else if (value instanceof Integer) {
|
||||
ret = new BigDecimal((Integer) value);
|
||||
} else {
|
||||
throw new ClassCastException("Not possible to coerce [" + value + "] from class " + value.getClass() + " into a BigDecimal.");
|
||||
}
|
||||
} else {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 差
|
||||
*
|
||||
* @param i
|
||||
* @param arg
|
||||
* @return
|
||||
*/
|
||||
public static BigDecimal subs(BigDecimal i, BigDecimal... arg) {
|
||||
BigDecimal difference = i;
|
||||
for (BigDecimal b : arg) {
|
||||
difference = difference.subtract(b);
|
||||
}
|
||||
return difference;
|
||||
}
|
||||
|
||||
public static BigDecimal getZeroMax(BigDecimal bigDecimal) {
|
||||
if (isLessThanZero(bigDecimal)) {
|
||||
return ZERO;
|
||||
}
|
||||
return bigDecimal;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 和
|
||||
*
|
||||
* @param i
|
||||
* @param arg
|
||||
* @return
|
||||
*/
|
||||
public static BigDecimal adds(BigDecimal i, BigDecimal... arg) {
|
||||
BigDecimal bigDecimal = i;
|
||||
if (bigDecimal == null) {
|
||||
bigDecimal = BigDecimal.ZERO;
|
||||
}
|
||||
for (BigDecimal b : arg) {
|
||||
if (b == null) {
|
||||
b = BigDecimal.ZERO;
|
||||
}
|
||||
bigDecimal = bigDecimal.add(b);
|
||||
}
|
||||
return bigDecimal;
|
||||
}
|
||||
}
|
@ -12,15 +12,6 @@ import java.math.RoundingMode;
|
||||
|
||||
*/
|
||||
public class MoneyUtils {
|
||||
/**
|
||||
* 金额的小数位数
|
||||
*/
|
||||
private static final int PRICE_SCALE = 2;
|
||||
|
||||
/**
|
||||
* 百分比对应的 BigDecimal 对象
|
||||
*/
|
||||
public static final BigDecimal PERCENT_100 = BigDecimal.valueOf(100);
|
||||
|
||||
/**
|
||||
* 计算百分比金额,四舍五入
|
||||
@ -78,34 +69,5 @@ public class MoneyUtils {
|
||||
public static String fenToYuanStr(int fen) {
|
||||
return new Money(0, fen).toString();
|
||||
}
|
||||
/**
|
||||
* 金额相乘,默认进行四舍五入
|
||||
*
|
||||
* 位数:{@link #PRICE_SCALE}
|
||||
*
|
||||
* @param price 金额
|
||||
* @param count 数量
|
||||
* @return 金额相乘结果
|
||||
*/
|
||||
public static BigDecimal priceMultiply(BigDecimal price, BigDecimal count) {
|
||||
if (price == null || count == null) {
|
||||
return null;
|
||||
}
|
||||
return price.multiply(count).setScale(PRICE_SCALE, RoundingMode.HALF_UP);
|
||||
}
|
||||
/**
|
||||
* 金额相乘(百分比),默认进行四舍五入
|
||||
*
|
||||
* 位数:{@link #PRICE_SCALE}
|
||||
*
|
||||
* @param price 金额
|
||||
* @param percent 百分比
|
||||
* @return 金额相乘结果
|
||||
*/
|
||||
public static BigDecimal priceMultiplyPercent(BigDecimal price, BigDecimal percent) {
|
||||
if (price == null || percent == null) {
|
||||
return null;
|
||||
}
|
||||
return price.multiply(percent).divide(PERCENT_100, PRICE_SCALE, RoundingMode.HALF_UP);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* Bean 工具类
|
||||
@ -13,7 +12,7 @@ import java.util.function.Consumer;
|
||||
* 1. 默认使用 {@link cn.hutool.core.bean.BeanUtil} 作为实现类,虽然不同 bean 工具的性能有差别,但是对绝大多数同学的项目,不用在意这点性能
|
||||
* 2. 针对复杂的对象转换,可以搜参考 AuthConvert 实现,通过 mapstruct + default 配合实现
|
||||
*
|
||||
* @author 芋道源码
|
||||
|
||||
*/
|
||||
public class BeanUtils {
|
||||
|
||||
@ -21,14 +20,6 @@ public class BeanUtils {
|
||||
return BeanUtil.toBean(source, targetClass);
|
||||
}
|
||||
|
||||
public static <T> T toBean(Object source, Class<T> targetClass, Consumer<T> peek) {
|
||||
T target = toBean(source, targetClass);
|
||||
if (target != null) {
|
||||
peek.accept(target);
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
public static <S, T> List<T> toBean(List<S> source, Class<T> targetType) {
|
||||
if (source == null) {
|
||||
return null;
|
||||
@ -36,34 +27,11 @@ public class BeanUtils {
|
||||
return CollectionUtils.convertList(source, s -> toBean(s, targetType));
|
||||
}
|
||||
|
||||
public static <S, T> List<T> toBean(List<S> source, Class<T> targetType, Consumer<T> peek) {
|
||||
List<T> list = toBean(source, targetType);
|
||||
if (list != null) {
|
||||
list.forEach(peek);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static <S, T> PageResult<T> toBean(PageResult<S> source, Class<T> targetType) {
|
||||
return toBean(source, targetType, null);
|
||||
}
|
||||
|
||||
public static <S, T> PageResult<T> toBean(PageResult<S> source, Class<T> targetType, Consumer<T> peek) {
|
||||
public static <S, T> PageResult<T> toBean(PageResult<S> source, Class<T> targetType) {
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
List<T> list = toBean(source.getList(), targetType);
|
||||
if (peek != null) {
|
||||
list.forEach(peek);
|
||||
}
|
||||
return new PageResult<>(list, source.getTotal());
|
||||
return new PageResult<>(toBean(source.getList(), targetType), source.getTotal());
|
||||
}
|
||||
|
||||
public static void copyProperties(Object source, Object target) {
|
||||
if (source == null || target == null) {
|
||||
return;
|
||||
}
|
||||
BeanUtil.copyProperties(source, target, false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
package cn.iocoder.yudao.framework.common.util.spring;
|
||||
|
||||
import net.sourceforge.pinyin4j.PinyinHelper;
|
||||
|
||||
/**
|
||||
* Spring 中文转换
|
||||
*/
|
||||
public class ChineseConversionUtils {
|
||||
|
||||
public static String getChineseInitials(String chinese) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
for (char c : chinese.toCharArray()) {
|
||||
// 获取汉字对应的拼音数组(可能有多音字)
|
||||
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c);
|
||||
if (pinyinArray != null && pinyinArray.length > 0) {
|
||||
// 取第一个拼音的首字母并转大写
|
||||
result.append(pinyinArray[0].charAt(0));
|
||||
}
|
||||
}
|
||||
return result.toString().toUpperCase();
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.framework.common.validation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
@ -22,9 +22,9 @@ import java.lang.annotation.*;
|
||||
public @interface InEnum {
|
||||
|
||||
/**
|
||||
* @return 实现 ArrayValuable 接口的类
|
||||
* @return 实现 EnumValuable 接口的
|
||||
*/
|
||||
Class<? extends ArrayValuable<?>> value();
|
||||
Class<? extends IntArrayValuable> value();
|
||||
|
||||
String message() default "必须在指定范围 {value}";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package cn.iocoder.yudao.framework.common.validation;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
@ -9,31 +9,29 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class InEnumCollectionValidator implements ConstraintValidator<InEnum, Collection<?>> {
|
||||
public class InEnumCollectionValidator implements ConstraintValidator<InEnum, Collection<Integer>> {
|
||||
|
||||
private List<?> values;
|
||||
private List<Integer> values;
|
||||
|
||||
@Override
|
||||
public void initialize(InEnum annotation) {
|
||||
ArrayValuable<?>[] values = annotation.value().getEnumConstants();
|
||||
IntArrayValuable[] values = annotation.value().getEnumConstants();
|
||||
if (values.length == 0) {
|
||||
this.values = Collections.emptyList();
|
||||
} else {
|
||||
this.values = Arrays.asList(values[0].array());
|
||||
this.values = Arrays.stream(values[0].array()).boxed().collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(Collection<?> list, ConstraintValidatorContext context) {
|
||||
if (list == null) {
|
||||
return true;
|
||||
}
|
||||
public boolean isValid(Collection<Integer> list, ConstraintValidatorContext context) {
|
||||
// 校验通过
|
||||
if (CollUtil.containsAll(values, list)) {
|
||||
return true;
|
||||
}
|
||||
// 校验不通过,自定义提示语句
|
||||
// 校验不通过,自定义提示语句(因为,注解上的 value 是枚举类,无法获得枚举类的实际值)
|
||||
context.disableDefaultConstraintViolation(); // 禁用默认的 message 的值
|
||||
context.buildConstraintViolationWithTemplate(context.getDefaultConstraintMessageTemplate()
|
||||
.replaceAll("\\{value}", CollUtil.join(list, ","))).addConstraintViolation(); // 重新添加错误提示语句
|
||||
|
@ -1,29 +1,30 @@
|
||||
package cn.iocoder.yudao.framework.common.validation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class InEnumValidator implements ConstraintValidator<InEnum, Object> {
|
||||
public class InEnumValidator implements ConstraintValidator<InEnum, Integer> {
|
||||
|
||||
private List<?> values;
|
||||
private List<Integer> values;
|
||||
|
||||
@Override
|
||||
public void initialize(InEnum annotation) {
|
||||
ArrayValuable<?>[] values = annotation.value().getEnumConstants();
|
||||
IntArrayValuable[] values = annotation.value().getEnumConstants();
|
||||
if (values.length == 0) {
|
||||
this.values = Collections.emptyList();
|
||||
} else {
|
||||
this.values = Arrays.asList(values[0].array());
|
||||
this.values = Arrays.stream(values[0].array()).boxed().collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(Object value, ConstraintValidatorContext context) {
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext context) {
|
||||
// 为空时,默认不校验,即认为通过
|
||||
if (value == null) {
|
||||
return true;
|
||||
@ -32,7 +33,7 @@ public class InEnumValidator implements ConstraintValidator<InEnum, Object> {
|
||||
if (values.contains(value)) {
|
||||
return true;
|
||||
}
|
||||
// 校验不通过,自定义提示语句
|
||||
// 校验不通过,自定义提示语句(因为,注解上的 value 是枚举类,无法获得枚举类的实际值)
|
||||
context.disableDefaultConstraintViolation(); // 禁用默认的 message 的值
|
||||
context.buildConstraintViolationWithTemplate(context.getDefaultConstraintMessageTemplate()
|
||||
.replaceAll("\\{value}", values.toString())).addConstraintViolation(); // 重新添加错误提示语句
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.framework.ip.core.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@ -13,7 +13,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum AreaTypeEnum implements ArrayValuable<Integer> {
|
||||
public enum AreaTypeEnum implements IntArrayValuable {
|
||||
|
||||
COUNTRY(1, "国家"),
|
||||
PROVINCE(2, "省份"),
|
||||
@ -21,7 +21,7 @@ public enum AreaTypeEnum implements ArrayValuable<Integer> {
|
||||
DISTRICT(4, "地区"), // 县、镇、区等
|
||||
;
|
||||
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(AreaTypeEnum::getType).toArray(Integer[]::new);
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(AreaTypeEnum::getType).toArray();
|
||||
|
||||
/**
|
||||
* 类型
|
||||
@ -33,7 +33,7 @@ public enum AreaTypeEnum implements ArrayValuable<Integer> {
|
||||
private final String name;
|
||||
|
||||
@Override
|
||||
public Integer[] array() {
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,7 @@
|
||||
package cn.iocoder.yudao.framework.pay.core.enums.transfer;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.iocoder.yudao.framework.common.core.ArrayValuable;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@ -15,7 +14,7 @@ import java.util.Arrays;
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PayTransferTypeEnum implements ArrayValuable<Integer> {
|
||||
public enum PayTransferTypeEnum implements IntArrayValuable {
|
||||
|
||||
ALIPAY_BALANCE(1, "支付宝余额"),
|
||||
WX_BALANCE(2, "微信余额"),
|
||||
@ -28,10 +27,10 @@ public enum PayTransferTypeEnum implements ArrayValuable<Integer> {
|
||||
private final Integer type;
|
||||
private final String name;
|
||||
|
||||
public static final Integer[] ARRAYS = Arrays.stream(values()).map(PayTransferTypeEnum::getType).toArray(Integer[]::new);
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PayTransferTypeEnum::getType).toArray();
|
||||
|
||||
@Override
|
||||
public Integer[] array() {
|
||||
public int[] array() {
|
||||
return ARRAYS;
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,6 @@ import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Excel 工具类
|
||||
@ -50,13 +49,14 @@ public class ExcelUtils {
|
||||
|
||||
public static <T> void write(HttpServletResponse response, String filename, String sheetName,
|
||||
Class<T> head, List<T> data,
|
||||
Map<Integer, List<String>> mapDropDown) throws IOException {
|
||||
int col, List<String> value,
|
||||
int col1,List<String> value1) throws IOException {
|
||||
|
||||
// 输出excel
|
||||
EasyExcel.write(response.getOutputStream(), head)
|
||||
.autoCloseStream(false) // 不要自动关闭,交给 Servlet 自己处理
|
||||
.registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) // 基于 column 长度,自动适配。最大 255 宽度
|
||||
.registerWriteHandler(new SpinnerWriteHandler(mapDropDown))
|
||||
.registerWriteHandler(new SpinnerWriteHandler(col, value, col1, value1))
|
||||
.registerConverter(new LongStringConverter()) // 避免 Long 类型丢失精度
|
||||
.excelType(ExcelTypeEnum.XLS)
|
||||
.sheet(sheetName).doWrite(data);
|
||||
|
@ -7,30 +7,42 @@ import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddressList;
|
||||
import org.apache.poi.xssf.usermodel.XSSFDataValidation;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class SpinnerWriteHandler implements SheetWriteHandler {
|
||||
|
||||
private Map<Integer, List<String>> mapDropDown;
|
||||
private int col;
|
||||
|
||||
private int col1;
|
||||
|
||||
private List<String> deptName;
|
||||
|
||||
private List<String> postName;
|
||||
|
||||
public SpinnerWriteHandler() {
|
||||
}
|
||||
|
||||
public SpinnerWriteHandler(Map<Integer, List<String>> mapDropDown) {
|
||||
public SpinnerWriteHandler(int col, List<String> deptName,
|
||||
int col1, List<String> postName) {
|
||||
|
||||
this.mapDropDown = mapDropDown;
|
||||
this.col = col;
|
||||
this.col1 = col1;
|
||||
this.deptName = deptName;
|
||||
this.postName = postName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {
|
||||
|
||||
// Map<Integer, List<String>> mapDropDown = new HashMap<>();
|
||||
// // 这里的key值 对应导出列的顺序 从0开始
|
||||
// if (deptName != null) {
|
||||
// mapDropDown.put(col, deptName);
|
||||
// }
|
||||
// mapDropDown.put(col1, postName);
|
||||
Map<Integer, String[]> mapDropDown = new HashMap<>();
|
||||
// 这里的key值 对应导出列的顺序 从0开始
|
||||
if (deptName != null) {
|
||||
mapDropDown.put(col, deptName.toArray(new String[0]));
|
||||
}
|
||||
mapDropDown.put(col1, postName.toArray(new String[0]));
|
||||
Sheet sheet = writeSheetHolder.getSheet();
|
||||
/// 开始设置下拉框
|
||||
DataValidationHelper helper = sheet.getDataValidationHelper();// 设置下拉框
|
||||
@ -44,7 +56,7 @@ public class SpinnerWriteHandler implements SheetWriteHandler {
|
||||
Name category1Name = workbook.createName();
|
||||
category1Name.setNameName(hiddenName);
|
||||
|
||||
for (Map.Entry<Integer, List<String>> entry : mapDropDown.entrySet()) {
|
||||
for (Map.Entry<Integer, String[]> entry : mapDropDown.entrySet()) {
|
||||
|
||||
/*** 起始行、终止行、起始列、终止列 **/
|
||||
CellRangeAddressList addressList = new CellRangeAddressList(1, 1000, entry.getKey(), entry.getKey());
|
||||
@ -53,18 +65,18 @@ public class SpinnerWriteHandler implements SheetWriteHandler {
|
||||
String excelLine = getExcelLine(entry.getKey());
|
||||
|
||||
// 循环赋值
|
||||
List<String> values = entry.getValue();
|
||||
for (int i = 0; i < values.size(); i++) {
|
||||
String[] values = entry.getValue();
|
||||
for (int i = 0, length = values.length; i < length; i++) {
|
||||
// 3:表示你开始的行数 3表示 你开始的列数
|
||||
Row row = hidden.getRow(i);
|
||||
if (row == null) {
|
||||
row = hidden.createRow(i);
|
||||
}
|
||||
row.createCell(entry.getKey()).setCellValue(values.get(i));
|
||||
row.createCell(entry.getKey()).setCellValue(values[i]);
|
||||
}
|
||||
// hidden!$H:$1:$H$50 sheet为hidden的 H1列开始H50行数据获取下拉数组
|
||||
String refers = hiddenName + "!$"+excelLine+
|
||||
"$1:$"+excelLine +"$"+ (values.size());
|
||||
"$1:$"+excelLine +"$"+ (values.length);
|
||||
|
||||
/*** 设置下拉框数据 **/
|
||||
DataValidationConstraint constraint = helper.createFormulaListConstraint(refers);
|
||||
|
@ -209,13 +209,6 @@ spring:
|
||||
- Path=/app-api/statistics/**
|
||||
filters:
|
||||
- RewritePath=/app-api/statistics/v3/api-docs, /v3/api-docs
|
||||
## erp-server 服务
|
||||
- id: erp-admin-api # 路由的编号
|
||||
uri: grayLb://erp-server
|
||||
predicates: # 断言,作为路由的匹配条件,对应 RouteDefinition 数组
|
||||
- Path=/admin-api/erp/**
|
||||
filters:
|
||||
- RewritePath=/admin-api/erp/v3/api-docs, /v3/api-docs # 配置,保证转发到 /v3/api-docs
|
||||
x-forwarded:
|
||||
prefix-enabled: false # 避免 Swagger 重复带上额外的 /admin-api/system 前缀
|
||||
|
||||
@ -269,6 +262,3 @@ knife4j:
|
||||
- name: statistics-server
|
||||
service-name: statistics-server
|
||||
url: /admin-api/statistics/v3/api-docs
|
||||
- name: erp-server
|
||||
service-name: erp-server
|
||||
url: /admin-api/erp/v3/api-docs
|
||||
|
@ -40,8 +40,4 @@ public interface BpmOAContractApi {
|
||||
@PostMapping(PREFIX + "/getList")
|
||||
@Operation(summary = "获得合同列表")
|
||||
CommonResult<List<BpmOAContractDTO>> getContractList(@RequestBody BpmOAContractVO respVO);
|
||||
|
||||
@PostMapping(PREFIX + "/updateSettlementFlagByIds")
|
||||
@Operation(summary = "批量更新合同结算状态")
|
||||
void updateSettlementFlagByIds(@RequestBody List<Long> contractIds);
|
||||
}
|
||||
|
@ -1,28 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.loan.BpmOALoanSumDTO;
|
||||
import cn.iocoder.yudao.module.bpm.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;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 流程实例")
|
||||
public interface BpmOALoanApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/oa/loan";
|
||||
|
||||
@GetMapping(PREFIX + "/getListByStaffId")
|
||||
@Operation(summary = "获取员工当月需抵扣的借支金额")
|
||||
@Parameter(name = "staffId", description = "用户编号", required = true)
|
||||
@Parameter(name = "month", description = "月份", required = true)
|
||||
CommonResult<List<BpmOALoanSumDTO>> getListByStaffId(@RequestParam("staffId") Collection<Long> staffId,
|
||||
@RequestParam("month") String month);
|
||||
}
|
@ -1,7 +1,9 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.receipt.*;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.receipt.BpmOAReceiptDTO;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.receipt.BpmOAReceiptVO;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.receipt.ReceiptStatisticsDTO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -31,9 +33,5 @@ public interface BpmOAReceiptApi {
|
||||
@GetMapping(PREFIX + "/get-receipt-statistics")
|
||||
@Operation(summary = "获得指定用户的回款统计信息")
|
||||
CommonResult<List<ReceiptStatisticsDTO>> getContractStatistics(@RequestParam("userId") List<Long> userIds,
|
||||
@RequestParam(name = "createTime", required = false) LocalDateTime[] createTime);
|
||||
|
||||
@PostMapping(PREFIX + "/getReceiptSettlement")
|
||||
@Operation(summary = "获取用户回款结算信息")
|
||||
CommonResult<List<ReceiptSettlementDTO>> getReceiptSettlement(@RequestBody ReceiptSettlementVO vo);
|
||||
@RequestParam(name = "createTime", required = false) LocalDateTime[] createTime);
|
||||
}
|
||||
|
@ -1,28 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.salesperformance.SalesPerformanceDTO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.ApiConstants;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 销售目标")
|
||||
public interface BpmOASalesPerformanceApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/oa/salesPerformance";
|
||||
|
||||
@GetMapping(PREFIX + "/getSalesPerformance")
|
||||
@Operation(summary = "根据日期获取用户销售目标申请")
|
||||
CommonResult<List<SalesPerformanceDTO>> getReceiptSettlement(@RequestParam(name = "year", required = false) String year,
|
||||
@RequestParam(name = "month", required = false) String month);
|
||||
|
||||
@GetMapping(PREFIX + "/getBySalesPerformanceId")
|
||||
@Operation(summary = "根据日期获取用户销售目标申请")
|
||||
CommonResult<SalesPerformanceDTO> getBySalesPerformanceId(@RequestParam(name = "salesPerformanceId", required = false) Long salesPerformanceId);
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.oa.vo.loan;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产借支 创建 Request VO
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Schema(description = "管理后台 - 借支 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode()
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOALoanDTO {
|
||||
|
||||
@Schema(description = "收款人信息")
|
||||
private Long bankId;
|
||||
|
||||
@Schema(description = "借支工厂")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "借支厂区用户")
|
||||
private Long sfUserId;
|
||||
|
||||
@Schema(description = "借支类型 | 1工资 2费用", example = "1")
|
||||
private Integer loanType;
|
||||
|
||||
@Schema(description = "抵扣工资月份 | yyyy-MM")
|
||||
private String returnDate;
|
||||
|
||||
@Schema(description = "借支金额")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "流程实例编号")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "状态-参见 bpm_process_instance_result 枚举")
|
||||
private Integer result;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.oa.vo.loan;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "RPC 服务 - OA 借支 Response VO")
|
||||
@Data
|
||||
public class BpmOALoanSumDTO {
|
||||
|
||||
@Schema(description = "借支员工编号")
|
||||
private Long sfUserId;
|
||||
|
||||
@Schema(description = "借支总金额")
|
||||
private BigDecimal totalAmount;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.oa.vo.receipt;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ReceiptSettlementDTO {
|
||||
@Schema(description = "用户编号")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "回款总金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "渠道商回款总金额")
|
||||
private BigDecimal channelAmount;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.oa.vo.receipt;
|
||||
|
||||
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.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class ReceiptSettlementVO {
|
||||
@Schema(description = "时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.oa.vo.salesperformance;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class SalesPerformanceDTO {
|
||||
/**
|
||||
* 销售业绩目标申请id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 申请人的用户编号
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 年
|
||||
*/
|
||||
private String year;
|
||||
/**
|
||||
* 月
|
||||
*/
|
||||
private String month;
|
||||
/**
|
||||
* 回款目标
|
||||
*/
|
||||
private BigDecimal paymentTarget;
|
||||
/**
|
||||
* 销售目标
|
||||
*/
|
||||
private Integer saleTarget;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 申请结果
|
||||
*/
|
||||
private Integer result;
|
||||
}
|
@ -63,9 +63,6 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode OA_PAYMENT_NOT_EXISTS = new ErrorCode(1_009_001_126, "付款申请不存在");
|
||||
ErrorCode OA_RECEIPT_NOT_EXISTS = new ErrorCode(1_009_001_127, "回款申请不存在");
|
||||
ErrorCode OA_PAYMENT_FILES_NOT_NULL = new ErrorCode(1_009_001_128, "后补发票不能为空!");
|
||||
ErrorCode OA_EXPENSES_NOT_EXISTS = new ErrorCode(1_009_001_129, "开支日报申请不存在");
|
||||
ErrorCode OA_LOAN_NOT_EXISTS = new ErrorCode(1_009_001_130, "借支申请不存在");
|
||||
ErrorCode OA_LOAN_NOT_CREATE = new ErrorCode(1_009_001_131, "厂区员工信息不存在");
|
||||
|
||||
// ========== 流程模型 1-009-002-000 ==========
|
||||
ErrorCode MODEL_KEY_EXISTS = new ErrorCode(1_009_002_000, "已经存在流程标识为【{}】的流程");
|
||||
@ -118,10 +115,6 @@ public interface ErrorCodeConstants {
|
||||
// ========== 用户组模块 1-009-011-000 ==========
|
||||
ErrorCode USER_GROUP_NOT_EXISTS = new ErrorCode(1_009_011_000, "用户组不存在");
|
||||
ErrorCode USER_GROUP_IS_DISABLE = new ErrorCode(1_009_011_001, "名字为【{}】的用户组已被禁用");
|
||||
// ========== 业绩申请模块 1-009-012-000 ==========
|
||||
ErrorCode CAN_ONLY_APPLY_FOR_CURRENT_MONTH_PERFORMANCE_TARGET = new ErrorCode(1_009_012_001, "只能申请当月业绩目标");
|
||||
ErrorCode THE_PROCESS_IS_BEING_APPROVED_OR_HAS_PASSED_THE_CURRENT_MONTH_AND_THE_APPLICATION_CANNOT_BE_REPEATED
|
||||
= new ErrorCode(1_009_012_002, "流程审批中或已通过当月不可重复申请");
|
||||
|
||||
|
||||
ErrorCode BPM_SYSTEM_BUG = new ErrorCode(1_009_012_001, "系统问题,请联系管理员");
|
||||
|
@ -18,14 +18,12 @@ public enum BpmTaskRuleScriptEnum {
|
||||
LEADER_X1(20L, "流程发起人的一级领导"),
|
||||
LEADER_X2(21L, "流程发起人的二级领导"),
|
||||
LEADER_X3(22L, "流程发起人的三级领导"),
|
||||
LEADER_X4(23L, "发起人的上级领导"),
|
||||
LEADER_X4(23L, "审批人的上级领导"),
|
||||
LEADER_X5(24L, "调岗部门领导"),
|
||||
LEADER_X6(25L, "分配任务的责任人"),
|
||||
LEADER_X7(26L, "入职部门领导"),
|
||||
LEADER_X8(27L, "调薪部门领导"),
|
||||
LEADER_X9(28L, "调薪人上级领导"),
|
||||
LEADER_X10(29L, "所选工厂的领导"),
|
||||
LEADER_X11(30L, "审批人的上级领导");
|
||||
LEADER_X9(28L, "调薪人上级领导");
|
||||
|
||||
/**
|
||||
* 脚本编号
|
||||
|
@ -134,12 +134,6 @@
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-protection</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>zn-module-smartfactory-api</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
|
@ -24,7 +24,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti
|
||||
*/
|
||||
@RestController
|
||||
@Validated
|
||||
public class BpmOAContractApiImpl implements BpmOAContractApi {
|
||||
public class BpmOAContractApiImpl implements BpmOAContractApi{
|
||||
|
||||
@Resource
|
||||
private BpmOAContractService contractService;
|
||||
@ -52,9 +52,4 @@ public class BpmOAContractApiImpl implements BpmOAContractApi {
|
||||
List<BpmOAContractDO> contractDO = contractService.getContractList(respVO);
|
||||
return success(BeanUtils.toBean(contractDO, BpmOAContractDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSettlementFlagByIds(List<Long> contractIds) {
|
||||
contractService.updateSettlementFlagByIds(contractIds);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@ -32,25 +34,8 @@ public class BpmOAEvectionApiImpl implements BpmOAEvectionApi {
|
||||
List<BpmOAEvectionDO> evectionOff = evectionService.getEvectionListByEndTime(now.minusDays(1));
|
||||
|
||||
Map<String, List<Long>> result = new HashMap<>();
|
||||
result.put("on", evectionOn.stream().flatMap(item -> {
|
||||
Set<Long> togetherUserIds = item.getTogetherUserIds();
|
||||
List<Long> ids = new ArrayList<>();
|
||||
ids.add(item.getUserId());
|
||||
if (togetherUserIds != null) {
|
||||
ids.addAll(togetherUserIds); // 将 Set 转换为 List 并添加进去
|
||||
}
|
||||
return ids.stream();
|
||||
}).distinct().collect(Collectors.toList()));
|
||||
result.put("off", evectionOff.stream().flatMap(item -> {
|
||||
Set<Long> togetherUserIds = item.getTogetherUserIds();
|
||||
List<Long> ids = new ArrayList<>();
|
||||
ids.add(item.getUserId());
|
||||
if (togetherUserIds != null) {
|
||||
ids.addAll(togetherUserIds); // 将 Set 转换为 List 并添加进去
|
||||
}
|
||||
return ids.stream();
|
||||
}).distinct().collect(Collectors.toList()));
|
||||
|
||||
result.put("on", evectionOn.stream().map(BpmOAEvectionDO::getUserId).distinct().collect(Collectors.toList()));
|
||||
result.put("off", evectionOff.stream().map(BpmOAEvectionDO::getUserId).distinct().collect(Collectors.toList()));
|
||||
return success(result);
|
||||
}
|
||||
}
|
||||
|
@ -1,30 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.loan.BpmOALoanSumDTO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOALoanService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* Flowable 流程实例 Api 实现类
|
||||
*/
|
||||
@RestController
|
||||
@Validated
|
||||
public class BpmOALoanApiImpl implements BpmOALoanApi{
|
||||
|
||||
@Resource
|
||||
private BpmOALoanService loanService;
|
||||
|
||||
@Override
|
||||
public CommonResult<List<BpmOALoanSumDTO>> getListByStaffId(Collection<Long> staffId, String month) {
|
||||
|
||||
return success(loanService.getListByStaffId(staffId, month));
|
||||
}
|
||||
}
|
@ -2,12 +2,13 @@ package cn.iocoder.yudao.module.bpm.api.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.receipt.*;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.receipt.BpmOAReceiptDTO;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.receipt.BpmOAReceiptVO;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.receipt.ReceiptStatisticsDTO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.receipt.ReceiptStatisticsVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReceiptDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAReceiptService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -44,9 +45,4 @@ public class BpmOAReceiptApiImpl implements BpmOAReceiptApi{
|
||||
List<ReceiptStatisticsDTO> respVOS = receiptService.getReceiptStatisticsListByUserIds(userIds, createTime);
|
||||
return success(BeanUtils.toBean(respVOS, ReceiptStatisticsDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<ReceiptSettlementDTO>> getReceiptSettlement(ReceiptSettlementVO vo) {
|
||||
return success(receiptService.getReceiptSettlement(vo));
|
||||
}
|
||||
}
|
||||
|
@ -1,39 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.api.oa;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.salesperformance.SalesPerformanceDTO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASalesPerformanceDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASalesPerformanceService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Flowable 流程实例 Api 实现类
|
||||
*/
|
||||
@RestController
|
||||
@Validated
|
||||
public class BpmOASalesPerformanceApiImpl implements BpmOASalesPerformanceApi {
|
||||
|
||||
@Resource
|
||||
private BpmOASalesPerformanceService salesPerformanceService;
|
||||
|
||||
@Override
|
||||
public CommonResult<List<SalesPerformanceDTO>> getReceiptSettlement(String year, String month) {
|
||||
List<BpmOASalesPerformanceDO> list = salesPerformanceService.list(new LambdaQueryWrapper<BpmOASalesPerformanceDO>()
|
||||
.eq(BpmOASalesPerformanceDO::getYear, year)
|
||||
.eq(BpmOASalesPerformanceDO::getMonth, month)
|
||||
.eq(BpmOASalesPerformanceDO::getResult, 2));
|
||||
return CommonResult.success(BeanUtil.copyToList(list, SalesPerformanceDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<SalesPerformanceDTO> getBySalesPerformanceId(Long salesPerformanceId) {
|
||||
BpmOASalesPerformanceDO item = salesPerformanceService.getById(salesPerformanceId);
|
||||
return CommonResult.success(BeanUtil.copyProperties(item, SalesPerformanceDTO.class));
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.definition;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
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;
|
||||
@ -86,31 +85,27 @@ public class BpmProcessCcController {
|
||||
PageResult<BpmProcessCcDO> pageResult = processCcService.getProcessCcPage(pageReqVO);
|
||||
PageResult<BpmProcessCcRespVO> respVOPageResult = BeanUtils.toBean(pageResult, BpmProcessCcRespVO.class);
|
||||
|
||||
if (CollUtil.isNotEmpty(respVOPageResult.getList())) {
|
||||
// 获取公司部门Map
|
||||
Map<Long, DeptRespDTO> deptMap = convertMap(deptApi.getCompanyDept().getCheckedData(), DeptRespDTO::getId);
|
||||
// 获取列表中所有用户组详情
|
||||
List<BpmUserGroupDO> groupDOS = groupService.getUserGroupList(
|
||||
respVOPageResult.getList().stream()
|
||||
.flatMap(item -> item.getUserGroupId().stream())
|
||||
.collect(Collectors.toSet()));
|
||||
// 转换Map
|
||||
Map<Long, String> groupNameMap = convertMap(groupDOS, BpmUserGroupDO::getId, BpmUserGroupDO::getName);
|
||||
|
||||
// 获取公司部门Map
|
||||
Map<Long, DeptRespDTO> deptMap = convertMap(deptApi.getCompanyDept().getCheckedData(), DeptRespDTO::getId);
|
||||
// 获取列表中所有用户组详情
|
||||
List<BpmUserGroupDO> groupDOS = groupService.getUserGroupList(
|
||||
respVOPageResult.getList().stream()
|
||||
.flatMap(item -> item.getUserGroupId().stream())
|
||||
.collect(Collectors.toSet()));
|
||||
// 转换Map
|
||||
Map<Long, String> groupNameMap = convertMap(groupDOS, BpmUserGroupDO::getId, BpmUserGroupDO::getName);
|
||||
|
||||
respVOPageResult.getList().forEach(data -> {
|
||||
|
||||
// 设置用户组名称
|
||||
data.setGroupName(data.getUserGroupId().stream()
|
||||
.map(groupNameMap::get)
|
||||
.collect(Collectors.joining("、")));
|
||||
// 设置公司名称
|
||||
data.setCompanyName(data.getCompanyDeptId().stream()
|
||||
.map(item -> deptMap.get(item) != null ? deptMap.get(item).getName() : "")
|
||||
.collect(Collectors.joining("、")));
|
||||
});
|
||||
}
|
||||
respVOPageResult.getList().forEach(data -> {
|
||||
|
||||
// 设置用户组名称
|
||||
data.setGroupName(data.getUserGroupId().stream()
|
||||
.map(groupNameMap::get)
|
||||
.collect(Collectors.joining("、")));
|
||||
// 设置公司名称
|
||||
data.setCompanyName(data.getCompanyDeptId().stream()
|
||||
.map(item -> deptMap.get(item) != null ? deptMap.get(item).getName() : "")
|
||||
.collect(Collectors.joining("、")));
|
||||
});
|
||||
return success(respVOPageResult);
|
||||
}
|
||||
}
|
@ -2,9 +2,7 @@ package cn.iocoder.yudao.module.bpm.controller.admin.definition;
|
||||
|
||||
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.bpm.controller.admin.definition.vo.process.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@ -14,7 +12,6 @@ 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 java.util.stream.Collectors;
|
||||
|
||||
@ -64,21 +61,4 @@ public class BpmProcessDefinitionController {
|
||||
String bpmnXML = bpmDefinitionService.getProcessDefinitionBpmnXML(id);
|
||||
return success(bpmnXML);
|
||||
}
|
||||
|
||||
@PutMapping ("/update-scope")
|
||||
@Operation(summary = "修改流程定义的 Scope")
|
||||
public CommonResult<Boolean> updateProcessDefinitionScope(@Valid @RequestBody DefinitionScopeVO scopeVO) {
|
||||
bpmDefinitionService.updateProcessDefinitionScope(scopeVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping ("/get")
|
||||
@Operation(summary = "获得流程定义")
|
||||
@Parameter(name = "processDefinitionId", description = "流程定义编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:process-definition:query')")
|
||||
public CommonResult<DefinitionScopeVO> getProcessDefinition(@RequestParam("processDefinitionId") String processDefinitionId) {
|
||||
|
||||
BpmProcessDefinitionExtDO definitionExtDO = bpmDefinitionService.getProcessDefinitionExt(processDefinitionId);
|
||||
return success(BeanUtils.toBean(definitionExtDO, DefinitionScopeVO.class));
|
||||
}
|
||||
}
|
||||
|
@ -16,9 +16,6 @@ public class BpmProcessDefinitionRespVO {
|
||||
@Schema(description = "版本", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "流程Key")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "流程名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋道")
|
||||
@NotEmpty(message = "流程名称不能为空")
|
||||
private String name;
|
||||
|
@ -1,25 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.process;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 流程定义的 ScopeVO")
|
||||
@Data
|
||||
public class DefinitionScopeVO {
|
||||
|
||||
@Schema(description = "流程定义的编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "流程定义的编号不能为空")
|
||||
private String processDefinitionId;
|
||||
|
||||
@Schema(description = "使用权限范围 | 1全员 2指定部门 3指定用户", example = "1")
|
||||
private Integer dataScope;
|
||||
|
||||
@Schema(description = "使用权限范围 | 指定部门编号数组", example = "1,2,3")
|
||||
private List<Long> dataScopeDeptIds;
|
||||
|
||||
@Schema(description = "使用权限范围 | 指定用户编号数组", example = "1,2,3")
|
||||
private List<Long> dataScopeUserIds;
|
||||
}
|
@ -3,13 +3,13 @@ package cn.iocoder.yudao.module.bpm.controller.admin.financialpayment;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentSaveReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpayment.vo.FinancialPaymentSaveVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.financialpaymentitem.vo.FinancialPaymentItemRespVO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpaymentitem.FinancialPaymentItemDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
@ -17,6 +17,7 @@ import cn.iocoder.yudao.module.bpm.service.financialpaymentitem.FinancialPayment
|
||||
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.*;
|
||||
|
||||
@ -105,10 +106,4 @@ public class FinancialPaymentController {
|
||||
return success(BeanUtils.toBean(pageResult, FinancialPaymentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/total")
|
||||
@Operation(summary = "获得财务支付统计信息")
|
||||
public CommonResult<FinancialPaymentRespVO> getPaymentTotal(@Valid FinancialPaymentPageReqVO pageReqVO) {
|
||||
FinancialPaymentDO paymentDO = financialPaymentService.getPaymentTotal(pageReqVO);
|
||||
return success(BeanUtils.toBean(paymentDO, FinancialPaymentRespVO.class));
|
||||
}
|
||||
}
|
||||
|
@ -62,16 +62,4 @@ public class FinancialPaymentRespVO {
|
||||
|
||||
@Schema(description = "流程实例名称")
|
||||
private String processInstanceName;
|
||||
|
||||
@Schema(description = "收款人名称")
|
||||
private String recipientName;
|
||||
|
||||
@Schema(description = "付款公司编号")
|
||||
private Long companyId;
|
||||
|
||||
@Schema(description = "付款公司工厂编号")
|
||||
private Long companyFactoryId;
|
||||
|
||||
@Schema(description = "付款公司名称")
|
||||
private String companyName;
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUti
|
||||
* OA 合同审批 Controller
|
||||
*
|
||||
* @author 符溶馨
|
||||
|
||||
*/
|
||||
@Tag(name = "管理后台 - OA 合同审批")
|
||||
@RestController
|
||||
@ -67,6 +68,7 @@ public class BpmOAContractController {
|
||||
@Operation(summary = "获得合同审批")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOAContractRespVO> getContract(@RequestParam("id") Long id) {
|
||||
|
||||
BpmOAContractDO contract = contractService.getContract(id);
|
||||
BpmOAContractRespVO respVO = BpmOAContractConvert.INSTANCE.convert(contract);
|
||||
if (respVO != null) {
|
||||
@ -75,8 +77,8 @@ public class BpmOAContractController {
|
||||
Map<Long, AdminUserRespDTO> userMap = userApi.getUserMap(userIds);
|
||||
if (CollectionUtil.isNotEmpty(userMap)) {
|
||||
// 设置创建人、签约人名称
|
||||
respVO.setSignatoryName(userMap.get(contract.getSignatoryId()) != null ? userMap.get(contract.getSignatoryId()).getNickname() : null);
|
||||
respVO.setCreateName(userMap.get(contract.getUserId()) != null ? userMap.get(contract.getUserId()).getNickname() : null);
|
||||
respVO.setSignatoryName(userMap.get(contract.getSignatoryId()).getNickname());
|
||||
respVO.setCreateName(userMap.get(contract.getUserId()).getNickname());
|
||||
}
|
||||
|
||||
// 获取公司信息
|
||||
@ -135,12 +137,15 @@ public class BpmOAContractController {
|
||||
return success(contractService.getContractPage(pageReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/getList")
|
||||
@Operation(summary = "获取下属和自己的合同列表")
|
||||
public CommonResult<List<BpmOAContractRespVO>> getList(@RequestParam(required = false) String relation,
|
||||
@RequestParam(required = false) Integer contractType,
|
||||
@RequestParam(required = false) String contractName) {
|
||||
List<BpmOAContractDO> contracts = contractService.getList(relation, contractType, contractName);
|
||||
@GetMapping("/getListByDeptId")
|
||||
@Operation(summary = "获得同部门的销售合同")
|
||||
public CommonResult<List<BpmOAContractRespVO>> getListByDeptId() {
|
||||
|
||||
// 获取同部门所有用户id
|
||||
List<Long> userIds = userApi.getUserIdsByUserIdGroupByDept(getLoginUserId()).getCheckedData();
|
||||
|
||||
List<BpmOAContractDO> contracts = contractService.getListByDeptId(userIds);
|
||||
|
||||
return success(BeanUtils.toBean(contracts, BpmOAContractRespVO.class));
|
||||
}
|
||||
|
||||
@ -163,4 +168,5 @@ public class BpmOAContractController {
|
||||
|
||||
return success(BeanUtils.toBean(respVOs, BpmOAContractRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.evection.BpmOAEvectionCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.evection.BpmOAEvectionRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAEvectionConvert;
|
||||
@ -66,15 +65,6 @@ public class BpmOAEvectionController {
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/get-list")
|
||||
@Operation(summary = "获得我的出差申请")
|
||||
public CommonResult<List<BpmOAEvectionRespVO>> getEvectionList() {
|
||||
|
||||
List<BpmOAEvectionDO> evections = evectionService.getEvectionList();
|
||||
|
||||
return success(BeanUtils.toBean(evections, BpmOAEvectionRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getByProcessInstanceId")
|
||||
@Operation(summary = "获得出差申请")
|
||||
@Parameter(name = "processInstanceId", description = "流程实例编号", required = true, example = "1024")
|
||||
|
@ -1,110 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAExpensesDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAExpensesService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
/**
|
||||
* OA 生产开支 Controller
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Tag(name = "管理后台 - OA 生产开支")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/oa/expenses")
|
||||
@Validated
|
||||
public class BpmOAExpensesController {
|
||||
|
||||
@Resource
|
||||
private BpmOAExpensesService expensesService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createExpenses(@Valid @RequestBody BpmOAExpensesCreateReqVO createReqVO) {
|
||||
|
||||
return success(expensesService.createExpenses(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得生产开支申请")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOAExpensesRespVO> getExpenses(@RequestParam("id") Long id) {
|
||||
|
||||
BpmOAExpensesDO expensesDO = expensesService.getExpenses(id);
|
||||
BpmOAExpensesRespVO respVO = expensesService.convertExpenses(expensesDO);
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/getByProcessInstanceId")
|
||||
@Operation(summary = "获得现金支出申请")
|
||||
@Parameter(name = "processInstanceId", description = "流程实例编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOAExpensesRespVO> getExpensesByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {
|
||||
|
||||
BpmOAExpensesDO expensesDO = expensesService.getByProcessInstanceId(processInstanceId);
|
||||
BpmOAExpensesRespVO respVO = expensesService.convertExpenses(expensesDO);
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得生产开支申请分页")
|
||||
@DataPermission(enable = false)
|
||||
public CommonResult<PageResult<BpmOAExpensesPageRespVO>> getExpensesPage(BpmOAExpensesPageReqVO pageReqVO) {
|
||||
|
||||
PageResult<BpmOAExpensesPageRespVO> respVO = expensesService.getExpensesPage(pageReqVO);
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/total")
|
||||
@Operation(summary = "获得开支金额统计")
|
||||
@DataPermission(enable = false)
|
||||
public CommonResult<BpmOAExpensesTotal> getExpensesTotal(BpmOAExpensesPageReqVO pageReqVO) {
|
||||
|
||||
return success(expensesService.getExpensesTotal(pageReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/payment")
|
||||
@Operation(summary = "提前付款")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<Boolean> getPayment(Long id) {
|
||||
|
||||
expensesService.getPayment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/refused")
|
||||
@Operation(summary = "拒绝付款")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@Parameter(name = "processInstanceId", description = "流程实例编号", required = true, example = "1024")
|
||||
public CommonResult<Boolean> refused(@RequestParam("id") Long id,
|
||||
@RequestParam("processInstanceId") String processInstanceId) {
|
||||
|
||||
expensesService.refused(id, processInstanceId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/oneClickPayment")
|
||||
@Operation(summary = "一键支付")
|
||||
@Parameter(name = "month", description = "月份", required = true, example = "2025-04")
|
||||
@DataPermission(enable = false)
|
||||
public CommonResult<Boolean> oneClickPayment(String month) {
|
||||
|
||||
expensesService.oneClickPayment(month);
|
||||
return success(true);
|
||||
}
|
||||
}
|
@ -8,8 +8,6 @@ import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAImprestDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAImprestService;
|
||||
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;
|
||||
@ -40,9 +38,6 @@ public class BpmOAImprestController {
|
||||
@Resource
|
||||
private BankApi bankApi;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createImprest(@Valid @RequestBody BpmOAImprestCreateReqVO createReqVO) {
|
||||
@ -57,20 +52,14 @@ public class BpmOAImprestController {
|
||||
|
||||
BpmOAImprestDO imprest = imprestService.getImprest(id);
|
||||
BpmOAImprestRespVO respVO = BpmOAImprestConvert.INSTANCE.convert(imprest);
|
||||
if (respVO != null) {
|
||||
if (respVO.getBankId() != null) {
|
||||
// 获取收款账号信息
|
||||
BankRespDTO bankRespDTO = bankApi.getBank(respVO.getBankId()).getCheckedData();
|
||||
if (bankRespDTO != null) {
|
||||
respVO.setBankName(bankRespDTO.getBankName());
|
||||
respVO.setNickname(bankRespDTO.getNickname());
|
||||
respVO.setBankNo(bankRespDTO.getBankNo());
|
||||
}
|
||||
if (respVO != null && imprest.getBankId() != null) {
|
||||
// 获取收款账号信息
|
||||
BankRespDTO bankRespDTO = bankApi.getBank(imprest.getBankId()).getCheckedData();
|
||||
if (bankRespDTO != null) {
|
||||
respVO.setBankName(bankRespDTO.getBankName());
|
||||
respVO.setNickname(bankRespDTO.getNickname());
|
||||
respVO.setBankNo(bankRespDTO.getBankNo());
|
||||
}
|
||||
|
||||
// 获取公司信息
|
||||
DeptRespDTO company = deptApi.getDept(respVO.getCompanyId()).getCheckedData();
|
||||
respVO.setCompanyName(company.getName());
|
||||
}
|
||||
|
||||
return success(respVO);
|
||||
@ -110,10 +99,6 @@ public class BpmOAImprestController {
|
||||
respVO.setNickname(bankRespDTO.getNickname());
|
||||
respVO.setBankNo(bankRespDTO.getBankNo());
|
||||
}
|
||||
|
||||
// 获取公司信息
|
||||
DeptRespDTO company = deptApi.getDept(respVO.getCompanyId()).getCheckedData();
|
||||
respVO.setCompanyName(company.getName());
|
||||
}
|
||||
|
||||
return success(respVO);
|
||||
|
@ -1,194 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
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.bpm.controller.admin.oa.vo.loan.BpmOALoanCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.loan.BpmOALoanPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.loan.BpmOALoanRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.loan.BpmOAReturnVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALoanDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOALoanService;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.FactoryInfoApi;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.dto.FactoryInfoDTO;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.staff.StaffApi;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.staff.dto.StaffDTO;
|
||||
import cn.iocoder.yudao.module.system.api.bank.BankApi;
|
||||
import cn.iocoder.yudao.module.system.api.bank.dto.BankRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
/**
|
||||
* OA 借支申请 Controller
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Tag(name = "管理后台 - OA 借支申请")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/oa/loan")
|
||||
@Validated
|
||||
public class BpmOALoanController {
|
||||
|
||||
@Resource
|
||||
private BpmOALoanService loanService;
|
||||
|
||||
@Resource
|
||||
private BankApi bankApi;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
@Resource
|
||||
private StaffApi staffApi;
|
||||
|
||||
@Resource
|
||||
private FactoryInfoApi factoryInfoApi;
|
||||
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建借支申请")
|
||||
public CommonResult<Long> createLoan(@Valid @RequestBody BpmOALoanCreateReqVO createReqVO) {
|
||||
|
||||
return success(loanService.createLoan(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得借支申请")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOALoanRespVO> getLoan(@RequestParam("id") Long id) {
|
||||
BpmOALoanDO loan = loanService.getLoan(id);
|
||||
BpmOALoanRespVO respVO = BeanUtils.toBean(loan, BpmOALoanRespVO.class);
|
||||
|
||||
if (respVO != null) {
|
||||
// 获取银行卡信息
|
||||
BankRespDTO bankRespDTO = null;
|
||||
if (loan.getBankId() != null) {
|
||||
bankRespDTO = bankApi.getBank(loan.getBankId()).getCheckedData();
|
||||
if (bankRespDTO != null) {
|
||||
respVO.setBankNo(bankRespDTO.getBankNo());
|
||||
respVO.setBankName(bankRespDTO.getBankName());
|
||||
respVO.setPayeeName(bankRespDTO.getNickname());
|
||||
}
|
||||
}
|
||||
|
||||
// 获取工厂信息
|
||||
DeptRespDTO dto = deptApi.getDeptByFactoryId(loan.getFactoryId()).getCheckedData();
|
||||
// 设置工厂名称
|
||||
respVO.setFactoryName(dto != null ? dto.getName() : null);
|
||||
|
||||
// 获取用户信息
|
||||
StaffDTO staffDTO = staffApi.getStaff(loan.getSfUserId()).getCheckedData();
|
||||
//设置员工名称
|
||||
respVO.setSfUserName(staffDTO != null ? staffDTO.getNickName() : null);
|
||||
}
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/getByProcessInstanceId")
|
||||
@Operation(summary = "获得借支申请")
|
||||
@Parameter(name = "processInstanceId", description = "流程实例编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOALoanRespVO> getByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {
|
||||
BpmOALoanDO loan = loanService.getByProcessInstanceId(processInstanceId);
|
||||
BpmOALoanRespVO respVO = BeanUtils.toBean(loan, BpmOALoanRespVO.class);
|
||||
|
||||
if (respVO != null) {
|
||||
// 获取银行卡信息
|
||||
BankRespDTO bankRespDTO = null;
|
||||
if (loan.getBankId() != null) {
|
||||
bankRespDTO = bankApi.getBank(loan.getBankId()).getCheckedData();
|
||||
if (bankRespDTO != null) {
|
||||
respVO.setBankNo(bankRespDTO.getBankNo());
|
||||
respVO.setBankName(bankRespDTO.getBankName());
|
||||
respVO.setPayeeName(bankRespDTO.getNickname());
|
||||
}
|
||||
}
|
||||
|
||||
// 获取工厂信息
|
||||
DeptRespDTO dto = deptApi.getDeptByFactoryId(loan.getFactoryId()).getCheckedData();
|
||||
// 设置工厂名称
|
||||
respVO.setFactoryName(dto != null ? dto.getName() : null);
|
||||
|
||||
// 获取用户信息
|
||||
StaffDTO staffDTO = staffApi.getStaff(loan.getSfUserId()).getCheckedData();
|
||||
//设置员工名称
|
||||
respVO.setSfUserName(staffDTO != null ? staffDTO.getNickName() : null);
|
||||
}
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/get-list")
|
||||
@Operation(summary = "获得指定用户的借支申请列表")
|
||||
public CommonResult<PageResult<BpmOALoanRespVO>> getLoanList(BpmOALoanPageReqVO pageReqVO) {
|
||||
|
||||
PageResult<BpmOALoanDO> loanList = loanService.getListByStaffId(pageReqVO);
|
||||
PageResult<BpmOALoanRespVO> respVOS = BeanUtils.toBean(loanList, BpmOALoanRespVO.class);
|
||||
if (CollUtil.isNotEmpty(respVOS.getList())) {
|
||||
|
||||
// 获取支付信息
|
||||
List<String> processInstanceIds = convertList(loanList.getList(), BpmOALoanDO::getProcessInstanceId);
|
||||
Map<String, FinancialPaymentDO> financialPayments = convertMap(financialPaymentService.getFinancialPaymentList(processInstanceIds), FinancialPaymentDO::getProcessInstanceId);
|
||||
|
||||
// 获取申请人信息
|
||||
Set<Long> userIds = convertSet(loanList.getList(), BpmOALoanDO::getUserId);
|
||||
Map<Long, AdminUserRespDTO> userMap = userApi.getUserMap(userIds);
|
||||
|
||||
// 获取借支人信息
|
||||
Set<Long> loanUserIds = convertSet(loanList.getList(), BpmOALoanDO::getSfUserId);
|
||||
Map<Long, StaffDTO> loanUserMap = convertMap(staffApi.getStaffList(loanUserIds).getCheckedData(), StaffDTO::getId);
|
||||
|
||||
// 获取工厂信息
|
||||
Set<Long> deptIds = convertSet(loanList.getList(), BpmOALoanDO::getFactoryId);
|
||||
Map<Long, FactoryInfoDTO> factoryMap = factoryInfoApi.getFactoryMap(deptIds);
|
||||
|
||||
respVOS.getList().forEach(item -> {
|
||||
// 设置申请人名称
|
||||
item.setUserName(userMap.get(item.getUserId()).getNickname());
|
||||
// 设置借支用户名称
|
||||
item.setSfUserName(loanUserMap.get(item.getSfUserId()).getNickName());
|
||||
// 设置借支用户部门名称
|
||||
item.setFactoryName(factoryMap.get(item.getFactoryId()).getName());
|
||||
// 设置支付状态
|
||||
item.setStatus(financialPayments.containsKey(item.getProcessInstanceId()) ? financialPayments.get(item.getProcessInstanceId()).getStatus() : 2);
|
||||
});
|
||||
}
|
||||
|
||||
return success(respVOS);
|
||||
}
|
||||
|
||||
@GetMapping("/get-return-list")
|
||||
@Operation(summary = "获得指定用户的还款列表")
|
||||
public CommonResult<PageResult<BpmOAReturnVO>> getReturnList(BpmOALoanPageReqVO pageReqVO) {
|
||||
|
||||
PageResult<BpmOAReturnVO> respVOS = loanService.getReturnList(pageReqVO);
|
||||
|
||||
return success(respVOS);
|
||||
}
|
||||
}
|
@ -84,8 +84,6 @@ public class BpmOAPaymentController {
|
||||
@Parameter(name = "type", description = "付款类型", required = true, example = "1")
|
||||
public CommonResult<List<BpmOAPaymentRespVO>> getPayment(@RequestParam("type") Integer type) {
|
||||
|
||||
List<BpmOAPaymentRespVO> list = paymentService.getPaymentList(type);
|
||||
|
||||
return success(paymentService.getPaymentList(type));
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
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;
|
||||
@ -11,8 +10,7 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procurepay.BpmOAProcur
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcurePayDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAProcurePayService;
|
||||
import cn.iocoder.yudao.module.system.api.project.ProjectApi;
|
||||
import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAProcureService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -22,12 +20,8 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
|
||||
@Tag(name = "管理后台 - 采购支付")
|
||||
@RestController
|
||||
@ -38,7 +32,7 @@ public class BpmOAProcurePayController {
|
||||
@Resource
|
||||
private BpmOAProcurePayService oAProcurePayService;
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
private BpmOAProcureService oaProcureService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建采购支付")
|
||||
@ -86,18 +80,7 @@ public class BpmOAProcurePayController {
|
||||
@Operation(summary = "获取可用采购单列表")
|
||||
public CommonResult<List<BpmOAProcureRespVO>> getAvailablePurchaseOrders(@RequestParam(name = "type", required = false) Integer type) {
|
||||
List<BpmOAProcureDO> list = oAProcurePayService.getAvailablePurchaseOrders(type);
|
||||
List<BpmOAProcureRespVO> respVOS = BeanUtils.toBean(list, BpmOAProcureRespVO.class);
|
||||
if (CollUtil.isNotEmpty(respVOS)) {
|
||||
// 获取项目编号列表
|
||||
Set<String> projectNo = convertSet(respVOS, BpmOAProcureRespVO::getProjectNo);
|
||||
List<ProjectDTO> projectList = projectApi.getProjectList(projectNo).getCheckedData();
|
||||
Map<String, ProjectDTO> projectMap = convertMap(projectList, ProjectDTO::getProjectNo);
|
||||
|
||||
respVOS.forEach(respVO -> {
|
||||
respVO.setProjectName(projectMap.get(respVO.getProjectNo()) != null ? projectMap.get(respVO.getProjectNo()).getName() : "");
|
||||
});
|
||||
}
|
||||
return success(respVOS);
|
||||
return success(BeanUtils.toBean(list, BpmOAProcureRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getByProcessInstanceId")
|
||||
|
@ -5,7 +5,6 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOARei
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.BpmOAReimbursementRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAReimbursementService;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.project.ProjectApi;
|
||||
import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -38,9 +37,6 @@ public class BpmOAReimbursementController {
|
||||
@Resource
|
||||
private ProjectApi projectApi;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
// @PreAuthorize("@ss.hasPermission('bpm:oa-reimbursement:create')")
|
||||
@Operation(summary = "创建请求申请")
|
||||
@ -56,16 +52,10 @@ public class BpmOAReimbursementController {
|
||||
|
||||
BpmOAReimbursementDO reimbursement = service.getReimbursement(id);
|
||||
BpmOAReimbursementRespVO respVO = service.convert(reimbursement);
|
||||
if (respVO != null) {
|
||||
if (StringUtil.isNotEmpty(respVO.getProjectNo())) {
|
||||
// 设置项目名称
|
||||
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
|
||||
respVO.setProjectName(projectDTO.getName());
|
||||
}
|
||||
if (respVO.getPaymentCompany() != null) {
|
||||
// 设置付款公司名称
|
||||
respVO.setPaymentCompanyName(deptApi.getDept(respVO.getPaymentCompany()).getCheckedData().getName());
|
||||
}
|
||||
if (respVO != null && StringUtil.isNotEmpty(respVO.getProjectNo())) {
|
||||
// 设置项目名称
|
||||
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
|
||||
respVO.setProjectName(projectDTO.getName());
|
||||
}
|
||||
return success(respVO);
|
||||
}
|
||||
@ -92,16 +82,10 @@ public class BpmOAReimbursementController {
|
||||
|
||||
BpmOAReimbursementDO reimbursement = service.getByProcessInstanceId(processInstanceId);
|
||||
BpmOAReimbursementRespVO respVO = service.convert(reimbursement);
|
||||
if (respVO != null) {
|
||||
if (StringUtil.isNotEmpty(respVO.getProjectNo())) {
|
||||
// 设置项目名称
|
||||
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
|
||||
respVO.setProjectName(projectDTO.getName());
|
||||
}
|
||||
if (respVO.getPaymentCompany() != null) {
|
||||
// 设置付款公司名称
|
||||
respVO.setPaymentCompanyName(deptApi.getDept(respVO.getPaymentCompany()).getCheckedData().getName());
|
||||
}
|
||||
if (respVO != null && StringUtil.isNotEmpty(respVO.getProjectNo())) {
|
||||
// 设置项目名称
|
||||
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
|
||||
respVO.setProjectName(projectDTO.getName());
|
||||
}
|
||||
return success(respVO);
|
||||
}
|
||||
|
@ -1,13 +1,11 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salary.BpmOASalaryCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salary.BpmOASalaryRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOASalaryConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASalaryDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASalaryService;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.FactoryInfoApi;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.dto.FactoryInfoDTO;
|
||||
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;
|
||||
@ -18,10 +16,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
@ -44,17 +38,14 @@ public class BpmOASalaryController {
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private FactoryInfoApi factoryInfoApi;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createSalary(@Valid @RequestBody BpmOASalaryCreateReqVO createReqVO) {
|
||||
|
||||
// if (createReqVO.getFactoryId() != null) {
|
||||
// DeptRespDTO dto = deptApi.getDeptByFactoryId(createReqVO.getFactoryId()).getCheckedData();
|
||||
// createReqVO.setCompanyDeptId(dto.getId());
|
||||
// }
|
||||
if (createReqVO.getFactoryId() != null) {
|
||||
DeptRespDTO dto = deptApi.getDeptByFactoryId(createReqVO.getFactoryId()).getCheckedData();
|
||||
createReqVO.setCompanyDeptId(dto.getId());
|
||||
}
|
||||
return success(salaryService.createSalary(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
@ -68,24 +59,12 @@ public class BpmOASalaryController {
|
||||
return success(new BpmOASalaryRespVO());
|
||||
}
|
||||
|
||||
BpmOASalaryRespVO respVO = BeanUtils.toBean(salary, BpmOASalaryRespVO.class);
|
||||
if (salary.getCompanyDeptId() != null) {
|
||||
// 获取部门详情
|
||||
DeptRespDTO dto = getDept(salary.getCompanyDeptId());
|
||||
// 获取部门详情
|
||||
DeptRespDTO dto = getDept(salary.getCompanyDeptId());
|
||||
|
||||
respVO.setCompanyName(dto.getName());
|
||||
}else {
|
||||
// 获取工厂信息
|
||||
Set<Long> factoryIds = salary.getFactoryDeptId();
|
||||
List<FactoryInfoDTO> factoryInfoDTOS = factoryInfoApi.getFactoryInfoList(factoryIds).getCheckedData();
|
||||
|
||||
String factoryNames = factoryInfoDTOS.stream()
|
||||
.map(FactoryInfoDTO::getShortName)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
respVO.setCompanyName(factoryNames);
|
||||
}
|
||||
BpmOASalaryRespVO respVO = BpmOASalaryConvert.INSTANCE.convert(salary)
|
||||
.setCompanyName(dto.getName())
|
||||
.setFactoryId(dto.getFactoryId());
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
@ -97,28 +76,12 @@ public class BpmOASalaryController {
|
||||
|
||||
BpmOASalaryDO salary = salaryService.getByProcessInstanceId(processInstanceId);
|
||||
|
||||
if (salary == null) {
|
||||
return success(new BpmOASalaryRespVO());
|
||||
}
|
||||
// 获取部门详情
|
||||
DeptRespDTO dto = getDept(salary.getCompanyDeptId());
|
||||
|
||||
BpmOASalaryRespVO respVO = BeanUtils.toBean(salary, BpmOASalaryRespVO.class);
|
||||
if (salary.getCompanyDeptId() != null) {
|
||||
// 获取部门详情
|
||||
DeptRespDTO dto = getDept(salary.getCompanyDeptId());
|
||||
|
||||
respVO.setCompanyName(dto.getName());
|
||||
}else {
|
||||
// 获取工厂信息
|
||||
Set<Long> factoryIds = salary.getFactoryDeptId();
|
||||
List<FactoryInfoDTO> factoryInfoDTOS = factoryInfoApi.getFactoryInfoList(factoryIds).getCheckedData();
|
||||
|
||||
String factoryNames = factoryInfoDTOS.stream()
|
||||
.map(FactoryInfoDTO::getShortName)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
respVO.setCompanyName(factoryNames);
|
||||
}
|
||||
BpmOASalaryRespVO respVO = BpmOASalaryConvert.INSTANCE.convert(salary)
|
||||
.setCompanyName(dto.getName())
|
||||
.setFactoryId(dto.getFactoryId());
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
|
@ -1,74 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salesperformance.SalesPerformancePageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salesperformance.SalesPerformanceRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salesperformance.SalesPerformanceSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASalesPerformanceDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASalesPerformanceService;
|
||||
|
||||
@Tag(name = "管理后台 - 销售业绩目标申请OA")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/sales-performance")
|
||||
@Validated
|
||||
public class SalesPerformanceController {
|
||||
|
||||
@Resource
|
||||
private BpmOASalesPerformanceService bpmOASalesPerformanceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建销售业绩目标申请OA")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:sales-performance:create')")
|
||||
public CommonResult<Long> createSalesPerformance(@Valid @RequestBody SalesPerformanceSaveReqVO createReqVO) {
|
||||
return success(bpmOASalesPerformanceService.createSalesPerformance(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新销售业绩目标申请OA")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:sales-performance:update')")
|
||||
public CommonResult<Boolean> updateSalesPerformance(@Valid @RequestBody SalesPerformanceSaveReqVO updateReqVO) {
|
||||
bpmOASalesPerformanceService.updateSalesPerformance(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除销售业绩目标申请OA")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('bpm:sales-performance:delete')")
|
||||
public CommonResult<Boolean> deleteSalesPerformance(@RequestParam("id") Long id) {
|
||||
bpmOASalesPerformanceService.deleteSalesPerformance(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得销售业绩目标申请OA")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:sales-performance:query')")
|
||||
public CommonResult<SalesPerformanceRespVO> getSalesPerformance(@RequestParam("id") Long id) {
|
||||
BpmOASalesPerformanceDO salesPerformance = bpmOASalesPerformanceService.getSalesPerformance(id);
|
||||
return success(BeanUtils.toBean(salesPerformance, SalesPerformanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得销售业绩目标申请OA分页")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:sales-performance:query')")
|
||||
public CommonResult<PageResult<SalesPerformanceRespVO>> getSalesPerformancePage(@Valid SalesPerformancePageReqVO pageReqVO) {
|
||||
PageResult<BpmOASalesPerformanceDO> pageResult = bpmOASalesPerformanceService.getSalesPerformancePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SalesPerformanceRespVO.class));
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产开支 创建 Request VO
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Schema(description = "管理后台 - 生产开支创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode()
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOAExpensesCreateReqVO {
|
||||
|
||||
@Schema(description = "收款人信息")
|
||||
private Long bankId;
|
||||
|
||||
@Schema(description = "开支明细")
|
||||
private List<Expenses> expensesItem;
|
||||
|
||||
@Schema(description = "工厂类型 |1工厂 2公司 ")
|
||||
private Integer factoryType;
|
||||
|
||||
@Schema(description = "报销总金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销总金额不能为空")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "流程实例编号")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "状态-参见 bpm_process_instance_result 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 开支日报分页 Request VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class BpmOAExpensesPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "申请人用户编号", example = "1")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "所属工厂编号", example = "1")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "费用类型 | 字典值参照bpm_oa_expenses_type")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "费用板块 | 1叉车 2打包 3搬运 4运输")
|
||||
private Integer costSection;
|
||||
|
||||
@Schema(description = "审批通过时间")
|
||||
private String[] endTime;
|
||||
|
||||
@Schema(description = "收款人姓名")
|
||||
private String payeeName;
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Schema(description = "管理后台 - 生产开支 请求Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOAExpensesPageRespVO extends BpmOABaseRespVO {
|
||||
|
||||
@Schema(description = "申请人用户编号")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "申请人用户名称")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "收款人信息编号")
|
||||
private Long bankId;
|
||||
|
||||
@Schema(description = "收款人名称")
|
||||
private String payeeName;
|
||||
|
||||
@Schema(description = "银行卡号")
|
||||
private String bankNo;
|
||||
|
||||
@Schema(description = "开户行名称")
|
||||
private String bankName;
|
||||
|
||||
@Schema(description = "报销总金额")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "费用申请主键")
|
||||
private Long expensesId;
|
||||
|
||||
@Schema(description = "费用类型 | 字典值参照bpm_oa_expenses_type")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "费用板块 | 1叉车 2打包 3搬运 4运输")
|
||||
private Integer costSection;
|
||||
|
||||
@Schema(description = "费用产生部门")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "费用产生部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "支出金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Schema(description = "费用明细")
|
||||
private String detail;
|
||||
|
||||
@Schema(description = "审批时间")
|
||||
private String endTime;
|
||||
|
||||
@Schema(description = "支付状态 | 0未支付 1已支付")
|
||||
private Integer status;
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Schema(description = "管理后台 - 生产开支 请求Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOAExpensesRespVO extends BpmOABaseRespVO {
|
||||
|
||||
@Schema(description = "收款人信息编号")
|
||||
private Long bankId;
|
||||
|
||||
@Schema(description = "收款人名称")
|
||||
private String payeeName;
|
||||
|
||||
@Schema(description = "银行卡号")
|
||||
private String bankNo;
|
||||
|
||||
@Schema(description = "开户行名称")
|
||||
private String bankName;
|
||||
|
||||
@Schema(description = "开支明细")
|
||||
private List<Expenses> expensesItem;
|
||||
|
||||
@Schema(description = "工厂类型 | 1公司 工厂")
|
||||
private Integer factoryType;
|
||||
|
||||
@Schema(description = "报销总金额")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 生产开支金额统计 Response VO")
|
||||
@Data
|
||||
public class BpmOAExpensesTotal {
|
||||
|
||||
@Schema(description = "已付款金额")
|
||||
private BigDecimal amountPaid;
|
||||
|
||||
@Schema(description = "应付款金额")
|
||||
private BigDecimal payableAmount;
|
||||
|
||||
@Schema(description = "剩余付款金额")
|
||||
private BigDecimal remainingPayable;
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses;
|
||||
|
||||
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 Expenses {
|
||||
|
||||
@Schema(description = "id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "费用类型 | 字典值参照bpm_oa_expenses_type", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "费用类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "费用板块 | 1叉车 2打包 3搬运 4运输", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "费用板块不能为空")
|
||||
private Integer costSection;
|
||||
|
||||
@Schema(description = "费用产生部门", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "费用产生部门不能为空")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "费用产生部门名称")
|
||||
private String deptName;
|
||||
|
||||
@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 detail;
|
||||
}
|
@ -36,10 +36,6 @@ public class BpmOAImprestCreateReqVO {
|
||||
@NotNull(message = "费用事由不能为空")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "付款公司编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "付款公司编号不能为空")
|
||||
private Long companyId;
|
||||
|
||||
@Schema(description = "费用金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "费用金额不能为空")
|
||||
private BigDecimal amount;
|
||||
|
@ -44,12 +44,6 @@ public class BpmOAImprestRespVO extends BpmOABaseRespVO {
|
||||
@NotNull(message = "费用事由不能为空")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "付款公司编号")
|
||||
private Long companyId;
|
||||
|
||||
@Schema(description = "付款公司名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "费用金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "费用金额不能为空")
|
||||
private BigDecimal amount;
|
||||
|
@ -26,9 +26,6 @@ public class BpmOAInvoiceRespVO extends BpmOABaseRespVO {
|
||||
@Schema(description = "合同名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String contractName;
|
||||
|
||||
@Schema(description = "合同编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String contractNo;
|
||||
|
||||
@Schema(description = "关联合同流程实例编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String contractInstanceId;
|
||||
|
||||
|
@ -1,58 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.loan;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生产借支 创建 Request VO
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Schema(description = "管理后台 - 生产借支创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode()
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOALoanCreateReqVO {
|
||||
|
||||
@Schema(description = "收款人信息")
|
||||
private Long bankId;
|
||||
|
||||
@Schema(description = "借支工厂", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "借支工厂不能为空")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "借支厂区用户", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "借支用户不能为空")
|
||||
private Long sfUserId;
|
||||
|
||||
@Schema(description = "借支类型 | 1工资 2费用", example = "1")
|
||||
@NotNull(message = "借支类型不能为空")
|
||||
private Integer loanType;
|
||||
|
||||
@Schema(description = "抵扣工资月份 | yyyy-MM")
|
||||
private String returnDate;
|
||||
|
||||
@Schema(description = "借支金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "借支金额不能为空")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "借支事由", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "借支事由不能为空")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "流程实例编号")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "状态-参见 bpm_process_instance_result 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.loan;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 借支申请分页 Request VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class BpmOALoanPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "员工ID")
|
||||
private Long staffId;
|
||||
|
||||
@Schema(description = "借支类型")
|
||||
private Integer loanType;
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.loan;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Schema(description = "管理后台 - 生产开支 请求Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOALoanRespVO extends BpmOABaseRespVO {
|
||||
|
||||
@Schema(description = "申请人用户编号")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "申请人名称")
|
||||
private String userName;
|
||||
|
||||
@Schema(description = "收款人信息编号")
|
||||
private Long bankId;
|
||||
|
||||
@Schema(description = "收款人名称")
|
||||
private String payeeName;
|
||||
|
||||
@Schema(description = "银行卡号")
|
||||
private String bankNo;
|
||||
|
||||
@Schema(description = "开户行名称")
|
||||
private String bankName;
|
||||
|
||||
@Schema(description = "借支工厂")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "借支工厂名称")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "借支用户")
|
||||
private Long sfUserId;
|
||||
|
||||
@Schema(description = "借支用户名称")
|
||||
private String sfUserName;
|
||||
|
||||
@Schema(description = "借支类型 | 1工资 2费用", example = "1")
|
||||
private Integer loanType;
|
||||
|
||||
@Schema(description = "抵扣工资月份 | yyyy-MM")
|
||||
private String returnDate;
|
||||
|
||||
@Schema(description = "借支金额")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "借支事由")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
|
||||
@Schema(description = "支付状态 | 0待支付 1分批支付中 2已支付 3拒绝")
|
||||
private Integer status;
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.loan;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 借支申请还款 Response VO")
|
||||
@Data
|
||||
public class BpmOAReturnVO {
|
||||
|
||||
@Schema(description = "员工ID")
|
||||
private Long staffId;
|
||||
|
||||
@Schema(description = "员工名称")
|
||||
private String staffName;
|
||||
|
||||
@Schema(description = "工厂ID")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "工厂名称")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "还款月份")
|
||||
private String month;
|
||||
|
||||
@Schema(description = "还款金额")
|
||||
private BigDecimal repaymentAmount;
|
||||
|
||||
@Schema(description = "还款类型 | 1开支抵扣 2工资还款")
|
||||
private Integer type;
|
||||
}
|
@ -47,7 +47,7 @@ public class BpmOAPaymentCreateReqVO {
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Schema(description = "付款比例 | 针对分期付款情况", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private BigDecimal paymentRatio;
|
||||
private Integer paymentRatio;
|
||||
|
||||
@Schema(description = "付款金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "付款金额不能为空")
|
||||
|
@ -26,7 +26,4 @@ public class BpmOAPaymentPageReqVO extends PageParam {
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private String[] createTime;
|
||||
|
||||
@Schema(description = "申请人用户编号")
|
||||
private Long userId;
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ public class BpmOAPaymentRespVO extends BpmOABaseRespVO {
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Schema(description = "付款比例 | 针对分期付款情况")
|
||||
private BigDecimal paymentRatio;
|
||||
private Integer paymentRatio;
|
||||
|
||||
@Schema(description = "付款金额")
|
||||
private BigDecimal amount;
|
||||
@ -92,10 +92,7 @@ public class BpmOAPaymentRespVO extends BpmOABaseRespVO {
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "累计付款比列")
|
||||
private BigDecimal ratio;
|
||||
|
||||
@Schema(description = "累计付款金额")
|
||||
private BigDecimal paymentAmount;
|
||||
private Integer ratio;
|
||||
|
||||
@Schema(description = "上传文件")
|
||||
private List<UploadUserFile> fileItems;
|
||||
|
@ -30,39 +30,11 @@ public class BpmOAPrintDataRespVO extends BpmOABaseRespVO {
|
||||
@Schema(description = "流程审批节点信息【包含人员签名地址】")
|
||||
List<BpmTaskRespVO> processTasks ;
|
||||
|
||||
/**
|
||||
* 发起流程的用户
|
||||
*/
|
||||
private User startUser;
|
||||
|
||||
/**
|
||||
* 抄送用户信息
|
||||
*/
|
||||
private List<CCUser> ccUsers;
|
||||
|
||||
@Schema(description = "用户信息")
|
||||
@Data
|
||||
public static class User {
|
||||
|
||||
@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 = "公司编号")
|
||||
private Long companyId;
|
||||
|
||||
@Schema(description = "公司名称")
|
||||
private String companyName;
|
||||
}
|
||||
|
||||
@Schema(description = "抄送用户信息")
|
||||
@Data
|
||||
public static class CCUser {
|
||||
|
@ -28,7 +28,4 @@ public class BpmOAReceiptPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "查询模式")
|
||||
private String relation;
|
||||
|
||||
@Schema(description = "合同编号")
|
||||
private Long contractId;
|
||||
}
|
||||
|
@ -24,9 +24,6 @@ public class BpmOAReimbursementCreateReqVO {
|
||||
@Schema(description = "开户行信息")
|
||||
private String bankName;
|
||||
|
||||
@Schema(description = "付款公司")
|
||||
private Long paymentCompany;
|
||||
|
||||
@Schema(description = "报销项目明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销项目不能为空")
|
||||
private List<Reimbursement> reimbursements;
|
||||
@ -52,9 +49,6 @@ public class BpmOAReimbursementCreateReqVO {
|
||||
@Schema(description = "备用金差额", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private BigDecimal difference ;
|
||||
|
||||
@Schema(description = "业务表编号")
|
||||
private Long objectId;
|
||||
|
||||
@Schema(description = "报销发票总数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销发票总数不能为空")
|
||||
private Integer totalQuantity ;
|
||||
|
@ -27,12 +27,6 @@ public class BpmOAReimbursementRespVO extends BpmOABaseRespVO {
|
||||
@Schema(description = "收款人卡号")
|
||||
private String bankNo;
|
||||
|
||||
@Schema(description = "付款公司")
|
||||
private Long paymentCompany;
|
||||
|
||||
@Schema(description = "付款公司名称")
|
||||
private String paymentCompanyName;
|
||||
|
||||
@Schema(description = "报销项目明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销项目不能为空")
|
||||
private List<ReimbursementDTO> reimbursements;
|
||||
|
@ -38,7 +38,4 @@ public class Reimbursement {
|
||||
|
||||
@Schema(description = "采购计划编号", example = "1")
|
||||
private Long procureId;
|
||||
|
||||
@Schema(description = "业务表编号")
|
||||
private Long objectId;
|
||||
}
|
||||
|
@ -36,7 +36,4 @@ public class ReimbursementDTO {
|
||||
|
||||
@Schema(description = "采购计划编号", example = "1")
|
||||
private Long procureId;
|
||||
|
||||
@Schema(description = "业务表编号")
|
||||
private Long objectId;
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 薪资付款申请 创建 Request VO
|
||||
@ -31,15 +30,11 @@ public class BpmOASalaryCreateReqVO {
|
||||
@DateTimeFormat(pattern = "yyyy-MM")
|
||||
private String salaryDate;
|
||||
|
||||
@Schema(description = "公司类型 | 1公司 2工厂", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "公司类型不能为空")
|
||||
private Integer deptType;
|
||||
|
||||
@Schema(description = "付款公司")
|
||||
private Long companyDeptId;
|
||||
|
||||
@Schema(description = "付款工厂的部门编号集合")
|
||||
private Set<Long> factoryDeptId;
|
||||
@Schema(description = "付款工厂编号")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "付款总额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "付款总额不能为空")
|
||||
@ -52,9 +47,6 @@ public class BpmOASalaryCreateReqVO {
|
||||
@Schema(description = "支付对象")
|
||||
private String paymentRecipient;
|
||||
|
||||
@Schema(description = "薪资主体明细")
|
||||
private List<SalarySubjectItemsVO> salarySubjectItems;
|
||||
|
||||
@Schema(description = "流程实例编号")
|
||||
private String processInstanceId;
|
||||
|
||||
@ -64,7 +56,4 @@ public class BpmOASalaryCreateReqVO {
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "附件不能为空")
|
||||
private List<UploadUserFile> fileItems;
|
||||
|
||||
@Schema(description = "员工薪资id集合")
|
||||
private Set<Long> staffSalaryIds;
|
||||
}
|
||||
|
@ -8,9 +8,9 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author 符溶馨
|
||||
@ -28,21 +28,12 @@ public class BpmOASalaryRespVO extends BpmOABaseRespVO {
|
||||
@DateTimeFormat(pattern = "yyyy-MM")
|
||||
private String salaryDate;
|
||||
|
||||
@Schema(description = "公司类型 | 1公司 2工厂")
|
||||
private Integer deptType;
|
||||
|
||||
@Schema(description = "付款公司")
|
||||
private Long companyDeptId;
|
||||
|
||||
@Schema(description = "付款公司名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "付款工厂的部门编号集合")
|
||||
private Set<Long> factoryDeptId;
|
||||
|
||||
@Schema(description = "付款工厂名称")
|
||||
private String factoryName;
|
||||
|
||||
@Schema(description = "付款工厂")
|
||||
private Long FactoryId;
|
||||
|
||||
@ -55,9 +46,6 @@ public class BpmOASalaryRespVO extends BpmOABaseRespVO {
|
||||
@Schema(description = "支付对象")
|
||||
private String paymentRecipient;
|
||||
|
||||
@Schema(description = "薪资主体明细")
|
||||
private List<SalarySubjectItemsVO> salarySubjectItems;
|
||||
|
||||
@Schema(description = "流程实例编号")
|
||||
private String processInstanceId;
|
||||
|
||||
@ -66,7 +54,4 @@ public class BpmOASalaryRespVO extends BpmOABaseRespVO {
|
||||
|
||||
@Schema(description = "上传文件")
|
||||
private List<UploadUserFile> fileItems;
|
||||
|
||||
@Schema(description = "员工薪资id集合")
|
||||
private Set<Long> staffSalaryIds;
|
||||
}
|
||||
|
@ -1,17 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salary;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 薪资付款申请创建 Request VO")
|
||||
@Data
|
||||
public class SalarySubjectItemsVO {
|
||||
|
||||
@Schema(description = "薪资主体编号")
|
||||
private Integer salarySubjectId;
|
||||
|
||||
@Schema(description = "金额")
|
||||
private BigDecimal amount;
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salesperformance;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
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 = "管理后台 - 销售业绩目标申请OA分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class SalesPerformancePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "申请人的用户编号", example = "2022")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "年")
|
||||
private String year;
|
||||
|
||||
@Schema(description = "月")
|
||||
private String month;
|
||||
|
||||
@Schema(description = "回款目标")
|
||||
private BigDecimal paymentTarget;
|
||||
|
||||
@Schema(description = "销售目标")
|
||||
private Integer saleTarget;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "申请结果")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "1600")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salesperformance;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 销售业绩目标申请OA Response VO")
|
||||
@Data
|
||||
public class SalesPerformanceRespVO {
|
||||
|
||||
@Schema(description = "销售业绩目标申请", requiredMode = Schema.RequiredMode.REQUIRED, example = "1883")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2022")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "年", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String year;
|
||||
|
||||
@Schema(description = "月", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String month;
|
||||
|
||||
@Schema(description = "回款目标")
|
||||
private BigDecimal paymentTarget;
|
||||
|
||||
@Schema(description = "销售目标")
|
||||
private Integer saleTarget;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "申请结果", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "1600")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salesperformance;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 销售业绩目标申请OA新增/修改 Request VO")
|
||||
@Data
|
||||
public class SalesPerformanceSaveReqVO {
|
||||
|
||||
@Schema(description = "销售业绩目标申请", requiredMode = Schema.RequiredMode.REQUIRED, example = "1883")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "2022")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "年", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "年不能为空")
|
||||
private String year;
|
||||
|
||||
@Schema(description = "月", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "月不能为空")
|
||||
private String month;
|
||||
|
||||
@Schema(description = "回款目标")
|
||||
private BigDecimal paymentTarget;
|
||||
|
||||
@Schema(description = "销售目标")
|
||||
private Integer saleTarget;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "申请结果", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "1600")
|
||||
private String processInstanceId;
|
||||
}
|
@ -54,21 +54,14 @@ public class BpmProcessInstanceRespVO {
|
||||
|
||||
@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 = "公司编号")
|
||||
private Long companyId;
|
||||
|
||||
@Schema(description = "公司名称")
|
||||
private String companyName;
|
||||
}
|
||||
|
||||
@Schema(description = "流程定义信息")
|
||||
|
@ -39,6 +39,4 @@ public class BpmTaskDonePageReqVO extends PageParam {
|
||||
@Schema(description = "部门编号")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "任务状态")
|
||||
private Integer result ;
|
||||
}
|
||||
|
@ -24,10 +24,6 @@ public class BpmTaskDonePageRespVO {
|
||||
@Schema(description = "任务结果-参见 bpm_process_instance_result", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "任务结果-参见 bpm_process_instance_status", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
private Integer status;
|
||||
|
||||
|
||||
@Schema(description = "审批建议", requiredMode = Schema.RequiredMode.REQUIRED, example = "不请假了!")
|
||||
private String reason;
|
||||
|
||||
|
@ -1,67 +0,0 @@
|
||||
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.expenses.BpmOAExpensesCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.Expenses;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAExpensesDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAExpensesItemDO;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.dto.FactoryInfoDTO;
|
||||
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
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Mapper
|
||||
public interface BpmOAExpensesConvert {
|
||||
|
||||
BpmOAExpensesConvert INSTANCE = Mappers.getMapper(BpmOAExpensesConvert.class);
|
||||
|
||||
BpmOAExpensesDO convert(BpmOAExpensesCreateReqVO bean);
|
||||
|
||||
BpmOAExpensesRespVO convert(BpmOAExpensesDO bean);
|
||||
|
||||
default BpmOAExpensesRespVO convert1(BpmOAExpensesDO expensesDO, List<BpmOAExpensesItemDO> expensesItemDOs,
|
||||
Map<Long, FactoryInfoDTO> deptMap, BankRespDTO bankRespDTO) {
|
||||
|
||||
BpmOAExpensesRespVO respVO = BeanUtils.toBean(expensesDO, BpmOAExpensesRespVO.class);
|
||||
|
||||
List<Expenses> expensesItems = BeanUtils.toBean(expensesItemDOs, Expenses.class);
|
||||
if (deptMap != null) {
|
||||
|
||||
expensesItems = convertList(expensesItems, deptMap);
|
||||
}
|
||||
|
||||
if (bankRespDTO != null) {
|
||||
respVO.setBankNo(bankRespDTO.getBankNo());
|
||||
respVO.setBankName(bankRespDTO.getBankName());
|
||||
respVO.setPayeeName(bankRespDTO.getNickname());
|
||||
}
|
||||
|
||||
respVO.setExpensesItem(expensesItems);
|
||||
return respVO;
|
||||
}
|
||||
|
||||
default List<Expenses> convertList(List<Expenses> list, Map<Long, FactoryInfoDTO> deptMap) {
|
||||
|
||||
return CollectionUtils.convertList(list, expenses -> convert(expenses, deptMap.get(expenses.getDeptId())));
|
||||
}
|
||||
|
||||
default Expenses convert(Expenses expensesItem, FactoryInfoDTO dept) {
|
||||
|
||||
if (dept != null) {
|
||||
expensesItem.setDeptName(dept.getShortName());
|
||||
}
|
||||
|
||||
return expensesItem;
|
||||
}
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.convert.oa;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salesperformance.SalesPerformanceSaveReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASalesPerformanceDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
||||
/**
|
||||
* 销售业绩目标申请OA Convert
|
||||
*
|
||||
* @author 艾楷
|
||||
*/
|
||||
@Mapper
|
||||
public interface BpmOASalesPerformanceConvert {
|
||||
|
||||
BpmOASalesPerformanceConvert INSTANCE = Mappers.getMapper(BpmOASalesPerformanceConvert.class);
|
||||
|
||||
BpmOASalesPerformanceDO convert(SalesPerformanceSaveReqVO createReqVO);
|
||||
}
|
@ -97,7 +97,7 @@ public interface BpmProcessInstanceConvert {
|
||||
|
||||
default BpmProcessInstanceRespVO convert2(HistoricProcessInstance processInstance, BpmProcessInstanceExtDO processInstanceExt,
|
||||
ProcessDefinition processDefinition, BpmProcessDefinitionExtDO processDefinitionExt,
|
||||
String bpmnXml, AdminUserRespDTO startUser, DeptRespDTO dept, DeptRespDTO companyDept) {
|
||||
String bpmnXml, AdminUserRespDTO startUser, DeptRespDTO dept) {
|
||||
BpmProcessInstanceRespVO respVO = convert2(processInstance);
|
||||
copyTo(processInstanceExt, respVO);
|
||||
respVO.setBusinessKey(processInstance.getBusinessKey()) ;
|
||||
@ -111,12 +111,6 @@ public interface BpmProcessInstanceConvert {
|
||||
if (dept != null) {
|
||||
respVO.getStartUser().setDeptName(dept.getName());
|
||||
}
|
||||
if (companyDept != null) {
|
||||
// 设置用户所属公司编号
|
||||
respVO.getStartUser().setCompanyId(companyDept.getId());
|
||||
// 设置用户所属公司名称
|
||||
respVO.getStartUser().setCompanyName(companyDept.getName());
|
||||
}
|
||||
}
|
||||
return respVO;
|
||||
}
|
||||
|
@ -90,21 +90,4 @@ public class BpmProcessDefinitionExtDO extends BaseDO {
|
||||
* 流程图标路径地址
|
||||
*/
|
||||
private String processImg ;
|
||||
|
||||
/**
|
||||
* 使用权限范围 | 1全员 2指定部门 3指定用户
|
||||
*/
|
||||
private Integer dataScope;
|
||||
|
||||
/**
|
||||
* 使用权限 指定部门数组
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<Long> dataScopeDeptIds;
|
||||
|
||||
/**
|
||||
* 使用权限 指定用户数组
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<Long> dataScopeUserIds;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class FinancialPaymentDO extends BaseDO {
|
||||
*/
|
||||
private String reason;
|
||||
/**
|
||||
* 流程类型 1现金支出 2备用金 3采购付款 4报销 5付款申请 6薪资付款 7借支申请 8供应商采购付款 9开支日报
|
||||
* 流程类型 1现金支出 2备用金 3采购付款 4报销 5供应商采购付款
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
@ -83,19 +83,6 @@ public class FinancialPaymentDO extends BaseDO {
|
||||
* 流程结束时间
|
||||
*/
|
||||
private LocalDateTime endTime;
|
||||
/**
|
||||
* 收款人名称
|
||||
*/
|
||||
private String recipientName;
|
||||
/**
|
||||
* 付款公司编号
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 公司工厂编号
|
||||
*/
|
||||
private Long companyFactoryId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
@ -112,9 +99,4 @@ public class FinancialPaymentDO extends BaseDO {
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String receiveUserNickName;
|
||||
/**
|
||||
* 付款公司名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String companyName;
|
||||
}
|
||||
|
@ -134,11 +134,6 @@ public class BpmOAContractDO extends BaseDO {
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 是否结算 0否 1是
|
||||
*/
|
||||
private Integer settlementFlag;
|
||||
|
||||
/**
|
||||
* 审批结果
|
||||
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||
|
@ -1,86 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import liquibase.pro.packaged.I;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* OA 生产开支 DO
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@TableName(value ="bpm_oa_expenses", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmOAExpensesDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 出差表单主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 申请人的用户编号
|
||||
* 关联 AdminUserDO 的 id 属性
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 收款人信息
|
||||
* system_bank 编号
|
||||
*/
|
||||
private Long bankId;
|
||||
|
||||
/**
|
||||
* 工厂类型 | 1公司 2工厂
|
||||
*/
|
||||
private Integer factoryType;
|
||||
|
||||
/**
|
||||
* 支出总金额
|
||||
*/
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
private BigDecimal amountPaid;
|
||||
|
||||
/**
|
||||
* 支付状态 | 0未支付 1已支付 2已抵扣 3未抵扣完
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 申请结果
|
||||
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||
* 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈
|
||||
*/
|
||||
private Integer result;
|
||||
|
||||
/**
|
||||
* 对应的流程编号
|
||||
* 关联 ProcessInstance 的 id 属性
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 附件基本信息
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
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_expenses_item", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmOAExpensesItemDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 表单主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 生产开支业务编号
|
||||
*/
|
||||
private Long expensesId;
|
||||
|
||||
/**
|
||||
* 费用类型 字典值参照 BPM_OA_EXPENSES_TYPE
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 费用板块 | 1叉车 2打包 3搬运 4运输
|
||||
*/
|
||||
private Integer costSection;
|
||||
|
||||
/**
|
||||
* 费用产生部门
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
/**
|
||||
* 申请日期
|
||||
*/
|
||||
private LocalDate applicationDate;
|
||||
|
||||
/**
|
||||
* 费用明细
|
||||
*/
|
||||
private String detail;
|
||||
}
|
@ -65,11 +65,6 @@ public class BpmOAImprestDO extends BaseDO {
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 付款公司编号
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 申请金额
|
||||
*/
|
||||
|
@ -1,100 +0,0 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* OA 生产开支 DO
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@TableName(value ="bpm_oa_loan", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmOALoanDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 出差表单主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 申请人的用户编号
|
||||
* 关联 AdminUserDO 的 id 属性
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 收款人信息
|
||||
* system_bank 编号
|
||||
*/
|
||||
private Long bankId;
|
||||
|
||||
/**
|
||||
* 借支工厂
|
||||
*/
|
||||
private Long factoryId;
|
||||
|
||||
/**
|
||||
* 借支用户编号
|
||||
*/
|
||||
private Long sfUserId;
|
||||
|
||||
/**
|
||||
* 借支类型 | 1工资 2费用
|
||||
*/
|
||||
private Integer loanType;
|
||||
|
||||
/**
|
||||
* 抵扣工资月份 | yyyy-MM
|
||||
*/
|
||||
private String returnDate;
|
||||
|
||||
/**
|
||||
* 借出金额
|
||||
*/
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
/**
|
||||
* 还款金额
|
||||
*/
|
||||
private BigDecimal returnAmount;
|
||||
|
||||
/**
|
||||
* 借支原因
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 申请结果
|
||||
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||
* 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈
|
||||
*/
|
||||
private Integer result;
|
||||
|
||||
/**
|
||||
* 对应的流程编号
|
||||
* 关联 ProcessInstance 的 id 属性
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 附件基本信息
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user