Commit 9ca7c90d by 程裕兵

feat:sync settle

parent 9c43ba1b
......@@ -8,9 +8,12 @@ import com.jiejing.filecenter.api.authority.vo.SignatureVO;
import com.jiejing.filecenter.api.common.enums.AccessTypeEnum;
import com.jiejing.filecenter.api.common.util.UploadUtil;
import com.jiejing.filecenter.api.resource.ResourceApi;
import com.jiejing.fitness.finance.repository.service.StudioCashierRecordRpService;
import com.jiejing.fitness.finance.service.utils.FileUtils;
import com.jiejing.paycenter.api.merchant.MerchantQueryApi;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
......@@ -36,7 +39,8 @@ public class TestController {
private AuthorityApi authorityApi;
@PostMapping(value = "/private/test/upload")
public JsonResult<SignatureVO> upload(@RequestParam String url, @RequestParam Long tenantId) throws IOException {
public JsonResult<SignatureVO> upload(@RequestParam String url, @RequestParam Long tenantId)
throws IOException {
GetAuthorityRequest request = new GetAuthorityRequest();
request.setAccessTypeEnum(AccessTypeEnum.PRIVATE);
request.setBizCode("FINANCE_INFO");
......@@ -53,6 +57,17 @@ public class TestController {
return result;
}
@Resource
private StudioCashierRecordRpService studioCashierRecordRpService;
@PostMapping(value = "/private/test/sumMerchantPaySuccessGroupByStudioId")
public JsonResult<Map<Long, BigDecimal>> sumMerchantPaySuccessGroupByStudioId(@RequestParam Long startDate, @RequestParam Long endDate,
@RequestParam Long merchantId) {
return JsonResult.success(studioCashierRecordRpService.sumMerchantPaySuccessGroupByStudioId(
merchantId, new Date(startDate), new Date(endDate)));
}
private String getSuffix(String url) {
String[] split = url.split("\\?");
String fileName = StringUtils.substringAfterLast(split[0], "/");
......
......@@ -38,7 +38,7 @@
<select id="sumMerchantPaySuccessGroupByStudioId"
resultType="com.jiejing.fitness.finance.repository.entity.StudioCashierRecord">
select studio_id, sum(actual_amount) as trans_amount
select studio_id, sum(actual_amount) as actual_amount
from studio_cashier_record
where merchant_id = #{merchantId}
and trans_state = 'PAY_SUCCESS'
......
......@@ -233,6 +233,7 @@ public class PayServiceImpl implements PayService {
// 对账
BigDecimal totalAmount = studioCashierRecordRpService.sumMerchantPaySuccess(apply.getMerchantId(),
startDate, endDate);
log.info("settle vo is {}, local total amount is {}", JSON.toJSONString(vo), totalAmount);
if (BigDecimal.ZERO.compareTo(vo.getTransAmount()) == 0
&& BigDecimal.ZERO.compareTo(totalAmount) == 0) {
// 没有交易
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment