Compare commits
No commits in common. "dev" and "crm-业绩目标" have entirely different histories.
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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,6 @@ 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;
|
||||
@ -150,46 +149,4 @@ public class WxMpMsgTemplateUtils {
|
||||
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,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);
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
if (source == null) {
|
||||
return null;
|
||||
}
|
||||
List<T> list = toBean(source.getList(), targetType);
|
||||
if (peek != null) {
|
||||
list.forEach(peek);
|
||||
}
|
||||
return new PageResult<>(list, source.getTotal());
|
||||
}
|
||||
|
||||
public static void copyProperties(Object source, Object target) {
|
||||
if (source == null || target == null) {
|
||||
return;
|
||||
}
|
||||
BeanUtil.copyProperties(source, target, false);
|
||||
return new PageResult<>(toBean(source.getList(), targetType), source.getTotal());
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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,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;
|
||||
}
|
@ -12,7 +12,4 @@ public class ReceiptSettlementDTO {
|
||||
|
||||
@Schema(description = "回款总金额")
|
||||
private BigDecimal money;
|
||||
|
||||
@Schema(description = "渠道商回款总金额")
|
||||
private BigDecimal channelAmount;
|
||||
}
|
||||
|
@ -65,7 +65,6 @@ public interface ErrorCodeConstants {
|
||||
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, "已经存在流程标识为【{}】的流程");
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
@ -75,8 +75,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());
|
||||
}
|
||||
|
||||
// 获取公司信息
|
||||
@ -163,4 +163,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")
|
||||
|
@ -2,8 +2,10 @@ 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.controller.admin.oa.vo.expenses.BpmOAExpensesCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesPageRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesRespVO;
|
||||
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;
|
||||
@ -63,48 +65,9 @@ public class BpmOAExpensesController {
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
@ -2,12 +2,9 @@ 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;
|
||||
@ -112,7 +109,7 @@ public class BpmOALoanController {
|
||||
}
|
||||
|
||||
@GetMapping("/getByProcessInstanceId")
|
||||
@Operation(summary = "获得借支申请")
|
||||
@Operation(summary = "获得加班申请")
|
||||
@Parameter(name = "processInstanceId", description = "流程实例编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOALoanRespVO> getByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {
|
||||
BpmOALoanDO loan = loanService.getByProcessInstanceId(processInstanceId);
|
||||
@ -146,29 +143,30 @@ public class BpmOALoanController {
|
||||
|
||||
@GetMapping("/get-list")
|
||||
@Operation(summary = "获得指定用户的借支申请列表")
|
||||
public CommonResult<PageResult<BpmOALoanRespVO>> getLoanList(BpmOALoanPageReqVO pageReqVO) {
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<List<BpmOALoanRespVO>> getLoanList(@RequestParam("staffId") Long staffId) {
|
||||
|
||||
PageResult<BpmOALoanDO> loanList = loanService.getListByStaffId(pageReqVO);
|
||||
PageResult<BpmOALoanRespVO> respVOS = BeanUtils.toBean(loanList, BpmOALoanRespVO.class);
|
||||
if (CollUtil.isNotEmpty(respVOS.getList())) {
|
||||
List<BpmOALoanDO> loanList = loanService.getListByStaffId(staffId);
|
||||
List<BpmOALoanRespVO> respVOS = BeanUtils.toBean(loanList, BpmOALoanRespVO.class);
|
||||
if (CollUtil.isNotEmpty(respVOS)) {
|
||||
|
||||
// 获取支付信息
|
||||
List<String> processInstanceIds = convertList(loanList.getList(), BpmOALoanDO::getProcessInstanceId);
|
||||
List<String> processInstanceIds = convertList(loanList, BpmOALoanDO::getProcessInstanceId);
|
||||
Map<String, FinancialPaymentDO> financialPayments = convertMap(financialPaymentService.getFinancialPaymentList(processInstanceIds), FinancialPaymentDO::getProcessInstanceId);
|
||||
|
||||
// 获取申请人信息
|
||||
Set<Long> userIds = convertSet(loanList.getList(), BpmOALoanDO::getUserId);
|
||||
Set<Long> userIds = convertSet(loanList, BpmOALoanDO::getUserId);
|
||||
Map<Long, AdminUserRespDTO> userMap = userApi.getUserMap(userIds);
|
||||
|
||||
// 获取借支人信息
|
||||
Set<Long> loanUserIds = convertSet(loanList.getList(), BpmOALoanDO::getSfUserId);
|
||||
Set<Long> loanUserIds = convertSet(loanList, BpmOALoanDO::getSfUserId);
|
||||
Map<Long, StaffDTO> loanUserMap = convertMap(staffApi.getStaffList(loanUserIds).getCheckedData(), StaffDTO::getId);
|
||||
|
||||
// 获取工厂信息
|
||||
Set<Long> deptIds = convertSet(loanList.getList(), BpmOALoanDO::getFactoryId);
|
||||
Set<Long> deptIds = convertSet(loanList, BpmOALoanDO::getFactoryId);
|
||||
Map<Long, FactoryInfoDTO> factoryMap = factoryInfoApi.getFactoryMap(deptIds);
|
||||
|
||||
respVOS.getList().forEach(item -> {
|
||||
respVOS.forEach(item -> {
|
||||
// 设置申请人名称
|
||||
item.setUserName(userMap.get(item.getUserId()).getNickname());
|
||||
// 设置借支用户名称
|
||||
@ -182,13 +180,4 @@ public class BpmOALoanController {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -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,17 +52,11 @@ public class BpmOAReimbursementController {
|
||||
|
||||
BpmOAReimbursementDO reimbursement = service.getReimbursement(id);
|
||||
BpmOAReimbursementRespVO respVO = service.convert(reimbursement);
|
||||
if (respVO != null) {
|
||||
if (StringUtil.isNotEmpty(respVO.getProjectNo())) {
|
||||
if (respVO != null && 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());
|
||||
}
|
||||
}
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@ -92,17 +82,11 @@ public class BpmOAReimbursementController {
|
||||
|
||||
BpmOAReimbursementDO reimbursement = service.getByProcessInstanceId(processInstanceId);
|
||||
BpmOAReimbursementRespVO respVO = service.convert(reimbursement);
|
||||
if (respVO != null) {
|
||||
if (StringUtil.isNotEmpty(respVO.getProjectNo())) {
|
||||
if (respVO != null && 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());
|
||||
}
|
||||
}
|
||||
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());
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -27,9 +27,6 @@ public class BpmOAExpensesCreateReqVO {
|
||||
@Schema(description = "开支明细")
|
||||
private List<Expenses> expensesItem;
|
||||
|
||||
@Schema(description = "工厂类型 |1工厂 2公司 ")
|
||||
private Integer factoryType;
|
||||
|
||||
@Schema(description = "报销总金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销总金额不能为空")
|
||||
private BigDecimal totalMoney;
|
||||
|
@ -29,8 +29,5 @@ public class BpmOAExpensesPageReqVO extends PageParam {
|
||||
private Integer costSection;
|
||||
|
||||
@Schema(description = "审批通过时间")
|
||||
private String[] endTime;
|
||||
|
||||
@Schema(description = "收款人姓名")
|
||||
private String payeeName;
|
||||
private LocalDateTime[] endTime;
|
||||
}
|
||||
|
@ -58,10 +58,4 @@ public class BpmOAExpensesPageRespVO extends BpmOABaseRespVO {
|
||||
|
||||
@Schema(description = "费用明细")
|
||||
private String detail;
|
||||
|
||||
@Schema(description = "审批时间")
|
||||
private String endTime;
|
||||
|
||||
@Schema(description = "支付状态 | 0未支付 1已支付")
|
||||
private Integer status;
|
||||
}
|
||||
|
@ -34,9 +34,6 @@ public class BpmOAExpensesRespVO extends BpmOABaseRespVO {
|
||||
@Schema(description = "开支明细")
|
||||
private List<Expenses> expensesItem;
|
||||
|
||||
@Schema(description = "工厂类型 | 1公司 工厂")
|
||||
private Integer factoryType;
|
||||
|
||||
@Schema(description = "报销总金额")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
|
@ -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;
|
||||
}
|
@ -32,21 +32,10 @@ public class BpmOALoanCreateReqVO {
|
||||
@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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
@ -7,7 +7,6 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@ -50,18 +49,9 @@ public class BpmOALoanRespVO extends BpmOABaseRespVO {
|
||||
@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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
@ -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;
|
||||
|
||||
|
@ -7,7 +7,6 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpenses
|
||||
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;
|
||||
@ -31,7 +30,7 @@ public interface BpmOAExpensesConvert {
|
||||
BpmOAExpensesRespVO convert(BpmOAExpensesDO bean);
|
||||
|
||||
default BpmOAExpensesRespVO convert1(BpmOAExpensesDO expensesDO, List<BpmOAExpensesItemDO> expensesItemDOs,
|
||||
Map<Long, FactoryInfoDTO> deptMap, BankRespDTO bankRespDTO) {
|
||||
Map<Long, DeptRespDTO> deptMap, BankRespDTO bankRespDTO) {
|
||||
|
||||
BpmOAExpensesRespVO respVO = BeanUtils.toBean(expensesDO, BpmOAExpensesRespVO.class);
|
||||
|
||||
@ -51,15 +50,15 @@ public interface BpmOAExpensesConvert {
|
||||
return respVO;
|
||||
}
|
||||
|
||||
default List<Expenses> convertList(List<Expenses> list, Map<Long, FactoryInfoDTO> deptMap) {
|
||||
default List<Expenses> convertList(List<Expenses> list, Map<Long, DeptRespDTO> deptMap) {
|
||||
|
||||
return CollectionUtils.convertList(list, expenses -> convert(expenses, deptMap.get(expenses.getDeptId())));
|
||||
}
|
||||
|
||||
default Expenses convert(Expenses expensesItem, FactoryInfoDTO dept) {
|
||||
default Expenses convert(Expenses expensesItem, DeptRespDTO dept) {
|
||||
|
||||
if (dept != null) {
|
||||
expensesItem.setDeptName(dept.getShortName());
|
||||
expensesItem.setDeptName(dept.getName());
|
||||
}
|
||||
|
||||
return expensesItem;
|
||||
|
@ -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付款申请 6薪资付款 7借支申请 8供应商采购付款
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ 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;
|
||||
@ -45,26 +44,11 @@ public class BpmOAExpensesDO extends BaseDO {
|
||||
*/
|
||||
private Long bankId;
|
||||
|
||||
/**
|
||||
* 工厂类型 | 1公司 2工厂
|
||||
*/
|
||||
private Integer factoryType;
|
||||
|
||||
/**
|
||||
* 支出总金额
|
||||
*/
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
/**
|
||||
* 支付金额
|
||||
*/
|
||||
private BigDecimal amountPaid;
|
||||
|
||||
/**
|
||||
* 支付状态 | 0未支付 1已支付 2已抵扣 3未抵扣完
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 申请结果
|
||||
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||
|
@ -54,31 +54,11 @@ public class BpmOALoanDO extends BaseDO {
|
||||
*/
|
||||
private Long sfUserId;
|
||||
|
||||
/**
|
||||
* 借支类型 | 1工资 2费用
|
||||
*/
|
||||
private Integer loanType;
|
||||
|
||||
/**
|
||||
* 抵扣工资月份 | yyyy-MM
|
||||
*/
|
||||
private String returnDate;
|
||||
|
||||
/**
|
||||
* 借出金额
|
||||
*/
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
/**
|
||||
* 还款金额
|
||||
*/
|
||||
private BigDecimal returnAmount;
|
||||
|
||||
/**
|
||||
* 借支原因
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 申请结果
|
||||
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||
|
@ -78,9 +78,9 @@ public class BpmOAPaymentDO extends BaseDO {
|
||||
private Long bankId;
|
||||
|
||||
/**
|
||||
* 付款方式 | 1分批付款 3全额付款 4指定金额付款
|
||||
* 付款方式 | 1预付款 2分期付款 3全额付款
|
||||
*/
|
||||
private BigDecimal paymentMethod;
|
||||
private Integer paymentMethod;
|
||||
|
||||
/**
|
||||
* 付款总额 | 针对预付款、分期付款情况
|
||||
|
@ -1,7 +1,8 @@
|
||||
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.controller.admin.oa.vo.reimbursement.Reimbursement;
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -64,15 +65,10 @@ public class BpmOAReimbursementDO extends BaseDO {
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 付款公司编号
|
||||
* 报销明细数据JSON
|
||||
*/
|
||||
private Long paymentCompany;
|
||||
|
||||
// /**
|
||||
// * 报销明细数据JSON
|
||||
// */
|
||||
// @TableField(typeHandler = JacksonTypeHandler.class)
|
||||
// private List<Reimbursement> reimbursements;
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<Reimbursement> reimbursements;
|
||||
/**
|
||||
* 总报销金额
|
||||
*/
|
||||
|
@ -68,9 +68,4 @@ public class BpmOAReimbursementItemDO extends BaseDO {
|
||||
* 采购申请编号
|
||||
*/
|
||||
private Long procureId;
|
||||
|
||||
/**
|
||||
* 业务表编号
|
||||
*/
|
||||
private Long objectId;
|
||||
}
|
||||
|
@ -2,8 +2,6 @@ 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.framework.mybatis.core.type.JsonLongSetTypeHandler;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.salary.SalarySubjectItemsVO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -13,7 +11,6 @@ import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* OA 薪资付款 DO
|
||||
@ -52,28 +49,11 @@ public class BpmOASalaryDO extends BaseDO {
|
||||
*/
|
||||
private String salaryDate;
|
||||
|
||||
/**
|
||||
* 公司类型 | 1公司 2工厂
|
||||
*/
|
||||
private Integer deptType;
|
||||
|
||||
/**
|
||||
* 付款公司
|
||||
*/
|
||||
private Long companyDeptId;
|
||||
|
||||
/**
|
||||
* 付款工厂的部门编号集合
|
||||
*/
|
||||
@TableField(typeHandler = JsonLongSetTypeHandler.class)
|
||||
private Set<Long> factoryDeptId;
|
||||
|
||||
/**
|
||||
* 员工薪资id集合
|
||||
*/
|
||||
@TableField(typeHandler = JsonLongSetTypeHandler.class)
|
||||
private Set<Long> staffSalaryIds;
|
||||
|
||||
/**
|
||||
* 付款总额
|
||||
*/
|
||||
@ -89,13 +69,6 @@ public class BpmOASalaryDO extends BaseDO {
|
||||
*/
|
||||
private String paymentRecipient;
|
||||
|
||||
|
||||
/**
|
||||
* 薪资主体明细
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<SalarySubjectItemsVO> salarySubjectItems;
|
||||
|
||||
/**
|
||||
* 薪资付款申请的结果
|
||||
*
|
||||
|
@ -6,10 +6,8 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.evection.BpmOAEvection
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAEvectionDO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出差申请 Mapper
|
||||
@ -28,6 +26,4 @@ public interface BpmOAEvectionMapper extends BaseMapperX<BpmOAEvectionDO> {
|
||||
.geIfPresent(BpmOAEvectionDO::getEndTime, createReqVO.getStartTime())
|
||||
.in(BpmOAEvectionDO::getResult, Arrays.asList(BpmProcessInstanceResultEnum.PROCESS.getResult(), BpmProcessInstanceResultEnum.APPROVE.getResult())));
|
||||
}
|
||||
|
||||
List<BpmOAEvectionDO> selectEvectionList(@Param("userId") Long userId);
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesPageRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesTotal;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAExpensesDO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@ -14,8 +13,4 @@ public interface BpmOAExpensesMapper extends BaseMapperX<BpmOAExpensesDO> {
|
||||
|
||||
IPage<BpmOAExpensesPageRespVO> selectExpensesPage(@Param("page") IPage<BpmOAExpensesPageReqVO> page,
|
||||
@Param("pageReqVO") BpmOAExpensesPageReqVO pageReqVO);
|
||||
|
||||
BpmOAExpensesTotal selectTotal(@Param("pageReqVO") BpmOAExpensesPageReqVO pageReqVO);
|
||||
|
||||
void oneClickPayment(@Param("month") String month);
|
||||
}
|
||||
|
@ -1,24 +1,9 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.loan.BpmOALoanSumDTO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.loan.BpmOALoanPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.loan.BpmOAReturnVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALoanDO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface BpmOALoanMapper extends BaseMapperX<BpmOALoanDO> {
|
||||
|
||||
List<BpmOALoanSumDTO> selectSumByStaffId(@Param("staffId") Collection<Long> staffId,
|
||||
@Param("month") String month);
|
||||
|
||||
IPage<BpmOAReturnVO> selectReturnList(@Param("pageReqVO") BpmOALoanPageReqVO pageReqVO,
|
||||
@Param("page") IPage<BpmOAReturnVO> page);
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ public interface BpmOAPaymentMapper extends BaseMapperX<BpmOAPaymentDO> {
|
||||
.eq(BpmOAPaymentDO::getIsTickets, 1)
|
||||
.eqIfPresent(BpmOAPaymentDO::getStatus, pageReqVO.getStatus())
|
||||
.betweenIfPresent(BpmOAPaymentDO::getCreateTime, pageReqVO.getCreateTime())
|
||||
.eqIfPresent(BpmOAPaymentDO::getUserId, pageReqVO.getUserId())
|
||||
.eq(pageReqVO.getIsMy(), BpmOAPaymentDO::getUserId, userId)
|
||||
.orderByAsc(BpmOAPaymentDO::getStatus)
|
||||
.orderByDesc(BpmOAPaymentDO::getId));
|
||||
|
@ -93,7 +93,6 @@ public interface BpmTaskExtMapper extends BaseMapperX<BpmTaskExtDO> {
|
||||
queryWrapperX.selectAs(BpmProcessInstanceExtDO::getStartUserId, BpmTaskDonePageRespVO::getStartUserId);
|
||||
queryWrapperX.selectAs(BpmProcessInstanceExtDO::getProcessDefinitionId, BpmTaskDonePageRespVO::getProcessDefinitionId);
|
||||
queryWrapperX.selectAs(BpmProcessInstanceExtDO::getCcids, BpmTaskDonePageRespVO::getCcUserIds);
|
||||
queryWrapperX.selectAs(BpmProcessInstanceExtDO::getStatus, BpmTaskDonePageRespVO::getStatus ) ;
|
||||
|
||||
queryWrapperX.innerJoin(BpmProcessInstanceExtDO.class, on -> on
|
||||
.eq(BpmTaskExtDO::getProcessInstanceId, BpmProcessInstanceExtDO::getProcessInstanceId)
|
||||
@ -102,10 +101,6 @@ public interface BpmTaskExtMapper extends BaseMapperX<BpmTaskExtDO> {
|
||||
queryWrapperX.likeRight(BpmProcessInstanceExtDO::getProcessDefinitionId, "oa_");
|
||||
queryWrapperX.eq(BpmTaskExtDO::getAssigneeUserId, userId);
|
||||
queryWrapperX.ne(BpmTaskExtDO::getReason, BpmConstants.AUTO_APPRAVAL);
|
||||
// queryWrapperX.ne(BpmTaskExtDO::getResult,4); //还未开始审批,发起人主动撤销的流程,不显示
|
||||
if (pageVO.getResult() != null) {
|
||||
queryWrapperX.eq(BpmTaskExtDO::getResult,pageVO.getResult());
|
||||
}
|
||||
queryWrapperX.betweenIfPresent(BpmTaskExtDO::getCreateTime, pageVO.getCreateTime());
|
||||
queryWrapperX.orderByDesc(BpmTaskExtDO::getEndTime);
|
||||
|
||||
|
@ -58,12 +58,6 @@ public class BpmTaskEntryLeaderScript implements BpmTaskAssignScript {
|
||||
//根据部门ID 获取部门信息
|
||||
DeptRespDTO dept = deptApi.getDept(deptId).getCheckedData();
|
||||
|
||||
// 获取4级部门信息
|
||||
if (dept.getLevel() > 4) {
|
||||
String[] level = dept.getFlag().split("-");
|
||||
dept = deptApi.getDept(Long.valueOf(level[4])).getCheckedData();
|
||||
}
|
||||
|
||||
return dept != null && dept.getLeaderUserId() != null ? asSet(dept.getLeaderUserId()) : emptySet();
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,6 @@ import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@ -94,14 +93,9 @@ public class BpmTaskFactoryLeaderScript extends BpmTaskAssignLeaderAbstractScrip
|
||||
if (salaryDO != null) {
|
||||
|
||||
// 获取申请部门信息
|
||||
DeptRespDTO deptRespDTO = null;
|
||||
if (salaryDO.getCompanyDeptId() != null) {
|
||||
deptRespDTO = deptApi.getDept(salaryDO.getCompanyDeptId()).getCheckedData();
|
||||
}else if (CollUtil.isNotEmpty(salaryDO.getFactoryDeptId())) {
|
||||
deptRespDTO = deptApi.getDeptByFactoryId(new ArrayList<>(salaryDO.getFactoryDeptId()).get(0)).getCheckedData();
|
||||
}
|
||||
DeptRespDTO deptRespDTO = deptApi.getDept(salaryDO.getCompanyDeptId()).getCheckedData();
|
||||
// 判断是否是属于工厂部门
|
||||
if (deptRespDTO != null) {
|
||||
if (deptRespDTO != null && deptRespDTO.getFactoryId() != null) {
|
||||
dept = deptApi.getDept(deptRespDTO.getParentId()).getCheckedData();
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import cn.iocoder.yudao.module.product.api.storeproduct.StoreProductApi;
|
||||
import cn.iocoder.yudao.module.product.api.storeproductattrvalue.StoreProductAttrValueApi;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.factoryInfo.FactoryInfoApi;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.staff.StaffApi;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.staffSalary.StaffSalaryApi;
|
||||
import cn.iocoder.yudao.module.system.api.assetreceive.AssetReceiveApi;
|
||||
import cn.iocoder.yudao.module.system.api.assets.AssetsApi;
|
||||
import cn.iocoder.yudao.module.system.api.assets.AssetsTypeApi;
|
||||
@ -46,8 +45,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
SubscribeMessageSendApi.class, SocialClientApi.class, UsersExtApi.class, AttendanceApi.class, BankApi.class, ConfigApi.class, PositionApi.class, SupplierApi.class, AssetsApi.class,
|
||||
AssetsTypeApi.class, AssetReceiveApi.class, AttendanceApi.class, AttendanceGroupApi.class, WorkOvertimeApi.class, HolidayApi.class,
|
||||
RentalOrderApi.class, RentalDepositRecordApi.class, ProjectApi.class, RentalItemsRecordApi.class,AdminOauthUserOtherInfoApi.class, StoreProductAttrValueApi.class, StoreProductApi.class,
|
||||
ContractApi.class, BusinessApi.class, CrmCustomerApi.class, StaffApi.class, LoanApi.class, FactoryInfoApi.class, UserLiveTreeApi.class, SalesPerformanceSettlementApi.class,
|
||||
StaffSalaryApi.class
|
||||
ContractApi.class, BusinessApi.class, CrmCustomerApi.class, StaffApi.class, LoanApi.class, FactoryInfoApi.class, UserLiveTreeApi.class, SalesPerformanceSettlementApi.class
|
||||
})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
|
@ -89,13 +89,6 @@ public interface FinancialPaymentService {
|
||||
*/
|
||||
List<FinancialPaymentDO> getFinancialPaymentList(List<String> processInstanceIds);
|
||||
|
||||
/**
|
||||
* 根据流程实例编号获取支付信息
|
||||
* @param processInstanceId 流程实例编号
|
||||
* @return 支付信息
|
||||
*/
|
||||
FinancialPaymentDO getFinancialPaymentByProcessInstanceId(String processInstanceId);
|
||||
|
||||
/**
|
||||
* 获取支付信息 统计
|
||||
* @param pageReqVO 查询条件
|
||||
|
@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.financialpayment;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.Constants;
|
||||
import cn.iocoder.yudao.framework.common.enums.SocialTypeEnum;
|
||||
@ -25,7 +24,6 @@ import cn.iocoder.yudao.module.bpm.dal.mysql.oa.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.task.BpmProcessInstanceExtMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAExpensesService;
|
||||
import cn.iocoder.yudao.module.system.api.auth.AdminOauthUserOtherInfoApi;
|
||||
import cn.iocoder.yudao.module.system.api.auth.dto.AdminOauthUserOtherInfoApiDTO;
|
||||
import cn.iocoder.yudao.module.system.api.auth.vo.AdminOauthUserOtherInfoApiVO;
|
||||
@ -91,9 +89,6 @@ public class FinancialPaymentServiceImpl implements FinancialPaymentService {
|
||||
@Resource
|
||||
private BpmOASalaryMapper salaryMapper;
|
||||
|
||||
@Resource
|
||||
private BpmOAExpensesMapper expensesMapper;
|
||||
|
||||
@Override
|
||||
public Long createFinancialPayment(FinancialPaymentSaveVO vo) {
|
||||
FinancialPaymentItemSaveReqVO createReqVO = vo.getFinancialPaymentItemSaveReqVO();
|
||||
@ -144,8 +139,6 @@ public class FinancialPaymentServiceImpl implements FinancialPaymentService {
|
||||
case 8:
|
||||
supplierPurchasePaymentMapper.updateById(new BpmOASupplierPurchasePaymentDO().setId(financialPayment.getObjectId()).setResult(BpmProcessInstanceResultEnum.BACK.getResult()));
|
||||
break;
|
||||
case 9:
|
||||
expensesMapper.updateById(new BpmOAExpensesDO().setId(financialPayment.getObjectId()).setResult(BpmProcessInstanceResultEnum.BACK.getResult()));
|
||||
}
|
||||
BpmProcessInstanceExtDO instanceExtDO = new BpmProcessInstanceExtDO().setProcessInstanceId(financialPayment.getProcessInstanceId())
|
||||
.setStatus(BpmProcessInstanceStatusEnum.FINISH.getStatus())
|
||||
@ -154,11 +147,9 @@ public class FinancialPaymentServiceImpl implements FinancialPaymentService {
|
||||
}
|
||||
this.updateById(financialPayment);
|
||||
|
||||
// 支付完成时
|
||||
if (financialPayment.getStatus() == 2) {
|
||||
// 判断是借支申请时
|
||||
if (financialPayment.getType() == 7 && financialPayment.getStatus() == 2) {
|
||||
|
||||
switch (financialPayment.getType()) {
|
||||
case 7: // 借支申请时
|
||||
// 获取借支信息
|
||||
BpmOALoanDO loanDO = loanMapper.selectById(financialPayment.getObjectId());
|
||||
|
||||
@ -166,19 +157,9 @@ public class FinancialPaymentServiceImpl implements FinancialPaymentService {
|
||||
LoanDTO createDO = new LoanDTO()
|
||||
.setUserId(loanDO.getSfUserId())
|
||||
.setDeptId(loanDO.getFactoryId())
|
||||
.setLoanType(loanDO.getLoanType())
|
||||
.setAmount(loanDO.getTotalMoney())
|
||||
.setReturnAmount(BigDecimal.ZERO);
|
||||
loanApi.createLoan(createDO);
|
||||
break;
|
||||
case 9: // 开支日报时
|
||||
// 更新开支日报支付状态、支付金额
|
||||
expensesMapper.updateById(new BpmOAExpensesDO()
|
||||
.setId(financialPayment.getObjectId())
|
||||
.setStatus(1)
|
||||
.setAmountPaid(financialPayment.getActualPayment()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// -- 获取发起人的openId
|
||||
@ -272,15 +253,6 @@ public class FinancialPaymentServiceImpl implements FinancialPaymentService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public FinancialPaymentDO getFinancialPaymentByProcessInstanceId(String processInstanceId) {
|
||||
List<FinancialPaymentDO> financialPaymentDO = financialPaymentMapper.selectList(FinancialPaymentDO::getProcessInstanceId, processInstanceId);
|
||||
if (CollUtil.isNotEmpty(financialPaymentDO)) {
|
||||
return financialPaymentDO.get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FinancialPaymentDO getPaymentTotal(FinancialPaymentPageReqVO pageReqVO) {
|
||||
pageReqVO.setReceiveUserId(getLoginUserId());
|
||||
|
@ -229,16 +229,6 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
|
||||
BpmProcessInstanceExtDO processInstance = bpmProcessInstanceService.getProcessInstanceDO(processInstanceId);
|
||||
CommonResult<AdminUserRespDTO> user = userApi.getUser(cash.getUserId());
|
||||
|
||||
// 从缓存中部门所属公司信息
|
||||
DeptRespDTO deptRespDTO = deptApi.getCompanyByDept(cashItemDOs.get(0).getDeptId()).getCheckedData();
|
||||
|
||||
// 获取收款人信息
|
||||
BankRespDTO bankRespDTO = new BankRespDTO();
|
||||
if (cash.getBankId() != null) {
|
||||
bankRespDTO = bankApi.getBank(cash.getBankId()).getCheckedData();
|
||||
}
|
||||
|
||||
// -- 插入到财务支付表中
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(cash.getUserId())
|
||||
@ -252,8 +242,6 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
||||
.setAmountPayable(isImprest == 1 ? amount.abs() : cash.getTotalMoney())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bankRespDTO.getNickname())
|
||||
.setCompanyId(deptRespDTO != null ? deptRespDTO.getId() : null)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -54,10 +54,4 @@ public interface BpmOAEvectionService {
|
||||
* @return 出差申请列表
|
||||
*/
|
||||
List<BpmOAEvectionDO> getEvectionListByEndTime(LocalDate date);
|
||||
|
||||
/**
|
||||
* 获得我的出差申请列表
|
||||
* @return 出差申请列表
|
||||
*/
|
||||
List<BpmOAEvectionDO> getEvectionList();
|
||||
}
|
||||
|
@ -20,7 +20,6 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_EVECTION_IS_EXISTS;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_EVECTION_NOT_EXISTS;
|
||||
|
||||
@ -151,10 +150,4 @@ public class BpmOAEvectionServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
.eq(BpmOAEvectionDO::getResult, BpmProcessInstanceResultEnum.APPROVE.getResult())
|
||||
.likeIfPresent(BpmOAEvectionDO::getEndTime, date.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BpmOAEvectionDO> getEvectionList() {
|
||||
|
||||
return evectionMapper.selectEvectionList(getLoginUserId());
|
||||
}
|
||||
}
|
||||
|
@ -1,12 +1,14 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.*;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesPageRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAExpensesDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAExpensesItemDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
public interface BpmOAExpensesService {
|
||||
@ -65,36 +67,4 @@ public interface BpmOAExpensesService {
|
||||
* @return 分页结果
|
||||
*/
|
||||
PageResult<BpmOAExpensesPageRespVO> getExpensesPage(BpmOAExpensesPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得开支金额统计
|
||||
* @return 统计信息
|
||||
*/
|
||||
BpmOAExpensesTotal getExpensesTotal(BpmOAExpensesPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 提前付款 | 手动插入至支付管理
|
||||
* @param id 生产开支id
|
||||
*/
|
||||
void getPayment(Long id);
|
||||
|
||||
/**
|
||||
* 更新生产开支 支付状态
|
||||
* @param status 支付状态
|
||||
* @param amountPaid 支付金额
|
||||
*/
|
||||
void updateExpenses(Long id ,Integer status, BigDecimal amountPaid);
|
||||
|
||||
/**
|
||||
* 拒绝付款
|
||||
* @param id 生产开支id
|
||||
* @param processInstanceId 流程实例编号
|
||||
*/
|
||||
void refused(Long id, String processInstanceId);
|
||||
|
||||
/**
|
||||
* 一键支付
|
||||
* @param month 月份
|
||||
*/
|
||||
void oneClickPayment(String month);
|
||||
}
|
||||
|
@ -1,51 +1,41 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.framework.mybatis.core.util.MyBatisUtils;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.*;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesPageReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesPageRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAExpensesConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
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.bpm.dal.dataobject.task.BpmProcessInstanceExtDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAExpensesItemMapper;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAExpensesMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
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.loan.LoanApi;
|
||||
import cn.iocoder.yudao.module.system.api.loan.dto.LoanDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_EXPENSES_NOT_EXISTS;
|
||||
|
||||
@ -70,30 +60,18 @@ public class BpmOAExpensesServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
private BpmOAExpensesItemMapper expensesItemMapper;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
private BpmProcessInstanceApi processInstanceApi;
|
||||
|
||||
@Resource
|
||||
private FactoryInfoApi factoryInfoApi;
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private BankApi bankApi;
|
||||
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
|
||||
@Resource
|
||||
@Lazy // 解决循环依赖
|
||||
private BpmHistoryProcessInstanceService historyProcessInstanceService;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
@Resource
|
||||
private LoanApi loanApi;
|
||||
|
||||
@Resource
|
||||
private StaffApi staffApi;
|
||||
|
||||
@Override
|
||||
public Long createExpenses(Long userId, BpmOAExpensesCreateReqVO createReqVO) {
|
||||
|
||||
@ -112,11 +90,9 @@ public class BpmOAExpensesServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
String type = bpmOAExpensesItemDOS.stream().map(item -> item.getType().toString()).collect(Collectors.joining(","));
|
||||
processInstanceVariables.put("type", type);
|
||||
processInstanceVariables.put("factoryType", expenses.getFactoryType());
|
||||
processInstanceVariables.put("factory_id", bpmOAExpensesItemDOS.get(0).getDeptId());
|
||||
String processInstanceId = processInstanceService.createProcessInstance(userId,
|
||||
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(expenses.getId())));
|
||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(expenses.getId()))).getCheckedData();
|
||||
|
||||
// 将工作流的编号,更新到 OA 生产开支单中
|
||||
expensesMapper.updateById(new BpmOAExpensesDO().setId(expenses.getId()).setProcessInstanceId(processInstanceId));
|
||||
@ -142,48 +118,7 @@ public class BpmOAExpensesServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
// 获得现金支出业务数据
|
||||
BpmOAExpensesDO expenses = validateLeaveExists(id);
|
||||
|
||||
//审核通过 (最后节点)
|
||||
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
||||
|
||||
ProcessInstance instance = processInstanceService.getProcessInstance(processInstanceId);
|
||||
if (instance.isEnded()) {
|
||||
|
||||
// 获取申请人对应的厂区员工编号
|
||||
StaffDTO staffDTO = staffApi.getStaffByUserId(expenses.getUserId()).getCheckedData();
|
||||
if (staffDTO != null) {
|
||||
|
||||
// 判断申请人是否存在 费用借支
|
||||
LoanDTO loanDTO = loanApi.getByUserId(staffDTO.getId(), 2).getCheckedData();
|
||||
if (loanDTO != null) {
|
||||
|
||||
if (loanDTO.getRemainingAmount().compareTo(expenses.getTotalMoney()) >= 0) {
|
||||
|
||||
// 设置开支日报支付状态为 已抵扣
|
||||
expenses.setStatus(2).setAmountPaid(expenses.getTotalMoney());
|
||||
|
||||
}else {
|
||||
|
||||
// 设置开支日报支付状态为 未抵扣完毕
|
||||
expenses.setStatus(3).setAmountPaid(loanDTO.getRemainingAmount());
|
||||
}
|
||||
|
||||
// 更新借支表中 归还金额
|
||||
loanApi.createLoan(new LoanDTO()
|
||||
.setUserId(staffDTO.getId())
|
||||
.setLoanType(2)
|
||||
.setAmount(BigDecimal.ZERO)
|
||||
.setReturnAmount(expenses.getAmountPaid()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 更新开支日报 审批结果、支付状态以及支付金额
|
||||
expensesMapper.updateById(new BpmOAExpensesDO()
|
||||
.setId(id)
|
||||
.setResult(result)
|
||||
.setStatus(expenses.getStatus())
|
||||
.setAmountPaid(expenses.getAmountPaid()));
|
||||
expensesMapper.updateById(new BpmOAExpensesDO().setId(id).setResult(result));
|
||||
}
|
||||
|
||||
private BpmOAExpensesDO validateLeaveExists(Long id) {
|
||||
@ -225,7 +160,8 @@ public class BpmOAExpensesServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
List<BpmOAExpensesItemDO> expensesItemDOs = getExpensesItem(expenses.getId());
|
||||
|
||||
//获取部门信息map
|
||||
Map<Long, FactoryInfoDTO> factoryInfoDTOS = factoryInfoApi.getFactoryMap(convertSet(expensesItemDOs, BpmOAExpensesItemDO::getDeptId));
|
||||
List<DeptRespDTO> deptList = deptApi.getDeptByFactoryIds(convertSet(expensesItemDOs, BpmOAExpensesItemDO::getDeptId)).getCheckedData();
|
||||
Map<Long, DeptRespDTO> deptMap = convertMap(deptList, DeptRespDTO::getFactoryId);
|
||||
|
||||
// 获取银行卡信息
|
||||
BankRespDTO bankRespDTO = null;
|
||||
@ -233,7 +169,7 @@ public class BpmOAExpensesServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
bankRespDTO = bankApi.getBank(expenses.getBankId()).getCheckedData();
|
||||
}
|
||||
|
||||
return BpmOAExpensesConvert.INSTANCE.convert1(expenses, expensesItemDOs, factoryInfoDTOS, bankRespDTO);
|
||||
return BpmOAExpensesConvert.INSTANCE.convert1(expenses, expensesItemDOs, deptMap, bankRespDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -241,84 +177,4 @@ public class BpmOAExpensesServiceImpl extends BpmOABaseService implements BpmOAE
|
||||
IPage<BpmOAExpensesPageRespVO> page = expensesMapper.selectExpensesPage(MyBatisUtils.buildPage(pageReqVO) ,pageReqVO);
|
||||
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmOAExpensesTotal getExpensesTotal(BpmOAExpensesPageReqVO pageReqVO) {
|
||||
return expensesMapper.selectTotal(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getPayment(Long id) {
|
||||
|
||||
// 获取开支详情
|
||||
BpmOAExpensesDO expenses = this.getExpenses(id);
|
||||
List<BpmOAExpensesItemDO> expensesItems = this.getExpensesItem(id);
|
||||
|
||||
// 校验是否已添加至支付管理
|
||||
if (financialPaymentService.getFinancialPaymentByProcessInstanceId(expenses.getProcessInstanceId()) == null) {
|
||||
|
||||
String reason = expensesItems.stream().map(BpmOAExpensesItemDO::getDetail)
|
||||
.filter(StrUtil::isNotEmpty)
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
BpmProcessInstanceExtDO processInstance = processInstanceService.getProcessInstanceDO(expenses.getProcessInstanceId());
|
||||
// -- 插入到财务支付表中
|
||||
CommonResult<AdminUserRespDTO> user = userApi.getUser(expenses.getUserId());
|
||||
|
||||
// 获取收款人信息
|
||||
BankRespDTO bankRespDTO = null;
|
||||
if (expenses.getBankId() != null) {
|
||||
bankRespDTO = bankApi.getBank(expenses.getBankId()).getCheckedData();
|
||||
}
|
||||
|
||||
// 获取付款公司信息
|
||||
FactoryInfoDTO dto = new FactoryInfoDTO();
|
||||
if (expenses.getFactoryType() == 1) {
|
||||
dto = factoryInfoApi.getFactoryInfo(expensesItems.get(0).getDeptId()).getCheckedData();
|
||||
}
|
||||
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(expenses.getUserId())
|
||||
.setDeptId(user.getData() == null ? null : user.getData().getDeptId())
|
||||
.setProcessInstanceId(expenses.getProcessInstanceId())
|
||||
.setReason(reason)
|
||||
.setObjectId(id)
|
||||
.setType(9)
|
||||
.setStatus(0)
|
||||
.setAmountPayable(expenses.getTotalMoney())
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bankRespDTO != null ? bankRespDTO.getNickname() : "")
|
||||
.setCompanyFactoryId(dto.getId())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExpenses(Long id ,Integer status, BigDecimal amountPaid) {
|
||||
|
||||
expensesMapper.updateById(new BpmOAExpensesDO()
|
||||
.setId(id)
|
||||
.setStatus(status)
|
||||
.setAmountPaid(amountPaid));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refused(Long id, String processInstanceId) {
|
||||
|
||||
// 设置状态为 驳回
|
||||
expensesMapper.updateById(new BpmOAExpensesDO()
|
||||
.setId(id)
|
||||
.setResult(BpmProcessInstanceResultEnum.BACK.getResult()));
|
||||
|
||||
// 同步更新流程实例表
|
||||
processInstanceService.updateProcessInstanceResult(processInstanceId, BpmProcessInstanceResultEnum.BACK.getResult());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void oneClickPayment(String month) {
|
||||
|
||||
expensesMapper.oneClickPayment(month);
|
||||
}
|
||||
}
|
||||
|
@ -14,10 +14,6 @@ import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -44,7 +40,7 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_IMPREST_NO
|
||||
public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAImprestService {
|
||||
|
||||
/**
|
||||
* OA 备用金对应的流程定义 KEY
|
||||
* OA 出差对应的流程定义 KEY
|
||||
*/
|
||||
public static final String PROCESS_KEY = "oa_imprest";
|
||||
|
||||
@ -53,23 +49,14 @@ public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAIm
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceApi processInstanceApi;
|
||||
|
||||
@Resource
|
||||
@Lazy // 解决循环依赖
|
||||
private BpmProcessInstanceService bpmProcessInstanceService;
|
||||
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private BankApi bankApi;
|
||||
|
||||
@Resource
|
||||
private BpmHistoryProcessInstanceService historyProcessInstanceService;
|
||||
|
||||
@ -108,7 +95,7 @@ public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAIm
|
||||
@Override
|
||||
public void updateImprestResult(String processInstanceId, Long id, Integer result) {
|
||||
|
||||
BpmOAImprestDO imprestDO = validateLeaveExists(id);
|
||||
validateLeaveExists(id);
|
||||
imprestMapper.updateById(new BpmOAImprestDO().setId(id).setResult(result));
|
||||
|
||||
//审核通过 (最后节点)
|
||||
@ -118,44 +105,31 @@ public class BpmOAImprestServiceImpl extends BpmOABaseService implements BpmOAIm
|
||||
|
||||
if (instance.isEnded()) {
|
||||
//判断是否有采购报销
|
||||
BpmOAImprestDO cash = getImprest(id);
|
||||
BpmProcessInstanceExtDO processInstance = bpmProcessInstanceService.getProcessInstanceDO(processInstanceId);
|
||||
CommonResult<AdminUserRespDTO> user = userApi.getUser(imprestDO.getUserId());
|
||||
|
||||
// 从缓存中部门所属公司信息
|
||||
DeptRespDTO deptRespDTO = deptApi.getDept(imprestDO.getCompanyId()).getCheckedData();
|
||||
|
||||
// 获取收款人信息
|
||||
BankRespDTO bankRespDTO = new BankRespDTO();
|
||||
if (imprestDO.getBankId() != null) {
|
||||
bankRespDTO = bankApi.getBank(imprestDO.getBankId()).getCheckedData();
|
||||
}
|
||||
|
||||
CommonResult<AdminUserRespDTO> user = userApi.getUser(cash.getUserId());
|
||||
// -- 插入到财务支付表中
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(imprestDO.getUserId())
|
||||
.setUserId(cash.getUserId())
|
||||
.setDeptId(user.getData() == null ? null : user.getData().getDeptId())
|
||||
.setProcessInstanceId(imprestDO.getProcessInstanceId())
|
||||
.setReason(imprestDO.getReason())
|
||||
.setProcessInstanceId(cash.getProcessInstanceId())
|
||||
.setReason(cash.getReason())
|
||||
.setObjectId(id)
|
||||
.setType(2)
|
||||
.setStatus(0)
|
||||
.setAmountPayable(imprestDO.getAmount())
|
||||
.setAmountPayable(cash.getAmount())
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bankRespDTO.getNickname())
|
||||
.setCompanyId(deptRespDTO != null ? deptRespDTO.getId() : null)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private BpmOAImprestDO validateLeaveExists(Long id) {
|
||||
BpmOAImprestDO imprestDO = imprestMapper.selectById(id);
|
||||
if (imprestDO == null) {
|
||||
private void validateLeaveExists(Long id) {
|
||||
if (imprestMapper.selectById(id) == null) {
|
||||
throw exception(OA_IMPREST_NOT_EXISTS);
|
||||
}
|
||||
return imprestDO;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,14 +1,9 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.loan.BpmOALoanSumDTO;
|
||||
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.BpmOAReturnVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOALoanDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -53,23 +48,9 @@ public interface BpmOALoanService {
|
||||
BpmOALoanDO getByProcessInstanceId(String processInstanceId);
|
||||
|
||||
/**
|
||||
* 获得指定用户的借支分页列表
|
||||
* @param pageReqVO 分页参数
|
||||
* 获得指定用户的借支列表
|
||||
* @param staffId 员工编号
|
||||
* @return 借支列表
|
||||
*/
|
||||
PageResult<BpmOALoanDO> getListByStaffId(BpmOALoanPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获取员工当月需抵扣的借支金额
|
||||
* @param staffId 员工编号集合
|
||||
* @return 借支金额统计
|
||||
*/
|
||||
List<BpmOALoanSumDTO> getListByStaffId(Collection<Long> staffId, String month);
|
||||
|
||||
/**
|
||||
* 获取员工还款分页列表
|
||||
* @param pageReqVO 分页信息
|
||||
* @return 还款分页列表
|
||||
*/
|
||||
PageResult<BpmOAReturnVO> getReturnList(BpmOALoanPageReqVO pageReqVO);
|
||||
List<BpmOALoanDO> getListByStaffId(Long staffId);
|
||||
}
|
||||
|
@ -2,16 +2,11 @@ package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
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.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
|
||||
import cn.iocoder.yudao.module.bpm.api.oa.vo.loan.BpmOALoanSumDTO;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
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.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.dal.dataobject.task.BpmProcessInstanceExtDO;
|
||||
@ -20,28 +15,19 @@ import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
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.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_LOAN_NOT_CREATE;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_LOAN_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
@ -73,48 +59,18 @@ public class BpmOALoanServiceImpl extends BpmOABaseService implements BpmOALoanS
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
|
||||
@Resource
|
||||
private StaffApi staffApi;
|
||||
|
||||
@Resource
|
||||
private BankApi bankApi;
|
||||
|
||||
@Resource
|
||||
private FactoryInfoApi factoryInfoApi;
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createLoan(Long userId, BpmOALoanCreateReqVO vo) {
|
||||
|
||||
// 提交是费用借支时
|
||||
if (vo.getLoanType() == 2) {
|
||||
|
||||
// 校验创建
|
||||
StaffDTO staffDTO = validateCreate(userId, vo);
|
||||
vo.setSfUserId(staffDTO.getId());
|
||||
vo.setFactoryId(staffDTO.getFactoryId());
|
||||
}
|
||||
|
||||
//插入OA 借支申请
|
||||
BpmOALoanDO loan = BeanUtils.toBean(vo, BpmOALoanDO.class)
|
||||
.setUserId(userId)
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
loanMapper.insert(loan);
|
||||
|
||||
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
// 提交是费用借支时
|
||||
if (vo.getLoanType() == 2) {
|
||||
|
||||
// 获取借支人所属厂区信息
|
||||
FactoryInfoDTO factoryInfoDTO = factoryInfoApi.getFactoryInfo(loan.getFactoryId()).getCheckedData();
|
||||
processInstanceVariables.put("factoryType", factoryInfoDTO.getType());
|
||||
}
|
||||
|
||||
processInstanceVariables.put("loanType", loan.getLoanType());
|
||||
String processInstanceId = processInstanceService.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(loan.getId())));
|
||||
@ -134,19 +90,9 @@ public class BpmOALoanServiceImpl extends BpmOABaseService implements BpmOALoanS
|
||||
return loan.getId();
|
||||
}
|
||||
|
||||
private StaffDTO validateCreate(Long userId, BpmOALoanCreateReqVO vo) {
|
||||
|
||||
StaffDTO staffDTO = staffApi.getStaffByUserId(userId).getCheckedData();
|
||||
if (staffDTO == null) {
|
||||
throw exception(OA_LOAN_NOT_CREATE);
|
||||
}
|
||||
|
||||
return staffDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLoanResult(String processInstanceId, Long id, Integer result) {
|
||||
BpmOALoanDO loanDO = validateLoanExists(id);
|
||||
BpmOALoanDO loanDO = validateLeaveExists(id);
|
||||
loanMapper.updateById(new BpmOALoanDO().setId(id).setResult(result));
|
||||
|
||||
//审核通过 (最后节点)
|
||||
@ -158,15 +104,11 @@ public class BpmOALoanServiceImpl extends BpmOABaseService implements BpmOALoanS
|
||||
BpmProcessInstanceExtDO processInstance = processInstanceService.getProcessInstanceDO(processInstanceId);
|
||||
// -- 插入到财务支付表中
|
||||
CommonResult<AdminUserRespDTO> user = userApi.getUser(loanDO.getUserId());
|
||||
|
||||
// 获取收款人信息
|
||||
BankRespDTO bankRespDTO = bankApi.getBank(loanDO.getBankId()).getCheckedData();
|
||||
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(loanDO.getUserId())
|
||||
.setDeptId(user.getData() == null ? null : user.getData().getDeptId())
|
||||
.setProcessInstanceId(loanDO.getProcessInstanceId())
|
||||
.setReason(loanDO.getReason())
|
||||
.setReason("")
|
||||
.setObjectId(id)
|
||||
.setType(7)
|
||||
.setStatus(0)
|
||||
@ -174,13 +116,12 @@ public class BpmOALoanServiceImpl extends BpmOABaseService implements BpmOALoanS
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bankRespDTO.getNickname())
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private BpmOALoanDO validateLoanExists(Long id) {
|
||||
private BpmOALoanDO validateLeaveExists(Long id) {
|
||||
BpmOALoanDO loanDO = loanMapper.selectById(id);
|
||||
if (loanDO == null) {
|
||||
throw exception(OA_LOAN_NOT_EXISTS);
|
||||
@ -205,26 +146,9 @@ public class BpmOALoanServiceImpl extends BpmOABaseService implements BpmOALoanS
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BpmOALoanDO> getListByStaffId(BpmOALoanPageReqVO pageReqVO) {
|
||||
return loanMapper.selectPage(pageReqVO, new LambdaQueryWrapperX<BpmOALoanDO>()
|
||||
.eq(BpmOALoanDO::getSfUserId, pageReqVO.getStaffId())
|
||||
.eq(BpmOALoanDO::getLoanType, pageReqVO.getLoanType())
|
||||
public List<BpmOALoanDO> getListByStaffId(Long staffId) {
|
||||
return loanMapper.selectList(new LambdaQueryWrapperX<BpmOALoanDO>()
|
||||
.eq(BpmOALoanDO::getSfUserId, staffId)
|
||||
.eq(BpmOALoanDO::getResult, BpmProcessInstanceResultEnum.APPROVE.getResult()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BpmOALoanSumDTO> getListByStaffId(Collection<Long> staffId, String month) {
|
||||
return loanMapper.selectSumByStaffId(staffId, month);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BpmOAReturnVO> getReturnList(BpmOALoanPageReqVO pageReqVO) {
|
||||
|
||||
// 过滤之前老数据
|
||||
if (pageReqVO.getLoanType() == null) {
|
||||
return PageResult.empty();
|
||||
}
|
||||
IPage<BpmOAReturnVO> page = loanMapper.selectReturnList(pageReqVO, MyBatisUtils.buildPage(pageReqVO));
|
||||
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||
}
|
||||
}
|
||||
|
@ -125,16 +125,6 @@ public class BpmOAPaymentServiceImpl extends BpmOABaseService implements BpmOAPa
|
||||
BpmProcessInstanceExtDO processInstance = processInstanceService.getProcessInstanceDO(processInstanceId);
|
||||
// -- 插入到财务支付表中
|
||||
CommonResult<AdminUserRespDTO> user = userApi.getUser(paymentDO.getUserId());
|
||||
|
||||
// 从缓存中部门所属公司信息
|
||||
DeptRespDTO deptRespDTO = deptApi.getDept(paymentDO.getPaymentCompany()).getCheckedData();
|
||||
|
||||
// 获取收款人信息
|
||||
BankRespDTO bankRespDTO = new BankRespDTO();
|
||||
if (paymentDO.getBankId() != null) {
|
||||
bankRespDTO = bankApi.getBank(paymentDO.getBankId()).getCheckedData();
|
||||
}
|
||||
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(paymentDO.getUserId())
|
||||
.setDeptId(user.getData() == null ? null : user.getData().getDeptId())
|
||||
@ -147,8 +137,6 @@ public class BpmOAPaymentServiceImpl extends BpmOABaseService implements BpmOAPa
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bankRespDTO.getNickname())
|
||||
.setCompanyId(deptRespDTO != null ? deptRespDTO.getId() : null)
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -276,9 +264,9 @@ public class BpmOAPaymentServiceImpl extends BpmOABaseService implements BpmOAPa
|
||||
// 获取银行卡信息
|
||||
BankRespDTO bankResp = bankApi.getBank(payment.getBankId()).getCheckedData();
|
||||
// 设置银行卡信息
|
||||
respVO.setBankName(bankResp != null ? bankResp.getBankName() : null);
|
||||
respVO.setBankNo(bankResp != null ? bankResp.getBankNo() : null);
|
||||
respVO.setNickname(bankResp != null ? bankResp.getNickname() : null);
|
||||
respVO.setBankName(bankResp.getBankName());
|
||||
respVO.setBankNo(bankResp.getBankNo());
|
||||
respVO.setNickname(bankResp.getNickname());
|
||||
}
|
||||
}
|
||||
return respVO;
|
||||
|
@ -100,7 +100,6 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createReimbursement(Long userId, BpmOAReimbursementCreateReqVO createReqVO) {
|
||||
BpmOAReimbursementDO reimbursement = BpmOAReimbursementConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
@ -120,8 +119,6 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
createDO.forEach(item -> item.setReimbursementId(reimbursement.getId()));
|
||||
reimbursementItemMapper.insertBatch(createDO);
|
||||
|
||||
// 同步更新
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||
@ -184,6 +181,12 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
|
||||
//判断是否有采购报销
|
||||
List<Long> procureIds = new ArrayList<>();
|
||||
// List<Reimbursement> reimbursements = bpmOAReimbursementDO.getReimbursements();
|
||||
//
|
||||
// //直接从数据库取出来的List<Reimbursement> 实际上是List<LinkedHashMap>类型 所以不能直接遍历
|
||||
// //将list再次转为json串,然后由json串再转为list
|
||||
// String json = JsonUtils.toJsonString(reimbursements);
|
||||
// reimbursements = JsonUtils.parseArray(json, Reimbursement.class);
|
||||
for (BpmOAReimbursementItemDO reimbursement : reimbursements) {
|
||||
//报销类别为 采购费时
|
||||
if ("4".equals(reimbursement.getType())) {
|
||||
@ -235,10 +238,6 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
BpmProcessInstanceExtDO processInstance = bpmProcessInstanceService.getProcessInstanceDO(processInstanceId);
|
||||
// -- 插入到财务支付表中
|
||||
CommonResult<AdminUserRespDTO> user = userApi.getUser(bpmOAReimbursementDO.getUserId());
|
||||
|
||||
// 从缓存中部门所属公司信息
|
||||
DeptRespDTO deptRespDTO = deptApi.getCompanyByDept(reimbursements.get(0).getDeptId()).getCheckedData();
|
||||
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(bpmOAReimbursementDO.getUserId())
|
||||
.setDeptId(user.getData() == null ? null : user.getData().getDeptId())
|
||||
@ -251,8 +250,6 @@ public class BpmOAReimbursementServiceImpl extends BpmOABaseService implements B
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setRecipientName(bpmOAReimbursementDO.getNickname())
|
||||
.setCompanyId(deptRespDTO != null ? deptRespDTO.getId() : null)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.smartfactory.api.staffSalary.StaffSalaryApi;
|
||||
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;
|
||||
@ -62,9 +61,6 @@ public class BpmOASalaryServiceImpl extends BpmOABaseService implements BpmOASal
|
||||
@Resource
|
||||
private FinancialPaymentService financialPaymentService;
|
||||
|
||||
@Resource
|
||||
private StaffSalaryApi staffSalaryApi;
|
||||
|
||||
@Override
|
||||
public Long createSalary(Long userId, BpmOASalaryCreateReqVO createReqVO) {
|
||||
|
||||
@ -73,14 +69,12 @@ public class BpmOASalaryServiceImpl extends BpmOABaseService implements BpmOASal
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
salaryMapper.insert(salary) ;
|
||||
|
||||
// 获取申请公司或工厂信息
|
||||
DeptRespDTO dto = deptApi.getDept(salary.getCompanyDeptId()).getCheckedData();
|
||||
|
||||
// 配置申请公司或工厂部门flag
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
if (createReqVO.getDeptType() == 1) {
|
||||
// 获取申请公司信息
|
||||
DeptRespDTO dto = deptApi.getDept(salary.getCompanyDeptId()).getCheckedData();
|
||||
processInstanceVariables.put("company_dept_flag", dto.getFlag());
|
||||
}
|
||||
processInstanceVariables.put("dept_type", createReqVO.getDeptType());
|
||||
// 发起 BPM 流程
|
||||
String processInstanceId = processInstanceService.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
@ -100,18 +94,12 @@ public class BpmOASalaryServiceImpl extends BpmOABaseService implements BpmOASal
|
||||
if (fileItems != null && !fileItems.isEmpty()) {
|
||||
uploadBpmFileProcessInstanceId(processInstanceId,fileItems) ;
|
||||
}
|
||||
|
||||
// 同步更新 员工薪资表已发放工资状态
|
||||
staffSalaryApi.updateIsGrant(salary.getStaffSalaryIds(), 1);
|
||||
|
||||
return salary.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSalaryResult(String processInstanceId, Long id, Integer result) {
|
||||
BpmOASalaryDO salaryDO = validateLeaveExists(id);
|
||||
salaryMapper.updateById(new BpmOASalaryDO().setId(id).setResult(result));
|
||||
|
||||
//审核通过 (最后节点)
|
||||
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
||||
|
||||
@ -122,7 +110,6 @@ public class BpmOASalaryServiceImpl extends BpmOABaseService implements BpmOASal
|
||||
BpmProcessInstanceExtDO processInstance = processInstanceService.getProcessInstanceDO(processInstanceId);
|
||||
// -- 插入到财务支付表中
|
||||
CommonResult<AdminUserRespDTO> user = userApi.getUser(salaryDO.getUserId());
|
||||
|
||||
financialPaymentService.save(new FinancialPaymentDO()
|
||||
.setUserId(salaryDO.getUserId())
|
||||
.setDeptId(user.getData() == null ? null : user.getData().getDeptId())
|
||||
@ -135,21 +122,10 @@ public class BpmOASalaryServiceImpl extends BpmOABaseService implements BpmOASal
|
||||
.setProcessInstanceName(processInstance.getName())
|
||||
.setBeginTime(processInstance.getCreateTime())
|
||||
.setEndTime(processInstance.getEndTime())
|
||||
.setCompanyId(salaryDO.getDeptType() == 1 ? salaryDO.getCompanyDeptId() : null)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// -- 自己取消
|
||||
// -- 审核拒绝
|
||||
//所有关联的采购申请改为 未支付状态
|
||||
if (BpmProcessInstanceResultEnum.REJECT.getResult().equals(result)
|
||||
|| BpmProcessInstanceResultEnum.CANCEL.getResult().equals(result)
|
||||
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
||||
|
||||
// 还原员工薪资表已发放工资状态
|
||||
staffSalaryApi.updateIsGrant(salaryDO.getStaffSalaryIds(), 0);
|
||||
}
|
||||
salaryMapper.updateById(new BpmOASalaryDO().setId(id).setResult(result));
|
||||
}
|
||||
|
||||
private BpmOASalaryDO validateLeaveExists(Long id) {
|
||||
|
@ -146,14 +146,6 @@ public interface BpmProcessInstanceService {
|
||||
*/
|
||||
void updateProcessInstanceExtReject(String id, String reason);
|
||||
|
||||
/**
|
||||
* 更新 ProcessInstance 拓展记录结果
|
||||
*
|
||||
* @param id 流程编号
|
||||
* @param result 结果
|
||||
*/
|
||||
void updateProcessInstanceResult(String id, Integer result);
|
||||
|
||||
/**
|
||||
* /**
|
||||
* 流程实例数量统计查询
|
||||
|
File diff suppressed because one or more lines are too long
@ -28,8 +28,6 @@ import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionServic
|
||||
import cn.iocoder.yudao.module.bpm.service.message.BpmMessageService;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASalaryService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.dto.ProcessInstanceVariablesDTO;
|
||||
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 cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
@ -101,9 +99,6 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
@Resource
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private FactoryInfoApi factoryInfoApi;
|
||||
|
||||
@Resource
|
||||
private BpmTaskExtMapper taskExtMapper;
|
||||
|
||||
@ -217,45 +212,16 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
|
||||
// 获取薪资付款列表
|
||||
List<BpmOASalaryDO> salaryDOS = salaryService.getListByProcessInstanceIds(processInstanceIds);
|
||||
// 获取公司编号map
|
||||
Map<String, Long> salaryDeptMap = salaryDOS.stream()
|
||||
.filter(item -> item.getCompanyDeptId() != null)
|
||||
.collect(Collectors.toMap(BpmOASalaryDO::getProcessInstanceId, BpmOASalaryDO::getCompanyDeptId));
|
||||
// 获取工厂编号Map
|
||||
Map<String, Set<Long>> factoryDeptMap = salaryDOS.stream()
|
||||
.filter(item -> CollUtil.isNotEmpty(item.getFactoryDeptId()))
|
||||
.collect(Collectors.toMap(BpmOASalaryDO::getProcessInstanceId, BpmOASalaryDO::getFactoryDeptId));
|
||||
// 获取付款部门信息
|
||||
Map<Long, DeptRespDTO> dtoMap = deptApi.getDeptMap(convertSet(salaryDOS, BpmOASalaryDO::getCompanyDeptId));
|
||||
// 获取付款工厂信息
|
||||
Map<Long, FactoryInfoDTO> factoryInfoDTOMap = factoryInfoApi.getFactoryMap(factoryDeptMap.values()
|
||||
.stream()
|
||||
.flatMap(Set::stream)
|
||||
.collect(Collectors.toSet()));
|
||||
// 组合数据
|
||||
Map<String, List<FactoryInfoDTO>> groupedMap = factoryDeptMap.entrySet()
|
||||
.stream()
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
entry -> entry.getValue().stream()
|
||||
.map(factoryInfoDTOMap::get)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList())
|
||||
));
|
||||
|
||||
pageResp.getRecords().forEach(item -> {
|
||||
if (salaryDeptMap.containsKey(item.getProcessInstanceId())) {
|
||||
item.setStartUserNickname(item.getStartUserNickname() +
|
||||
"(" +
|
||||
dtoMap.get(salaryDeptMap.get(item.getProcessInstanceId())).getName() +
|
||||
")");
|
||||
}else if (factoryDeptMap.containsKey(item.getProcessInstanceId())) {
|
||||
item.setStartUserNickname(item.getStartUserNickname() +
|
||||
"(" +
|
||||
groupedMap.get(item.getProcessInstanceId()).stream()
|
||||
.map(FactoryInfoDTO::getShortName)
|
||||
.collect(Collectors.joining(",")) +
|
||||
")");
|
||||
}
|
||||
});
|
||||
|
||||
@ -297,31 +263,10 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
// 获取薪资付款列表
|
||||
List<BpmOASalaryDO> salaryDOS = salaryService.getListByProcessInstanceIds(processInstanceIds);
|
||||
Map<String, Long> salaryDeptMap = salaryDOS.stream()
|
||||
.filter(item -> item.getCompanyDeptId() != null)
|
||||
.collect(Collectors.toMap(BpmOASalaryDO::getProcessInstanceId, BpmOASalaryDO::getCompanyDeptId));
|
||||
// 获取付款部门信息
|
||||
Map<Long, DeptRespDTO> dtoMap = deptApi.getDeptMap(convertSet(salaryDOS, BpmOASalaryDO::getCompanyDeptId));
|
||||
|
||||
// 获取工厂编号Map
|
||||
Map<String, Set<Long>> factoryDeptMap = salaryDOS.stream()
|
||||
.filter(item -> CollUtil.isNotEmpty(item.getFactoryDeptId()))
|
||||
.collect(Collectors.toMap(BpmOASalaryDO::getProcessInstanceId, BpmOASalaryDO::getFactoryDeptId));
|
||||
// 获取付款工厂信息
|
||||
Map<Long, FactoryInfoDTO> factoryInfoDTOMap = factoryInfoApi.getFactoryMap(factoryDeptMap.values()
|
||||
.stream()
|
||||
.flatMap(Set::stream)
|
||||
.collect(Collectors.toSet()));
|
||||
// 组合数据
|
||||
Map<String, List<FactoryInfoDTO>> groupedMap = factoryDeptMap.entrySet()
|
||||
.stream()
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
entry -> entry.getValue().stream()
|
||||
.map(factoryInfoDTOMap::get)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList())
|
||||
));
|
||||
|
||||
pageResult.getList().forEach(item -> {
|
||||
item.setStartUserNickname(userMap.get(item.getStartUserId()).getNickname());
|
||||
if (salaryDeptMap.containsKey(item.getProcessInstanceId())) {
|
||||
@ -329,13 +274,6 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
"(" +
|
||||
dtoMap.get(salaryDeptMap.get(item.getProcessInstanceId())).getName() +
|
||||
")");
|
||||
}else if (factoryDeptMap.containsKey(item.getProcessInstanceId())) {
|
||||
item.setStartUserNickname(item.getStartUserNickname() +
|
||||
"(" +
|
||||
groupedMap.get(item.getProcessInstanceId()).stream()
|
||||
.map(FactoryInfoDTO::getShortName)
|
||||
.collect(Collectors.joining(",")) +
|
||||
")");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -15,14 +15,11 @@
|
||||
a.*,
|
||||
b.nickname as nickname,
|
||||
c.name as deptName,
|
||||
d.nickname as receiveUserNickName,
|
||||
case when ISNULL(a.company_id) THEN sf.short_name ELSE company.short_name END as companyName
|
||||
d.nickname as receiveUserNickName
|
||||
from bpm_financial_payment as a
|
||||
left join system_users as b on a.user_id = b.id
|
||||
left join system_dept as c on b.dept_id = c.id
|
||||
left join system_users as d on a.receive_user_id = d.id
|
||||
left join system_dept as company on company.id = a.company_id
|
||||
left join sf_factory_info as sf on sf.id = a.company_factory_id
|
||||
<where>
|
||||
a.deleted = 0
|
||||
<if test="vo.deptIds != null and vo.deptIds.size() > 0">
|
||||
|
@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAEvectionMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="selectEvectionList" resultType="cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAEvectionDO">
|
||||
SELECT
|
||||
a.*
|
||||
FROM
|
||||
bpm_oa_evection a
|
||||
WHERE
|
||||
a.id NOT IN (
|
||||
SELECT
|
||||
c.object_id
|
||||
FROM
|
||||
bpm_oa_reimbursement b,
|
||||
bpm_oa_reimbursement_item c
|
||||
WHERE
|
||||
b.user_id = #{userId}
|
||||
AND b.deleted = 0
|
||||
AND b.id = c.reimbursement_id
|
||||
AND b.result IN ( 1, 2 )
|
||||
AND c.type = 1
|
||||
AND c.object_id IS NOT NULL
|
||||
)
|
||||
AND a.user_id = #{userId}
|
||||
AND a.deleted = 0
|
||||
ORDER BY
|
||||
a.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAExpensesMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
@ -24,9 +25,7 @@
|
||||
ub.bank_no AS bankNo,
|
||||
ub.bank_name AS bankName,
|
||||
b.total_money AS totalMoney,
|
||||
b.process_instance_id AS processInstanceId,
|
||||
c.end_time AS endTime,
|
||||
b.status AS status
|
||||
b.process_instance_id AS processInstanceId
|
||||
FROM bpm_oa_expenses b
|
||||
JOIN bpm_oa_expenses_item a ON a.expenses_id = b.id
|
||||
JOIN bpm_process_instance_ext c ON c.process_instance_id = b.process_instance_id
|
||||
@ -49,72 +48,14 @@
|
||||
<if test="pageReqVO.costSection != null">
|
||||
AND a.cost_section = #{pageReqVO.costSection}
|
||||
</if>
|
||||
<if test="pageReqVO.payeeName != null">
|
||||
AND ub.nickname LIKE CONCAT('%', #{pageReqVO.payeeName}, '%')
|
||||
</if>
|
||||
<if test="pageReqVO.endTime != null and pageReqVO.endTime.length > 0">
|
||||
<if test="pageReqVO.endTime[0] != null">
|
||||
and DATE_FORMAT(c.end_time, '%Y-%m-%d') >= #{pageReqVO.endTime[0]}
|
||||
and c.end_time >= #{pageReqVO.endTime[0]}
|
||||
</if>
|
||||
<if test="pageReqVO.endTime[1] != null">
|
||||
and DATE_FORMAT(c.end_time, '%Y-%m-%d') <= #{pageReqVO.endTime[1]}
|
||||
and c.end_time <= #{pageReqVO.endTime[1]}
|
||||
</if>
|
||||
</if>
|
||||
ORDER BY c.end_time DESC, a.expenses_id
|
||||
</select>
|
||||
|
||||
<select id="selectTotal" resultType="cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.expenses.BpmOAExpensesTotal">
|
||||
SELECT
|
||||
SUM(a.total_money) AS payableAmount,
|
||||
SUM(a.amount_paid) AS amountPaid,
|
||||
SUM(a.total_money) - SUM(a.amount_paid) AS remainingPayable
|
||||
FROM
|
||||
bpm_oa_expenses a
|
||||
LEFT JOIN bpm_process_instance_ext c ON c.process_instance_id = a.process_instance_id
|
||||
LEFT JOIN system_bank ub ON ub.id = a.bank_id
|
||||
WHERE
|
||||
a.deleted = 0
|
||||
AND a.result = 2
|
||||
<if test="pageReqVO.userId != null">
|
||||
AND a.user_id = #{pageReqVO.userId}
|
||||
</if>
|
||||
AND EXISTS (
|
||||
SELECT
|
||||
1
|
||||
FROM
|
||||
bpm_oa_expenses_item b
|
||||
WHERE
|
||||
b.expenses_id = a.id
|
||||
<if test="pageReqVO.factoryId != null">
|
||||
AND b.dept_id = #{pageReqVO.factoryId}
|
||||
</if>
|
||||
<if test="pageReqVO.type != null">
|
||||
AND b.type = #{pageReqVO.type}
|
||||
</if>
|
||||
<if test="pageReqVO.costSection != null">
|
||||
AND b.cost_section = #{pageReqVO.costSection}
|
||||
</if>
|
||||
)
|
||||
<if test="pageReqVO.payeeName != null">
|
||||
AND ub.nickname LIKE CONCAT('%', #{pageReqVO.payeeName}, '%')
|
||||
</if>
|
||||
<if test="pageReqVO.endTime != null and pageReqVO.endTime.length > 0">
|
||||
<if test="pageReqVO.endTime[0] != null">
|
||||
and DATE_FORMAT(c.end_time, '%Y-%m-%d') >= #{pageReqVO.endTime[0]}
|
||||
</if>
|
||||
<if test="pageReqVO.endTime[1] != null">
|
||||
and DATE_FORMAT(c.end_time, '%Y-%m-%d') <= #{pageReqVO.endTime[1]}
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<update id="oneClickPayment">
|
||||
UPDATE bpm_oa_expenses e
|
||||
JOIN bpm_process_instance_ext b ON e.process_instance_id = b.process_instance_id
|
||||
SET e.STATUS = 1, e.amount_paid = e.total_money
|
||||
WHERE
|
||||
e.result = 2
|
||||
AND e.STATUS != 2
|
||||
AND DATE_FORMAT( b.end_time, '%Y-%m' ) = #{month}
|
||||
</update>
|
||||
</mapper>
|
||||
|
@ -1,74 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOALoanMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<select id="selectSumByStaffId" resultType="cn.iocoder.yudao.module.bpm.api.oa.vo.loan.BpmOALoanSumDTO">
|
||||
SELECT
|
||||
sf_user_id AS sfUserId,
|
||||
SUM(total_money) AS totalAmount
|
||||
FROM
|
||||
bpm_oa_loan
|
||||
WHERE
|
||||
deleted = 0
|
||||
AND result = 2
|
||||
AND return_date = #{month}
|
||||
AND sf_user_id IN
|
||||
<foreach item="item" index="index" collection="staffId" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
GROUP BY
|
||||
sf_user_id
|
||||
</select>
|
||||
|
||||
<select id="selectReturnList" resultType="cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.loan.BpmOAReturnVO">
|
||||
<if test="pageReqVO.loanType == 1">
|
||||
SELECT
|
||||
s.staff_id AS staffId,
|
||||
st.nick_name AS staffName,
|
||||
s.factory_id AS factoryId,
|
||||
sf.short_name AS factoryName,
|
||||
s.month AS month,
|
||||
s.return_amount AS repaymentAmount,
|
||||
2 AS type
|
||||
FROM
|
||||
sf_staff_salary s
|
||||
LEFT JOIN sf_staff st ON s.staff_id = st.id
|
||||
LEFT JOIN sf_factory_info sf ON s.factory_id = sf.id
|
||||
WHERE
|
||||
s.staff_id = #{pageReqVO.staffId}
|
||||
AND s.return_amount > 0
|
||||
AND s.deleted = 0
|
||||
AND st.deleted = 0
|
||||
AND sf.deleted = 0
|
||||
</if>
|
||||
<if test="pageReqVO.loanType == 2">
|
||||
SELECT
|
||||
e.user_id AS staffId,
|
||||
u.nickname AS staffName,
|
||||
d.factory_id AS factoryId,
|
||||
d.name AS factoryName,
|
||||
DATE_FORMAT( p.end_time, '%Y-%m' ) AS month,
|
||||
e.amount_paid AS repaymentAmount,
|
||||
1 AS type
|
||||
FROM
|
||||
bpm_oa_expenses e
|
||||
LEFT JOIN system_users u ON e.user_id = u.id
|
||||
LEFT JOIN system_dept d ON u.dept_id = d.id
|
||||
LEFT JOIN bpm_process_instance_ext p ON e.process_instance_id = p.process_instance_id
|
||||
WHERE
|
||||
e.deleted = 0
|
||||
AND e.result = 2
|
||||
AND e.status = 2
|
||||
AND u.deleted = 0
|
||||
AND d.deleted = 0
|
||||
AND p.deleted = 0
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
@ -17,8 +17,7 @@
|
||||
bank.nickname as nickname,
|
||||
bank.bank_no as bankNo,
|
||||
bank.bank_name as bankName,
|
||||
COALESCE(SUM( b.payment_ratio ), 0) + COALESCE(a.payment_ratio,0) AS ratio,
|
||||
COALESCE(SUM( b.amount ), 0) + COALESCE(a.amount, 0) AS paymentAmount
|
||||
COALESCE(SUM( b.payment_ratio ), 0) + COALESCE(a.payment_ratio,0) AS ratio
|
||||
FROM
|
||||
bpm_oa_payment a
|
||||
<if test="method != 1">
|
||||
@ -36,6 +35,6 @@
|
||||
GROUP BY
|
||||
a.id
|
||||
HAVING
|
||||
amount < total_amount
|
||||
ratio < 100
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -62,13 +62,10 @@
|
||||
<select id="getReceiptSettlement"
|
||||
resultType="cn.iocoder.yudao.module.bpm.api.oa.vo.receipt.ReceiptSettlementDTO">
|
||||
SELECT
|
||||
a.user_id AS userId,
|
||||
SUM( a.money ) AS money,
|
||||
SUM( CASE WHEN b.is_channel = 1 THEN a.money ELSE 0 END ) AS channelAmount
|
||||
user_id AS userId,
|
||||
SUM(money) AS money
|
||||
FROM
|
||||
bpm_oa_receipt a
|
||||
INNER JOIN bpm_oa_contract c on a.contract_id = c.id
|
||||
INNER JOIN crm_business b on b.id = c.business_id
|
||||
bpm_oa_receipt
|
||||
WHERE
|
||||
deleted = 0
|
||||
AND result = 2
|
||||
|
22
yudao-module-crm/.flattened-pom.xml
Normal file
22
yudao-module-crm/.flattened-pom.xml
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
</parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-crm</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>infra 模块,主要提供两块能力:
|
||||
1. 我们放基础设施的运维与管理,支撑上层的通用与核心业务。 例如说:定时任务的管理、服务器的信息等等
|
||||
2. 研发工具,提升研发效率与质量。 例如说:代码生成器、接口文档等等</description>
|
||||
<modules>
|
||||
<module>yudao-module-crm-api</module>
|
||||
<module>yudao-module-crm-biz</module>
|
||||
</modules>
|
||||
</project>
|
36
yudao-module-crm/yudao-module-crm-api/.flattened-pom.xml
Normal file
36
yudao-module-crm/yudao-module-crm-api/.flattened-pom.xml
Normal file
@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-crm</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
</parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-crm-api</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>infra 模块 API,暴露给其它模块调用</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -22,9 +22,6 @@ public class CrmContractProductSettlementDTO {
|
||||
@Schema(description = "数量")
|
||||
private Integer nums;
|
||||
|
||||
@Schema(description = "渠道商转介数量")
|
||||
private Integer channelNums;
|
||||
|
||||
@Schema(description = "折扣")
|
||||
private BigDecimal discount;
|
||||
|
||||
|
153
yudao-module-crm/yudao-module-crm-biz/.flattened-pom.xml
Normal file
153
yudao-module-crm/yudao-module-crm-biz/.flattened-pom.xml
Normal file
@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-crm</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
</parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-crm-biz</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>infra 模块,主要提供两块能力:
|
||||
1. 我们放基础设施的运维与管理,支撑上层的通用与核心业务。 例如说:定时任务的管理、服务器的信息等等
|
||||
2. 研发工具,提升研发效率与质量。 例如说:代码生成器、接口文档等等</description>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-crm-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-product-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-system-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-banner</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-error-code</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-rpc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-job</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.smallbun.screw</groupId>
|
||||
<artifactId>screw-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-monitor</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.codecentric</groupId>
|
||||
<artifactId>spring-boot-admin-starter-server</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-file</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-bpm-api</artifactId>
|
||||
<version>2.0.0-jdk8-snapshot</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.crm.controller.admin.crmanalysis;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.crmanalysis.vo.ContractVO;
|
||||
import cn.iocoder.yudao.module.crm.controller.admin.crmanalysis.vo.TimeQueryVO;
|
||||
import cn.iocoder.yudao.module.crm.service.crmanalysis.RankService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -29,14 +28,14 @@ public class RankController {
|
||||
|
||||
@GetMapping("/contract")
|
||||
@Operation(summary = "获得合同排名")
|
||||
public CommonResult<List<ContractVO>> getContractRank(TimeQueryVO vo) {
|
||||
return success(rankService.getContractRank(vo));
|
||||
public CommonResult<List<ContractVO>> getContractRank() {
|
||||
return success(rankService.getContractRank());
|
||||
}
|
||||
|
||||
@GetMapping("/receivables")
|
||||
@Operation(summary = "获得回款排名")
|
||||
public CommonResult<List<ContractVO>> getRecevablesRank(TimeQueryVO vo) {
|
||||
return success(rankService.getReceivablesRank(vo));
|
||||
public CommonResult<List<ContractVO>> getRecevablesRank() {
|
||||
return success(rankService.getReceivablesRank());
|
||||
}
|
||||
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user