diff --git a/dxhy-base/src/main/java/com/dxhy/base/service/fpxxrz/BaseRzFpxxServiceImpl.java b/dxhy-base/src/main/java/com/dxhy/base/service/fpxxrz/BaseRzFpxxServiceImpl.java index 2f8895be..eaacf6a4 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/service/fpxxrz/BaseRzFpxxServiceImpl.java +++ b/dxhy-base/src/main/java/com/dxhy/base/service/fpxxrz/BaseRzFpxxServiceImpl.java @@ -72,6 +72,7 @@ public class BaseRzFpxxServiceImpl extends MpBaseServiceImpl{}",orgList); if (gfshList.size() == 0) { // 未从getUserInfo()获取到购方税号信息 @@ -124,11 +125,9 @@ public class BaseRzFpxxServiceImpl extends MpBaseServiceImpl queryWrapper = new QueryWrapper<>(); @@ -138,6 +137,7 @@ public class BaseRzFpxxServiceImpl extends MpBaseServiceImpl queryRecord = new QueryWrapper<>(); queryRecord.eq("uuid", uuid); BaseTDxRecordInvoice rdxRecordInvoice = baseTDxRecordInvoiceDao.selectOne(queryRecord); + if (rdxRecordInvoice.getDkTaxAmount() != null && StringHelper.isNotBlank(rdxRecordInvoice.getDkTaxAmount().toPlainString())){ + rzlb.setDkse(rdxRecordInvoice.getDkTaxAmount().toPlainString()); + } if (rdxRecordInvoice != null) { if (list == null || list.size() == 0 || !list.contains(rdxRecordInvoice.getGfTaxNo())) { rzlb.setBkrzts("无该发票购方税号权限"); diff --git a/dxhy-common/src/main/java/com/dxhy/common/service/impl/DictdetaServciceImpl.java b/dxhy-common/src/main/java/com/dxhy/common/service/impl/DictdetaServciceImpl.java index 7cf18049..a57096ad 100644 --- a/dxhy-common/src/main/java/com/dxhy/common/service/impl/DictdetaServciceImpl.java +++ b/dxhy-common/src/main/java/com/dxhy/common/service/impl/DictdetaServciceImpl.java @@ -34,7 +34,6 @@ public class DictdetaServciceImpl implements DictdetaServcice { @Override public String queryDictName(String type,String code) { - log.info("type={},code={}",type,code); String dictJson = redisUtils.get(RedisConstant.KEY_DICT + type); List dictdetaModels = JSON.parseArray(dictJson, DictdetaModel.class); Map collect = dictdetaModels.stream().collect(Collectors.toMap(DictdetaModel::getDictcode, DictdetaModel::getDictname)); diff --git a/dxhy-core/src/main/java/com/dxhy/core/thread/FpcjhzExportThread.java b/dxhy-core/src/main/java/com/dxhy/core/thread/FpcjhzExportThread.java index c2b775a8..9c0c6796 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/thread/FpcjhzExportThread.java +++ b/dxhy-core/src/main/java/com/dxhy/core/thread/FpcjhzExportThread.java @@ -169,14 +169,18 @@ public class FpcjhzExportThread extends BaseThread { excelFile.append(ftpFileName.toString()); // 递归导出数据到excel - this.cicleExport(pramsMap, default_curr, excelFile.toString(), jsonObject); - - // FTP文件存储路径 - String[] toDay = DateUtil.today().split("-"); - String ftpFilePath = fileService.getPathPrefix() + userName + "/" + "excelFile/" + toDay[0] + "/" - + toDay[1] + "/" + toDay[2] + "/" + ftpFileName.toString(); - // 文件上传ftp - fileService.uploadFile(ftpFilePath, excelFile.toString()); + String ftpFilePath = ""; + String rtnMsg = this.cicleExport(pramsMap, default_curr, excelFile.toString(), jsonObject); + if("ok".equals(rtnMsg)) { + // FTP文件存储路径 + String[] toDay = DateUtil.today().split("-"); + ftpFilePath = fileService.getPathPrefix() + userName + "/" + "excelFile/" + toDay[0] + "/" + + toDay[1] + "/" + toDay[2] + "/" + ftpFileName.toString(); + // 文件上传ftp + fileService.uploadFile(ftpFilePath, excelFile.toString()); + }else{ + ftpFilePath = rtnMsg; + } // 设置成功消息内容 msg.put("title", super.getSuccTitle(title)); @@ -222,12 +226,15 @@ public class FpcjhzExportThread extends BaseThread { * */ - private boolean cicleExport(Map pramsMap, int curr, String excelFile, JSONObject jsonObject) + private String cicleExport(Map pramsMap, int curr, String excelFile, JSONObject jsonObject) throws Exception { // 查询指定页数的数据 JSONObject pageData = fpcjService.selectByGfshAndCjrq(pramsMap, curr, default_size); boolean hasNext = pageData.getBooleanValue("hasNext"); List dataList = (List)pageData.get("datalist"); + if(dataList.size() > 5000){ + return "数据不能超过5000条"; + } boolean firstPage = false; if (curr == default_curr) { @@ -243,7 +250,7 @@ public class FpcjhzExportThread extends BaseThread { // 写入当前页数据 ExcelPoiUtil.exportListArrayToExcel1(excelFile, title, jsonObject, dataList, firstPage, false); // 更新页数 - return cicleExport(pramsMap, nextPage, excelFile, jsonObject); + cicleExport(pramsMap, nextPage, excelFile, jsonObject); } else { // 写入最后一页数据 FpcjCjhzRespVO vo = new FpcjCjhzRespVO(); @@ -253,7 +260,7 @@ public class FpcjhzExportThread extends BaseThread { vo.setSe(hjse); dataList.add(vo); ExcelPoiUtil.exportListArrayToExcel1(excelFile, title, jsonObject, dataList, firstPage, true); - return hasNext; } + return "ok"; } } diff --git a/dxhy-core/src/main/java/com/dxhy/core/thread/PoolAddTaxThread.java b/dxhy-core/src/main/java/com/dxhy/core/thread/PoolAddTaxThread.java index 258fc5ea..3b90e0e4 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/thread/PoolAddTaxThread.java +++ b/dxhy-core/src/main/java/com/dxhy/core/thread/PoolAddTaxThread.java @@ -181,6 +181,12 @@ public class PoolAddTaxThread extends BaseThread { } else { pramsMap.put("gfsh", gfshList); } + boolean flag = checkList(gfshList); + if (flag){ + pramsMap.put("sign","88"); + log.info("登陆账号无税号"); + } + if (cjksyf != null && !"".equals(cjksyf)) { pramsMap.put("cjksyf", DateUtils.getMorning(DateUtils.strToDate(cjksyf))); } @@ -468,4 +474,22 @@ public class PoolAddTaxThread extends BaseThread { return filePath.toString(); } + 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-core/src/main/java/com/dxhy/core/thread/PoolSaleThread.java b/dxhy-core/src/main/java/com/dxhy/core/thread/PoolSaleThread.java index d0f6b017..5020384b 100644 --- a/dxhy-core/src/main/java/com/dxhy/core/thread/PoolSaleThread.java +++ b/dxhy-core/src/main/java/com/dxhy/core/thread/PoolSaleThread.java @@ -186,6 +186,11 @@ public class PoolSaleThread extends BaseThread { } else { pramsMap.put("gfsh", gfshList); } + boolean flag = checkList(gfshList); + if (flag){ + pramsMap.put("sign","88"); + log.info("登陆账号无税号"); + } if (cjksyf != null && !"".equals(cjksyf)) { pramsMap.put("cjksyf", DateUtils.getMorning(DateUtils.strToDate(cjksyf))); } @@ -468,4 +473,22 @@ public class PoolSaleThread extends BaseThread { return filePath.toString(); } + 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-core/src/main/resources/mapper/ExtPaperMapper.xml b/dxhy-core/src/main/resources/mapper/ExtPaperMapper.xml index 51265a5a..e4ee55e0 100644 --- a/dxhy-core/src/main/resources/mapper/ExtPaperMapper.xml +++ b/dxhy-core/src/main/resources/mapper/ExtPaperMapper.xml @@ -293,10 +293,13 @@ like CONCAT('%',#{keyWord},'%') - and t.gf_tax_no in - - #{item} - + + and t.gf_tax_no in + + #{item} + + + and t.invoice_type = #{invoiceType} @@ -400,10 +403,13 @@ like CONCAT('%',#{keyWord},'%') - and t.xf_tax_no in - - #{item} - + + and t.xf_tax_no in + + #{item} + + + and t.invoice_type = #{invoiceType} @@ -547,7 +553,7 @@ from ${dxhyTertiary}.t_dx_record_invoice t left JOIN ${dxhyDetail}.t_dx_record_invoice_detail b ON t.uuid = b.uuid - where t.detail_yesorno = '1' + where '1' = '1' AND t.create_date BETWEEN #{cjksyf} and #{cjjsyf} @@ -559,10 +565,13 @@ like CONCAT('%',#{keyWord},'%') - and t.gf_tax_no in - - #{item} - + + and t.gf_tax_no in + + #{item} + + + and t.invoice_type = #{invoiceType} @@ -657,7 +666,7 @@ from ${dxhyTertiary}.t_dx_sale_record_invoice t left JOIN ${dxhyDetail}.t_dx_record_invoice_detail_sales b ON t.uuid = b.uuid - where t.detail_yesorno = '1' + where 1 = 1 AND t.create_date between #{cjksyf} and #{cjjsyf} @@ -669,10 +678,13 @@ like CONCAT('%',#{keyWord},'%') - and t.xf_tax_no in - - #{item} - + + and t.xf_tax_no in + + #{item} + + + and t.invoice_type = #{invoiceType} diff --git a/dxhy-core/src/main/resources/mapper/FpZhMapper.xml b/dxhy-core/src/main/resources/mapper/FpZhMapper.xml index 28250108..4ced888f 100644 --- a/dxhy-core/src/main/resources/mapper/FpZhMapper.xml +++ b/dxhy-core/src/main/resources/mapper/FpZhMapper.xml @@ -100,7 +100,6 @@ and t.bdk_status in ('1','2') and t.export_mark = '0' and t.auth_status != '0' - and t.rzh_yesorno != '0' and t.company = #{company} and t.gf_tax_no in diff --git a/dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtInvoicePoolController.java b/dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtInvoicePoolController.java index 881ce31f..d82b57e1 100644 --- a/dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtInvoicePoolController.java +++ b/dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtInvoicePoolController.java @@ -66,9 +66,14 @@ public class ExtInvoicePoolController extends AbstractController { // } // } gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); - if (gfshList.size() == 0) { - return ResponseEntity.ok(R.ok().put("data", "")); + boolean flag = checkList(gfshList); + if (flag){ + pramsMap.put("sign","88"); + log.info("登陆账号无税号"); } +// if (gfshList.size() == 0) { +// return ResponseEntity.ok(R.ok().put("data", "")); +// } pramsMap.put("gfsh", gfshList); if (pramsMap.get("cjksyf") != null && !"".equals(pramsMap.get("cjksyf"))) { pramsMap.put("cjksyf", DateUtils.getMorning(DateUtils.strToDate(pramsMap.get("cjksyf").toString()))); @@ -219,10 +224,16 @@ public class ExtInvoicePoolController extends AbstractController { // return ResponseEntity.ok(R.ok().put("data", "")); // } // } + gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); - if (gfshList.size() == 0) { - return ResponseEntity.ok(R.ok().put("data", "")); - } + boolean flag = checkList(gfshList); + if (flag){ + pramsMap.put("sign","88"); + log.info("登陆账号无税号"); + } +// if (gfshList.size() == 0) { +// return ResponseEntity.ok(R.ok().put("data", "")); +// } pramsMap.put("taxno", gfshList); if (pramsMap.get("cjksyf") != null && !"".equals(pramsMap.get("cjksyf"))) { pramsMap.put("cjksyf", DateUtils.getMorning(DateUtils.strToDate(pramsMap.get("cjksyf").toString()))); @@ -327,4 +338,22 @@ public class ExtInvoicePoolController extends AbstractController { System.out.println(replace); } } + 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/ExtInvoicePoolMapper.xml b/dxhy-extend/src/main/resources/mapper/ExtInvoicePoolMapper.xml index 8ce721fb..9d93ab8e 100644 --- a/dxhy-extend/src/main/resources/mapper/ExtInvoicePoolMapper.xml +++ b/dxhy-extend/src/main/resources/mapper/ExtInvoicePoolMapper.xml @@ -69,10 +69,13 @@ like CONCAT('%',#{keyWord},'%') - and t.gf_tax_no in - - #{item} - + + and t.gf_tax_no in + + #{item} + + + and t.invoice_type = #{invoiceType} @@ -218,10 +221,13 @@ like CONCAT('%',#{keyWord},'%') - and t.gf_tax_no in - - #{item} - + + and t.gf_tax_no in + + #{item} + + + and t.invoice_type = #{invoiceType} @@ -506,10 +512,13 @@ like CONCAT('%',#{keyWord},'%') - and t.xf_tax_no in - - #{item} - + + and t.xf_tax_no in + + #{item} + + + and t.invoice_type = #{invoiceType} @@ -617,10 +626,13 @@ like CONCAT('%',#{keyWord},'%') - and t.xf_tax_no in - - #{item} - + + and t.xf_tax_no in + + #{item} + + + and t.invoice_type = #{invoiceType} diff --git a/dxhy-extend/src/main/resources/mapper/ExtJxssbbMapper.xml b/dxhy-extend/src/main/resources/mapper/ExtJxssbbMapper.xml index 68504cc7..11a9b730 100644 --- a/dxhy-extend/src/main/resources/mapper/ExtJxssbbMapper.xml +++ b/dxhy-extend/src/main/resources/mapper/ExtJxssbbMapper.xml @@ -13,8 +13,10 @@ select count(1) totalCount, ifnull(sum(invoice_amount), 0) totalAmount, ifnull(sum(dk_tax_amount), 0) totalTax FROM t_dx_record_invoice - WHERE valid='1' and invoice_type in ('01','03','08','14') AND invoice_status='0' AND - rzh_yesorno='1' + WHERE valid='1' + and (invoice_type in('01','03','08','14','31','283','161','183','185') or (invoice_type ='32' and t.lq_tdyslxDm='08')) + AND invoice_status='0' + AND rzh_yesorno='1' and rzh_belong_date = #{skssq} @@ -54,9 +56,11 @@