更新对文件内容的判断

This commit is contained in:
panshuling321 2022-03-28 17:17:35 +08:00
parent 3e035dfcd9
commit 3abcf2fd0b
7 changed files with 31 additions and 8 deletions

View File

@ -38,13 +38,16 @@ public class CommonController extends BaseController {
return AjaxResult.success(commonService.ossUpload(domain)); return AjaxResult.success(commonService.ossUpload(domain));
} }
@Log(title = "上传对账单(文件方式)", businessType = BusinessType.INSERT) @Log(title = "上传对账单(文件方式)", businessType = BusinessType.INSERT)
@PostMapping("/file/upload") @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){ if (file ==null || type < 1){
return AjaxResult.error("文件或者对账类型为空"); 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") @GetMapping("/file/getPage")

View File

@ -11,7 +11,7 @@ public interface CommonService {
XhpcTradebillUploadRecordDomain ossUpload(XhpcTradebillUploadRecordDomain domain) throws Exception; 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<XhpcTradebillUploadRecordDomain> getFilePage(Map<String, Object> params); List<XhpcTradebillUploadRecordDomain> getFilePage(Map<String, Object> params);
} }

View File

@ -117,7 +117,7 @@ public class CommonServiceImpl implements CommonService {
@Override @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(); XhpcTradebillUploadRecordDomain domain = new XhpcTradebillUploadRecordDomain();
// 创建OSSClient实例 // 创建OSSClient实例
@ -137,6 +137,7 @@ public class CommonServiceImpl implements CommonService {
domain.setStartTime(startTime); domain.setStartTime(startTime);
domain.setEndTime(endTime); domain.setEndTime(endTime);
domain.setType(type); domain.setType(type);
domain.setTenantId(tenantId);
return ossUpload(domain); return ossUpload(domain);
} }

View File

@ -332,7 +332,8 @@ public class PaymentBillServiceImpl implements PaymentBillService {
*/ */
public XhpcTradebillPaymentCheckRecordDomain computeTradebillData(XhpcTradebillPaymentCheckRecordDomain domain) { 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); domain.setStatus(2);
} else { } else {
domain.setStatus(0); domain.setStatus(0);

View File

@ -48,7 +48,13 @@
from xhpc_history_order o from xhpc_history_order o
left join xhpc_charging_station s on o.charging_station_id=s.charging_station_id 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 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}
<if test="startTime!=null and startTime != ''">
and o.create_time <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime !=''">
and o.create_time <![CDATA[ <= ]]> #{endTime}
</if>
</select> </select>
</mapper> </mapper>

View File

@ -54,7 +54,13 @@
create_time as 'createTime', create_time as 'createTime',
update_time as 'updateTime' update_time as 'updateTime'
from xhpc_recharge_order from xhpc_recharge_order
where tenant_id=#{tenantId} and create_time BETWEEN #{startTime} AND #{endTime} where tenant_id=#{tenantId}
<if test="startTime!=null and startTime != ''">
and create_time <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime !=''">
and create_time <![CDATA[ <= ]]> #{endTime}
</if>
</select> </select>
</mapper> </mapper>

View File

@ -50,6 +50,12 @@
create_time as 'createTime', create_time as 'createTime',
update_time as 'updateTime' update_time as 'updateTime'
from xhpc_refund_order from xhpc_refund_order
where tenant_id=#{tenantId} and create_time BETWEEN #{startTime} AND #{endTime} where tenant_id=#{tenantId}
<if test="startTime!=null and startTime != ''">
and create_time <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime !=''">
and create_time <![CDATA[ <= ]]> #{endTime}
</if>
</select> </select>
</mapper> </mapper>