diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/CommonController.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/CommonController.java index b5801d42..4699104a 100644 --- a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/CommonController.java +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/controller/CommonController.java @@ -38,13 +38,16 @@ public class CommonController extends BaseController { return AjaxResult.success(commonService.ossUpload(domain)); } + @Log(title = "上传对账单(文件方式)", businessType = BusinessType.INSERT) @PostMapping("/file/upload") - public AjaxResult fileUpload(MultipartFile file, int type, String startTime, String endTime) throws Exception { + public AjaxResult fileUpload(HttpServletRequest request, MultipartFile file, int type, String startTime, String endTime) throws Exception { if (file ==null || type < 1){ return AjaxResult.error("文件或者对账类型为空"); } - return AjaxResult.success(commonService.fileUpload(file, type, startTime, endTime)); + LoginUser logUser = logUserUtils.getLogUser(request); + + return AjaxResult.success(commonService.fileUpload(logUser.getTenantId(), file, type, startTime, endTime)); } @GetMapping("/file/getPage") diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/CommonService.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/CommonService.java index ae687413..2d1a86e6 100644 --- a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/CommonService.java +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/CommonService.java @@ -11,7 +11,7 @@ public interface CommonService { XhpcTradebillUploadRecordDomain ossUpload(XhpcTradebillUploadRecordDomain domain) throws Exception; - XhpcTradebillUploadRecordDomain fileUpload(MultipartFile file, int type, String startTime, String endTime) throws Exception; + XhpcTradebillUploadRecordDomain fileUpload(String tenantId, MultipartFile file, int type, String startTime, String endTime) throws Exception; List getFilePage(Map params); } diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/CommonServiceImpl.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/CommonServiceImpl.java index 9c4a7232..27c67cb5 100644 --- a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/CommonServiceImpl.java +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/CommonServiceImpl.java @@ -117,7 +117,7 @@ public class CommonServiceImpl implements CommonService { @Override - public XhpcTradebillUploadRecordDomain fileUpload(MultipartFile file, int type, String startTime, String endTime) throws Exception { + public XhpcTradebillUploadRecordDomain fileUpload(String tenantId, MultipartFile file, int type, String startTime, String endTime) throws Exception { XhpcTradebillUploadRecordDomain domain = new XhpcTradebillUploadRecordDomain(); // 创建OSSClient实例 @@ -137,6 +137,7 @@ public class CommonServiceImpl implements CommonService { domain.setStartTime(startTime); domain.setEndTime(endTime); domain.setType(type); + domain.setTenantId(tenantId); return ossUpload(domain); } diff --git a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/PaymentBillServiceImpl.java b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/PaymentBillServiceImpl.java index aaf9cd92..81b46d35 100644 --- a/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/PaymentBillServiceImpl.java +++ b/xhpc-modules/xhpc-tradebill/src/main/java/com/xhpc/tradebill/service/impl/PaymentBillServiceImpl.java @@ -332,7 +332,8 @@ public class PaymentBillServiceImpl implements PaymentBillService { */ public XhpcTradebillPaymentCheckRecordDomain computeTradebillData(XhpcTradebillPaymentCheckRecordDomain domain) { - if (domain.getPaymentAmount().equals(domain.getPlatformAmount())) { + if (domain.getPaymentAmount() !=null && domain.getPlatformAmount()!=null + && domain.getPaymentAmount().equals(domain.getPlatformAmount())) { domain.setStatus(2); } else { domain.setStatus(0); diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcHistoryOrderMapper.xml b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcHistoryOrderMapper.xml index 42a4693c..943966e5 100644 --- a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcHistoryOrderMapper.xml @@ -48,7 +48,13 @@ from xhpc_history_order o left join xhpc_charging_station s on o.charging_station_id=s.charging_station_id left join xhpc_charge_order c on o.charge_order_id=c.charge_order_id - where tenant_id=#{tenantId} and create_time BETWEEN #{startTime} AND #{endTime} + where o.tenant_id=#{tenantId} + + and o.create_time = ]]> #{startTime} + + + and o.create_time #{endTime} + \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRechargeOrderMapper.xml b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRechargeOrderMapper.xml index dc692cea..c9787151 100644 --- a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRechargeOrderMapper.xml +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRechargeOrderMapper.xml @@ -54,7 +54,13 @@ create_time as 'createTime', update_time as 'updateTime' from xhpc_recharge_order - where tenant_id=#{tenantId} and create_time BETWEEN #{startTime} AND #{endTime} + where tenant_id=#{tenantId} + + and create_time = ]]> #{startTime} + + + and create_time #{endTime} + \ No newline at end of file diff --git a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRefundOrderMapper.xml b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRefundOrderMapper.xml index aab2fc8b..7604985d 100644 --- a/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRefundOrderMapper.xml +++ b/xhpc-modules/xhpc-tradebill/src/main/resources/mapper/XhpcRefundOrderMapper.xml @@ -50,6 +50,12 @@ create_time as 'createTime', update_time as 'updateTime' from xhpc_refund_order - where tenant_id=#{tenantId} and create_time BETWEEN #{startTime} AND #{endTime} + where tenant_id=#{tenantId} + + and create_time = ]]> #{startTime} + + + and create_time #{endTime} + \ No newline at end of file