Merge #136 into master from cc_20260508_adjustment
feat:费用单费用调整单合并
* cc_20260508_adjustment: (20 commits squashed)
- feat:费用单调整
- feat:费用调整
- feat:新增审批
- feat:费用调整单
- feat:调整单
- feat:自动分账
- feat:填写添加门店
- feat:流水查询条件
- Merge branch 'master' into cc_20260508_adjustment
- feat:费用流水筛选条件
- feat:getAdjustAmount
- feat:提现申请单导出
- feat:提现申请单导出 状态
- feat:提现申请单导出 状态
- Merge branch 'cc_20260513_withdrawApplication_export' into cc_20260508_adjustment
# Conflicts:
#	coolstore-partner-model/src/main/java/com/cool/store/dto/wallet/WithdrawApplicationDTO.java
- feat:提现申请单导出 状态
- feat:导出
- feat:认款完成状态的费用单和调整单,若存在关联的费用分账单,不允许删除,未关联分账单的可以删除
- feat:费用单费用调整单合并
- feat:费用单费用调整单合并
Signed-off-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>
Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>
CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/136
This commit is contained in:
@@ -395,6 +395,11 @@ public class RedisConstant {
|
||||
*/
|
||||
public static final String SPLIT_ORDER_EXPORT_LOCK = "split_order_export_lock";
|
||||
|
||||
/**
|
||||
* 提现申请导出锁
|
||||
*/
|
||||
public static final String WITHDRAW_APPLICATION_EXPORT_LOCK = "withdraw_application_export_lock";
|
||||
|
||||
/**
|
||||
* 钱包分账公司配置-招商分部
|
||||
*/
|
||||
|
||||
@@ -399,6 +399,7 @@ public enum ErrorCodeEnum {
|
||||
WITHDRAW_APPLY_NOT_EXIST(1621011, "提现申请单不存在!", null),
|
||||
WITHDRAW_ING(1621012, "提现中,请勿重复分账!", null),
|
||||
WALLET_BALANCE_INSUFFICIENT(1621013, "钱包余额不足!", null),
|
||||
WALLET_OPEN_ACCOUNT_NO_BALANCE(1621014,"认款失败,该门店钱包余额不足!",null),
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -35,9 +35,10 @@ public enum FileTypeEnum {
|
||||
MY_POINT_EXPORT("myPointExport", "我的铺位管理列表"),
|
||||
ORDER_DEVICE_DETAIL_EXPORT("orderDeviceDetailExport", "订单设备明细导出"),
|
||||
TP_SCORE_JOURNAL_EXPORT("tpScoreJournalExport", "十二分制积分流水导出"),
|
||||
ADJUSTMENT_ORDER_EXPORT("adjustmentOrderExport", "费用调整单导出"),
|
||||
ADJUSTMENT_ORDER_EXPORT("adjustmentOrderExport", "费用单据导出"),
|
||||
EXPENSE_ORDER_EXPORT("expenseOrderExport", "费用单导出"),
|
||||
SPLIT_ORDER_EXPORT("splitOrderExport", "分账单导出"),
|
||||
WITHDRAW_APPLICATION_EXPORT("withdrawApplicationExport", "提现申请导出"),
|
||||
;
|
||||
private String fileType;
|
||||
private String desc;
|
||||
|
||||
@@ -3,6 +3,10 @@ package com.cool.store.enums.fees;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 平安钱包缴费转账状态枚举类
|
||||
@@ -15,17 +19,23 @@ import lombok.Getter;
|
||||
@AllArgsConstructor
|
||||
public enum AllocationPayStatusEnum {
|
||||
|
||||
PAID(1, "已支付"),
|
||||
FAIL(2, "支付失败"),
|
||||
PAYING(3, "支付中"),
|
||||
CANCEL(4, "已取消"),
|
||||
UNPAID(5, "未支付"),
|
||||
PAID(1, "已支付","提现成功"),
|
||||
FAIL(2, "支付失败","提现失败"),
|
||||
PAYING(3, "支付中","提现中"),
|
||||
CANCEL(4, "已取消","已取消"),
|
||||
UNPAID(5, "未支付","未提现"),
|
||||
;
|
||||
|
||||
private final Integer status;
|
||||
|
||||
private final String desc;
|
||||
|
||||
private final String otherDesc;
|
||||
|
||||
public static List<Integer> getAllStatus(){
|
||||
return Arrays.stream(AllocationPayStatusEnum.values()).map(AllocationPayStatusEnum::getStatus).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static String getDescByStatus(Integer status) {
|
||||
for (AllocationPayStatusEnum value : values()) {
|
||||
if (value.status.equals(status)) {
|
||||
@@ -34,4 +44,13 @@ public enum AllocationPayStatusEnum {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public static String getOtherDescByStatus(Integer status) {
|
||||
for (AllocationPayStatusEnum value : values()) {
|
||||
if (value.status.equals(status)) {
|
||||
return value.otherDesc;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.cool.store.enums.wallet;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Auther zx_szh
|
||||
* @Date 2026/4/9 09:35
|
||||
@@ -8,7 +11,9 @@ package com.cool.store.enums.wallet;
|
||||
public enum DocStatusEnum {
|
||||
|
||||
//10-待充值/20-已充值待认款/30-认款完成/40-分部分账/50-分账完成
|
||||
DOC_STATUS_05(5,"待审批"),
|
||||
DOC_STATUS_1(10,"待充值"),
|
||||
DOC_STATUS_15(15,"审批未通过"),
|
||||
DOC_STATUS_2(20,"已充值待认款"),
|
||||
DOC_STATUS_3(30,"认款完成"),
|
||||
DOC_STATUS_4(40,"部分分账"),
|
||||
@@ -32,6 +37,9 @@ public enum DocStatusEnum {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static List<Integer> getCanDeleteStatus(){
|
||||
return Arrays.asList(DOC_STATUS_05.getStatus(),DOC_STATUS_1.getStatus(),DOC_STATUS_2.getStatus());
|
||||
}
|
||||
|
||||
public static DocStatusEnum fromStatus(Integer status) {
|
||||
for (DocStatusEnum item : values()) {
|
||||
|
||||
@@ -58,6 +58,13 @@ public class WithdrawApplicationDAO {
|
||||
return withdrawApplicationMapper.pageQuery(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询总数
|
||||
*/
|
||||
public Long count(WithdrawApplicationPageRequest request) {
|
||||
return withdrawApplicationMapper.count(request);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据提现单号查询
|
||||
*/
|
||||
|
||||
@@ -17,4 +17,9 @@ public interface WithdrawApplicationMapper extends Mapper<WithdrawApplicationDO>
|
||||
* 分页查询
|
||||
*/
|
||||
List<WithdrawApplicationDTO> pageQuery(@Param("request") WithdrawApplicationPageRequest request);
|
||||
|
||||
/**
|
||||
* 查询总数
|
||||
*/
|
||||
Long count(@Param("request") WithdrawApplicationPageRequest request);
|
||||
}
|
||||
|
||||
@@ -97,6 +97,9 @@
|
||||
<if test="request.expenseSheetType != null and request.expenseSheetType != ''">
|
||||
and a.expense_sheet_type = #{request.expenseSheetType}
|
||||
</if>
|
||||
<if test="request.createUserId != null and request.createUserId != ''">
|
||||
and a.create_user_id = #{request.createUserId}
|
||||
</if>
|
||||
<if test="request.regionIds != null and !request.regionIds.isEmpty()">
|
||||
AND <foreach collection="request.regionIds" item="regionId" separator=" OR " open="(" close=")">
|
||||
b.region_path LIKE CONCAT('%/', #{regionId}, '/%')
|
||||
@@ -149,6 +152,9 @@
|
||||
<if test="request.expenseSheetType != null and request.expenseSheetType != ''">
|
||||
and a.expense_sheet_type = #{request.expenseSheetType}
|
||||
</if>
|
||||
<if test="request.createUserId != null and request.createUserId != ''">
|
||||
and a.create_user_id = #{request.createUserId}
|
||||
</if>
|
||||
<if test="request.regionIds != null and !request.regionIds.isEmpty()">
|
||||
AND <foreach collection="request.regionIds" item="regionId" separator=" OR " open="(" close=")">
|
||||
b.region_path LIKE CONCAT('%/', #{regionId}, '/%')
|
||||
|
||||
@@ -15,7 +15,9 @@
|
||||
fail_reason AS failReason,
|
||||
create_user_id AS createUserId,
|
||||
create_time AS createTime,
|
||||
update_time AS updateTime
|
||||
update_time AS updateTime,
|
||||
relate_store_id AS relateStoreId,
|
||||
remark
|
||||
FROM zxjp_withdraw_application
|
||||
WHERE 1=1
|
||||
<if test="request.withdrawNo != null and request.withdrawNo != ''">
|
||||
@@ -36,4 +38,26 @@
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询总数 -->
|
||||
<select id="count" resultType="java.lang.Long">
|
||||
SELECT COUNT(1)
|
||||
FROM zxjp_withdraw_application
|
||||
WHERE 1=1
|
||||
<if test="request.withdrawNo != null and request.withdrawNo != ''">
|
||||
AND withdraw_no LIKE CONCAT('%', #{request.withdrawNo}, '%')
|
||||
</if>
|
||||
<if test="request.accountName != null and request.accountName != ''">
|
||||
AND account_name LIKE CONCAT('%', #{request.accountName}, '%')
|
||||
</if>
|
||||
<if test="request.startTime != null">
|
||||
AND create_time >= #{request.startTime}
|
||||
</if>
|
||||
<if test="request.endTime != null">
|
||||
AND create_time <= #{request.endTime}
|
||||
</if>
|
||||
<if test="request.status != null">
|
||||
AND status = #{request.status}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package com.cool.store.dto.wallet;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.cool.store.enums.fees.AllocationPayStatusEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -17,39 +21,83 @@ public class WithdrawApplicationDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("主键ID")
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("提现申请单号")
|
||||
@ExcelProperty(value = "提现申请单号", order = 1)
|
||||
@ColumnWidth(30)
|
||||
private String withdrawNo;
|
||||
|
||||
@ApiModelProperty("提现账户名称")
|
||||
@ExcelProperty(value = "提现账户名称", order = 2)
|
||||
@ColumnWidth(30)
|
||||
private String accountName;
|
||||
|
||||
@ApiModelProperty("提现金额")
|
||||
@ExcelProperty(value = "提现金额", order = 3)
|
||||
@ColumnWidth(30)
|
||||
private BigDecimal amount;
|
||||
|
||||
@ApiModelProperty("到账银行卡号")
|
||||
@ExcelProperty(value = "到账银行卡号", order = 4)
|
||||
@ColumnWidth(30)
|
||||
private String bankCardNo;
|
||||
|
||||
@ApiModelProperty("银行所属银行")
|
||||
@ExcelProperty(value = "银行所属银行", order = 5)
|
||||
@ColumnWidth(30)
|
||||
private String bankName;
|
||||
|
||||
@ApiModelProperty("状态(1-已分账 2-分账失败 3-分账中 5-待分账)")
|
||||
@ExcelIgnore
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty("状态名称")
|
||||
@ExcelProperty(value = "状态", order = 6)
|
||||
@ColumnWidth(30)
|
||||
private String statusName;
|
||||
|
||||
@ApiModelProperty("失败原因")
|
||||
@ExcelProperty(value = "失败原因", order = 7)
|
||||
@ColumnWidth(30)
|
||||
private String failReason;
|
||||
|
||||
@ApiModelProperty("门店ID")
|
||||
@ExcelIgnore
|
||||
private String relateStoreId;
|
||||
|
||||
@ApiModelProperty("门店名称")
|
||||
@ExcelProperty(value = "门店名称", order = 8)
|
||||
@ColumnWidth(30)
|
||||
private String relateStoreName;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@ExcelProperty(value = "备注", order = 9)
|
||||
@ColumnWidth(30)
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("创建人")
|
||||
@ExcelIgnore
|
||||
private String createUserId;
|
||||
|
||||
@ApiModelProperty("创建人姓名")
|
||||
@ExcelProperty(value = "创建人姓名", order = 10)
|
||||
@ColumnWidth(30)
|
||||
private String createUserName;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@ExcelProperty(value = "创建时间", order = 11)
|
||||
@ColumnWidth(30)
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
@ExcelIgnore
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
|
||||
public String getStatusName() {
|
||||
return AllocationPayStatusEnum.getOtherDescByStatus(status);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,4 +104,8 @@ public class AdjustmentOrderDO {
|
||||
@ApiModelProperty("支付时间")
|
||||
@Column(name = "pay_time")
|
||||
private Date payTime;
|
||||
|
||||
@ApiModelProperty("拒绝原因")
|
||||
@Column(name = "reject_reason")
|
||||
private String rejectReason;
|
||||
}
|
||||
|
||||
@@ -88,4 +88,16 @@ public class WithdrawApplicationDO implements Serializable {
|
||||
*/
|
||||
@Column(name = "update_time")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 门店ID
|
||||
*/
|
||||
@Column(name = "relate_store_id")
|
||||
private String relateStoreId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Column(name = "remark")
|
||||
private String remark;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 调整单审批请求
|
||||
*/
|
||||
@Data
|
||||
public class AdjustmentApprovalRequest implements Serializable {
|
||||
|
||||
@ApiModelProperty("调整单ID")
|
||||
@NotNull(message = "调整单ID不能为空")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("审批结果 1-通过 2-拒绝")
|
||||
@NotNull(message = "审批结果不能为空")
|
||||
private Integer approvalResult;
|
||||
|
||||
@ApiModelProperty("拒绝原因(拒绝时必填)")
|
||||
private String rejectReason;
|
||||
}
|
||||
@@ -43,6 +43,9 @@ public class AdjustmentOrderPageRequest extends PageBasicInfo implements Seriali
|
||||
@ApiModelProperty("认领结束时间")
|
||||
private Date claimEndTime;
|
||||
|
||||
@ApiModelProperty("创建人ID")
|
||||
private String createUserId;
|
||||
|
||||
private String storeId;
|
||||
|
||||
private List<String> regionIds;
|
||||
|
||||
@@ -35,4 +35,10 @@ public class WithdrawApplicationRequest implements Serializable {
|
||||
@ApiModelProperty(value = "提现账户", required = true)
|
||||
@NotBlank(message = "提现账户不能为空")
|
||||
private String accountNo;
|
||||
|
||||
@ApiModelProperty(value = "门店ID")
|
||||
private String relateStoreId;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
}
|
||||
|
||||
@@ -20,10 +20,14 @@ public class CoolTradeRecodePageRequest extends PageBasicInfo {
|
||||
private Integer walletType;
|
||||
@ApiModelProperty(value = "关键字(账户名称,账户编号,业务系统付款单号,提现银行卡号)",required = true)
|
||||
private String keyword;
|
||||
@ApiModelProperty(value = "1.转账 2.提现 3.充值",required = false)
|
||||
private Integer tradeType;
|
||||
@ApiModelProperty(value = "关键字(门店编号,门店名称)",required = true)
|
||||
private String storeKeyword;
|
||||
@ApiModelProperty(value = "费用科目",required = true)
|
||||
private Integer feeItemId;
|
||||
@ApiModelProperty(value = "费用科目Code",required = false)
|
||||
private String expenseTypeCode;
|
||||
@ApiModelProperty(value = "组织ID",required = false,hidden = true)
|
||||
private Long orgId;
|
||||
|
||||
@@ -37,6 +41,7 @@ public class CoolTradeRecodePageRequest extends PageBasicInfo {
|
||||
target.setFeeItemId(this.getFeeItemId());
|
||||
target.setCurrentPage(this.getPageNum());
|
||||
target.setPageSize(this.getPageSize());
|
||||
target.setTradeType(this.getTradeType());
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ public class TradeRecodePageRequest {
|
||||
private String keyword;
|
||||
@ApiModelProperty(value = "关键字(门店编号,门店名称)",required = true)
|
||||
private String storeKeyword;
|
||||
@ApiModelProperty(value = "1.转账 2.提现 3.充值",required = false)
|
||||
private Integer tradeType;
|
||||
@ApiModelProperty(value = "费用科目",required = true)
|
||||
private Integer feeItemId;
|
||||
@ApiModelProperty(value = "当前页码",required = true)
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.alibaba.excel.annotation.format.DateTimeFormat;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.cool.store.annotation.DictField;
|
||||
import com.cool.store.converter.StringListConverter;
|
||||
import com.cool.store.enums.ExpenseSheetTypeEnum;
|
||||
import com.cool.store.enums.wallet.AdjustTypeEnum;
|
||||
import com.cool.store.enums.wallet.DocStatusEnum;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -23,6 +24,15 @@ public class AdjustmentOrderResponse implements Serializable {
|
||||
@ExcelIgnore
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty("费用单类型 1-费用单 2-调整单")
|
||||
@ExcelIgnore
|
||||
private Integer expenseSheetType;
|
||||
|
||||
@ApiModelProperty("单据类型")
|
||||
@ExcelProperty(value = "单据类型", order = 0)
|
||||
@ColumnWidth(30)
|
||||
private String expenseSheetTypeName;
|
||||
|
||||
@ApiModelProperty("调整单号")
|
||||
@ExcelProperty(value = "调整单号", order = 1)
|
||||
@ColumnWidth(30)
|
||||
@@ -157,9 +167,10 @@ public class AdjustmentOrderResponse implements Serializable {
|
||||
@ColumnWidth(30)
|
||||
private Date payTime;
|
||||
|
||||
@ApiModelProperty("费用单类型 1-费用单 2-调整单")
|
||||
@ExcelIgnore
|
||||
private Integer expenseSheetType;
|
||||
@ApiModelProperty("拒绝原因")
|
||||
@ExcelProperty(value = "拒绝原因", order = 21)
|
||||
@ColumnWidth(30)
|
||||
private String rejectReason;
|
||||
|
||||
public String getAdjustTypeName() {
|
||||
AdjustTypeEnum adjustTypeEnum = AdjustTypeEnum.fromCode(this.adjustType);
|
||||
@@ -170,4 +181,17 @@ public class AdjustmentOrderResponse implements Serializable {
|
||||
DocStatusEnum docStatusEnum = DocStatusEnum.fromStatus(this.status);
|
||||
return docStatusEnum!=null?docStatusEnum.getDesc():"";
|
||||
}
|
||||
|
||||
public String getExpenseSheetTypeName(){
|
||||
ExpenseSheetTypeEnum expenseSheetTypeEnum = ExpenseSheetTypeEnum.getByCode(this.expenseSheetType);
|
||||
return expenseSheetTypeEnum!=null?expenseSheetTypeEnum.getDesc():"";
|
||||
}
|
||||
|
||||
public BigDecimal getAdjustAmount() {
|
||||
if (this.adjustType!=null && this.adjustType==2){
|
||||
return BigDecimal.ZERO.subtract(this.adjustAmount);
|
||||
}
|
||||
return this.adjustAmount;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,4 +50,13 @@ public class WithdrawApplicationResponse implements Serializable {
|
||||
|
||||
@ApiModelProperty("更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty("门店ID")
|
||||
private String relateStoreId;
|
||||
|
||||
@ApiModelProperty("门店名称")
|
||||
private String relateStoreName;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,9 @@ public class WalletHttpClientRest {
|
||||
throw new ServiceException(ErrorCodeEnum.WALLET_API_ERROR, msg);
|
||||
} else if (code == 610 || msg.equals("支付密码不正确")) {
|
||||
throw new ServiceException(ErrorCodeEnum.PASSWORD_ERROR);
|
||||
} else {
|
||||
} else if (code == 611) {
|
||||
throw new ServiceException(ErrorCodeEnum.WALLET_OPEN_ACCOUNT_NO_BALANCE);
|
||||
}else {
|
||||
throw new ServiceException(ErrorCodeEnum.THIRD_API_ERROR,
|
||||
"code: " + code + ", msg: " + msg);
|
||||
}
|
||||
|
||||
@@ -87,5 +87,11 @@ public interface AdjustmentOrderService {
|
||||
*/
|
||||
Long pageCount(AdjustmentOrderPageRequest request,LoginUserInfo user);
|
||||
|
||||
/**
|
||||
* 审批调整单
|
||||
* @param request 审批请求
|
||||
* @return 是否成功
|
||||
*/
|
||||
Boolean approval(AdjustmentApprovalRequest request);
|
||||
|
||||
}
|
||||
|
||||
@@ -79,4 +79,11 @@ public interface ExportRealizeService {
|
||||
* @param importTaskDO 导出任务
|
||||
*/
|
||||
void exportSplitOrder(SplitOrderPageRequest request, ImportTaskDO importTaskDO);
|
||||
|
||||
/**
|
||||
* 提现申请导出
|
||||
* @param request 查询Request
|
||||
* @param importTaskDO 导出任务
|
||||
*/
|
||||
void exportWithdrawApplication(WithdrawApplicationPageRequest request, ImportTaskDO importTaskDO);
|
||||
}
|
||||
|
||||
@@ -103,14 +103,6 @@ public interface ExportService {
|
||||
*/
|
||||
Long exportAdjustmentOrder(AdjustmentOrderPageRequest request, LoginUserInfo user);
|
||||
|
||||
/**
|
||||
* 费用单导出
|
||||
* @param request 查询Request
|
||||
* @param user 当前用户
|
||||
* @return 记录总数
|
||||
*/
|
||||
Long exportExpenseOrder(AdjustmentOrderPageRequest request, LoginUserInfo user);
|
||||
|
||||
/**
|
||||
* 分账单导出
|
||||
* @param request 查询Request
|
||||
@@ -118,4 +110,12 @@ public interface ExportService {
|
||||
* @return 记录总数
|
||||
*/
|
||||
Long exportSplitOrder(SplitOrderPageRequest request, LoginUserInfo user);
|
||||
|
||||
/**
|
||||
* 提现流水导出
|
||||
* @param request
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
Long exportWithdrawApplication(WithdrawApplicationPageRequest request, LoginUserInfo user);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cool.store.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.*;
|
||||
@@ -10,6 +11,8 @@ import com.cool.store.entity.SplitOrderDO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
import com.cool.store.enums.ExpenseSheetTypeEnum;
|
||||
import com.cool.store.enums.fees.AllocationPayStatusEnum;
|
||||
import com.cool.store.enums.wallet.AdjustTypeEnum;
|
||||
import com.cool.store.enums.wallet.DocStatusEnum;
|
||||
import com.cool.store.enums.wallet.SplitSourceEnum;
|
||||
import com.cool.store.enums.wallet.SplitTypeEnum;
|
||||
@@ -19,11 +22,10 @@ import com.cool.store.request.wallet.ConfirmRechargeRequest;
|
||||
import com.cool.store.request.wallet.OutStoreIdRequest;
|
||||
import com.cool.store.response.AdjustmentOrderResponse;
|
||||
import com.cool.store.service.AdjustmentOrderService;
|
||||
import com.cool.store.service.UserAuthMappingService;
|
||||
import com.cool.store.service.SplitOrderService;
|
||||
import com.cool.store.service.dict.impl.DictService;
|
||||
import com.cool.store.service.wallet.WalletApiService;
|
||||
import com.cool.store.utils.GenerateNoUtil;
|
||||
import com.cool.store.vo.login.UserLoginVO;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -39,6 +41,7 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.cool.store.enums.fees.AllocationPayStatusEnum.*;
|
||||
import static com.cool.store.enums.fees.WalletFeeItemEnum.*;
|
||||
import static com.cool.store.enums.wallet.DocStatusEnum.*;
|
||||
|
||||
/**
|
||||
@@ -69,8 +72,13 @@ public class AdjustmentOrderServiceImpl implements AdjustmentOrderService {
|
||||
@Resource
|
||||
DictService dictService;
|
||||
|
||||
private static final String ADJUSTMENT_ORDER_PREFIX = "TZ";
|
||||
private static final String EXPENSE_SHEET_PREFIX = "FY";
|
||||
@Resource
|
||||
SplitOrderService splitOrderService;
|
||||
|
||||
|
||||
|
||||
private static final String PAYEE_ACCOUNT_NAME = "上海立规装饰设计工程有限公司";
|
||||
private static final String PAYEE_ACCOUNT_NO = "422011940168069";
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -82,7 +90,10 @@ public class AdjustmentOrderServiceImpl implements AdjustmentOrderService {
|
||||
if (store == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.STORE_IS_EXIST);
|
||||
}
|
||||
|
||||
Integer status = DOC_STATUS_1.getStatus();
|
||||
if (request.getAdjustType()!=null && request.getAdjustType()==2){
|
||||
status = DOC_STATUS_05.getStatus();
|
||||
}
|
||||
AdjustmentOrderDO adjustmentOrder = AdjustmentOrderDO.builder()
|
||||
.adjustmentNo(GenerateNoUtil.generateAdjustmentNo(request.getExpenseSheetType()))
|
||||
.storeId(request.getStoreId())
|
||||
@@ -97,7 +108,7 @@ public class AdjustmentOrderServiceImpl implements AdjustmentOrderService {
|
||||
.expenseSheetType(request.getExpenseSheetType())
|
||||
.settledAmount(new BigDecimal("0"))
|
||||
.pendingSettlementAmount(request.getAdjustAmount())
|
||||
.status(DOC_STATUS_1.getStatus())
|
||||
.status(status)
|
||||
.createUserId(userId)
|
||||
.createTime(new Date())
|
||||
.build();
|
||||
@@ -119,7 +130,7 @@ public class AdjustmentOrderServiceImpl implements AdjustmentOrderService {
|
||||
}
|
||||
|
||||
// 只有待确认缴费状态才能编辑
|
||||
if (!DOC_STATUS_1.getStatus().equals(existing.getStatus())) {
|
||||
if (!(DOC_STATUS_1.getStatus().equals(existing.getStatus())||DOC_STATUS_05.getStatus().equals(existing.getStatus()))) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_SUPPORT_OPERATION);
|
||||
}
|
||||
|
||||
@@ -155,13 +166,28 @@ public class AdjustmentOrderServiceImpl implements AdjustmentOrderService {
|
||||
throw new ServiceException(ErrorCodeEnum.CHANGE_NOT_NULL);
|
||||
}
|
||||
|
||||
// 只有待确认缴费状态才能删除
|
||||
if (!DOC_STATUS_1.getStatus().equals(existing.getStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_SUPPORT_OPERATION);
|
||||
// 待确认缴费状态可以直接删除
|
||||
if (DocStatusEnum.getCanDeleteStatus().contains(existing.getStatus())) {
|
||||
existing.setDeleted(1);
|
||||
adjustmentOrderDAO.update(existing);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
existing.setDeleted(1);
|
||||
adjustmentOrderDAO.update(existing);
|
||||
return Boolean.TRUE;
|
||||
|
||||
// 认款完成状态,检查是否有关联的分账单
|
||||
if (DOC_STATUS_3.getStatus().equals(existing.getStatus())) {
|
||||
List<SplitOrderDO> splitOrderDOS = splitOrderDAO.listByRelatedDocNo(
|
||||
existing.getAdjustmentNo(),
|
||||
AllocationPayStatusEnum.getAllStatus());
|
||||
if (CollectionUtils.isNotEmpty(splitOrderDOS)) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_SUPPORT_OPERATION);
|
||||
}
|
||||
existing.setDeleted(1);
|
||||
adjustmentOrderDAO.update(existing);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
// 其他状态不允许删除
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_SUPPORT_OPERATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -177,10 +203,6 @@ public class AdjustmentOrderServiceImpl implements AdjustmentOrderService {
|
||||
|
||||
return buildResponse(adjustmentOrder);
|
||||
}
|
||||
@Resource
|
||||
UserAuthMappingService userAuthMappingService;
|
||||
@Resource
|
||||
EnterpriseUserRoleDao enterpriseUserRoleDao;
|
||||
|
||||
@Override
|
||||
public PageInfo<AdjustmentOrderResponse> page(AdjustmentOrderPageRequest request, String userId) {
|
||||
@@ -371,9 +393,68 @@ public class AdjustmentOrderServiceImpl implements AdjustmentOrderService {
|
||||
|
||||
log.info("费用调整单认款成功,单号:{},交易流水号:{}",
|
||||
adjustmentOrder.getAdjustmentNo(), request.getTradeNos());
|
||||
//查看当前门店是否有账户
|
||||
OutStoreIdRequest outStoreIdRequest = new OutStoreIdRequest();
|
||||
outStoreIdRequest.setOutStoreId(adjustmentOrder.getStoreId());
|
||||
AccountInfoDTO onlineAccountInfo = walletApiService.getOnlineAccountInfo(outStoreIdRequest);
|
||||
if (onlineAccountInfo==null){
|
||||
log.info("费用调整单认款成功_当前门店无网商钱包账户");
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
//费用单:费用类型为“灯箱广告类(立规) ”、“监控设备类(立规)” ,认款完成自动分账,默认分账到“上海立规装饰设计工程有限公司”
|
||||
if (autoSplitOrder(adjustmentOrder.getExpenseSheetType(),adjustmentOrder.getExpenseTypeCode(),adjustmentOrder.getAdjustType())){
|
||||
StoreDO store = storeDao.getByStoreId(adjustmentOrder.getStoreId());
|
||||
GenerateSplitOrderRequest generateSplitOrderRequest = new GenerateSplitOrderRequest();
|
||||
generateSplitOrderRequest.setId(update.getId());
|
||||
generateSplitOrderRequest.setRemark(store.getStoreName()+adjustmentOrder.getRemark());
|
||||
//
|
||||
generateSplitOrderRequest.setSplitType(SplitTypeEnum.ADD_BY_HAND.getStatus());
|
||||
generateSplitOrderRequest.setSplitAmount(adjustmentOrder.getPendingSettlementAmount());
|
||||
//收款账户
|
||||
generateSplitOrderRequest.setPayeeAccountName(PAYEE_ACCOUNT_NAME);
|
||||
generateSplitOrderRequest.setPayeeAccountNo(PAYEE_ACCOUNT_NO);
|
||||
//付款账户
|
||||
generateSplitOrderRequest.setPayerAccountName(onlineAccountInfo.getAccountName());
|
||||
generateSplitOrderRequest.setPayerAccountNo(onlineAccountInfo.getAccountNo());
|
||||
//生成分账单
|
||||
String splitOrder = generateSplitOrder(generateSplitOrderRequest);
|
||||
|
||||
SplitOrderDO adjustDO = splitOrderDAO.getBySplitNo(splitOrder);
|
||||
//确认分账
|
||||
splitOrderService.confirmSplitOrder(adjustDO.getId(),userInfo);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否自动分账
|
||||
* 费用单 广告费或者视频设备费
|
||||
* 调整单 广告费或者视频设备费 且是调增
|
||||
* @param expenseSheetType
|
||||
* @param expenseType
|
||||
* @param adjustType
|
||||
* @return
|
||||
*/
|
||||
private Boolean autoSplitOrder(Integer expenseSheetType, String expenseType, Integer adjustType) {
|
||||
// 广告费或者视频设备费
|
||||
boolean flag = ADVERTISEMENT_FEE.getExpenseType().equals(expenseType)
|
||||
|| VIDEO_DEVICE_FEE.getExpenseType().equals(expenseType);
|
||||
|
||||
if (expenseSheetType == ExpenseSheetTypeEnum.EXPENSE_SHEET.getCode()) {
|
||||
// 广告费或者视频设备费 自动分账 返回true,其他费用类型手动分账
|
||||
return flag;
|
||||
}
|
||||
|
||||
// 调整单逻辑
|
||||
if (expenseSheetType == ExpenseSheetTypeEnum.ADJUSTMENT_SHEET.getCode()) {
|
||||
// 调整单逻辑:调增 且 广告费/视频设备费 才自动分账
|
||||
return adjustType == AdjustTypeEnum.ADJUST_TYPE_1.getCode()&& flag;
|
||||
}
|
||||
|
||||
// 其他单据类型不分账
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean calculateAmount(String no, String transferAmount) {
|
||||
AdjustmentOrderDO adjustmentOrderDO = adjustmentOrderDAO.getByAdjustmentNo(no);
|
||||
@@ -413,6 +494,47 @@ public class AdjustmentOrderServiceImpl implements AdjustmentOrderService {
|
||||
return adjustmentOrderDAO.pageCount(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean approval(AdjustmentApprovalRequest request) {
|
||||
if (request.getId() == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.CHANGE_ID_NOT_NULL);
|
||||
}
|
||||
|
||||
AdjustmentOrderDO adjustmentOrder = adjustmentOrderDAO.getById(request.getId());
|
||||
if (adjustmentOrder == null) {
|
||||
throw new ServiceException(ErrorCodeEnum.CHANGE_NOT_NULL);
|
||||
}
|
||||
|
||||
// 只有待审批状态才能审批
|
||||
if (!DOC_STATUS_05.getStatus().equals(adjustmentOrder.getStatus())) {
|
||||
throw new ServiceException(ErrorCodeEnum.NOT_SUPPORT_OPERATION);
|
||||
}
|
||||
|
||||
// 拒绝时必须填写拒绝原因
|
||||
if (request.getApprovalResult() == 2 && StringUtils.isBlank(request.getRejectReason())) {
|
||||
throw new ServiceException(ErrorCodeEnum.ERROR_MESSAGE, "拒绝原因不能为空");
|
||||
}
|
||||
|
||||
Integer newStatus;
|
||||
if (request.getApprovalResult() == 1) {
|
||||
// 审批通过,状态变为待充值
|
||||
newStatus = DOC_STATUS_1.getStatus();
|
||||
} else {
|
||||
// 审批拒绝,状态变为审批未通过
|
||||
newStatus = DOC_STATUS_15.getStatus();
|
||||
}
|
||||
|
||||
AdjustmentOrderDO update = AdjustmentOrderDO.builder()
|
||||
.id(request.getId())
|
||||
.status(newStatus)
|
||||
.rejectReason(request.getRejectReason())
|
||||
.build();
|
||||
|
||||
int result = adjustmentOrderDAO.update(update);
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建响应对象
|
||||
*/
|
||||
@@ -437,6 +559,7 @@ public class AdjustmentOrderServiceImpl implements AdjustmentOrderService {
|
||||
response.setClaimTime(adjustmentOrder.getClaimTime());
|
||||
response.setContractAttachmentInfo(adjustmentOrder.getContractAttachmentInfo());
|
||||
response.setPayTime(adjustmentOrder.getPayTime());
|
||||
response.setRejectReason(adjustmentOrder.getRejectReason());
|
||||
|
||||
// 设置门店信息
|
||||
if (StringUtils.isNotBlank(adjustmentOrder.getStoreId())) {
|
||||
|
||||
@@ -8,8 +8,10 @@ import com.cool.store.dao.*;
|
||||
import com.cool.store.dto.*;
|
||||
import com.cool.store.dto.tp.TpScoreJournalExportDTO;
|
||||
import com.cool.store.dto.pre.fry.ApplyManagementDTO;
|
||||
import com.cool.store.dto.wallet.WithdrawApplicationDTO;
|
||||
import com.cool.store.entity.*;
|
||||
import com.cool.store.enums.*;
|
||||
import com.cool.store.enums.fees.AllocationPayStatusEnum;
|
||||
import com.cool.store.enums.point.*;
|
||||
import com.cool.store.exception.ServiceException;
|
||||
import com.cool.store.mapper.*;
|
||||
@@ -17,6 +19,8 @@ import com.cool.store.request.*;
|
||||
import com.cool.store.request.order.PCStoreOrderQueryRequest;
|
||||
import com.cool.store.request.tp.TpScoreJournalQueryRequest;
|
||||
import com.cool.store.request.visit.VisitRecordQueryRequest;
|
||||
import com.cool.store.request.wallet.BillDetailRequest;
|
||||
import com.cool.store.request.WithdrawApplicationPageRequest;
|
||||
import com.cool.store.request.visit.VisitRecordQueryRequest;
|
||||
import com.cool.store.response.*;
|
||||
import com.cool.store.service.*;
|
||||
@@ -140,6 +144,8 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
AdjustmentOrderService adjustmentOrderService;
|
||||
@Resource
|
||||
SplitOrderService splitOrderService;
|
||||
@Resource
|
||||
private WithdrawApplicationService withdrawApplicationService;
|
||||
|
||||
@Override
|
||||
@Async
|
||||
@@ -955,7 +961,6 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
(pageNum, pageSize) -> {
|
||||
request.setPageNum(pageNum);
|
||||
request.setPageSize(pageSize);
|
||||
request.setExpenseSheetType(2);
|
||||
PageInfo<AdjustmentOrderResponse> pageInfo = adjustmentOrderService.page(request,importTaskDO.getCreateUserId());
|
||||
List<AdjustmentOrderResponse> list = pageInfo.getList();
|
||||
dictService.fillDictField(list);
|
||||
@@ -1028,5 +1033,31 @@ public class ExportRealizeServiceImpl implements ExportRealizeService {
|
||||
redisUtilPool.delKey(RedisConstant.SPLIT_ORDER_EXPORT_LOCK);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Async("generalThreadPool")
|
||||
public void exportWithdrawApplication(WithdrawApplicationPageRequest request, ImportTaskDO importTaskDO) {
|
||||
String url = "";
|
||||
try {
|
||||
url = easyExcelUtil.exportExcelInBatches(WithdrawApplicationDTO.class,
|
||||
(pageNum, pageSize) -> {
|
||||
request.setPageNum(pageNum);
|
||||
request.setPageSize(pageSize);
|
||||
PageInfo<WithdrawApplicationDTO> page = withdrawApplicationService.page(request);
|
||||
List<WithdrawApplicationDTO> list = page.getList();
|
||||
return list;
|
||||
},
|
||||
FileTypeEnum.WITHDRAW_APPLICATION_EXPORT.getDesc(),
|
||||
FileTypeEnum.WITHDRAW_APPLICATION_EXPORT.getDesc());
|
||||
importTaskDO.setStatus(ImportStatusEnum.success.getCode());
|
||||
} catch (Exception e) {
|
||||
log.error("提现申请导出失败", e);
|
||||
importTaskDO.setStatus(ImportStatusEnum.fail.getCode());
|
||||
} finally {
|
||||
importTaskDO.setFileUrl(url);
|
||||
importTaskMapper.update(eid, importTaskDO);
|
||||
redisUtilPool.delKey(RedisConstant.WITHDRAW_APPLICATION_EXPORT_LOCK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.cool.store.dao.HyOpenAreaInfoDAO;
|
||||
import com.cool.store.dao.LineInfoDAO;
|
||||
import com.cool.store.dao.PreFryQualificationApplyDAO;
|
||||
import com.cool.store.dao.ShopInfoDAO;
|
||||
import com.cool.store.dao.WithdrawApplicationDAO;
|
||||
import com.cool.store.dao.order.StoreOrderDAO;
|
||||
import com.cool.store.dao.visit.VisitRecordDAO;
|
||||
import com.cool.store.dto.pre.fry.ApplyManagementDTO;
|
||||
@@ -93,6 +94,8 @@ public class ExportServiceImpl implements ExportService {
|
||||
private AdjustmentOrderService adjustmentOrderService;
|
||||
@Resource
|
||||
private SplitOrderService splitOrderService;
|
||||
@Resource
|
||||
private WithdrawApplicationDAO withdrawApplicationDAO;
|
||||
|
||||
|
||||
|
||||
@@ -407,32 +410,7 @@ public class ExportServiceImpl implements ExportService {
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long exportExpenseOrder(AdjustmentOrderPageRequest request, LoginUserInfo user) {
|
||||
Long count = adjustmentOrderService.pageCount(request,user);
|
||||
if (count.intValue() > CommonConstants.MAX_EXPORT_SIZE_PRO) {
|
||||
throw new ServiceException(ErrorCodeEnum.EXPORT_LIMIT_100000);
|
||||
}
|
||||
if (Long.valueOf(0).equals(count)) {
|
||||
log.error("导出数据为空");
|
||||
return 0L;
|
||||
}
|
||||
boolean lock = redisUtilPool.setNxExpire(RedisConstant.EXPENSE_ORDER_EXPORT_LOCK, RedisConstant.EXPENSE_ORDER_EXPORT_LOCK, 30 * 60 * 1000);
|
||||
if (!lock) {
|
||||
throw new ServiceException(ErrorCodeEnum.EXPORT_TASK_LIMIT);
|
||||
}
|
||||
ImportTaskDO importTaskDO = new ImportTaskDO();
|
||||
importTaskDO.setStatus(ImportStatusEnum.Ongoing.getCode());
|
||||
importTaskDO.setFileName(FileTypeEnum.EXPENSE_ORDER_EXPORT.getDesc() + DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1, new Date()));
|
||||
importTaskDO.setIsImport(Boolean.FALSE);
|
||||
importTaskDO.setFileType(FileTypeEnum.EXPENSE_ORDER_EXPORT.getFileType());
|
||||
importTaskDO.setCreateUserId(user.getUserId());
|
||||
importTaskDO.setCreateTime(new Date().getTime());
|
||||
importTaskDO.setCreateName(user.getName());
|
||||
importTaskMapper.insert(eid, importTaskDO);
|
||||
exportRealizeService.exportExpenseOrder(request, importTaskDO);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Long exportSplitOrder(SplitOrderPageRequest request, LoginUserInfo user) {
|
||||
@@ -461,5 +439,32 @@ public class ExportServiceImpl implements ExportService {
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long exportWithdrawApplication(WithdrawApplicationPageRequest request, LoginUserInfo user) {
|
||||
Long count = withdrawApplicationDAO.count(request);
|
||||
if (count.intValue() > CommonConstants.MAX_EXPORT_SIZE_PRO) {
|
||||
throw new ServiceException(ErrorCodeEnum.EXPORT_LIMIT_100000);
|
||||
}
|
||||
if (Long.valueOf(0).equals(count)) {
|
||||
log.error("导出数据为空");
|
||||
return 0L;
|
||||
}
|
||||
boolean lock = redisUtilPool.setNxExpire(RedisConstant.WITHDRAW_APPLICATION_EXPORT_LOCK, RedisConstant.WITHDRAW_APPLICATION_EXPORT_LOCK, 30 * 60 * 1000);
|
||||
if (!lock) {
|
||||
throw new ServiceException(ErrorCodeEnum.EXPORT_TASK_LIMIT);
|
||||
}
|
||||
ImportTaskDO importTaskDO = new ImportTaskDO();
|
||||
importTaskDO.setStatus(ImportStatusEnum.Ongoing.getCode());
|
||||
importTaskDO.setFileName(FileTypeEnum.WITHDRAW_APPLICATION_EXPORT.getDesc() + DateUtils.parseDateToStr(DateUtils.SPECIAL_DATE_START_1, new Date()));
|
||||
importTaskDO.setIsImport(Boolean.FALSE);
|
||||
importTaskDO.setFileType(FileTypeEnum.WITHDRAW_APPLICATION_EXPORT.getFileType());
|
||||
importTaskDO.setCreateUserId(user.getUserId());
|
||||
importTaskDO.setCreateTime(new Date().getTime());
|
||||
importTaskDO.setCreateName(user.getName());
|
||||
importTaskMapper.insert(eid, importTaskDO);
|
||||
exportRealizeService.exportWithdrawApplication(request, importTaskDO);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,11 +5,13 @@ import com.cool.store.constants.RedisConstant;
|
||||
import com.cool.store.context.CurrentUserHolder;
|
||||
import com.cool.store.context.LoginUserInfo;
|
||||
import com.cool.store.dao.EnterpriseUserDAO;
|
||||
import com.cool.store.dao.StoreDao;
|
||||
import com.cool.store.dao.WithdrawApplicationDAO;
|
||||
import com.cool.store.dao.wallet.WalletTradeDAO;
|
||||
import com.cool.store.dto.wallet.AccountWithdrawerDTO;
|
||||
import com.cool.store.dto.wallet.TradeRecordDTO;
|
||||
import com.cool.store.dto.wallet.WithdrawApplicationDTO;
|
||||
import com.cool.store.entity.StoreDO;
|
||||
import com.cool.store.entity.WithdrawApplicationDO;
|
||||
import com.cool.store.entity.wallet.WalletTradeDO;
|
||||
import com.cool.store.enums.ErrorCodeEnum;
|
||||
@@ -28,6 +30,7 @@ import com.cool.store.utils.RedisUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -65,6 +68,9 @@ public class WithdrawApplicationServiceImpl implements WithdrawApplicationServic
|
||||
@Resource
|
||||
EnterpriseUserDAO enterpriseUserDAO;
|
||||
|
||||
@Resource
|
||||
StoreDao storeDao;
|
||||
|
||||
private static final String WITHDRAW_ORDER_PREFIX = "TX";
|
||||
|
||||
@Override
|
||||
@@ -77,8 +83,19 @@ public class WithdrawApplicationServiceImpl implements WithdrawApplicationServic
|
||||
.filter(StringUtils::isNotBlank)
|
||||
.collect(Collectors.toSet());
|
||||
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(new ArrayList<>(userIdList));
|
||||
|
||||
// 获取门店ID列表并查询门店名称
|
||||
Set<String> storeIdList = responses.stream()
|
||||
.filter(x -> StringUtils.isNotBlank(x.getRelateStoreId()))
|
||||
.map(WithdrawApplicationDTO::getRelateStoreId)
|
||||
.collect(Collectors.toSet());
|
||||
Map<String, StoreDO> storeNameMap = storeDao.getStoreMapByStoreIds(new ArrayList<>(storeIdList));
|
||||
responses.stream().forEach(x->{
|
||||
x.setCreateUserName(userNameMap.get(x.getCreateUserId()));
|
||||
StoreDO storeDO = storeNameMap.get(x.getRelateStoreId());
|
||||
if (storeDO!=null){
|
||||
x.setRelateStoreName(storeDO.getStoreName());
|
||||
}
|
||||
});
|
||||
return new PageInfo<>(responses);
|
||||
}
|
||||
@@ -96,6 +113,8 @@ public class WithdrawApplicationServiceImpl implements WithdrawApplicationServic
|
||||
.amount(request.getAmount())
|
||||
.bankCardNo(request.getBankCardNo())
|
||||
.bankName(request.getBankName())
|
||||
.relateStoreId(request.getRelateStoreId())
|
||||
.remark(request.getRemark())
|
||||
.status(AllocationPayStatusEnum.UNPAID.getStatus())
|
||||
.createUserId(userId)
|
||||
.createTime(new Date())
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.cool.store.mapper.ApplyLicenseMapper;
|
||||
import com.cool.store.request.wallet.*;
|
||||
import com.cool.store.service.UserAuthMappingService;
|
||||
import com.cool.store.service.dict.impl.DictService;
|
||||
import com.cool.store.service.fees.WalletPayInfoService;
|
||||
import com.cool.store.service.impl.CommonService;
|
||||
import com.cool.store.service.wallet.*;
|
||||
import com.cool.store.utils.BeanUtil;
|
||||
@@ -82,6 +83,7 @@ public class WalletServiceImpl implements WalletService {
|
||||
private final UserAuthMappingService userAuthMappingService;
|
||||
private final CommonService commonService;
|
||||
private final WalletTradeService walletTradeService;
|
||||
private final WalletPayInfoService walletPayInfoService;
|
||||
@Value("${wallet.org.id}")
|
||||
private Long orgId;
|
||||
|
||||
@@ -558,6 +560,10 @@ public class WalletServiceImpl implements WalletService {
|
||||
if (orgFlag){
|
||||
tradeRecodePageRequest.setOrgId(orgId);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(request.getExpenseTypeCode())){
|
||||
tradeRecodePageRequest.setFeeItemId(walletPayInfoService.getFeeItemId(request.getExpenseTypeCode()));
|
||||
}
|
||||
|
||||
TradeRecordListDTO tradeRecordListDTO = walletApiService.getTradeRecordList(tradeRecodePageRequest);
|
||||
return toPageInfo(tradeRecordListDTO.getPageData(), TradeRecordDTO.class, tradeRecordListDTO.getPage());
|
||||
}
|
||||
|
||||
@@ -77,4 +77,10 @@ public class AdjustmentOrderController {
|
||||
public ResponseResult<String> generateSplitOrder(@Valid @RequestBody GenerateSplitOrderRequest request) {
|
||||
return ResponseResult.success(adjustmentOrderService.generateSplitOrder(request));
|
||||
}
|
||||
|
||||
@PostMapping("/approval")
|
||||
@ApiOperation("审批调整单")
|
||||
public ResponseResult<Boolean> approval(@Valid @RequestBody AdjustmentApprovalRequest request) {
|
||||
return ResponseResult.success(adjustmentOrderService.approval(request));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,15 +115,15 @@ public class ExportController {
|
||||
return ResponseResult.success(exportService.exportAdjustmentOrder(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
|
||||
@PostMapping("/expenseOrderExport")
|
||||
@ApiOperation("费用单导出")
|
||||
public ResponseResult<Long> expenseOrderExport(@RequestBody AdjustmentOrderPageRequest request) {
|
||||
return ResponseResult.success(exportService.exportExpenseOrder(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
|
||||
@PostMapping("/splitOrderExport")
|
||||
@ApiOperation("分账单导出")
|
||||
public ResponseResult<Long> splitOrderExport(@RequestBody SplitOrderPageRequest request) {
|
||||
return ResponseResult.success(exportService.exportSplitOrder(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
|
||||
@PostMapping("/withdrawApplicationExport")
|
||||
@ApiOperation("提现单导出")
|
||||
public ResponseResult<Long> exportWithdrawApplication(@RequestBody WithdrawApplicationPageRequest request) {
|
||||
return ResponseResult.success(exportService.exportWithdrawApplication(request, CurrentUserHolder.getUser()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user