Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b6718f9361 | |||
| a58de9bb7e | |||
| a211f06663 | |||
| 41cefd5fd5 |
+7
-7
@@ -13,13 +13,13 @@ import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bms.ar.domain.ArBill;
|
||||
import com.bms.ar.domain.ArBalanceWriteoff;
|
||||
import com.bms.ar.domain.vo.ArBillListExportRow;
|
||||
import com.bms.ar.domain.vo.ArBillQuery;
|
||||
import com.bms.ar.domain.vo.ArBillSummary;
|
||||
import com.bms.ar.service.IArBalanceWriteoffService;
|
||||
import com.bms.ar.service.IArBillService;
|
||||
import com.bms.receivable.domain.ArBill;
|
||||
import com.bms.receivable.domain.ArBalanceWriteoff;
|
||||
import com.bms.receivable.domain.vo.ArBillListExportRow;
|
||||
import com.bms.receivable.domain.vo.ArBillQuery;
|
||||
import com.bms.receivable.domain.vo.ArBillSummary;
|
||||
import com.bms.receivable.service.IArBalanceWriteoffService;
|
||||
import com.bms.receivable.service.IArBillService;
|
||||
import com.bms.common.annotation.Log;
|
||||
import com.bms.common.core.controller.BaseController;
|
||||
import com.bms.common.core.domain.AjaxResult;
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package com.bms.web.controller.ar;
|
||||
package com.bms.web.controller.receivable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,8 +7,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bms.ar.domain.ArBankAccount;
|
||||
import com.bms.ar.service.IArBillService;
|
||||
import com.bms.receivable.domain.ArBankAccount;
|
||||
import com.bms.receivable.service.IArBillService;
|
||||
import com.bms.common.core.controller.BaseController;
|
||||
import com.bms.common.core.domain.AjaxResult;
|
||||
|
||||
+15
-16
@@ -1,4 +1,4 @@
|
||||
package com.bms.web.controller.ar;
|
||||
package com.bms.web.controller.receivable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -23,21 +23,20 @@ import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bms.ar.domain.ArBill;
|
||||
import com.bms.ar.domain.ArBankAccount;
|
||||
import com.bms.ar.domain.ArBillDetailFee;
|
||||
import com.bms.ar.domain.ArBillExport;
|
||||
import com.bms.ar.domain.ArBillGenerateTask;
|
||||
import com.bms.ar.domain.ArBillLog;
|
||||
import com.bms.ar.domain.vo.ArBillActionRequest;
|
||||
import com.bms.ar.domain.vo.ArBillGenerateQuery;
|
||||
import com.bms.ar.domain.vo.ArBillGeneratePreviewExportRow;
|
||||
import com.bms.ar.domain.vo.ArBillGenerateRequest;
|
||||
import com.bms.ar.domain.vo.ArBillListExportRow;
|
||||
import com.bms.ar.domain.vo.ArBillQuery;
|
||||
import com.bms.ar.enums.ArBillDateType;
|
||||
import com.bms.ar.service.IArBillService;
|
||||
import com.bms.ar.security.ArBillScopeResolver;
|
||||
import com.bms.receivable.domain.ArBill;
|
||||
import com.bms.receivable.domain.ArBankAccount;
|
||||
import com.bms.receivable.domain.ArBillDetailFee;
|
||||
import com.bms.receivable.domain.ArBillGenerateTask;
|
||||
import com.bms.receivable.domain.ArBillLog;
|
||||
import com.bms.receivable.domain.vo.ArBillActionRequest;
|
||||
import com.bms.receivable.domain.vo.ArBillGenerateQuery;
|
||||
import com.bms.receivable.domain.vo.ArBillGeneratePreviewExportRow;
|
||||
import com.bms.receivable.domain.vo.ArBillGenerateRequest;
|
||||
import com.bms.receivable.domain.vo.ArBillListExportRow;
|
||||
import com.bms.receivable.domain.vo.ArBillQuery;
|
||||
import com.bms.receivable.enums.ArBillDateType;
|
||||
import com.bms.receivable.service.IArBillService;
|
||||
import com.bms.receivable.security.ArBillScopeResolver;
|
||||
import com.bms.common.annotation.Log;
|
||||
import com.bms.common.core.controller.BaseController;
|
||||
import com.bms.common.core.domain.AjaxResult;
|
||||
+3
-4
@@ -1,4 +1,4 @@
|
||||
package com.bms.web.controller.ar;
|
||||
package com.bms.web.controller.receivable;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -12,9 +12,8 @@ import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bms.ar.domain.ArBalanceWriteoff;
|
||||
import com.bms.ar.domain.ArBill;
|
||||
import com.bms.ar.service.IArBalanceWriteoffService;
|
||||
import com.bms.receivable.domain.ArBalanceWriteoff;
|
||||
import com.bms.receivable.service.IArBalanceWriteoffService;
|
||||
import com.bms.common.annotation.Log;
|
||||
import com.bms.common.core.controller.BaseController;
|
||||
import com.bms.common.core.domain.AjaxResult;
|
||||
+7
-7
@@ -6,16 +6,16 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.bms.ar.profit.ArCommissionRate;
|
||||
import com.bms.ar.profit.ArCommissionService;
|
||||
import com.bms.ar.profit.ArProfitQuery;
|
||||
import com.bms.ar.profit.ArProfitService;
|
||||
import com.bms.ar.profit.ArWriteoffRate;
|
||||
import com.bms.receivable.profit.ArCommissionRate;
|
||||
import com.bms.receivable.profit.ArCommissionService;
|
||||
import com.bms.receivable.profit.ArProfitQuery;
|
||||
import com.bms.receivable.profit.ArProfitService;
|
||||
import com.bms.receivable.profit.ArWriteoffRate;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import com.bms.ar.profit.ArProfitRow;
|
||||
import com.bms.ar.profit.ArCommissionResult;
|
||||
import com.bms.receivable.profit.ArProfitRow;
|
||||
import com.bms.receivable.profit.ArCommissionResult;
|
||||
import com.bms.common.utils.poi.ExcelUtil;
|
||||
import com.bms.price.enums.ProfitAreaRule;
|
||||
import com.bms.common.annotation.Log;
|
||||
|
||||
@@ -42,14 +42,14 @@ bms:
|
||||
order-source-sync-threads: 16
|
||||
# Order-list local rebill workers (2~24). Pair with Druid maxActive >= threads + 8.
|
||||
local-rebill-threads: 16
|
||||
# Night auto-rebill: hours 0-8, pull 500 (all statuses) -> bill -> next 500 until empty / 09:00.
|
||||
# Empty page => no billing.
|
||||
# Auto-rebill: every hour all day, pull 500 (all statuses) -> bill -> next 500 until empty.
|
||||
# Empty page => no billing. Window [start-hour, end-hour).
|
||||
night-retry:
|
||||
enabled: true
|
||||
start-hour: 0
|
||||
end-hour: 9
|
||||
end-hour: 24
|
||||
batch-size: 500
|
||||
cron: "0 0/1 0-8 * * ?"
|
||||
cron: "0 0 * * * ?"
|
||||
oracle:
|
||||
# SLAVE datasource Oracle main-order table (schema.table allowed)
|
||||
order-table: WEISHI_USER.TAB_ORDER
|
||||
|
||||
@@ -11,14 +11,14 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import com.bms.ar.domain.ArBalanceWriteoff;
|
||||
import com.bms.ar.domain.ArBill;
|
||||
import com.bms.ar.mapper.ArCommissionMapper;
|
||||
import com.bms.ar.profit.ArCommissionRate;
|
||||
import com.bms.ar.profit.ArCommissionResult;
|
||||
import com.bms.ar.profit.ArCommissionService;
|
||||
import com.bms.ar.profit.ArProfitScope;
|
||||
import com.bms.ar.profit.ArProfitScopeResolver;
|
||||
import com.bms.receivable.domain.ArBalanceWriteoff;
|
||||
import com.bms.receivable.domain.ArBill;
|
||||
import com.bms.receivable.mapper.ArCommissionMapper;
|
||||
import com.bms.receivable.profit.ArCommissionRate;
|
||||
import com.bms.receivable.profit.ArCommissionResult;
|
||||
import com.bms.receivable.profit.ArCommissionService;
|
||||
import com.bms.receivable.profit.ArProfitScope;
|
||||
import com.bms.receivable.profit.ArProfitScopeResolver;
|
||||
import com.bms.common.exception.ServiceException;
|
||||
|
||||
class ArCommissionServiceTest
|
||||
|
||||
@@ -8,9 +8,9 @@ import java.util.Map;
|
||||
import org.apache.ibatis.builder.xml.XMLMapperBuilder;
|
||||
import org.apache.ibatis.session.Configuration;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import com.bms.ar.profit.ArProfitQuery;
|
||||
import com.bms.ar.profit.ArProfitScope;
|
||||
import com.bms.ar.profit.ArCommissionResult;
|
||||
import com.bms.receivable.profit.ArProfitQuery;
|
||||
import com.bms.receivable.profit.ArProfitScope;
|
||||
import com.bms.receivable.profit.ArCommissionResult;
|
||||
|
||||
class ArProfitMapperSqlTest
|
||||
{
|
||||
@@ -18,7 +18,7 @@ class ArProfitMapperSqlTest
|
||||
void commissionInReportSummaryUsesBillFiltersAndDataScope() throws Exception
|
||||
{
|
||||
Configuration configuration = new Configuration();
|
||||
String resource = "mapper/ar/ArProfitMapper.xml";
|
||||
String resource = "mapper/receivable/ArProfitMapper.xml";
|
||||
try (InputStream input = getClass().getClassLoader().getResourceAsStream(resource))
|
||||
{
|
||||
new XMLMapperBuilder(input, configuration, resource, configuration.getSqlFragments()).parse();
|
||||
@@ -65,7 +65,7 @@ class ArProfitMapperSqlTest
|
||||
{
|
||||
Configuration configuration = new Configuration();
|
||||
// 提成 Mapper 先加载时也必须能解析引用的报表权限片段。
|
||||
for (String resource : new String[] { "mapper/ar/ArCommissionMapper.xml", "mapper/ar/ArProfitMapper.xml" })
|
||||
for (String resource : new String[] {"mapper/receivable/ArCommissionMapper.xml", "mapper/receivable/ArProfitMapper.xml"})
|
||||
{
|
||||
try (InputStream input = getClass().getClassLoader().getResourceAsStream(resource))
|
||||
{
|
||||
|
||||
@@ -4,10 +4,9 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import com.bms.ar.profit.ArProfitScopeResolver;
|
||||
import com.bms.receivable.profit.ArProfitScopeResolver;
|
||||
import com.bms.common.core.domain.entity.SysRole;
|
||||
import com.bms.common.core.domain.entity.SysUser;
|
||||
import com.bms.common.core.domain.model.LoginUser;
|
||||
|
||||
@@ -6,9 +6,9 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import com.bms.ar.profit.CommissionCalculator;
|
||||
import com.bms.ar.profit.ArCommissionResult;
|
||||
import com.bms.ar.profit.CommissionCalculator.Writeoff;
|
||||
import com.bms.receivable.profit.CommissionCalculator;
|
||||
import com.bms.receivable.profit.ArCommissionResult;
|
||||
import com.bms.receivable.profit.CommissionCalculator.Writeoff;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class CommissionCalculatorTest
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@ import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.bms.common.exception.ServiceException;
|
||||
import com.bms.common.utils.SecurityUtils;
|
||||
import com.bms.ar.domain.ArBankAccount;
|
||||
import com.bms.ar.mapper.ArBankAccountMapper;
|
||||
import com.bms.receivable.domain.ArBankAccount;
|
||||
import com.bms.receivable.mapper.ArBankAccountMapper;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomer;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerAttachment;
|
||||
import com.bms.customer.customerinfo.mapper.BmsCustomerMapper;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class BillingProperties
|
||||
* Keep below Druid maxActive with headroom for other traffic.
|
||||
*/
|
||||
private int localRebillThreads = 16;
|
||||
/** Night window auto-retry of prc_billing_task (all statuses) */
|
||||
/** Hourly auto-retry of prc_billing_task (all statuses) */
|
||||
private NightRetry nightRetry = new NightRetry();
|
||||
private Oracle oracle = new Oracle();
|
||||
|
||||
@@ -120,8 +120,8 @@ public class BillingProperties
|
||||
}
|
||||
|
||||
/**
|
||||
* Overnight rebill window: pull prc_billing_task (all success_status) and retryTask.
|
||||
* Default hours [0, 9) local time; empty result skips billing.
|
||||
* Auto rebill window: pull prc_billing_task (all success_status) and retryTask.
|
||||
* Default hours [0, 24) local time (all day); empty result skips billing.
|
||||
*/
|
||||
public static class NightRetry
|
||||
{
|
||||
@@ -129,8 +129,8 @@ public class BillingProperties
|
||||
private boolean enabled = true;
|
||||
/** Inclusive start hour (0 = 00:00) */
|
||||
private int startHour = 0;
|
||||
/** Exclusive end hour (9 = stop at 09:00) */
|
||||
private int endHour = 9;
|
||||
/** Exclusive end hour (24 = all day) */
|
||||
private int endHour = 24;
|
||||
/** Page size: bill this many then pull next page (default 500) */
|
||||
private int batchSize = 500;
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ public class PrcOrderBill extends BaseEntity
|
||||
private String creditArrearsStatus;
|
||||
/** NONE / REFUNDED */
|
||||
private String refundStatus;
|
||||
/** Billing fail: 0 ok; 1/2/3 sales miss; 23/24/25 catalog miss; soft-fail amount=0, no fee rows */
|
||||
/** Billing fail: 0 ok writes income bill+fee; non-0 amount=0, no income bill/fee */
|
||||
private Integer billingFailStatus;
|
||||
/** 失败原因 */
|
||||
private String errorMessage;
|
||||
|
||||
@@ -103,7 +103,7 @@ public class TmsPriceQuoteResult implements Serializable
|
||||
private String creditArrearsStatus;
|
||||
/** NONE / REFUNDED */
|
||||
private String refundStatus;
|
||||
/** Billing fail: 0 ok; 1/2/3 sales; 23/24/25 catalog (soft-fail on bill sync) */
|
||||
/** Billing fail: 0 ok (income bill+fee); 1/2/3 sales; 23/24/25 catalog */
|
||||
private Integer billingFailStatus;
|
||||
private Integer pieces;
|
||||
private BigDecimal actualWeight;
|
||||
|
||||
@@ -6,7 +6,8 @@ package com.bms.price.enums;
|
||||
* 1/2/3 sales-price (package) miss: product / country / weight;
|
||||
* 23/24/25 product-catalog price miss: product / country / weight;
|
||||
* 4+ map to prc_billing_task.fail_code.
|
||||
* Soft-fail income bill: 0/1/2/3/23/24/25; fee rows only for 0.
|
||||
* 26 not billed yet (order-source sync only).
|
||||
* Income bill + fee rows: only status 0.
|
||||
*/
|
||||
public enum BillBillingFailStatus
|
||||
{
|
||||
@@ -38,7 +39,9 @@ public enum BillBillingFailStatus
|
||||
/** Product catalog miss: product hit but country/zone miss. */
|
||||
CATALOG_COUNTRY(24),
|
||||
/** Product catalog miss: product+country hit but weight band miss. */
|
||||
CATALOG_WEIGHT(25);
|
||||
CATALOG_WEIGHT(25),
|
||||
/** Order landed from upstream but not billed yet. */
|
||||
NOT_BILLED(26);
|
||||
|
||||
private final int code;
|
||||
|
||||
@@ -70,16 +73,23 @@ public enum BillBillingFailStatus
|
||||
|
||||
public static boolean isFail(Integer code)
|
||||
{
|
||||
return code != null && code.intValue() > SUCCESS.code;
|
||||
if (code == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
int value = code.intValue();
|
||||
return value != SUCCESS.code && value != NOT_BILLED.code;
|
||||
}
|
||||
|
||||
/** Soft-fail sales/catalog misses also persist prc_income_bill. */
|
||||
public static boolean isNotBilled(Integer code)
|
||||
{
|
||||
return code != null && code.intValue() == NOT_BILLED.code;
|
||||
}
|
||||
|
||||
/** Only success (0) persists prc_income_bill. */
|
||||
public static boolean storesIncomeBill(Integer code)
|
||||
{
|
||||
int value = code == null ? SUCCESS.code : code.intValue();
|
||||
return value == SUCCESS.code
|
||||
|| value == PRODUCT.code || value == COUNTRY.code || value == WEIGHT.code
|
||||
|| value == CATALOG_PRODUCT.code || value == CATALOG_COUNTRY.code || value == CATALOG_WEIGHT.code;
|
||||
return code == null || code.intValue() == SUCCESS.code;
|
||||
}
|
||||
|
||||
/** 仅 0 落 prc_income_bill_fee。 */
|
||||
@@ -96,7 +106,7 @@ public enum BillBillingFailStatus
|
||||
}
|
||||
for (BillBillingFailStatus status : values())
|
||||
{
|
||||
if (status == SUCCESS)
|
||||
if (status == SUCCESS || status == NOT_BILLED)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -113,6 +123,7 @@ public enum BillBillingFailStatus
|
||||
switch (this)
|
||||
{
|
||||
case SUCCESS:
|
||||
case NOT_BILLED:
|
||||
return null;
|
||||
case PRODUCT:
|
||||
return BillTaskFailCode.PRODUCT_NOT_HIT.getCode();
|
||||
|
||||
+4
-4
@@ -6,7 +6,6 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
@@ -28,8 +27,8 @@ import org.springframework.transaction.support.TransactionSynchronization;
|
||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.bms.ar.enums.ArIncomeBillFeeStatus;
|
||||
import com.bms.ar.enums.ArOrderBillStatus;
|
||||
import com.bms.receivable.enums.ArIncomeBillFeeStatus;
|
||||
import com.bms.receivable.enums.ArOrderBillStatus;
|
||||
import com.bms.common.annotation.DataScope;
|
||||
import com.bms.common.core.domain.entity.SysUser;
|
||||
import com.bms.common.exception.ServiceException;
|
||||
@@ -3090,7 +3089,8 @@ public class PrcOrderBillServiceImpl implements IPrcOrderBillService
|
||||
bill.setBillId(UUID.randomUUID().toString());
|
||||
bill.setArBillStatus(ArOrderBillStatus.UNBILLED.getCode());
|
||||
bill.setRefundStatus(BillRefundStatus.NONE.getCode());
|
||||
bill.setBillingFailStatus(Integer.valueOf(BillBillingFailStatus.SUCCESS.getCode()));
|
||||
// Order-source sync only: mark not billed until quote/bill runs.
|
||||
bill.setBillingFailStatus(Integer.valueOf(BillBillingFailStatus.NOT_BILLED.getCode()));
|
||||
bill.setFreightRate(BigDecimal.ZERO);
|
||||
bill.setBaseFreightRate(BigDecimal.ZERO);
|
||||
bill.setRegistrationFee(BigDecimal.ZERO);
|
||||
|
||||
+1
@@ -265,6 +265,7 @@ public final class OrderBillExportSupport
|
||||
case 20: return "客户已停用";
|
||||
case 21: return "运费为空";
|
||||
case 22: return "未知失败";
|
||||
case 26: return "未计费";
|
||||
default: return String.valueOf(status);
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -16,13 +16,13 @@ import com.bms.price.mapper.PrcBillingTaskMapper;
|
||||
import com.bms.price.service.IPrcBillingTaskService;
|
||||
|
||||
/**
|
||||
* 夜间窗口按 prc_billing_task 自动重计费。
|
||||
* Auto retry prc_billing_task on a schedule.
|
||||
*
|
||||
* <p>在 [startHour, endHour) 内(默认 00:00-09:00):最多拉取 {@value #DEFAULT_BATCH}
|
||||
* 条任务 id(不限 success_status)-> 全部计费 -> 立刻拉下一页。
|
||||
* 空页则跳过计费并结束本轮(下次 cron 再处理新数据)。</p>
|
||||
* <p>Within [startHour, endHour) (default all day 00:00-24:00): pull up to {@value #DEFAULT_BATCH}
|
||||
* task ids (any success_status) -> bill all -> pull next page.
|
||||
* Empty page skips billing and ends this tick (next cron handles new rows).</p>
|
||||
*
|
||||
* <p>与监控手工重试 / 条件重试同一条重计费路径(先重置为 WAITING 再处理)。</p>
|
||||
* <p>Same path as monitor manual / filter retry (reset to WAITING then process).</p>
|
||||
*/
|
||||
@Component
|
||||
public class PrcBillingTaskNightRetryTask
|
||||
@@ -52,10 +52,10 @@ public class PrcBillingTaskNightRetryTask
|
||||
private IPrcBillingTaskService billingTaskService;
|
||||
|
||||
/**
|
||||
* Fire every minute; if a previous run is still paging batches, skip.
|
||||
* Fire every hour by default; if a previous run is still paging batches, skip.
|
||||
* Hour gate uses bms.billing.night-retry start/end.
|
||||
*/
|
||||
@Scheduled(cron = "${bms.billing.night-retry.cron:0 0/1 0-8 * * ?}")
|
||||
@Scheduled(cron = "${bms.billing.night-retry.cron:0 0 * * * ?}")
|
||||
public void scheduledTick()
|
||||
{
|
||||
BillingProperties.NightRetry cfg = billingProperties == null ? null : billingProperties.getNightRetry();
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.config;
|
||||
package com.bms.receivable.config;
|
||||
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain;
|
||||
package com.bms.receivable.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain;
|
||||
package com.bms.receivable.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain;
|
||||
package com.bms.receivable.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain;
|
||||
package com.bms.receivable.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain;
|
||||
package com.bms.receivable.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain;
|
||||
package com.bms.receivable.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain;
|
||||
package com.bms.receivable.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain;
|
||||
package com.bms.receivable.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain;
|
||||
package com.bms.receivable.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain.vo;
|
||||
package com.bms.receivable.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain.vo;
|
||||
package com.bms.receivable.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain.vo;
|
||||
package com.bms.receivable.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain.vo;
|
||||
package com.bms.receivable.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -8,7 +8,7 @@ import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import com.bms.common.config.serializer.StrictDateDeserializer;
|
||||
import com.bms.ar.enums.ArBillSelectionMode;
|
||||
import com.bms.receivable.enums.ArBillSelectionMode;
|
||||
import lombok.Data;
|
||||
|
||||
/** 从订单计费结果生成正式账单的参数。 */
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
package com.bms.ar.domain.vo;
|
||||
package com.bms.receivable.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.bms.ar.domain.ArBill;
|
||||
import com.bms.ar.enums.ArBillStatus;
|
||||
import com.bms.receivable.domain.ArBill;
|
||||
import com.bms.receivable.enums.ArBillStatus;
|
||||
import com.bms.common.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package com.bms.ar.domain.vo;
|
||||
package com.bms.receivable.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import com.bms.ar.domain.ArBill;
|
||||
import com.bms.receivable.domain.ArBill;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.domain.vo;
|
||||
package com.bms.receivable.domain.vo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/**
|
||||
* 应收账单余额核销单状态。
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/** 应收账单生成时用于截止日筛选的来源订单日期字段。 */
|
||||
public enum ArBillDateType
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/** 应收账单异步生成任务状态。 */
|
||||
public final class ArBillGenerateTaskStatus
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/** 应收账单生成状态,与账单业务状态分离。 */
|
||||
public final class ArBillGenerationStatus
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/**
|
||||
* 应收账单生成时的订单选择模式。
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/** 应收账单状态。数据库保存值使用 code,避免业务代码散落状态字符串。 */
|
||||
public enum ArBillStatus
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/**
|
||||
* 应收账单导出任务状态。
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/** 应收费用明细是否已经生成正式应收账单。 */
|
||||
public enum ArIncomeBillFeeStatus
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/** 应收日志关联对象类型。 */
|
||||
public enum ArLogObjectType
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/** 应收日志操作来源。 */
|
||||
public enum ArLogOperationSource
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/** 应收日志操作类型。 */
|
||||
public enum ArLogOperationType
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/** 应收操作日志结果。 */
|
||||
public enum ArLogResult
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.enums;
|
||||
package com.bms.receivable.enums;
|
||||
|
||||
/** 计费订单的应收账单状态。 */
|
||||
public enum ArOrderBillStatus
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.event;
|
||||
package com.bms.receivable.event;
|
||||
|
||||
/**
|
||||
* 应收账单导出任务已提交事件。
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.event;
|
||||
package com.bms.receivable.event;
|
||||
|
||||
/**
|
||||
* 应收账单异步生成任务已提交事件。
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package com.bms.ar.mapper;
|
||||
package com.bms.receivable.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bms.ar.security.ArBillRowScope;
|
||||
import com.bms.receivable.security.ArBillRowScope;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.ar.domain.ArBalanceWriteoff;
|
||||
import com.bms.receivable.domain.ArBalanceWriteoff;
|
||||
|
||||
/**
|
||||
* 应收账单余额核销 Mapper
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package com.bms.ar.mapper;
|
||||
package com.bms.receivable.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.ar.domain.ArBankAccount;
|
||||
import com.bms.receivable.domain.ArBankAccount;
|
||||
|
||||
public interface ArBankAccountMapper {
|
||||
ArBankAccount selectDefaultByCurrency(@Param("currency") String currency);
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package com.bms.ar.mapper;
|
||||
package com.bms.receivable.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bms.ar.security.ArBillRowScope;
|
||||
import com.bms.receivable.security.ArBillRowScope;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.ar.domain.ArBillDetailFee;
|
||||
import com.bms.receivable.domain.ArBillDetailFee;
|
||||
|
||||
public interface ArBillDetailFeeMapper {
|
||||
List<ArBillDetailFee> selectByBillIdAndDetailIdScoped(@Param("arBillId") Long arBillId, @Param("detailId") Long detailId, @Param("scope") ArBillRowScope scope);
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
package com.bms.ar.mapper;
|
||||
package com.bms.receivable.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bms.ar.security.ArBillRowScope;
|
||||
import com.bms.receivable.security.ArBillRowScope;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.ar.domain.ArBillDetail;
|
||||
import com.bms.receivable.domain.ArBillDetail;
|
||||
|
||||
public interface ArBillDetailMapper {
|
||||
List<ArBillDetail> selectByBillIdScoped(@Param("arBillId") Long arBillId, @Param("scope") ArBillRowScope scope);
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
package com.bms.ar.mapper;
|
||||
package com.bms.receivable.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.ar.domain.ArBillExport;
|
||||
import com.bms.receivable.domain.ArBillExport;
|
||||
|
||||
public interface ArBillExportMapper {
|
||||
List<ArBillExport> selectByBillId(Long arBillId);
|
||||
+3
-3
@@ -1,17 +1,17 @@
|
||||
package com.bms.ar.mapper;
|
||||
package com.bms.receivable.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.ar.domain.ArBillGenerateTask;
|
||||
import com.bms.receivable.domain.ArBillGenerateTask;
|
||||
|
||||
/**
|
||||
* 应收账单异步生成任务 Mapper。
|
||||
*/
|
||||
public interface ArBillGenerateTaskMapper {
|
||||
List<ArBillGenerateTask> selectActiveByCreateByScoped(@Param("createBy") String createBy,
|
||||
@Param("scope") com.bms.ar.security.ArBillRowScope scope);
|
||||
@Param("scope") com.bms.receivable.security.ArBillRowScope scope);
|
||||
|
||||
ArBillGenerateTask selectById(Long taskId);
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
package com.bms.ar.mapper;
|
||||
package com.bms.receivable.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.bms.ar.security.ArBillRowScope;
|
||||
import com.bms.receivable.security.ArBillRowScope;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.ar.domain.ArBillLog;
|
||||
import com.bms.receivable.domain.ArBillLog;
|
||||
|
||||
public interface ArBillLogMapper
|
||||
{
|
||||
+5
-5
@@ -1,14 +1,14 @@
|
||||
package com.bms.ar.mapper;
|
||||
package com.bms.receivable.mapper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.bms.ar.security.ArBillRowScope;
|
||||
import com.bms.receivable.security.ArBillRowScope;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.ar.domain.ArBill;
|
||||
import com.bms.ar.domain.vo.ArBillQuery;
|
||||
import com.bms.ar.domain.vo.ArBillSummary;
|
||||
import com.bms.receivable.domain.ArBill;
|
||||
import com.bms.receivable.domain.vo.ArBillQuery;
|
||||
import com.bms.receivable.domain.vo.ArBillSummary;
|
||||
|
||||
public interface ArBillMapper {
|
||||
List<ArBill> selectArBillList(@Param("query") ArBillQuery query, @Param("scope") ArBillRowScope scope);
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package com.bms.ar.mapper;
|
||||
package com.bms.receivable.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.ar.security.ArBillRowScope;
|
||||
import com.bms.receivable.security.ArBillRowScope;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerOption;
|
||||
|
||||
public interface ArBillScopeMapper {
|
||||
+6
-6
@@ -1,13 +1,13 @@
|
||||
package com.bms.ar.mapper;
|
||||
package com.bms.receivable.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.ar.profit.ArCommissionRate;
|
||||
import com.bms.ar.profit.ArWriteoffRate;
|
||||
import com.bms.ar.profit.ArCommissionResult;
|
||||
import com.bms.ar.profit.ArCommissionSummary;
|
||||
import com.bms.ar.profit.ArProfitScope;
|
||||
import com.bms.receivable.profit.ArCommissionRate;
|
||||
import com.bms.receivable.profit.ArWriteoffRate;
|
||||
import com.bms.receivable.profit.ArCommissionResult;
|
||||
import com.bms.receivable.profit.ArCommissionSummary;
|
||||
import com.bms.receivable.profit.ArProfitScope;
|
||||
|
||||
public interface ArCommissionMapper
|
||||
{
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package com.bms.ar.mapper;
|
||||
package com.bms.receivable.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.ar.domain.ArExportTemplate;
|
||||
import com.bms.receivable.domain.ArExportTemplate;
|
||||
|
||||
public interface ArExportTemplateMapper {
|
||||
/**
|
||||
+8
-8
@@ -1,14 +1,14 @@
|
||||
package com.bms.ar.mapper;
|
||||
package com.bms.receivable.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.bms.ar.profit.ArProfitQuery;
|
||||
import com.bms.ar.profit.ArProfitRow;
|
||||
import com.bms.ar.profit.ArProfitScope;
|
||||
import com.bms.ar.profit.ArProfitSummary;
|
||||
import com.bms.ar.profit.ArProfitSalesOption;
|
||||
import com.bms.ar.domain.ArBillDetailFee;
|
||||
import com.bms.ar.domain.ArBillDetail;
|
||||
import com.bms.receivable.profit.ArProfitQuery;
|
||||
import com.bms.receivable.profit.ArProfitRow;
|
||||
import com.bms.receivable.profit.ArProfitScope;
|
||||
import com.bms.receivable.profit.ArProfitSummary;
|
||||
import com.bms.receivable.profit.ArProfitSalesOption;
|
||||
import com.bms.receivable.domain.ArBillDetailFee;
|
||||
import com.bms.receivable.domain.ArBillDetail;
|
||||
|
||||
public interface ArProfitMapper
|
||||
{
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
+8
-8
@@ -1,17 +1,17 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.bms.ar.domain.ArBalanceWriteoff;
|
||||
import com.bms.ar.domain.ArBill;
|
||||
import com.bms.ar.mapper.ArCommissionMapper;
|
||||
import com.bms.ar.mapper.ArBillMapper;
|
||||
import com.bms.ar.enums.ArBillStatus;
|
||||
import com.bms.ar.enums.ArBillGenerationStatus;
|
||||
import com.bms.ar.security.ArBillRoleKeys;
|
||||
import com.bms.receivable.domain.ArBalanceWriteoff;
|
||||
import com.bms.receivable.domain.ArBill;
|
||||
import com.bms.receivable.mapper.ArCommissionMapper;
|
||||
import com.bms.receivable.mapper.ArBillMapper;
|
||||
import com.bms.receivable.enums.ArBillStatus;
|
||||
import com.bms.receivable.enums.ArBillGenerationStatus;
|
||||
import com.bms.receivable.security.ArBillRoleKeys;
|
||||
import com.bms.common.exception.ServiceException;
|
||||
import com.bms.common.core.domain.entity.SysUser;
|
||||
import com.bms.common.utils.SecurityUtils;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
/** 后端构造的数据范围,不接收前端传入的权限参数。 */
|
||||
public record ArProfitScope(boolean all, boolean self, boolean department, Long userId, Long deptId)
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Set;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.bms.ar.security.ArBillRoleKeys;
|
||||
import com.bms.receivable.security.ArBillRoleKeys;
|
||||
import com.bms.common.constant.Constants;
|
||||
import com.bms.common.core.domain.entity.SysRole;
|
||||
import com.bms.common.core.domain.entity.SysUser;
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bms.ar.mapper.ArProfitMapper;
|
||||
import com.bms.ar.domain.ArBillDetailFee;
|
||||
import com.bms.ar.domain.ArBillDetail;
|
||||
import com.bms.receivable.mapper.ArProfitMapper;
|
||||
import com.bms.receivable.domain.ArBillDetailFee;
|
||||
import com.bms.receivable.domain.ArBillDetail;
|
||||
|
||||
@Service
|
||||
public class ArProfitService
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.profit;
|
||||
package com.bms.receivable.profit;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.security;
|
||||
package com.bms.receivable.security;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.security;
|
||||
package com.bms.receivable.security;
|
||||
|
||||
/** 仅由后端构造,不能绑定到 HTTP 查询对象。 */
|
||||
public final class ArBillRowScope {
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.security;
|
||||
package com.bms.receivable.security;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -7,7 +7,7 @@ import java.util.function.Supplier;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.bms.ar.mapper.ArBillScopeMapper;
|
||||
import com.bms.receivable.mapper.ArBillScopeMapper;
|
||||
import com.bms.common.constant.Constants;
|
||||
import com.bms.common.core.domain.entity.SysRole;
|
||||
import com.bms.common.core.domain.entity.SysUser;
|
||||
+3
-3
@@ -1,8 +1,8 @@
|
||||
package com.bms.ar.service;
|
||||
package com.bms.receivable.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.bms.ar.domain.ArBalanceWriteoff;
|
||||
import com.bms.ar.domain.ArBill;
|
||||
import com.bms.receivable.domain.ArBalanceWriteoff;
|
||||
import com.bms.receivable.domain.ArBill;
|
||||
|
||||
/**
|
||||
* 应收账单余额核销 Service接口
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
package com.bms.ar.service;
|
||||
package com.bms.receivable.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bms.ar.domain.ArBillLog;
|
||||
import com.bms.ar.enums.ArLogObjectType;
|
||||
import com.bms.ar.enums.ArLogOperationType;
|
||||
import com.bms.receivable.domain.ArBillLog;
|
||||
import com.bms.receivable.enums.ArLogObjectType;
|
||||
import com.bms.receivable.enums.ArLogOperationType;
|
||||
|
||||
public interface IArBillLogService {
|
||||
List<ArBillLog> selectLogList(ArBillLog query);
|
||||
+13
-13
@@ -1,20 +1,20 @@
|
||||
package com.bms.ar.service;
|
||||
package com.bms.receivable.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import com.bms.ar.domain.ArBill;
|
||||
import com.bms.ar.domain.ArBankAccount;
|
||||
import com.bms.ar.domain.ArBillDetail;
|
||||
import com.bms.ar.domain.ArBillDetailFee;
|
||||
import com.bms.ar.domain.ArBillExport;
|
||||
import com.bms.ar.domain.ArBillGenerateTask;
|
||||
import com.bms.ar.domain.ArBillLog;
|
||||
import com.bms.ar.domain.vo.ArBillGenerateRequest;
|
||||
import com.bms.ar.domain.vo.ArBillGenerateQuery;
|
||||
import com.bms.ar.domain.vo.ArBillActionRequest;
|
||||
import com.bms.ar.domain.vo.ArBillQuery;
|
||||
import com.bms.ar.domain.vo.ArBillSummary;
|
||||
import com.bms.receivable.domain.ArBill;
|
||||
import com.bms.receivable.domain.ArBankAccount;
|
||||
import com.bms.receivable.domain.ArBillDetail;
|
||||
import com.bms.receivable.domain.ArBillDetailFee;
|
||||
import com.bms.receivable.domain.ArBillExport;
|
||||
import com.bms.receivable.domain.ArBillGenerateTask;
|
||||
import com.bms.receivable.domain.ArBillLog;
|
||||
import com.bms.receivable.domain.vo.ArBillGenerateRequest;
|
||||
import com.bms.receivable.domain.vo.ArBillGenerateQuery;
|
||||
import com.bms.receivable.domain.vo.ArBillActionRequest;
|
||||
import com.bms.receivable.domain.vo.ArBillQuery;
|
||||
import com.bms.receivable.domain.vo.ArBillSummary;
|
||||
import com.bms.price.domain.PrcOrderBill;
|
||||
|
||||
/**
|
||||
+16
-16
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.service.impl;
|
||||
package com.bms.receivable.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
@@ -12,21 +12,21 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
import com.bms.ar.domain.ArBalanceWriteoff;
|
||||
import com.bms.ar.domain.ArBill;
|
||||
import com.bms.ar.domain.ArBillLog;
|
||||
import com.bms.ar.enums.ArBalanceWriteoffStatus;
|
||||
import com.bms.ar.enums.ArBillStatus;
|
||||
import com.bms.ar.enums.ArLogObjectType;
|
||||
import com.bms.ar.enums.ArLogOperationSource;
|
||||
import com.bms.ar.enums.ArLogOperationType;
|
||||
import com.bms.ar.enums.ArLogResult;
|
||||
import com.bms.ar.mapper.ArBalanceWriteoffMapper;
|
||||
import com.bms.ar.mapper.ArBillMapper;
|
||||
import com.bms.ar.security.ArBillScopeResolver;
|
||||
import com.bms.ar.profit.ArCommissionService;
|
||||
import com.bms.ar.service.IArBalanceWriteoffService;
|
||||
import com.bms.ar.service.IArBillLogService;
|
||||
import com.bms.receivable.domain.ArBalanceWriteoff;
|
||||
import com.bms.receivable.domain.ArBill;
|
||||
import com.bms.receivable.domain.ArBillLog;
|
||||
import com.bms.receivable.enums.ArBalanceWriteoffStatus;
|
||||
import com.bms.receivable.enums.ArBillStatus;
|
||||
import com.bms.receivable.enums.ArLogObjectType;
|
||||
import com.bms.receivable.enums.ArLogOperationSource;
|
||||
import com.bms.receivable.enums.ArLogOperationType;
|
||||
import com.bms.receivable.enums.ArLogResult;
|
||||
import com.bms.receivable.mapper.ArBalanceWriteoffMapper;
|
||||
import com.bms.receivable.mapper.ArBillMapper;
|
||||
import com.bms.receivable.security.ArBillScopeResolver;
|
||||
import com.bms.receivable.profit.ArCommissionService;
|
||||
import com.bms.receivable.service.IArBalanceWriteoffService;
|
||||
import com.bms.receivable.service.IArBillLogService;
|
||||
import com.bms.common.exception.ServiceException;
|
||||
import com.bms.common.utils.SecurityUtils;
|
||||
import com.bms.customer.customermoney.domain.CustomerReceipt;
|
||||
+9
-9
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.service.impl;
|
||||
package com.bms.receivable.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -6,14 +6,14 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.bms.ar.domain.ArBillLog;
|
||||
import com.bms.ar.enums.ArLogObjectType;
|
||||
import com.bms.ar.enums.ArLogOperationSource;
|
||||
import com.bms.ar.enums.ArLogOperationType;
|
||||
import com.bms.ar.enums.ArLogResult;
|
||||
import com.bms.ar.mapper.ArBillLogMapper;
|
||||
import com.bms.ar.security.ArBillScopeResolver;
|
||||
import com.bms.ar.service.IArBillLogService;
|
||||
import com.bms.receivable.domain.ArBillLog;
|
||||
import com.bms.receivable.enums.ArLogObjectType;
|
||||
import com.bms.receivable.enums.ArLogOperationSource;
|
||||
import com.bms.receivable.enums.ArLogOperationType;
|
||||
import com.bms.receivable.enums.ArLogResult;
|
||||
import com.bms.receivable.mapper.ArBillLogMapper;
|
||||
import com.bms.receivable.security.ArBillScopeResolver;
|
||||
import com.bms.receivable.service.IArBillLogService;
|
||||
import com.bms.common.utils.uuid.IdUtils;
|
||||
|
||||
@Service
|
||||
+41
-40
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.service.impl;
|
||||
package com.bms.receivable.service.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -44,49 +44,49 @@ import org.springframework.transaction.support.TransactionTemplate;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.bms.ar.domain.ArBill;
|
||||
import com.bms.ar.domain.ArBankAccount;
|
||||
import com.bms.ar.domain.ArBillDetail;
|
||||
import com.bms.ar.domain.ArBillDetailFee;
|
||||
import com.bms.ar.domain.ArBillExport;
|
||||
import com.bms.ar.domain.ArBillGenerateTask;
|
||||
import com.bms.ar.domain.ArBillLog;
|
||||
import com.bms.ar.domain.ArExportTemplate;
|
||||
import com.bms.ar.event.ArBillExportTaskEvent;
|
||||
import com.bms.ar.event.ArBillGenerateTaskEvent;
|
||||
import com.bms.ar.enums.ArBillGenerateTaskStatus;
|
||||
import com.bms.ar.enums.ArBillDateType;
|
||||
import com.bms.ar.enums.ArBillGenerationStatus;
|
||||
import com.bms.ar.enums.ArBillSelectionMode;
|
||||
import com.bms.ar.enums.ArBillStatus;
|
||||
import com.bms.ar.enums.ArExportStatus;
|
||||
import com.bms.ar.enums.ArIncomeBillFeeStatus;
|
||||
import com.bms.ar.enums.ArLogObjectType;
|
||||
import com.bms.ar.enums.ArLogOperationSource;
|
||||
import com.bms.ar.enums.ArLogOperationType;
|
||||
import com.bms.ar.enums.ArLogResult;
|
||||
import com.bms.ar.enums.ArOrderBillStatus;
|
||||
import com.bms.ar.mapper.ArBillDetailFeeMapper;
|
||||
import com.bms.ar.mapper.ArBillDetailMapper;
|
||||
import com.bms.ar.mapper.ArBillExportMapper;
|
||||
import com.bms.ar.mapper.ArBillLogMapper;
|
||||
import com.bms.ar.mapper.ArBillMapper;
|
||||
import com.bms.ar.security.ArBillScopeResolver;
|
||||
import com.bms.receivable.domain.ArBill;
|
||||
import com.bms.receivable.domain.ArBankAccount;
|
||||
import com.bms.receivable.domain.ArBillDetail;
|
||||
import com.bms.receivable.domain.ArBillDetailFee;
|
||||
import com.bms.receivable.domain.ArBillExport;
|
||||
import com.bms.receivable.domain.ArBillGenerateTask;
|
||||
import com.bms.receivable.domain.ArBillLog;
|
||||
import com.bms.receivable.domain.ArExportTemplate;
|
||||
import com.bms.receivable.event.ArBillExportTaskEvent;
|
||||
import com.bms.receivable.event.ArBillGenerateTaskEvent;
|
||||
import com.bms.receivable.enums.ArBillGenerateTaskStatus;
|
||||
import com.bms.receivable.enums.ArBillDateType;
|
||||
import com.bms.receivable.enums.ArBillGenerationStatus;
|
||||
import com.bms.receivable.enums.ArBillSelectionMode;
|
||||
import com.bms.receivable.enums.ArBillStatus;
|
||||
import com.bms.receivable.enums.ArExportStatus;
|
||||
import com.bms.receivable.enums.ArIncomeBillFeeStatus;
|
||||
import com.bms.receivable.enums.ArLogObjectType;
|
||||
import com.bms.receivable.enums.ArLogOperationSource;
|
||||
import com.bms.receivable.enums.ArLogOperationType;
|
||||
import com.bms.receivable.enums.ArLogResult;
|
||||
import com.bms.receivable.enums.ArOrderBillStatus;
|
||||
import com.bms.receivable.mapper.ArBillDetailFeeMapper;
|
||||
import com.bms.receivable.mapper.ArBillDetailMapper;
|
||||
import com.bms.receivable.mapper.ArBillExportMapper;
|
||||
import com.bms.receivable.mapper.ArBillLogMapper;
|
||||
import com.bms.receivable.mapper.ArBillMapper;
|
||||
import com.bms.receivable.security.ArBillScopeResolver;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomerOption;
|
||||
import com.bms.customer.customerinfo.domain.BmsCustomer;
|
||||
import com.bms.customer.customerinfo.mapper.BmsCustomerMapper;
|
||||
import com.bms.common.core.domain.entity.SysUser;
|
||||
import com.bms.system.mapper.SysUserMapper;
|
||||
import com.bms.ar.mapper.ArBillGenerateTaskMapper;
|
||||
import com.bms.ar.mapper.ArBankAccountMapper;
|
||||
import com.bms.ar.mapper.ArExportTemplateMapper;
|
||||
import com.bms.ar.service.IArBillLogService;
|
||||
import com.bms.ar.service.IArBillService;
|
||||
import com.bms.ar.domain.vo.ArBillActionRequest;
|
||||
import com.bms.ar.domain.vo.ArBillGenerateQuery;
|
||||
import com.bms.ar.domain.vo.ArBillGenerateRequest;
|
||||
import com.bms.ar.domain.vo.ArBillQuery;
|
||||
import com.bms.ar.domain.vo.ArBillSummary;
|
||||
import com.bms.receivable.mapper.ArBillGenerateTaskMapper;
|
||||
import com.bms.receivable.mapper.ArBankAccountMapper;
|
||||
import com.bms.receivable.mapper.ArExportTemplateMapper;
|
||||
import com.bms.receivable.service.IArBillLogService;
|
||||
import com.bms.receivable.service.IArBillService;
|
||||
import com.bms.receivable.domain.vo.ArBillActionRequest;
|
||||
import com.bms.receivable.domain.vo.ArBillGenerateQuery;
|
||||
import com.bms.receivable.domain.vo.ArBillGenerateRequest;
|
||||
import com.bms.receivable.domain.vo.ArBillQuery;
|
||||
import com.bms.receivable.domain.vo.ArBillSummary;
|
||||
import com.bms.common.config.BmsConfig;
|
||||
import com.bms.common.exception.ServiceException;
|
||||
import com.bms.common.utils.DateUtils;
|
||||
@@ -116,7 +116,7 @@ public class ArBillServiceImpl implements IArBillService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ArBillServiceImpl.class);
|
||||
private static final String EXPORT_TEMPLATE_BUSINESS_TYPE = "AR_BILL";
|
||||
private static final String EXPORT_TEMPLATE_RESOURCE = "templates/ar/ar_bill_template.xlsx";
|
||||
private static final String EXPORT_TEMPLATE_RESOURCE = "templates/receivable/ar_bill_template.xlsx";
|
||||
/**
|
||||
* Excel 行号从 1 开始;模板第 4 行是表头,明细从第 5 行开始写入。
|
||||
*/
|
||||
@@ -1748,6 +1748,7 @@ public class ArBillServiceImpl implements IArBillService {
|
||||
}
|
||||
return switch (status) {
|
||||
case SUCCESS -> "";
|
||||
case NOT_BILLED -> "未计费";
|
||||
case PRODUCT -> "销售价未匹配产品";
|
||||
case COUNTRY -> "销售价未匹配国家";
|
||||
case WEIGHT -> "销售价未匹配重量段";
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.task;
|
||||
package com.bms.receivable.task;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -12,8 +12,8 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.event.TransactionPhase;
|
||||
import org.springframework.transaction.event.TransactionalEventListener;
|
||||
import com.bms.ar.event.ArBillExportTaskEvent;
|
||||
import com.bms.ar.service.IArBillService;
|
||||
import com.bms.receivable.event.ArBillExportTaskEvent;
|
||||
import com.bms.receivable.service.IArBillService;
|
||||
|
||||
/**
|
||||
* 应收账单导出异步任务执行器。
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
package com.bms.ar.task;
|
||||
package com.bms.receivable.task;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -12,9 +12,9 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.event.TransactionPhase;
|
||||
import org.springframework.transaction.event.TransactionalEventListener;
|
||||
import com.bms.ar.domain.ArBillGenerateTask;
|
||||
import com.bms.ar.event.ArBillGenerateTaskEvent;
|
||||
import com.bms.ar.service.IArBillService;
|
||||
import com.bms.receivable.domain.ArBillGenerateTask;
|
||||
import com.bms.receivable.event.ArBillGenerateTaskEvent;
|
||||
import com.bms.receivable.service.IArBillService;
|
||||
|
||||
/**
|
||||
* 应收账单异步生成任务调度器。
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bms.ar.mapper.ArBalanceWriteoffMapper">
|
||||
<mapper namespace="com.bms.receivable.mapper.ArBalanceWriteoffMapper">
|
||||
|
||||
<resultMap id="ArBalanceWriteoffResult" type="ArBalanceWriteoff">
|
||||
<id property="writeoffId" column="writeoff_id"/>
|
||||
@@ -93,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="query.params != null and query.params.endTime != null and query.params.endTime != ''">
|
||||
and date_format(w.writeoff_date,'%y%m%d') <= date_format(#{query.params.endTime},'%y%m%d')
|
||||
</if>
|
||||
<include refid="com.bms.ar.mapper.ArBillScopeMapper.billScope"/>
|
||||
<include refid="com.bms.receivable.mapper.ArBillScopeMapper.billScope"/>
|
||||
</where>
|
||||
order by w.create_time desc, w.writeoff_id desc
|
||||
</select>
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bms.ar.mapper.ArBankAccountMapper">
|
||||
<mapper namespace="com.bms.receivable.mapper.ArBankAccountMapper">
|
||||
<resultMap id="ArBankAccountResult" type="ArBankAccount">
|
||||
<id property="bankAccountId" column="bank_account_id"/>
|
||||
<result property="accountName" column="account_name"/>
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bms.ar.mapper.ArBillDetailFeeMapper">
|
||||
<mapper namespace="com.bms.receivable.mapper.ArBillDetailFeeMapper">
|
||||
<!-- 账单明细费用项读写;批量查询仅接收当前明细批次的 ID。 -->
|
||||
<resultMap id="ArBillDetailFeeResult" type="ArBillDetailFee">
|
||||
<id property="detailFeeId" column="detail_fee_id"/>
|
||||
@@ -102,7 +102,7 @@
|
||||
inner join ar_bill_detail d on d.detail_id = f.detail_id
|
||||
where d.ar_bill_id = #{arBillId}
|
||||
and f.detail_id = #{detailId}
|
||||
AND EXISTS (SELECT 1 FROM ar_bill b WHERE b.ar_bill_id = d.ar_bill_id <include refid="com.bms.ar.mapper.ArBillScopeMapper.billScope"/>)
|
||||
AND EXISTS (SELECT 1 FROM ar_bill b WHERE b.ar_bill_id = d.ar_bill_id <include refid="com.bms.receivable.mapper.ArBillScopeMapper.billScope"/>)
|
||||
order by f.fee_no, f.detail_fee_id
|
||||
</select>
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bms.ar.mapper.ArBillDetailMapper">
|
||||
<mapper namespace="com.bms.receivable.mapper.ArBillDetailMapper">
|
||||
<!-- 账单明细读写;详情页分页查询,导出任务按游标批量查询。 -->
|
||||
<resultMap id="ArBillDetailResult" type="ArBillDetail">
|
||||
<id property="detailId" column="detail_id"/>
|
||||
@@ -51,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
product_code, product_name, goods_description, country_code, country_name, dest_postcode,
|
||||
actual_weight, receive_weight, volume_weight, charge_weight, freight_rate, registration_fee, pkg_length, pkg_width, pkg_height,
|
||||
currency, total_amount, product_amount, redline_amount, billing_fail_status, remark, create_by, create_time
|
||||
from ar_bill_detail where ar_bill_id = #{arBillId} AND EXISTS (SELECT 1 FROM ar_bill b WHERE b.ar_bill_id = ar_bill_detail.ar_bill_id <include refid="com.bms.ar.mapper.ArBillScopeMapper.billScope"/>)
|
||||
from ar_bill_detail where ar_bill_id = #{arBillId} AND EXISTS (SELECT 1 FROM ar_bill b WHERE b.ar_bill_id = ar_bill_detail.ar_bill_id <include refid="com.bms.receivable.mapper.ArBillScopeMapper.billScope"/>)
|
||||
order by detail_no
|
||||
</select>
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bms.ar.mapper.ArBillExportMapper">
|
||||
<mapper namespace="com.bms.receivable.mapper.ArBillExportMapper">
|
||||
<!-- 导出任务和历史记录;PROCESSING/SUCCESS/FAILED 由异步执行器更新。 -->
|
||||
<resultMap id="ArBillExportResult" type="ArBillExport">
|
||||
<id property="exportId" column="export_id"/>
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bms.ar.mapper.ArBillGenerateTaskMapper">
|
||||
<mapper namespace="com.bms.receivable.mapper.ArBillGenerateTaskMapper">
|
||||
<!-- 生成任务表是异步任务的持久化队列;状态更新均带前置状态条件,保证多节点抢占幂等。 -->
|
||||
<resultMap id="ArBillGenerateTaskResult" type="ArBillGenerateTask">
|
||||
<id property="taskId" column="task_id"/>
|
||||
@@ -74,7 +74,7 @@
|
||||
where create_by = #{createBy}
|
||||
and status in ('WAITING', 'RUNNING', 'CANCEL_REQUESTED')
|
||||
AND EXISTS (SELECT 1 FROM ar_bill b WHERE b.ar_bill_id = ar_bill_generate_task.ar_bill_id
|
||||
<include refid="com.bms.ar.mapper.ArBillScopeMapper.billScope"/>)
|
||||
<include refid="com.bms.receivable.mapper.ArBillScopeMapper.billScope"/>)
|
||||
order by create_time desc, task_id desc
|
||||
</select>
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bms.ar.mapper.ArBillLogMapper">
|
||||
<mapper namespace="com.bms.receivable.mapper.ArBillLogMapper">
|
||||
<resultMap id="ArBillLogResult" type="ArBillLog">
|
||||
<id property="logId" column="log_id"/>
|
||||
<result property="arBillId" column="ar_bill_id"/>
|
||||
@@ -51,7 +51,7 @@
|
||||
</if>
|
||||
<if test="query.requestId != null and query.requestId != ''">and l.request_id = #{query.requestId}</if>
|
||||
<if test="query.result != null and query.result != ''">and l.result = #{query.result}</if>
|
||||
<include refid="com.bms.ar.mapper.ArBillScopeMapper.billScope"/>
|
||||
<include refid="com.bms.receivable.mapper.ArBillScopeMapper.billScope"/>
|
||||
</where>
|
||||
order by l.create_time desc, l.log_id desc
|
||||
</select>
|
||||
+5
-5
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bms.ar.mapper.ArBillMapper">
|
||||
<mapper namespace="com.bms.receivable.mapper.ArBillMapper">
|
||||
<!-- 账单头查询、状态流转和金额/生成进度更新。带 ForUpdate 的查询用于核销并发控制。 -->
|
||||
<resultMap id="ArBillResult" type="ArBill">
|
||||
<id property="arBillId" column="ar_bill_id"/>
|
||||
@@ -39,7 +39,7 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ArBillSummaryResult" type="com.bms.ar.domain.vo.ArBillSummary">
|
||||
<resultMap id="ArBillSummaryResult" type="com.bms.receivable.domain.vo.ArBillSummary">
|
||||
<result property="totalAmount" column="total_amount"/>
|
||||
<result property="writtenOffAmount" column="written_off_amount"/>
|
||||
<result property="unwrittenAmount" column="unwritten_amount"/>
|
||||
@@ -106,7 +106,7 @@
|
||||
<if test="query.billDateStart != null">and bill_date >= #{query.billDateStart}</if>
|
||||
<if test="query.billDateEnd != null">and bill_date <= #{query.billDateEnd}</if>
|
||||
<if test="query.billPeriodEnd != null">and bill_period_end = #{query.billPeriodEnd}</if>
|
||||
<include refid="com.bms.ar.mapper.ArBillScopeMapper.billScope"/>
|
||||
<include refid="com.bms.receivable.mapper.ArBillScopeMapper.billScope"/>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
|
||||
<select id="selectArBillByIdScoped" resultMap="ArBillResult">
|
||||
select b.* from ar_bill b where b.ar_bill_id = #{arBillId}
|
||||
<include refid="com.bms.ar.mapper.ArBillScopeMapper.billScope"/>
|
||||
<include refid="com.bms.receivable.mapper.ArBillScopeMapper.billScope"/>
|
||||
</select>
|
||||
|
||||
<select id="selectArBillByBillNo" parameterType="string" resultMap="ArBillResult">
|
||||
@@ -172,7 +172,7 @@
|
||||
and status in ('CONFIRMED', 'PARTIAL_WRITTEN_OFF')
|
||||
and (generation_status is null or generation_status = 'READY')
|
||||
and unwritten_amount > 0
|
||||
<include refid="com.bms.ar.mapper.ArBillScopeMapper.billScope"/>
|
||||
<include refid="com.bms.receivable.mapper.ArBillScopeMapper.billScope"/>
|
||||
order by bill_date asc, ar_bill_id asc
|
||||
</select>
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
<?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="com.bms.ar.mapper.ArBillScopeMapper">
|
||||
<mapper namespace="com.bms.receivable.mapper.ArBillScopeMapper">
|
||||
<resultMap id="CustomerOption" type="com.bms.customer.customerinfo.domain.BmsCustomerOption">
|
||||
<id property="customerId" column="customer_id"/>
|
||||
<result property="customerCode" column="customer_code"/>
|
||||
@@ -35,7 +35,7 @@
|
||||
<when test="scope != null and scope.all"/>
|
||||
<otherwise>
|
||||
AND EXISTS (SELECT 1 FROM ctr_customer c WHERE c.customer_id = b.customer_id
|
||||
<include refid="com.bms.ar.mapper.ArBillScopeMapper.customerScope"/>
|
||||
<include refid="com.bms.receivable.mapper.ArBillScopeMapper.customerScope"/>
|
||||
)
|
||||
</otherwise>
|
||||
</choose>
|
||||
+8
-8
@@ -1,13 +1,13 @@
|
||||
<?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="com.bms.ar.mapper.ArCommissionMapper">
|
||||
<resultMap id="rate" type="com.bms.ar.profit.ArCommissionRate">
|
||||
<mapper namespace="com.bms.receivable.mapper.ArCommissionMapper">
|
||||
<resultMap id="rate" type="com.bms.receivable.profit.ArCommissionRate">
|
||||
<id property="rateId" column="rate_id"/><result property="salesUserId" column="sales_user_id"/>
|
||||
<result property="salesUserCode" column="sales_user_code"/><result property="salesUserName" column="sales_user_name"/>
|
||||
<result property="rate" column="rate"/><result property="effectiveAt" column="effective_at"/>
|
||||
<result property="createBy" column="create_by"/><result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
<resultMap id="missingRate" type="com.bms.ar.profit.ArWriteoffRate">
|
||||
<resultMap id="missingRate" type="com.bms.receivable.profit.ArWriteoffRate">
|
||||
<id property="writeoffId" column="writeoff_id"/><result property="arBillId" column="ar_bill_id"/>
|
||||
<result property="billNo" column="bill_no"/><result property="customerName" column="customer_name"/>
|
||||
<result property="salesUserId" column="sales_user_id"/><result property="salesUserName" column="sales_user_name"/>
|
||||
@@ -16,7 +16,7 @@
|
||||
<result property="status" column="status"/><result property="confirmedBy" column="confirmed_by"/>
|
||||
<result property="confirmedTime" column="confirmed_time"/><result property="remark" column="confirm_remark"/>
|
||||
</resultMap>
|
||||
<resultMap id="commissionResult" type="com.bms.ar.profit.ArCommissionResult">
|
||||
<resultMap id="commissionResult" type="com.bms.receivable.profit.ArCommissionResult">
|
||||
<id property="resultId" column="result_id"/><result property="arBillId" column="ar_bill_id"/>
|
||||
<result property="detailId" column="detail_id"/><result property="billNo" column="bill_no"/>
|
||||
<result property="orderNo" column="order_no"/><result property="salesUserName" column="sales_user_name"/>
|
||||
@@ -27,7 +27,7 @@
|
||||
<result property="salesUserId" column="sales_user_id"/><result property="weightedRate" column="weighted_rate"/>
|
||||
<result property="billAmount" column="bill_amount"/>
|
||||
</resultMap>
|
||||
<resultMap id="commissionSummary" type="com.bms.ar.profit.ArCommissionSummary">
|
||||
<resultMap id="commissionSummary" type="com.bms.receivable.profit.ArCommissionSummary">
|
||||
<result property="salesUserId" column="sales_user_id"/><result property="salesUserName" column="sales_user_name"/>
|
||||
<result property="currency" column="currency"/><result property="orderCount" column="order_count"/>
|
||||
<result property="pendingCount" column="pending_count"/><result property="commissionAmount" column="commission_amount"/>
|
||||
@@ -44,7 +44,7 @@
|
||||
where sales_user_id = #{salesUserId} and effective_at <= #{at}
|
||||
order by effective_at desc, rate_id desc limit 1 for update
|
||||
</select>
|
||||
<insert id="insertRate" parameterType="com.bms.ar.profit.ArCommissionRate" useGeneratedKeys="true" keyProperty="rateId">
|
||||
<insert id="insertRate" parameterType="com.bms.receivable.profit.ArCommissionRate" useGeneratedKeys="true" keyProperty="rateId">
|
||||
insert into ar_profit_commission_rate(sales_user_id, rate, effective_at, create_by, create_time, remark)
|
||||
values(#{salesUserId}, #{rate}, #{effectiveAt}, #{createBy}, sysdate(), #{remark})
|
||||
</insert>
|
||||
@@ -104,7 +104,7 @@
|
||||
<otherwise>and r.result_status != 'REVERSED' and b.status = 'WRITTEN_OFF' and b.generation_status = 'READY'</otherwise>
|
||||
</choose>
|
||||
<if test="billId != null">and r.ar_bill_id = #{billId}</if>
|
||||
<include refid="com.bms.ar.mapper.ArProfitMapper.scopeCondition"/>
|
||||
<include refid="com.bms.receivable.mapper.ArProfitMapper.scopeCondition"/>
|
||||
order by r.result_id desc
|
||||
</select>
|
||||
<select id="selectCommissionSummary" resultMap="commissionSummary">
|
||||
@@ -121,7 +121,7 @@
|
||||
from ar_profit_commission_result r join ar_bill b on b.ar_bill_id = r.ar_bill_id
|
||||
where r.result_status != 'REVERSED' and b.status = 'WRITTEN_OFF' and b.generation_status = 'READY'
|
||||
<if test="billId != null">and r.ar_bill_id = #{billId}</if>
|
||||
<include refid="com.bms.ar.mapper.ArProfitMapper.scopeCondition"/>
|
||||
<include refid="com.bms.receivable.mapper.ArProfitMapper.scopeCondition"/>
|
||||
group by r.sales_user_id, r.currency
|
||||
order by sales_user_name, r.currency
|
||||
</select>
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bms.ar.mapper.ArExportTemplateMapper">
|
||||
<mapper namespace="com.bms.receivable.mapper.ArExportTemplateMapper">
|
||||
<!-- 模板管理查询;导出提交时会把选中的模板版本快照到导出任务。 -->
|
||||
<resultMap id="ArExportTemplateResult" type="ArExportTemplate">
|
||||
<id property="templateId" column="template_id"/>
|
||||
+6
-6
@@ -1,7 +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="com.bms.ar.mapper.ArProfitMapper">
|
||||
<resultMap id="row" type="com.bms.ar.profit.ArProfitRow">
|
||||
<mapper namespace="com.bms.receivable.mapper.ArProfitMapper">
|
||||
<resultMap id="row" type="com.bms.receivable.profit.ArProfitRow">
|
||||
<id property="arBillId" column="ar_bill_id"/>
|
||||
<result property="billNo" column="bill_no"/><result property="billName" column="bill_name"/>
|
||||
<result property="billDate" column="bill_date"/>
|
||||
@@ -13,19 +13,19 @@
|
||||
<result property="salesGrossMarginRate" column="sales_gross_margin_rate"/>
|
||||
<result property="writtenOffAmount" column="written_off_amount"/><result property="unwrittenAmount" column="unwritten_amount"/>
|
||||
</resultMap>
|
||||
<resultMap id="summary" type="com.bms.ar.profit.ArProfitSummary">
|
||||
<resultMap id="summary" type="com.bms.receivable.profit.ArProfitSummary">
|
||||
<result property="currency" column="currency"/><result property="billCount" column="bill_count"/>
|
||||
<result property="salesAmount" column="sales_amount"/><result property="productAmount" column="product_amount"/>
|
||||
<result property="salesGrossProfit" column="sales_gross_profit"/><result property="salesGrossMarginRate" column="sales_gross_margin_rate"/>
|
||||
<result property="commissionAmount" column="commission_amount"/>
|
||||
<result property="writtenOffAmount" column="written_off_amount"/><result property="unwrittenAmount" column="unwritten_amount"/>
|
||||
</resultMap>
|
||||
<resultMap id="detail" type="com.bms.ar.domain.ArBillDetail">
|
||||
<resultMap id="detail" type="com.bms.receivable.domain.ArBillDetail">
|
||||
<id property="detailId" column="detail_id"/><result property="orderNo" column="order_no"/>
|
||||
<result property="productName" column="product_name"/><result property="currency" column="currency"/>
|
||||
<result property="totalAmount" column="total_amount"/>
|
||||
</resultMap>
|
||||
<resultMap id="fee" type="com.bms.ar.domain.ArBillDetailFee">
|
||||
<resultMap id="fee" type="com.bms.receivable.domain.ArBillDetailFee">
|
||||
<id property="detailFeeId" column="detail_fee_id"/><result property="detailId" column="detail_id"/>
|
||||
<result property="feeName" column="fee_name"/><result property="feeType" column="fee_type"/>
|
||||
<result property="amount" column="amount"/><result property="productAmount" column="product_amount"/>
|
||||
@@ -133,7 +133,7 @@
|
||||
) commission on commission.currency = t.currency
|
||||
group by t.currency order by t.currency
|
||||
</select>
|
||||
<select id="selectSalesOptions" resultType="com.bms.ar.profit.ArProfitSalesOption">
|
||||
<select id="selectSalesOptions" resultType="com.bms.receivable.profit.ArProfitSalesOption">
|
||||
select u.user_id as userId, u.nick_name as name, u.user_name as code
|
||||
from sys_user u
|
||||
where u.del_flag = '0' and u.status = '0'
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user