diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtFpzhcxController.java b/dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtFpzhcxController.java index d9456436..3746f625 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtFpzhcxController.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtFpzhcxController.java @@ -3,6 +3,7 @@ package com.dxhy.extend.controller; import com.dxhy.common.aspect.SysLog; import com.dxhy.common.constant.CommonConstants; import com.dxhy.common.controller.AbstractController; +import com.dxhy.common.util.StringHelper; import com.dxhy.common.util.UserInfoUtil; import com.dxhy.common.utils.DateUtils; import com.dxhy.common.utils.R; @@ -115,6 +116,17 @@ public class ExtFpzhcxController extends AbstractController { } pramsMap.put("gfsh", gfshList); + String companyCode = (String) pramsMap.get("companyCode"); + if (org.apache.commons.lang3.StringUtils.isNotBlank(companyCode) && "99".equals(companyCode)){ + pramsMap.put("companyCodes",getUserInfo().getCompanyCodes()); + log.info("组织机构====>{}",pramsMap.get("companyCodes")); + } + if (StringUtils.isNotBlank(companyCode)){ + pramsMap.put("companyCode",companyCode); + }else { + return ResponseEntity.ok(R.error("所属组织不能为空")); + } + if (pramsMap.get("kpksrq") != null && !"".equals(pramsMap.get("kpksrq"))) { pramsMap.put("kpksrq", DateUtils.getMorning(DateUtils.strToDate(pramsMap.get("kpksrq").toString()))); } diff --git a/dxhy-extend/src/main/resources/mapper/ExtBbfpzhMapper.xml b/dxhy-extend/src/main/resources/mapper/ExtBbfpzhMapper.xml index a565392a..10146aa9 100644 --- a/dxhy-extend/src/main/resources/mapper/ExtBbfpzhMapper.xml +++ b/dxhy-extend/src/main/resources/mapper/ExtBbfpzhMapper.xml @@ -70,10 +70,28 @@ t.settlement_status,t.voucher_number,t.total_amount,t.sn_voucher_number,t.posting_time,t.image_id,t.account_period from t_dx_record_invoice t WHERE t.company = #{company} and t.invoice_date between #{kpksrq} and #{kpjsrq} - and t.gf_tax_no in - - #{item} - + + + and t.gf_tax_no in + + #{item} + + + + + and (t.comp_code in + + #{companyCode} + + or t.comp_code is null or t.comp_code = '' + ) + + + and t.comp_code = #{companyCode} + + + and (t.comp_code = '' or t.comp_code is null) + and t.bzdh = #{bzdh} @@ -331,10 +349,29 @@ select count(1) hjsl,sum(t.invoice_amount)hjje,sum(t.tax_amount)hjse from t_dx_record_invoice t where t.invoice_date between #{kpksrq} and #{kpjsrq} - and t.company = #{company} and t.gf_tax_no in - - #{item} - + and t.company = #{company} + + + and t.gf_tax_no in + + #{item} + + + + + and (t.comp_code in + + #{companyCode} + + or t.comp_code is null or t.comp_code = '' + ) + + + and t.comp_code = #{companyCode} + + + and (t.comp_code = '' or t.comp_code is null) + and t.invoice_status = #{invoiceStatus}