diff --git a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SsoLoginServiceImpl.java b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SsoLoginServiceImpl.java index d6a9e3de..61fae781 100644 --- a/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SsoLoginServiceImpl.java +++ b/dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SsoLoginServiceImpl.java @@ -264,29 +264,60 @@ public class SsoLoginServiceImpl implements SsoLoginService { return roleIds; } +// public List toUserOrg(SsoUser user) { +// SysUserOrgEntity userOrg; +// List listUserOrg = new ArrayList<>(); +// List dataPerm = user.getDataPerm(); +// List taxplayercodeDeptList = user.getTaxplayercodeDeptList(); +// if (dataPerm != null && dataPerm.size() > 0) { +// for (Long deptId : dataPerm) { +// if (dataPerm.size() > 0) { +// for (com.xxl.sso.core.entity.SysDeptEntity sysDeptEntity : taxplayercodeDeptList) { +// log.debug("deptId : " + deptId + " sysDetp: " + sysDeptEntity.getDeptId()); +// if (deptId.longValue() == sysDeptEntity.getDeptId().longValue()) { +// userOrg = new SysUserOrgEntity(); +// userOrg.setCompany(AdminConfig.company); +// userOrg.setDeptId(sysDeptEntity.getDeptId()); +// userOrg.setTaxname(sysDeptEntity.getName()); +// userOrg.setTaxno(sysDeptEntity.getTaxpayerCode()); +// listUserOrg.add(userOrg); +// } +// } +// } +// } +// } +// log.debug("listUserOrg : " + listUserOrg.size() + " listUserOrgJson: " + JSON.toJSONString(listUserOrg)); +// return listUserOrg; +// } + public List toUserOrg(SsoUser user) { SysUserOrgEntity userOrg; + Map detpCollect = null; List listUserOrg = new ArrayList<>(); List dataPerm = user.getDataPerm(); List taxplayercodeDeptList = user.getTaxplayercodeDeptList(); + if(taxplayercodeDeptList != null && taxplayercodeDeptList.size() > 0){ + detpCollect = taxplayercodeDeptList.stream().collect(Collectors.toMap(com.xxl.sso.core.entity.SysDeptEntity::getDeptId, tri -> tri)); + } + if(detpCollect == null){ + return listUserOrg; + } if (dataPerm != null && dataPerm.size() > 0) { + for (Long deptId : dataPerm) { - if (dataPerm.size() > 0) { - for (com.xxl.sso.core.entity.SysDeptEntity sysDeptEntity : taxplayercodeDeptList) { - log.debug("deptId : " + deptId + " sysDetp: " + sysDeptEntity.getDeptId()); - if (deptId.longValue() == sysDeptEntity.getDeptId().longValue()) { - userOrg = new SysUserOrgEntity(); - userOrg.setCompany(AdminConfig.company); - userOrg.setDeptId(sysDeptEntity.getDeptId()); - userOrg.setTaxname(sysDeptEntity.getName()); - userOrg.setTaxno(sysDeptEntity.getTaxpayerCode()); - listUserOrg.add(userOrg); - } - } + com.xxl.sso.core.entity.SysDeptEntity deptEntity = detpCollect.get(deptId); + if(deptEntity != null){ + userOrg = new SysUserOrgEntity(); + userOrg.setCompany(AdminConfig.company); + userOrg.setDeptId(deptEntity.getDeptId()); + userOrg.setTaxname(deptEntity.getName()); + userOrg.setTaxno(deptEntity.getTaxpayerCode()); + listUserOrg.add(userOrg); } } + } - log.debug("listUserOrg : " + listUserOrg.size() + " listUserOrgJson: " + JSON.toJSONString(listUserOrg)); + log.info("listUserOrg : " + listUserOrg.size() + " listUserOrgJson: " + JSON.toJSONString(listUserOrg)); return listUserOrg; } diff --git a/dxhy-admin/src/main/resources/dxhy-logback.xml b/dxhy-admin/src/main/resources/dxhy-logback.xml index ac4e26d6..d2d6386a 100644 --- a/dxhy-admin/src/main/resources/dxhy-logback.xml +++ b/dxhy-admin/src/main/resources/dxhy-logback.xml @@ -16,7 +16,7 @@ - DEBUG + INFO ${PATTERN} diff --git a/dxhy-admin/src/main/resources/logback-spring.xml b/dxhy-admin/src/main/resources/logback-spring.xml index 1675cc6c..98e953ff 100644 --- a/dxhy-admin/src/main/resources/logback-spring.xml +++ b/dxhy-admin/src/main/resources/logback-spring.xml @@ -25,7 +25,7 @@ - + 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 6af5b05d..f3d4db7b 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 @@ -13,6 +13,7 @@ import com.dxhy.common.controller.AbstractController; import com.dxhy.common.util.InvoiceUtil; import com.dxhy.common.util.StringHelper; import com.dxhy.common.util.UserInfoUtil; +import com.dxhy.common.utils.DateUtils; import com.dxhy.common.utils.R; import com.dxhy.common.vo.Tax; import lombok.extern.slf4j.Slf4j; @@ -277,6 +278,35 @@ public class BaseInvoiceController extends AbstractController { if (StringUtils.isNotBlank(inAccountStatus)) { pramsMap.put("inAccountStatus", inAccountStatus); } + + if(pramsMap.get("imageNumber") != null){ + pramsMap.put("imageId",pramsMap.get("imageNumber")); + } + + if(pramsMap.get("snVoucherNumber") != null){ + pramsMap.put("snVoucherNumber",pramsMap.get("snVoucherNumber")); + } + + if(pramsMap.get("accountPeriod") != null ){ + if(pramsMap.get("accountPeriod").toString().length() > 7) { + String accountPeriod = pramsMap.get("accountPeriod").toString().substring(0, 7); + pramsMap.put("accountPeriod", accountPeriod); + }else{ + pramsMap.put("accountPeriod", pramsMap.get("accountPeriod")); + } + } + + if (pramsMap.get("postingTimeStart") != null && !"".equals(pramsMap.get("postingTimeStart"))) { + pramsMap.put("postingTimeStart", + DateUtils.getMorning(DateUtils.strToDate(pramsMap.get("postingTimeStart").toString()))); + } + if (pramsMap.get("postingTimeEnd") != null && !"".equals(pramsMap.get("postingTimeEnd"))) { + pramsMap.put("postingTimeEnd", + DateUtils.getNight(DateUtils.strToDate(pramsMap.get("postingTimeEnd").toString()))); + } + + log.info("请求列表的参数为:{}",pramsMap); + try { return ResponseEntity.ok(R.ok().put("data", baseRzFpxxService.selectByPramsMap(pramsMap, curr, size))); } catch (Exception e) { @@ -424,9 +454,15 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("settlementNo", map.get("settlementNo")); pramsMap.put("voucherNumber", map.get("voucherNumber")); pramsMap.put("snVoucherNumber", map.get("snVoucherNumber")); - pramsMap.put("postingTime", map.get("postingTime")); - pramsMap.put("imageId", map.get("imageId")); - pramsMap.put("accountPeriod", map.get("accountPeriod")); + pramsMap.put("postingTimeEnd", map.get("postingTimeEnd")); + pramsMap.put("postingTimeStart", map.get("postingTimeStart")); + pramsMap.put("imageId", 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); + } +// pramsMap.put("accountPeriod", map.get("accountPeriod")); String inAccountStatus = (String)map.get("inAccountStatus"); if (sfkrz != null) { @@ -508,6 +544,7 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("position", position); } + //发票号码 if (!StringUtils.isBlank(invoiceNo)) { if(invoiceNo.length()==8){ pramsMap.put("invoiceNo", invoiceNo); @@ -515,6 +552,9 @@ public class BaseInvoiceController extends AbstractController { pramsMap.put("eleInvoiceNo", invoiceNo); } } + + + if (!StringUtils.isBlank(xfmc)) { pramsMap.put("xfmc", xfmc); } diff --git a/dxhy-base/src/main/java/com/dxhy/base/entity/BaseTDxRecordInvoice.java b/dxhy-base/src/main/java/com/dxhy/base/entity/BaseTDxRecordInvoice.java index 1e2b958f..856c6a67 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/entity/BaseTDxRecordInvoice.java +++ b/dxhy-base/src/main/java/com/dxhy/base/entity/BaseTDxRecordInvoice.java @@ -506,5 +506,7 @@ public class BaseTDxRecordInvoice implements Serializable { //账期 private String accountPeriod; //过账时间 - private Date postingTime; + private String postingTime; + //影像号 + private String imageId; } diff --git a/dxhy-base/src/main/java/com/dxhy/base/model/BaseFpRzRespVO.java b/dxhy-base/src/main/java/com/dxhy/base/model/BaseFpRzRespVO.java index 297c62d0..ea4f5d11 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/model/BaseFpRzRespVO.java +++ b/dxhy-base/src/main/java/com/dxhy/base/model/BaseFpRzRespVO.java @@ -202,5 +202,7 @@ public class BaseFpRzRespVO implements Serializable { private Date postingTime; //影像号 SN private String imageNumber; + private String imageId; + } diff --git a/dxhy-base/src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java b/dxhy-base/src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java index 498aa1ca..b9e2c0cc 100644 --- a/dxhy-base/src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java +++ b/dxhy-base/src/main/java/com/dxhy/base/model/BaseSggxCxRespVO.java @@ -1,7 +1,10 @@ package com.dxhy.base.model; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; +import java.util.Date; + /** * 手工勾选查询返回对象 * @@ -126,4 +129,24 @@ public class BaseSggxCxRespVO { */ private String eleInvoiceNo; + /** + * 影像id + */ + private String imageId; + + /** + * 凭证号 + */ + private String snVoucherNumber; + + /** + * 过账时间 + */ + private String postingTime; + + /** + * 过账时间 + */ + private String accountPeriod; + } 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 e92d0555..098ea695 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 @@ -14,6 +14,7 @@ import java.util.Map; import javax.annotation.Resource; import com.dxhy.common.constant.DictConstant; +import com.dxhy.common.utils.DateUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -168,6 +169,10 @@ public class BaseInvoiceManualCheckServiceImpl extends MpBaseServiceImpl pramsMap, int curr, int size) { @@ -65,6 +66,7 @@ public class BaseFpbrzServiceImpl extends MpBaseServiceImpl taxnoList = (List)pramsMap.get("gfsh"); diff --git a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml index afa090bd..2362edf9 100644 --- a/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml +++ b/dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml @@ -11,7 +11,12 @@ + + + + + @@ -52,9 +57,8 @@ select - id, dept_id, company_code, dept_name, username, user_id, email_address, create_time, del_status, modify_time + id, dept_id, company_code, dept_name, username, user_id, email_address,email_password, create_time, del_status, modify_time from email_maintain diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/config/ErpWebConfiguration.java b/dxhy-erp/src/main/java/com/dxhy/erp/config/ErpWebConfiguration.java index f5b39590..8b1c373a 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/config/ErpWebConfiguration.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/config/ErpWebConfiguration.java @@ -59,7 +59,7 @@ public class ErpWebConfiguration implements WebMvcConfigurer { */ private ArrayList getIncludePathPatterns() { ArrayList list = new ArrayList<>(); - String[] urls = {"/order/**"}; + String[] urls = {"/order/**,/sn/**"}; Collections.addAll(list, urls); return list; } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java b/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java index e5ab319a..ee913bab 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java @@ -1,20 +1,26 @@ package com.dxhy.erp.controller; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.dxhy.common.aspect.SysLog; import com.dxhy.common.constant.CommonConstants; import com.dxhy.common.constant.ConfigureConstant; +import com.dxhy.common.constant.DbConstant; import com.dxhy.common.controller.AbstractController; +import com.dxhy.common.datasource.config.DynamicContextHolder; import com.dxhy.common.enums.SNFplxEnum; import com.dxhy.common.util.InvoiceUtil; +import com.dxhy.common.util.UserInfoUtil; import com.dxhy.common.utils.R; +import com.dxhy.erp.dao.CustomsRecordDao; +import com.dxhy.erp.dao.RecordInvoiceDao; import com.dxhy.erp.dao.TdxSaleRecordInvoiceDao; -import com.dxhy.erp.entity.TDxInvoiceReimburse; -import com.dxhy.erp.entity.TdxCheckRecordInvoice; -import com.dxhy.erp.entity.TdxSaleRecordInvoice; +import com.dxhy.erp.entity.*; import com.dxhy.erp.entity.sdny.*; import com.dxhy.erp.service.*; import com.dxhy.erp.utils.HmacSHA1Util; +import com.dxhy.erp.utils.ServiceResult; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; @@ -64,13 +70,19 @@ public class SDNYMainProcessController extends AbstractController { @Resource TdxSaleRecordInvoiceDao tdxSaleRecordInvoiceDao; + @Resource + private CustomsRecordDao customsRecordDao; + + @Resource + private RecordInvoiceDao recordInvoiceDao; + /** * 查验发票 */ @PostMapping("/sn/singleInvoiceCheck") @ResponseBody @SysLog("发票查验") - public ResponseEntity singleInvoiceCheck(@RequestBody Map pramsMap) { + public ResponseEntity singleInvoiceCheck(@RequestBody Map pramsMap) throws ParseException { log.info("传入的参数为:{}", pramsMap); String userid = "101833"; String dbName = "business"; @@ -128,6 +140,7 @@ public class SDNYMainProcessController extends AbstractController { log.info("发票类型为:{}", pramsMap.get("invoiceType")); String uuid = (StringUtils.isBlank(pramsMap.get("invoiceCode")) ? "" : pramsMap.get("invoiceCode")) + pramsMap.get("invoiceNo"); + log.info("uuid={}", uuid); String notes = invoiceQueryService.checkingInvoiceInfo("business", uuid, getUserInfo()); if (notes != null) { return ResponseEntity.ok(JSONObject.toJSONString(R.error(notes))); @@ -136,18 +149,25 @@ public class SDNYMainProcessController extends AbstractController { //查询底账库是否有对应发票,有则直接返回 TdxCheckRecordInvoice checkInvoiceByUuid = signCheckRecordService.getCheckInvoiceByUuid(uuid); if (checkInvoiceByUuid != null) { + log.info("进项票池已存在发票.直接返回票池信息"); R data = new R(1000, "default success"); - String checkInvoice = JSONObject.toJSONString(checkInvoiceByUuid); + JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(checkInvoiceByUuid); + convertToResult(checkInvoice); + data.put("data", checkInvoice); return ResponseEntity.ok(JSONObject.toJSONString(data)); } else { TdxSaleRecordInvoice tdxSaleRecordInvoice = tdxSaleRecordInvoiceDao.selectByUuid(uuid); + log.info("tdxSaleRecordInvoice={}", tdxSaleRecordInvoice); if (tdxSaleRecordInvoice != null) { + log.info("销项票池已存在发票.直接返回票池信息"); R data = new R(1000, "default success"); - String checkInvoice = JSONObject.toJSONString(tdxSaleRecordInvoice); + JSONObject checkInvoice = (JSONObject) JSONObject.toJSON(tdxSaleRecordInvoice); + convertToResult(checkInvoice); + data.put("data", checkInvoice); return ResponseEntity.ok(JSONObject.toJSONString(data)); @@ -199,6 +219,148 @@ public class SDNYMainProcessController extends AbstractController { return ResponseEntity.ok(JSONObject.toJSONString(R.error().put("data", checkInvoiceResult))); } + private void convertToResult(JSONObject checkInvoice) throws ParseException { + checkInvoice.put("totalTax", checkInvoice.getString("taxAmount")); + checkInvoice.put("amountTax", checkInvoice.getString("totalAmount")); + checkInvoice.put("totalAmount", checkInvoice.getString("invoiceAmount")); + String invoiceCode = checkInvoice.get("invoiceCode").toString(); + String invoiceType = checkInvoice.get("invoiceType").toString(); + if ("22".equals(invoiceType)) { + invoiceType = "33"; + } + if ("21".equals(invoiceType)) { + invoiceType = "31"; + } + + checkInvoice.put("invoiceType", invoiceType); + checkInvoice.put("administrativeDivisionNo", ""); + checkInvoice.put("administrativeDivisionName", ""); + + checkInvoice.put("invoiceCode", invoiceCode); + checkInvoice.put("invoiceNumber", checkInvoice.get("invoiceNo").toString()); + String uuid = ""; + if(invoiceCode != null && StringUtils.isNoneBlank(invoiceCode)){ + uuid = invoiceCode + checkInvoice.get("invoiceNo").toString(); + checkInvoice.put("uuid",uuid); + }else{ + uuid = checkInvoice.get("invoiceNo").toString(); + checkInvoice.put("uuid",uuid); + } + + + String kprq = checkInvoice.get("invoiceDate").toString(); + SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy", Locale.US); + Date date = sdf.parse(kprq); + String formatStr = new SimpleDateFormat("yyyy-MM-dd").format(date); + log.info("开票日期为:{} ", formatStr); + + checkInvoice.put("billingDate", formatStr); + checkInvoice.put("purchaserName", checkInvoice.get("gfName")); + checkInvoice.put("purchaserTaxNo", checkInvoice.get("gfTaxNo")); + checkInvoice.put("purchaserBank", checkInvoice.get("gfBankAndNo")); + checkInvoice.put("purchaserAddressPhone", checkInvoice.get("gfAddressAndPhone")); + checkInvoice.put("salesName", checkInvoice.get("xfName")); + checkInvoice.put("salesTaxNo", checkInvoice.get("xfTaxNo")); + checkInvoice.put("salesAddressPhone", checkInvoice.get("gfAddressAndPhone")); + checkInvoice.put("salesBank", checkInvoice.get("gfBankAndNo")); + checkInvoice.put("checkCode", checkInvoice.get("checkCode")); + checkInvoice.put("state", "0"); + checkInvoice.put("tollSign", "07"); + String taxRate = ""; + + List> returnDetailList = new ArrayList<>(); +// JSONArray detailList = (JSONArray) invoiceData.get("detailList"); + JSONArray detailList = new JSONArray(); + + for (int i = 0; i < detailList.size(); i++) { + String taxRateDetail = ""; + JSONObject detail = (JSONObject) detailList.get(i); + Map snDetailMap = new HashMap(); + snDetailMap.put("rowNo", i + 1 + ""); + snDetailMap.put("commodityCode", detail.getString("ssflbm")); + snDetailMap.put("commodityName", detail.getString("hwmc")); + snDetailMap.put("specificationModel", detail.getString("ggxh")); + snDetailMap.put("unit", detail.getString("jldw")); + String quantity = detail.getString("spsl"); +// if (quantity.length() > 3) { +// int index = quantity.indexOf("."); +// quantity = quantity.substring(0, index + 2); +// } + snDetailMap.put("quantity", quantity); + + String unitPrice = detail.getString("bhsdj"); +// if (unitPrice.length() > 3) { +// int index = unitPrice.indexOf("."); +// unitPrice = unitPrice.substring(0, index + 3); +// } + + snDetailMap.put("unitPrice", unitPrice); + + + if ("11".equals(invoiceType)) { + snDetailMap.put("tax", "0"); + + //如果是卷票计算合计金额 + Float hjje = null; + if (detail.getString("se") != null && detail.getString("je") != null) { + Float je = Float.parseFloat(detail.getString("je")); + Float se = Float.parseFloat(detail.getString("se")); + hjje = je + se; + } + + if (hjje != null) + snDetailMap.put("amount", hjje.toString()); + + } else { + snDetailMap.put("tax", "***".equals(detail.getString("se")) ? "0.00" : detail.getString("se")); + snDetailMap.put("amount", detail.getString("je")); + } + + + if ("免税".equals(detail.getString("sl"))) { + taxRateDetail = "0"; + snDetailMap.put("taxRate", taxRateDetail); + } else { + if (detail.get("sl") != null && StringUtils.isNoneBlank(detail.get("sl").toString())) { + taxRateDetail = detail.get("sl").toString(); + if (!"0".equals(taxRateDetail)) { + if (StringUtils.isNoneBlank(taxRateDetail)) { + int index = taxRateDetail.indexOf("%"); + if (index > 0) { + taxRateDetail = taxRateDetail.substring(0, taxRateDetail.length() - 1); + Float num = Float.parseFloat(taxRateDetail); + if (num > 9) { + taxRateDetail = "0." + taxRateDetail; + } else { + if (!taxRateDetail.startsWith("0")) { + taxRateDetail = "0.0" + taxRateDetail; + } + } + } + } + } + + if ("11".equals(invoiceType)) { + taxRateDetail = "0.000"; + } + log.info("明细-发票税率为:{}", taxRateDetail); + snDetailMap.put("taxRate", taxRateDetail); + } + } + + log.info("明细-tax={}", detail.get("se")); + log.info("明细-commodityCode={}", detail.get("ssflbm")); + snDetailMap.put("currentDateEnd", detail.getString("txrqz")); + snDetailMap.put("currentDateStart", detail.getString("txrqq")); + snDetailMap.put("licensePlateNum", detail.getString("cph")); + snDetailMap.put("type", detail.getString("lx")); + + returnDetailList.add(snDetailMap); + } + + checkInvoice.put("invoiceLineList", returnDetailList); + } + /** * 查验发票 */ @@ -461,20 +623,20 @@ public class SDNYMainProcessController extends AbstractController { BigDecimal bigDecimal = new BigDecimal(taxRate); BigDecimal multiply = bigDecimal.multiply(new BigDecimal("100")); info.setZTAX(multiply.toString()); + info.setZSM(getZSM(taxRate)); } if (taxRate != null && taxRate.contains("%")) { String replace = taxRate.replace("%", ""); BigDecimal bigDecimal = new BigDecimal(replace); BigDecimal divide = bigDecimal.divide(new BigDecimal(100)); - taxRate = divide.toString(); - info.setZTAX(bigDecimal.multiply(new BigDecimal("0.01")).toString()); - info.setZSM(getZSM(taxRate)); - } - if (info.getZTAX() != null) { - info.setZSM(getZSM(info.getZTAX())); +// taxRate = divide.toString(); +// info.setZTAX(bigDecimal.multiply(new BigDecimal("0.01")).toString()); + info.setZTAX(replace+".00"); + info.setZSM(getZSM(divide.toString())); } if (info.getZTAX() == null || info.getZTAX() == "") { info.setZTAX("0.00"); + info.setZSM(getZSM(info.getZTAX())); } info.setZFPDM(snInvoice.getInvoiceCode()); info.setZCD(snInvoice.getOriginPlace()); @@ -506,7 +668,8 @@ public class SDNYMainProcessController extends AbstractController { info.setZGXR(""); //认证相关 - info.setZRZJG("0"); + String zrzjg = getZRZJG(snInvoice.getInvoiceCode(),snInvoice.getInvoiceNumber(),info.getZFPLX()); + info.setZRZJG(zrzjg); info.setZRZSSQ(""); // info.setZRZMS(""); // info.setZRZRQ(""); @@ -527,12 +690,20 @@ public class SDNYMainProcessController extends AbstractController { info.setZCCRZH(snInvoice.getIdcardNo()); info.setZCPXH(snInvoice.getBrandModel()); info.setZMHFZJJ(snInvoice.getCaacDevelopmentFund()); - info.setZGFDH(snInvoice.getPurchaserAddressPhone()); + + if (!"nullnull".equals(snInvoice.getPurchaserAddressPhone())){ + info.setZGFDH(snInvoice.getPurchaserAddressPhone()); +// info.setZGFDH(""); + } info.setZXFZH(snInvoice.getSalesBank()); info.setZJYM(snInvoice.getCheckCode()); info.setZSJDH(snInvoice.getInspectionListNo()); // info.setZYGC(""); info.setZJSHJ(snInvoice.getAmountTax()); + if (snInvoice.getAmountTax() == null && ("17".equals(info.getZFPLX()) || "18".equals(info.getZFPLX()))){ + info.setZJSHJ(snInvoice.getTotalAmount()); + + } info.setZCYRMC(snInvoice.getCarrierName()); info.setZJGDM(snInvoice.getTaxAuthorityNo()); //时间转换 @@ -543,10 +714,20 @@ public class SDNYMainProcessController extends AbstractController { if (snInvoice.getSource() == null) { info.setZPJLY("1"); } - info.setZCYZT(snInvoice.getCheckStaus()); - if (snInvoice.getCheckStaus() == null) { - info.setZCYZT("1"); + + if ("01".equals(snInvoice.getInvoiceType()) || "02".equals(snInvoice.getInvoiceType()) || "03".equals(snInvoice.getInvoiceType()) || "04".equals(snInvoice.getInvoiceType()) + || "08".equals(snInvoice.getInvoiceType()) || "10".equals(snInvoice.getInvoiceType()) || "11".equals(snInvoice.getInvoiceType()) || "14".equals(snInvoice.getInvoiceType()) + || "15".equals(snInvoice.getInvoiceType()) || "31".equals(snInvoice.getInvoiceType()) || "32".equals(snInvoice.getInvoiceType())) { + //可查验发票, + info.setZCYZT("1"); + } else { + //不可查验发票 + info.setZCYZT("3"); } +// info.setZCYZT(snInvoice.getCheckStaus()); +// if (snInvoice.getCheckStaus() == null) { +// info.setZCYZT("1"); +// } info.setZCJR("opentext"); info.setZGXR("opentext"); info.setZQM("opentext"); @@ -684,4 +865,64 @@ public class SDNYMainProcessController extends AbstractController { } return sm; } + + private String getZRZJG(String invoiceCode, String invoiceNo,String FPLX){ + String ZCYJG = ""; + String uuid = invoiceCode+invoiceNo; + DynamicContextHolder.push(DbConstant.BUSINESS_READ); + + //可价税分离票种 + //10:增值税专用发票 + //12:增值税电子普通发票 + //13:增值税普通发票(卷票) + //14:机动车销售统一发票 + //15:二手车销售统一发票 + //24:增值税电子普通发票(通行费) + //25:增值税电子专用发票 + //26:电子发票(增值税专用发票) + //27:电子发票(普通发票) + //22:过路费发票 + //11:增值税普通发票 + //16:定额发票 + //17:机打发票 + //18:出租车发票 + if ("10".equals(FPLX) || "12".equals(FPLX) || "13".equals(FPLX) || "14".equals(FPLX) || "15".equals(FPLX) + || "24".equals(FPLX) || "25".equals(FPLX) || "26".equals(FPLX) || "27".equals(FPLX) || "22".equals(FPLX) + || "11".equals(FPLX) || "16".equals(FPLX) || "17".equals(FPLX) || "18".equals(FPLX) ) { + QueryWrapper wrapper = new QueryWrapper(); + wrapper.eq("uuid", uuid); + TDxInvoiceReimburse one = tDxInvoiceReimburseService.getOne(wrapper); + if (one != null){ + ZCYJG = one.getRzhYesorno(); + } + + + } else { + //19:火车票 + //20:客运汽车 + //21:航空运输电子客票行程单 + //28:船票 + //如果是可查验类型,直接更新数据库 + if ( "19".equals(FPLX) || "20".equals(FPLX) || "21".equals(FPLX) || "28".equals(FPLX)) { + //其他票种 + QueryWrapper wrapper = new QueryWrapper(); + wrapper.eq("uuid", uuid); + RecordInvoice recordInvoice = recordInvoiceDao.selectOne(wrapper); + if (recordInvoice != null){ + ZCYJG = recordInvoice.getRzhYesorno(); + } + + } else { + //海关缴款书 + QueryWrapper wrapper = new QueryWrapper(); + wrapper.eq("uuid", uuid); + TdxCustomsRecord tdxCustomsRecord = customsRecordDao.selectOne(wrapper); + if (tdxCustomsRecord != null){ + ZCYJG = tdxCustomsRecord.getRzhYesorno(); + } + } + + } + return ZCYJG; + } } diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/dao/SysDeptDao.java b/dxhy-erp/src/main/java/com/dxhy/erp/dao/SysDeptDao.java index 2964779d..9ff1e518 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/dao/SysDeptDao.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/dao/SysDeptDao.java @@ -38,6 +38,10 @@ public interface SysDeptDao extends BaseMapper { * @return */ SysDeptEntity getOrg(@Param("taxno") String taxno); + + SysDeptEntity getOrgByCompCode(@Param("compCode") String compCode); + + SysDeptEntity getOrgByCompany(@Param("company") String company); /** diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/TDxInvoiceReimburse.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/TDxInvoiceReimburse.java index 4d3e1dbc..a66b8531 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/entity/TDxInvoiceReimburse.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/TDxInvoiceReimburse.java @@ -53,6 +53,7 @@ public class TDxInvoiceReimburse { private String xfTaxNo; private String xfName; private String taxRate; + private String taxCode; private String createDate; private String rzhYesorno; private String tag; diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java b/dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java index 15852206..816b73fd 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/entity/TdxSaleRecordInvoice.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.math.BigDecimal; @@ -42,6 +43,7 @@ public class TdxSaleRecordInvoice implements Serializable { /** * 开票日期 */ + @DateTimeFormat(pattern="yyyy-MM-dd") private Date invoiceDate; /** diff --git a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java index 972f6c87..cadc6110 100644 --- a/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java +++ b/dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java @@ -7,14 +7,17 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.dxhy.common.constant.DbConstant; import com.dxhy.common.datasource.config.DynamicContextHolder; +import com.dxhy.common.enums.FplxEnum; import com.dxhy.common.enums.SNFplxEnum; import com.dxhy.common.util.InvoiceUtil; import com.dxhy.common.vo.UserInfo; import com.dxhy.erp.dao.AreaDao; import com.dxhy.erp.dao.BaseTDxRecordInvoiceDao; import com.dxhy.erp.dao.BaseTDxTaxCurrentDao; +import com.dxhy.erp.dao.SysDeptDao; import com.dxhy.erp.entity.BaseTDxRecordInvoice; import com.dxhy.erp.entity.BaseTDxTaxCurrent; +import com.dxhy.erp.entity.SysDeptEntity; import com.dxhy.erp.entity.TDxInvoiceReimburse; import com.dxhy.erp.entity.kfpt.ApiCheckInvoiceSingleRequest; import com.dxhy.erp.entity.kfpt.ApiRequest; @@ -90,6 +93,9 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { @Resource private TDxInvoiceReimburseService tDxInvoiceReimburseService; + @Resource + private SysDeptDao sysDeptDao; + public String pushCheckResultToSAP(String requestParam) throws Exception { log.info("获取请求参数:{} , 请求地址:{}", requestParam, snYxUrl); String post = HttpUtils.sendPo(snYxUrl, requestParam, userName, password); @@ -98,7 +104,17 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { return post; } - public String pushInvoiceToRecordInvoice(SNInvoice snInvoice, String taxNo, String company) throws Exception { + public String pushInvoiceToRecordInvoice(SNInvoice snInvoice, String taxNo, String company,String compCode) throws Exception { + + BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice(); + DynamicContextHolder.push(DbConstant.BASICS_READ); + + SysDeptEntity orgByCompCode = sysDeptDao.getOrgByCompCode(compCode); + log.info("查询的组织信息为:{}",JSONObject.toJSONString(orgByCompCode)); + recordInvoice.setGfTaxNo(orgByCompCode.getTaxno()); + recordInvoice.setGfName(orgByCompCode.getTaxname()); + recordInvoice.setGfAddressAndPhone(orgByCompCode.getAddress() + orgByCompCode.getPhone()); + recordInvoice.setGfBankAndNo(orgByCompCode.getBank() + orgByCompCode.getAccount()); QueryWrapper currentWrapper = new QueryWrapper<>(); currentWrapper.eq("taxno", taxNo); @@ -129,7 +145,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { String gfmc = snInvoice.getPurchaserName(); String invoiceType = snInvoice.getInvoiceType(); - BaseTDxRecordInvoice recordInvoice = new BaseTDxRecordInvoice(); + recordInvoice.setUuid(fpdm + fphm); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); if (kprq != null) { @@ -317,7 +333,13 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { jsonObject.put("salesName", invoiceData.get("xhfmc")); jsonObject.put("salesTaxNo", invoiceData.get("xhfsbh")); jsonObject.put("salesAddressPhone", invoiceData.get("xhfdzdh")); - jsonObject.put("salesBank", invoiceData.get("xhfyhzh")); + if(FplxEnum.JDC.getFplxDm().equals(invoiceType)){ + if(invoiceData.get("khyh") != null && invoiceData.get("khzh") != null) { + jsonObject.put("salesBank", invoiceData.get("khyh").toString() + invoiceData.get("khzh").toString()); + } + }else{ + jsonObject.put("salesBank", invoiceData.get("xhfyhzh")); + } jsonObject.put("totalAmount", invoiceData.get("fpje")); if ("11".equals(invoiceData.get("fpzl"))) { jsonObject.put("totalTax", "0"); @@ -570,17 +592,27 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { log.info("价税分离失败:{}", invoiceResult.getMsg()); return invoiceResult.getMsg(); } + DynamicContextHolder.push(DbConstant.BASICS_READ); + SysDeptEntity orgByCompCode = sysDeptDao.getOrgByCompCode(compCode); + log.info("查询的组织信息为:{}",JSONObject.toJSONString(orgByCompCode)); + reimburse.setGfTaxNo(orgByCompCode.getTaxno()); + reimburse.setGfName(orgByCompCode.getTaxname()); + reimburse.setGfAddressAndPhone(orgByCompCode.getAddress() + orgByCompCode.getPhone()); + reimburse.setGfBankAndNo(orgByCompCode.getBank() + orgByCompCode.getAccount()); reimburse = convertToReimburse(invoice, reimburse, fplxdm, company); + log.info("插库的发票信息:{}",reimburse); + DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE); int insert = 0; QueryWrapper wrapper = new QueryWrapper(); wrapper.eq("uuid", reimburse.getUuid()); TDxInvoiceReimburse reimburse1 = tDxInvoiceReimburseService.getBaseMapper().selectOne(wrapper); if (reimburse1 != null) { - insert = tDxInvoiceReimburseService.getBaseMapper().updateById(reimburse1); +// insert = tDxInvoiceReimburseService.getBaseMapper().updateById(reimburse); + insert = tDxInvoiceReimburseService.getBaseMapper().update(reimburse,wrapper); } else { insert = tDxInvoiceReimburseService.getBaseMapper().insert(reimburse); } @@ -597,7 +629,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { log.info("可查验发票,更新底账库完成"); } else { //不可查验发票,未入库,插入票池 - this.pushInvoiceToRecordInvoice(invoice, taxNo, company); + this.pushInvoiceToRecordInvoice(invoice, taxNo, company,compCode); log.info("不可查验发票,插入底账库成功"); } @@ -634,12 +666,8 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { reimburse.setXfAddressAndPhone(invoice.getSalesAddressPhone()); reimburse.setXfBankAndNo(invoice.getSalesBank()); - reimburse.setGfTaxNo(invoice.getPurchaserTaxNo()); - reimburse.setGfName(invoice.getPurchaserName()); - reimburse.setGfAddressAndPhone(invoice.getPurchaserAddressPhone()); - reimburse.setGfBankAndNo(invoice.getPurchaserBank()); - reimburse.setTaxRate(invoice.getTaxRate()); + reimburse.setTaxCode(getTaxCode(invoice.getTaxRate())); reimburse.setIsDeduction(invoice.getIsDeductible()); if (StringUtils.isNoneBlank(reimburse.getInvoiceCode())) { @@ -664,6 +692,63 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { return reimburse; } + private String getTaxCode(String taxRate) { + + String sm = "J0"; + + switch (taxRate) { + // 发票采集 + case "0%": + sm = "J0"; + break; + case "0.00": + sm = "J0"; + break; + case "0.000": + sm = "J0"; + break; + case "免税": + sm = "J0"; + break; + case "16%": + sm = "J1"; + break; + case "13%": + sm = "J2"; + break; + case "10%": + sm = "J3"; + break; + case "9%": + sm = "J4"; + break; + case "6%": + sm = "J5"; + break; + case "5%": + sm = "J6"; + break; + case "3%": + sm = "J7"; + break; + case "2%": + sm = "J8"; + break; + case "1%": + sm = "J9"; + break; + case "17%": + sm = "JC"; + break; + default: + sm = "J0"; + break; + + } + return sm; + + } + private InvoiceInfo convertToInvoiceInfo(SNInvoice snInvoice) { InvoiceInfo invoice = new InvoiceInfo(); invoice.setInvoiceTypeCode(snInvoice.getInvoiceType()); @@ -681,7 +766,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter { invoice.setPassenger(snInvoice.getRiderName()); invoice.setDepartCity(snInvoice.getStationGetOn()); invoice.setArriveCity(snInvoice.getStationGetOff()); - if ("92".equals(invoice.getInvoiceTypeCode()) || "89".equals(invoice.getInvoiceTypeCode())) { + if ("92".equals(invoice.getInvoiceTypeCode()) || "89".equals(invoice.getInvoiceTypeCode()) || "88".equals(invoice.getInvoiceTypeCode())) { if (snInvoice.getAmountTax() != null) invoice.setInvoiceAmount(new BigDecimal(snInvoice.getAmountTax())); } diff --git a/dxhy-erp/src/main/resources/bootstrap-dev.yaml b/dxhy-erp/src/main/resources/bootstrap-dev.yaml index aa8b3494..d2241fff 100644 --- a/dxhy-erp/src/main/resources/bootstrap-dev.yaml +++ b/dxhy-erp/src/main/resources/bootstrap-dev.yaml @@ -4,22 +4,24 @@ spring: nacos: config: # Nacos config 地址 - server-addr: 10.1.2.202:8848 + server-addr: 172.31.36.147:33000 # Nacos config 命名空间,对应配置中的名称(dxhy-jxpt-namespace) - namespace: b271ba8e-84d9-4393-88b8-9271aff9465c + namespace: eb6eab27-62a4-4ccf-8640-b8e91df0a1a6 # Nacos config 分组 group: dxhy-erp-group # Nacos config 登录用户名 - username: dxhy-jxpt + username: nacos # Nacos config 登录密码 - password: dxhy-jxpt + password: Invoice.nacos.!1 # Nacos config 配置文件前缀 prefix: dxhy-erp # Nacos config 配置文件后缀,拼接完URL需要对应NacosServer中的dataId对应配置,${prefix}-${spring.profiles.active}.${file-extension} file-extension: yaml # Nacos discovery 配置 discovery: - server-addr: 10.1.2.202:8848 - username: dxhy-jxpt - password: dxhy-jxpt - namespace: b271ba8e-84d9-4393-88b8-9271aff9465c \ No newline at end of file + server-addr: 172.31.36.147:33000 + # Nacos config 登录用户名 + username: nacos + # Nacos config 登录密码 + password: Invoice.nacos.!1 + namespace: eb6eab27-62a4-4ccf-8640-b8e91df0a1a6 \ No newline at end of file diff --git a/dxhy-erp/src/main/resources/bootstrap-std.yaml b/dxhy-erp/src/main/resources/bootstrap-std.yaml index 588bf1e1..7c52edcd 100644 --- a/dxhy-erp/src/main/resources/bootstrap-std.yaml +++ b/dxhy-erp/src/main/resources/bootstrap-std.yaml @@ -10,7 +10,7 @@ spring: # Nacos config 分组 group: dxhy-erp-group # Nacos config 登录用户名 - username: admin + username: nacos # Nacos config 登录密码 password: Invoice.nacos.!1 # Nacos config 配置文件前缀 @@ -21,7 +21,7 @@ spring: discovery: server-addr: 172.31.36.143:33000 # Nacos config 登录用户名 - username: admin + username: nacos # Nacos config 登录密码 password: Invoice.nacos.!1 namespace: b271ba8e-84d9-4393-88b8-9271aff9465c \ No newline at end of file diff --git a/dxhy-erp/src/main/resources/mapper/SysDeptDao.xml b/dxhy-erp/src/main/resources/mapper/SysDeptDao.xml index a1cd5833..585cd639 100644 --- a/dxhy-erp/src/main/resources/mapper/SysDeptDao.xml +++ b/dxhy-erp/src/main/resources/mapper/SysDeptDao.xml @@ -28,6 +28,14 @@ and del_flag = '0' limit 1 + + diff --git a/dxhy-sign/src/main/java/com/dxhy/sign/controller/SignFpqsController.java b/dxhy-sign/src/main/java/com/dxhy/sign/controller/SignFpqsController.java index 2fb438e2..4d37b10d 100644 --- a/dxhy-sign/src/main/java/com/dxhy/sign/controller/SignFpqsController.java +++ b/dxhy-sign/src/main/java/com/dxhy/sign/controller/SignFpqsController.java @@ -278,8 +278,13 @@ public class SignFpqsController extends AbstractController { } } String invoiceType = pramsMap.get("invoiceType"); + String invoiceCode = pramsMap.get("invoiceCode"); + String invoiceNo = pramsMap.get("invoiceNo"); if(FplxEnum.QDZZP.getFplxDm().equals(invoiceType) || FplxEnum.QDPP.getFplxDm().equals(invoiceType)){ pramsMap.put("invoiceType", invoiceType); + }else if("99".equals(invoiceType) && invoiceNo.length() == 20){ + invoiceType = "31"; + pramsMap.put("invoiceType", invoiceType); }else { InvoiceUtil iu = new InvoiceUtil(pramsMap.get("invoiceCode")); pramsMap.put("invoiceType", iu.getFplxdm()); @@ -650,7 +655,7 @@ public class SignFpqsController extends AbstractController { int size = (int)pramsMap.get("size"); try { log.info("签收列表查询参数 {}",data); - log.info("返回结果为 {}",signFpqsService.selectDelfpList(data,curr,size)); + log.info("返回结果为 {}",signFpqsService.selectQsfpList(data,curr,size)); return ResponseEntity.ok(R.ok().put("data", signFpqsService.selectQsfpList(data, curr, size))); } catch (Exception e) { e.printStackTrace(); diff --git a/dxhy-sign/src/main/java/com/dxhy/sign/service/fpqs/impl/FpqsServiceImpl.java b/dxhy-sign/src/main/java/com/dxhy/sign/service/fpqs/impl/FpqsServiceImpl.java index 6d0d2e7f..a24970b6 100644 --- a/dxhy-sign/src/main/java/com/dxhy/sign/service/fpqs/impl/FpqsServiceImpl.java +++ b/dxhy-sign/src/main/java/com/dxhy/sign/service/fpqs/impl/FpqsServiceImpl.java @@ -92,7 +92,7 @@ public class FpqsServiceImpl extends MpBaseServiceImpl pageList = new ArrayList<>(); if (pramsMap.get("gxStatus") != null && !"".equals(pramsMap.get("gxStatus"))) { + log.info("gxStatus不为空直接进行查询"); pageList = signInvoiceDao.selectQsfpListJrtt(pramsMap); } else { + log.info("进入到signInvoiceMapper查询"); pageList = signInvoiceSmService.selectQsfpList(pramsMap); } log.info("pageList {}",pageList); @@ -1651,6 +1654,7 @@ public class SignFpqsServiceImpl extends MpBaseServiceImpl SELECT - r.id,t.notes,t.qs_type,t.qs_status,t.qs_date,t.user_name,t.invoice_code,t.invoice_no,t.ele_invoice_no,t.uuid,t.invoice_date,t.invoice_type,t.invoice_amount,t.tax_amount + t.id,t.notes,t.qs_type,t.qs_status,t.qs_date,t.user_name,t.invoice_code,t.invoice_no,t.ele_invoice_no,t.uuid,t.invoice_date,t.invoice_type,t.invoice_amount,t.tax_amount ,t.dept_id,t.dept_name,t.scan_id,t.gf_name,t.xf_name,t.gf_tax_no,t.xf_tax_no,t.check_code,t.remark,t.create_date,t.total_amount, t.voucher_number,img.image_path FROM t_dx_invoice t @@ -50,11 +50,14 @@ and t.invoice_type = #{invoiceType} --> - - and (r.invoice_type = '14' or (r.invoice_type = '32' and r.lq_tdyslxDm='08') ) - - - and r.invoice_type = #{invoiceType} and r.lq_tdyslxDm!='08' + + + + + + + + and r.invoice_type = #{invoiceType} and t.invoice_no = #{invoiceNo} @@ -115,17 +118,18 @@ and t.gf_tax_no = #{gfsh} - + + + + + + + + and t.invoice_type = #{invoiceType} - --> - - and (r.invoice_type = '14' or (r.invoice_type = '32' and r.lq_tdyslxDm='08') ) - - - and r.invoice_type = #{invoiceType} and r.lq_tdyslxDm!='08' - and t.invoice_no = #{invoiceNo}