From 20c9f1c2517ab8f1044b6b796bee73ec3ca0108c Mon Sep 17 00:00:00 2001 From: yishiqihuasheng <1191093413@qq.com> Date: Sun, 4 Jun 2023 19:38:11 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=8B=BE=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BaseInvoiceController.java | 305 +++++++++--------- .../base/dao/BaseTDxRecordInvoiceDao.java | 2 + .../dxhy/base/entity/BaseReturnEntity.java | 22 ++ .../BaseInvoiceManualCheckServiceImpl.java | 187 ++++------- .../resources/mapper/BaseSggxcxMapper.xml | 218 +++++++------ 5 files changed, 367 insertions(+), 367 deletions(-) create mode 100644 dxhy-base/src/main/java/com/dxhy/base/entity/BaseReturnEntity.java diff --git a/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java b/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java index 95572f32..3f7de4bb 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java +++ b/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java @@ -1,8 +1,11 @@ package com.dxhy.base.controller; +import cn.hutool.core.codec.Base64; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dxhy.base.entity.BaseReturnEntity; import com.dxhy.base.entity.BaseTDxRecordInvoice; import com.dxhy.base.model.BaseDrgxReqVO; import com.dxhy.base.service.fpxxrz.BaseCxrzfpService; @@ -22,8 +25,7 @@ import com.dxhy.common.utils.R; import com.dxhy.common.vo.Tax; import com.dxhy.common.vo.TaxOrgCode; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -31,6 +33,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.xml.ws.Response; import java.math.BigDecimal; import java.util.*; import java.util.regex.Matcher; @@ -816,50 +819,41 @@ public class BaseInvoiceController extends AbstractController { @SysLog("调用智能勾选查询接口") @ResponseBody public Object sgrzzngxcx(@RequestBody Map map) { -// String gfsh = (String)map.get("gfsh"); -// String invoiceType = (String)map.get("invoiceType"); -// String invoiceSource = (String)map.get("invoiceSource"); -// String kpksrq = (String)map.get("kpksrq"); -// String kpjsrq = (String)map.get("kpjsrq"); -// String qszt = (String)map.get("qszt"); -// String qsfs = (String)map.get("qsfs"); -// String businessCode = (String)map.get("businessCode"); -// String invoiceNo = (String)map.get("invoiceNo"); -// String qsksrq = (String)map.get("qsksrq"); -// String qsjsrq = (String)map.get("qsjsrq"); -// String xfmc = (String)map.get("xfmc"); -// String position = (String)map.get("position"); -// String fpzt = (String)map.get("invoiceStatus"); -// String sfkrz = (String)map.get("sfkrz"); -// String qsr = (String)map.get("qsr"); -// String bzdh = (String) map.get("bzdh"); + String inAccountStatus = (String) map.get("inAccountStatus"); String companyCode = (String) map.get("companyCode"); String gfsh = (String)map.get("gfsh"); String maxTax = (String) map.get("maxTax"); String menuId = (String)map.get("menuId"); String company = (String)map.get("company"); + String isChooseAll = (String) map.get("isChooseAll"); - int curr = 0; - if (map.get("curr") != null){ - curr = (int) map.get("curr"); - }else { - ResponseEntity.ok(R.error("分页数据不能为空")); + if (org.apache.commons.lang3.StringUtils.isBlank(isChooseAll)){ + return ResponseEntity.ok(R.error("是否全选标识不能为空")); } - + int curr = 0; int size = 0; - if (map.get("size")!= null){ - size = (int) map.get("size"); - }else { - ResponseEntity.ok(R.error("分页大小不能为空")); - } + if ("N".equalsIgnoreCase(isChooseAll)){ + + if (map.get("curr") != null){ + curr = (int) map.get("curr"); + }else { + ResponseEntity.ok(R.error("分页数据不能为空")); + } + + if (map.get("size")!= null){ + size = (int) map.get("size"); + }else { + ResponseEntity.ok(R.error("分页大小不能为空")); + } + } - if (StringUtils.isNotBlank(inAccountStatus)){ + if (StringUtils.isBlank(inAccountStatus)){ return ResponseEntity.ok(R.error("入账状态不能为空")); } - if (StringUtils.isNotBlank(maxTax)){ + if (StringUtils.isBlank(maxTax)){ return ResponseEntity.ok(R.error("税额上限不能为空")); } @@ -869,51 +863,16 @@ public class BaseInvoiceController extends AbstractController { return ResponseEntity.ok(R.error("输入税额上限格式不对,请重新输入")); } - String allIn = "88"; - - if (map.get("sign") != null && "99".equals((String)map.get("sign"))){ - allIn = "99"; - } - Map pramsMap = new HashMap<>(16); -// pramsMap.put("bzdh", bzdh); -// pramsMap.put("payment", map.get("payment")); -// pramsMap.put("paymentStatus", map.get("paymentStatus")); -// pramsMap.put("paymentDateStart", map.get("paymentDateStart")); -// pramsMap.put("paymentDateEnd", map.get("paymentDateEnd")); -// pramsMap.put("settlementNo", map.get("settlementNo")); -// pramsMap.put("voucherNumber", map.get("voucherNumber")); -// pramsMap.put("snVoucherNumber", map.get("snVoucherNumber")); -// pramsMap.put("postingTimeEnd", map.get("postingTimeEnd")); -// pramsMap.put("postingTimeStart", map.get("postingTimeStart")); -// pramsMap.put("imageNumber", map.get("imageNumber")); -// if (map.get("accountPeriod") != null && !"".equals(map.get("accountPeriod"))) { -// String accountPeriod = map.get("accountPeriod").toString().substring(0,7); -// pramsMap.put("accountPeriod", accountPeriod); -// log.info("accountPeriod:{}",accountPeriod); -// } -// -// if (sfkrz != null) { -// if (!"99".equals(sfkrz)) { -// pramsMap.put("sfkrz", sfkrz); -// } -// } -// if (invoiceSource != null) { -// if (!"99".equals(invoiceSource)) { -// pramsMap.put("invoiceSource", invoiceSource); -// } -// } pramsMap.put("inAccountStatus", inAccountStatus); pramsMap.put("company", company); - pramsMap.put("company", "BIGB"); pramsMap.put("menuId", menuId); - pramsMap.put("menuId", "118061"); pramsMap.put("maxTax",maxTax); - pramsMap.put("sign",allIn); pramsMap.put("curr",curr); pramsMap.put("size",size); + pramsMap.put("isChooseAll",isChooseAll); pramsMap.put("business", getUserInfo().getBusiness()); pramsMap.put("dbName", getUserInfo().getDbName()); List taxList = getUserInfo().getOrg(); @@ -926,12 +885,11 @@ public class BaseInvoiceController extends AbstractController { gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); } + //todo合并分支后把checkList加上可以让用户不使用上级权限就可以进行认证 - if (ObjectUtils.isNotEmpty(gfshList)){ - pramsMap.put("gfsh", gfshList); - }else { - return ResponseEntity.ok(R.error("购方税号不能为空")); - } + pramsMap.put("gfsh",gfshList); + + pramsMap.put("sign","88"); if (StringUtils.isNotBlank(companyCode)){ @@ -940,88 +898,141 @@ public class BaseInvoiceController extends AbstractController { -// if (!StringUtils.isBlank(invoiceType)) { -// if (!"99".equals(invoiceType)) { -// pramsMap.put("invoiceType", invoiceType); -// } -// } else { -// return ResponseEntity.ok(R.error("发票类型不能为空!")); -// } -// if (StringUtils.isNotBlank(fpzt)) { -// pramsMap.put("fpzt", fpzt); -// } else { -// return ResponseEntity.ok(R.error("发票状态不能为空")); -// } -// pramsMap.put("businessCode", "99"); -// if (!StringUtils.isBlank(qszt)) { -// if (!"99".equals(qszt)) { -// pramsMap.put("qszt", qszt); -// if ("1".equals(qszt)) { -// if (!StringUtils.isBlank(qsksrq)) { -// pramsMap.put("qsksrq", qsksrq); -// } else { -// return ResponseEntity.ok(R.error("签收开始日期不能为空!")); -// } -// if (!StringUtils.isBlank(qsjsrq)) { -// pramsMap.put("qsjsrq", qsjsrq); -// } else { -// return ResponseEntity.ok(R.error("签收结束日期不能为空!")); -// } -// if (!StringUtils.isBlank(qsfs)) { -// // 表示全部 -// if (!"99".equals(qsfs)) { -// pramsMap.put("qsfs", qsfs); -// } -// } else { -// return ResponseEntity.ok(R.error("签收方式不能为空!")); -// } -// pramsMap.put("businessCode", businessCode); -// } + try { + return ResponseEntity + .ok(R.ok().put("data", baseInvoiceManualCheckService.inTellingCheck(pramsMap))); + } catch (Exception e) { + e.printStackTrace(); + log.error("", e); + return ResponseEntity.ok(R.error(CommonConstants.MSG_ERR_DEFAULT)); + } + + } + + @PostMapping("/sggx/afterInTellingCheck") + @SysLog("智能勾选后认证") + @ResponseBody + public Object afterInTellingCheck(@RequestBody Map map) { + + String isChooseAll = (String) map.get("isChooseAll"); + + if (StringUtils.isBlank(isChooseAll)){ + return ResponseEntity.ok(R.error("是否全选标识不能为空")); + } + + int curr = 1; + int size = 10; + int count = 0; + + Map pramsMap = new HashMap<>(16); + + if ("N".equalsIgnoreCase(isChooseAll)){ + String uuids = (String) map.get("uuids"); + + if (StringUtils.isBlank(uuids)){ + return ResponseEntity.ok(R.error("所选发票不能为空")); + } + + String dkses = (String) map.get("dkses"); + + if (StringUtils.isBlank(dkses)){ + return ResponseEntity.ok(R.error("所选发票抵扣税额不能为空")); + } + + String gxType = (String) map.get("gxType"); + + if (StringUtils.isBlank(gxType)){ + return ResponseEntity.ok(R.error("所选发票勾选类型不能为空")); + } + + pramsMap.put("name", getUserName()); + pramsMap.put("dbName", getUserInfo().getDbName()); + pramsMap.put("loginName", getLoginName()); + pramsMap.put("userName", getUserName()); + pramsMap.put("uuids", uuids); + pramsMap.put("dkses",dkses); + pramsMap.put("gxType", gxType); + List gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); + + if (!gfshList.isEmpty()) { + pramsMap.put("gfsh", gfshList); + } else { + return ResponseEntity.ok(R.error("购方信息不能为空!")); + } + + + + + }else { + String companyCode = (String) map.get("companyCode"); + String gfsh = (String)map.get("gfsh"); + String gxType = (String) map.get("gxType"); + + if (StringUtils.isBlank(gxType)){ + return ResponseEntity.ok(R.error("所选发票勾选类型不能为空")); + } + + map.put("business", getUserInfo().getBusiness()); + map.put("dbName", getUserInfo().getDbName()); + List taxList = getUserInfo().getOrg(); + map.put("taxList", taxList); + map.put("qsflag", getUserInfo().getQsStatus()); +// List gfshList = new ArrayList<>(); +// if (!"99".equals(gfsh) && StringUtils.isNotBlank(gfsh)) { +// gfshList.add(gfsh); +// } else { +// gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); // } -// } else { -// return ResponseEntity.ok(R.error("签收状态不能为空!")); -// } -// String qsflag = getUserInfo().getQsStatus(); -// if ("1".equals(qsflag)) { -// pramsMap.put("qszt", "1"); -// } -// if (!StringUtils.isBlank(kpksrq)) { -// pramsMap.put("kpksrq", kpksrq); -// } else { -// return ResponseEntity.ok(R.error("开票开始日期不能为空!")); -// } -// if (!StringUtils.isBlank(kpjsrq)) { -// pramsMap.put("kpjsrq", kpjsrq); -// } else { -// return ResponseEntity.ok(R.error("开票结束日期不能为空!")); -// } -// -// if (!StringUtils.isBlank(position)) { -// pramsMap.put("username", getUserName()); -// pramsMap.put("position", position); -// } // -// //发票号码 -// if (!StringUtils.isBlank(invoiceNo)) { -// if(invoiceNo.length()==8){ -// pramsMap.put("invoiceNo", invoiceNo); -// }else { -// pramsMap.put("eleInvoiceNo", invoiceNo); -// } -// } +// //todo合并分支后把checkList加上可以让用户不使用上级权限就可以进行认证 // +// map.put("gfsh",gfshList); // -// if (!StringUtils.isBlank(xfmc)) { -// pramsMap.put("xfmc", xfmc); -// } -// if (!StringUtils.isBlank(qsr)) { -// pramsMap.put("qsr", qsr); -// } +// map.put("sign","88"); + + + if (StringUtils.isNotBlank(companyCode)){ + pramsMap.put("companyCode",companyCode); + } + String sgrzzngxcx = baseInvoiceManualCheckService.inTellingCheck(map); + String encode = Base64.decodeStr(sgrzzngxcx); + BaseReturnEntity baseReturnEntity = JSON.parseObject(encode, BaseReturnEntity.class); + List dataList = baseReturnEntity.getDataList(); + StringBuilder uuids = new StringBuilder(); + StringBuilder dkses = new StringBuilder(); + if (dataList != null && dataList.size() > 0){ + for (int i = 0; i < dataList.size(); i++) { + uuids.append(dataList.get(i).getUuid()); + dkses.append(dataList.get(i).getTaxAmount()); + if (i gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); + + if (!gfshList.isEmpty()) { + pramsMap.put("gfsh", gfshList); + } else { + return ResponseEntity.ok(R.error("购方信息不能为空!")); + } + } try { return ResponseEntity - .ok(R.ok().put("data", baseInvoiceManualCheckService.inTellingCheck(pramsMap))); + .ok(R.ok().put("data", baseIRzTDxRecordInvoiceService.identifiByIds(pramsMap, curr, size, count))); } catch (Exception e) { e.printStackTrace(); log.error("", e); diff --git a/dxhy-base/src/main/java/com/dxhy/base/dao/BaseTDxRecordInvoiceDao.java b/dxhy-base/src/main/java/com/dxhy/base/dao/BaseTDxRecordInvoiceDao.java index 9a89c5f9..fa2b4cce 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/dao/BaseTDxRecordInvoiceDao.java +++ b/dxhy-base/src/main/java/com/dxhy/base/dao/BaseTDxRecordInvoiceDao.java @@ -218,4 +218,6 @@ public interface BaseTDxRecordInvoiceDao extends BaseMapper pramsMap); List findSuspendStatus(@Param("uuids") List uuids); + + List selectChooseHj(Map pramsMap); } diff --git a/dxhy-base/src/main/java/com/dxhy/base/entity/BaseReturnEntity.java b/dxhy-base/src/main/java/com/dxhy/base/entity/BaseReturnEntity.java new file mode 100644 index 00000000..df1afa2b --- /dev/null +++ b/dxhy-base/src/main/java/com/dxhy/base/entity/BaseReturnEntity.java @@ -0,0 +1,22 @@ +package com.dxhy.base.entity; + +import lombok.Data; + +import java.util.List; + +@Data +@SuppressWarnings("AlibabaClassNamingShouldBeCamel") +public class BaseReturnEntity { + + private static final long serialVersionUID = -2166713217995969349L; + + private String hjse; + + private List dataList; + + private String hjsl; + + private String hjje; + + private String total; +} diff --git a/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java b/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java index d327a680..d4c91941 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java +++ b/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java @@ -451,37 +451,73 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl gfshList = (List)pramsMap.get("gfsh"); - - List gfshList1 = new ArrayList<>(); - if (gfshList.size() > 0) { - List curList = super.baseMapper.selectDksh(pramsMap); - for (BaseTDxDkCount cur : curList) { - String skssq = cur.getSkssq(); - String year = skssq.substring(0, 4); - String mon = skssq.substring(4); - LocalDate localDate = LocalDate.of(Integer.parseInt(year), Integer.parseInt(mon), 1); - LocalDate localDate1 = localDate.plusMonths(1); - LocalDate localDate2 = LocalDate.now(); - if ("0".equals(cur.getTjStatus()) || "3".equals(cur.getTjStatus()) - || localDate2.isBefore(localDate1)) { - gfshList1.add(cur.getTaxno()); + String sign = (String) pramsMap.get("sign"); + + //如果有自己的税号则选择出在未申请抵扣的税号 + if (!"88".equals(sign)){ + List gfshList1 = new ArrayList<>(); + if (gfshList.size() > 0) { + List curList = super.baseMapper.selectDksh(pramsMap); + for (BaseTDxDkCount cur : curList) { + String skssq = cur.getSkssq(); + String year = skssq.substring(0, 4); + String mon = skssq.substring(4); + LocalDate localDate = LocalDate.of(Integer.parseInt(year), Integer.parseInt(mon), 1); + LocalDate localDate1 = localDate.plusMonths(1); + LocalDate localDate2 = LocalDate.now(); + if ("0".equals(cur.getTjStatus()) || "3".equals(cur.getTjStatus()) + || localDate2.isBefore(localDate1)) { + gfshList1.add(cur.getTaxno()); + } } - } - if(ObjectUtils.isEmpty(gfshList1)|| gfshList1.size()==0){ - json.put("code","501"); - json.put("message","税号已经申请抵扣"); + if(ObjectUtils.isEmpty(gfshList1)|| gfshList1.size()==0){ + json.put("code","501"); + json.put("message","税号已经申请抵扣"); + return super.responseResult(json); + }else { + pramsMap.put("gfsh",gfshList1); + } + } else { + json.put("code", "501"); + json.put("message", "账号下无可用税号"); return super.responseResult(json); - }else { - pramsMap.put("gfsh",gfshList1); } - } else { - json.put("code", "501"); - json.put("message", "账号下无可用税号"); - return super.responseResult(json); } - PageHelper.startPage(1, 200); + String isChooseAll = (String) pramsMap.get("isChooseAll"); + + + //如果不是勾选所有进行统计和分页 + if ("N".equalsIgnoreCase(isChooseAll)){ + int curr = (int) pramsMap.get("curr"); + int size = (int) pramsMap.get("size"); + + // 合计信息,仅第一页时需要统计,减少数据库压力 + if (curr == 1) { + String hjsl = "0"; + String hjje = "0"; + String hjse = "0"; + List hjList = super.baseMapper.selectChooseHj(pramsMap); + BaseTDxRecordInvoice hjxx = hjList.get(0); + hjsl = hjxx.getSfygx(); + if (!"0".equals(hjsl)) { + hjje = AmountFormatUtil.fmtMicrometer(MathUtil.round(hjxx.getInvoiceAmount().toPlainString())); + hjse = AmountFormatUtil.fmtMicrometer(MathUtil.round(hjxx.getTaxAmount().toPlainString())); + } + json.put("hjsl", AmountFormatUtil.fmtMicrometer(hjsl)); + json.put("hjje", hjje); + json.put("hjse", hjse); + if ("0".equals(hjsl)) { + json.put("message", "无可操作的数据"); + json.put("code", "501"); + return super.responseResult(json); + } + } + + PageHelper.startPage(curr, size); + } + List pageList = super.baseMapper.selectInTellingCheck(pramsMap); if (pageList == null || pageList.size() == 0){ @@ -498,12 +534,6 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl businessList = (List)pramsMap.get("business"); if (pageList.size() > 0) { @@ -517,97 +547,18 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl"+maxTax+",currentTax====>"+currentTax+",taxAmount===>"+pageList.get(i).getTaxAmount()); - - if (maxTax.compareTo(currentTax) >0){ - count++; - log.info("count++{}"+count+",currentTax==》"+currentTax+",hjje===>"+hjje); - //发票状态不能认证 -// String invoiceStatus="07"; -// if ( pageList.get(i).getInvoiceStatus() != null && !invoiceStatus.contains(pageList.get(i).getInvoiceStatus()) -// || pageList.get(i).getInvoiceAmount() != null && pageList.get(i).getInvoiceAmount().compareTo(new BigDecimal(0)) < 0 -// || pageList.get(i).getTaxAmount() != null && pageList.get(i).getTaxAmount().compareTo(new BigDecimal(0)) < 0) { -// -// currentTax = currentTax.subtract(pageList.get(i).getTaxAmount()); -// hjje = hjje.subtract(pageList.get(i).getInvoiceAmount()); -// count--; -// log.info("count--{}"+count+",currentTax==》"+currentTax+",hjje===>"+hjje); -// continue; -// } - //发票税号一申请抵扣统计 -// if (!gfshList1.contains(pageList.get(i).getGfTaxNo())) { -// //该发票税号已申请抵扣统计 -// log.info("申请统计的购方税号为{}",pageList.get(i).getGfTaxNo()); -// currentTax = currentTax.subtract(pageList.get(i).getTaxAmount()); -// hjje = hjje.subtract(pageList.get(i).getInvoiceAmount()); -// count--; -// log.info("已申请抵扣统计 count-- ==={}"+count+",currentTax==》"+currentTax+",hjje===>"+hjje); -// -// continue; -// } - BaseSggxCxRespVO vo = getBaseSggxCxRespVO(pageList.get(i), count, taxnoList, businessList); - -// log.info("智能勾选查询返回对象VO {}",vo); - - log.info("returnList添加vo"); - returnList.add(vo); - }else { - log.info("统计税额超出税额上限减去最后一个,并结束循环遍历"); - currentTax = currentTax.subtract(pageList.get(i).getTaxAmount()); - hjje = hjje.subtract(pageList.get(i).getInvoiceAmount()); - - if (i collect = pageList.stream().skip(i + 1).sorted(Comparator.comparing(BaseTDxRecordInvoice::getTaxAmount)).collect(Collectors.toList()); - log.info("collect====>{}",collect.stream().map(BaseTDxRecordInvoice::getTaxAmount).collect(Collectors.toList())); - if (collect != null && collect.size() > 0){ - log.info("从小到大排序在进行添加"); - for (int j = 0; j < collect.size(); j++) { - if (collect.get(j).getTaxAmount().compareTo(new BigDecimal("0"))<1){ - continue; - } - currentTax = currentTax.add(collect.get(j).getTaxAmount()); - hjje = hjje.add(collect.get(j).getInvoiceAmount()); - log.info("maxTax====>"+maxTax+",currentTax====>"+currentTax); - if (maxTax.compareTo(currentTax)>0){ - count++; - log.info("最小排序count++{}"+count+",currentTax==》"+currentTax+",hjje===>"+hjje); - - BaseSggxCxRespVO vo = getBaseSggxCxRespVO(collect.get(j), count, taxnoList, businessList); - log.info("returnList添加vo"); - returnList.add(vo); - }else { - log.info("最小排序统计税额超出税额上限减去最后一个,并结束循环遍历"); - currentTax = currentTax.subtract(collect.get(j).getTaxAmount()); - hjje = hjje.subtract(collect.get(j).getInvoiceAmount()); - break; - } - } - } - } + BaseSggxCxRespVO vo = getBaseSggxCxRespVO(pageList.get(i), count, taxnoList, businessList); + count++; + log.info("returnList添加vo"); + returnList.add(vo); + } - break; - } + } + json.put("total", pageInfo.getTotal()); + json.put("datalist", returnList); - } - } - if(returnList == null || returnList.size() == 0){ - json.put("message","无可操作的数据"); - json.put("code","501"); - return super.responseResult(json); - }else { - json.put("hjje", hjje); - json.put("hjse", currentTax); - json.put("total", count); - json.put("datalist", returnList); - } } catch (Exception e) { // 统一设置操作异常标识 log.info("错误信息为:{}",e.getMessage()); diff --git a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml index f4ba951e..71a44234 100644 --- a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml @@ -1337,28 +1337,117 @@ + + + + + + + From e0b5d9d28985ae3ff9271c77a3e16a5407d4f5c5 Mon Sep 17 00:00:00 2001 From: yishiqihuasheng <1191093413@qq.com> Date: Sun, 4 Jun 2023 20:24:02 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=8B=BE=E9=80=89?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0uuid=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/controller/BaseInvoiceController.java | 18 ++++++++++-------- .../main/resources/mapper/BaseSggxcxMapper.xml | 4 ++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java b/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java index 3f7de4bb..5943b0fc 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java +++ b/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java @@ -885,11 +885,11 @@ public class BaseInvoiceController extends AbstractController { gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); } - //todo合并分支后把checkList加上可以让用户不使用上级权限就可以进行认证 + //TODO 合并分支后把checkList加上可以让用户不使用上级权限就可以进行认证 pramsMap.put("gfsh",gfshList); - pramsMap.put("sign","88"); + pramsMap.put("sign","99"); if (StringUtils.isNotBlank(companyCode)){ @@ -966,6 +966,12 @@ public class BaseInvoiceController extends AbstractController { }else { String companyCode = (String) map.get("companyCode"); String gfsh = (String)map.get("gfsh"); + List gfshList = new ArrayList<>(); + if(StringUtils.isBlank(gfsh) && "99".equals(gfsh)){ + gfshList=UserInfoUtil.getGfshAll(getUserInfo().getOrg()); + }else { + gfshList.add(gfsh); + } String gxType = (String) map.get("gxType"); if (StringUtils.isBlank(gxType)){ @@ -976,6 +982,7 @@ public class BaseInvoiceController extends AbstractController { map.put("dbName", getUserInfo().getDbName()); List taxList = getUserInfo().getOrg(); map.put("taxList", taxList); + map.put("gfsh",gfshList); map.put("qsflag", getUserInfo().getQsStatus()); // List gfshList = new ArrayList<>(); // if (!"99".equals(gfsh) && StringUtils.isNotBlank(gfsh)) { @@ -1020,13 +1027,8 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("loginName", getLoginName()); pramsMap.put("userName", getUserName()); pramsMap.put("gxType", gxType); - List gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); + pramsMap.put("gfsh", gfshList); - if (!gfshList.isEmpty()) { - pramsMap.put("gfsh", gfshList); - } else { - return ResponseEntity.ok(R.error("购方信息不能为空!")); - } } diff --git a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml index 71a44234..a58ddff9 100644 --- a/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml @@ -35,6 +35,7 @@ + @@ -1343,6 +1344,7 @@ (@total := @total + tax_amount) AS max_tax, invoice_type, comp_code, + uuid, invoice_code, invoice_no, gf_name, @@ -1377,6 +1379,7 @@ and auth_status in('0','5','6') and export_mark = '0' and invoice_status = '0' + and company = #{company} and t.gf_tax_no in @@ -1433,6 +1436,7 @@ and auth_status in('0','5','6') and export_mark = '0' and invoice_status = '0' + and company = #{company} and t.gf_tax_no in From 51dd13e53e194bfdbf336cfc9f6ac5fdf2802ed8 Mon Sep 17 00:00:00 2001 From: yishiqihuasheng <1191093413@qq.com> Date: Mon, 5 Jun 2023 08:51:50 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=8B=BE=E9=80=89?= =?UTF-8?q?=E7=9A=84=E8=AE=A4=E8=AF=81=E5=85=A8=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BaseInvoiceController.java | 127 ++++++------------ 1 file changed, 43 insertions(+), 84 deletions(-) diff --git a/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java b/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java index 5943b0fc..84bad887 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java +++ b/dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java @@ -926,64 +926,26 @@ public class BaseInvoiceController extends AbstractController { Map pramsMap = new HashMap<>(16); - if ("N".equalsIgnoreCase(isChooseAll)){ - String uuids = (String) map.get("uuids"); - - if (StringUtils.isBlank(uuids)){ - return ResponseEntity.ok(R.error("所选发票不能为空")); - } - - String dkses = (String) map.get("dkses"); - - if (StringUtils.isBlank(dkses)){ - return ResponseEntity.ok(R.error("所选发票抵扣税额不能为空")); - } - - String gxType = (String) map.get("gxType"); - - if (StringUtils.isBlank(gxType)){ - return ResponseEntity.ok(R.error("所选发票勾选类型不能为空")); - } - - pramsMap.put("name", getUserName()); - pramsMap.put("dbName", getUserInfo().getDbName()); - pramsMap.put("loginName", getLoginName()); - pramsMap.put("userName", getUserName()); - pramsMap.put("uuids", uuids); - pramsMap.put("dkses",dkses); - pramsMap.put("gxType", gxType); - List gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); - - if (!gfshList.isEmpty()) { - pramsMap.put("gfsh", gfshList); - } else { - return ResponseEntity.ok(R.error("购方信息不能为空!")); - } - - - - + String companyCode = (String) map.get("companyCode"); + String gfsh = (String)map.get("gfsh"); + List gfshList = new ArrayList<>(); + if(StringUtils.isBlank(gfsh) && "99".equals(gfsh)){ + gfshList=UserInfoUtil.getGfshAll(getUserInfo().getOrg()); }else { - String companyCode = (String) map.get("companyCode"); - String gfsh = (String)map.get("gfsh"); - List gfshList = new ArrayList<>(); - if(StringUtils.isBlank(gfsh) && "99".equals(gfsh)){ - gfshList=UserInfoUtil.getGfshAll(getUserInfo().getOrg()); - }else { - gfshList.add(gfsh); - } - String gxType = (String) map.get("gxType"); + gfshList.add(gfsh); + } + String gxType = (String) map.get("gxType"); - if (StringUtils.isBlank(gxType)){ - return ResponseEntity.ok(R.error("所选发票勾选类型不能为空")); - } + if (StringUtils.isBlank(gxType)){ + return ResponseEntity.ok(R.error("所选发票勾选类型不能为空")); + } - map.put("business", getUserInfo().getBusiness()); - map.put("dbName", getUserInfo().getDbName()); - List taxList = getUserInfo().getOrg(); - map.put("taxList", taxList); - map.put("gfsh",gfshList); - map.put("qsflag", getUserInfo().getQsStatus()); + map.put("business", getUserInfo().getBusiness()); + map.put("dbName", getUserInfo().getDbName()); + List taxList = getUserInfo().getOrg(); + map.put("taxList", taxList); + map.put("gfsh",gfshList); + map.put("qsflag", getUserInfo().getQsStatus()); // List gfshList = new ArrayList<>(); // if (!"99".equals(gfsh) && StringUtils.isNotBlank(gfsh)) { // gfshList.add(gfsh); @@ -998,39 +960,36 @@ public class BaseInvoiceController extends AbstractController { // map.put("sign","88"); - if (StringUtils.isNotBlank(companyCode)){ - pramsMap.put("companyCode",companyCode); - } - String sgrzzngxcx = baseInvoiceManualCheckService.inTellingCheck(map); - String encode = Base64.decodeStr(sgrzzngxcx); - BaseReturnEntity baseReturnEntity = JSON.parseObject(encode, BaseReturnEntity.class); - List dataList = baseReturnEntity.getDataList(); - StringBuilder uuids = new StringBuilder(); - StringBuilder dkses = new StringBuilder(); - if (dataList != null && dataList.size() > 0){ - for (int i = 0; i < dataList.size(); i++) { - uuids.append(dataList.get(i).getUuid()); - dkses.append(dataList.get(i).getTaxAmount()); - if (i dataList = baseReturnEntity.getDataList(); + StringBuilder uuids = new StringBuilder(); + StringBuilder dkses = new StringBuilder(); + if (dataList != null && dataList.size() > 0){ + for (int i = 0; i < dataList.size(); i++) { + uuids.append(dataList.get(i).getUuid()); + dkses.append(dataList.get(i).getTaxAmount()); + if (i Date: Mon, 5 Jun 2023 08:54:35 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=8B=BE=E9=80=89?= =?UTF-8?q?=E7=9A=84=E8=AE=A4=E8=AF=81=E5=85=A8=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../invoicecheck/BaseInvoiceManualCheckServiceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java b/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java index d4c91941..6f62fe4d 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java +++ b/dxhy-base/src/main/java/com/dxhy/base/service/invoicecheck/BaseInvoiceManualCheckServiceImpl.java @@ -12,8 +12,8 @@ import javax.annotation.Resource; import com.dxhy.common.constant.DictConstant; import com.dxhy.common.utils.DateUtils; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; import org.springframework.stereotype.Service; @@ -443,12 +443,14 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl pramsMap) { log.info("入参是:{}",pramsMap); - JSONObject json; + JSONObject json = new JSONObject(); DynamicContextHolder.push(pramsMap.get("dbName") + DbConstant.BUSINESS_READ); try { String company = (String)pramsMap.get("company"); String menuId = (String)pramsMap.get("menuId"); - json = tabulateRedisService.getTabulateMenu(company, menuId); + if (StringUtils.isNotBlank(menuId)){ + json = tabulateRedisService.getTabulateMenu(company, menuId); + } List gfshList = (List)pramsMap.get("gfsh"); String sign = (String) pramsMap.get("sign");