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..86b5b841 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,25 @@ public class ExtFpzhcxController extends AbstractController { } pramsMap.put("gfsh", gfshList); + boolean flag = checkList(gfshList); + + if (flag){ + pramsMap.put("sign","88"); + }else { + pramsMap.put("sign","99"); + } + + 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()))); } @@ -199,6 +219,25 @@ public class ExtFpzhcxController extends AbstractController { } + public boolean checkList(List list) { + boolean flag =false; + if (list == null || list.isEmpty()){ + flag = true; + }else { + String s = list.toString().replace("[","").replace("]",""); + if (StringHelper.isBlank(s)){ + flag = true; + } + if (StringHelper.isNotBlank(s) && s.contains(",")){ + String replace = s.replace(",", ""); + if (StringHelper.isBlank(replace)){ + flag = true; + } + } + } + return flag; + } + /** * 报表异常发票查询 * 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}