Merge remote-tracking branch 'origin/0815-通过销项获取当前组织最新税号' into release

# Conflicts:
#	dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
#	dxhy-erp/src/main/java/com/dxhy/erp/dao/VihicleInvoiceDetailDao.java
#	dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtInvoicePoolController.java
release
wangrangrang 2 years ago
commit 580f6bee91
  1. 28
      dxhy-admin/src/main/java/com/dxhy/admin/sys/entity/SaleTaxnoEntity.java
  2. 2
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/SysUserService.java
  3. 48
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SsoLoginServiceImpl.java
  4. 40
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysUserServiceImpl.java
  5. 8
      dxhy-admin/src/main/resources/bootstrap-test.yaml
  6. 229
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  7. 14
      dxhy-erp/src/main/java/com/dxhy/erp/service/SNPushCheckRecordService.java
  8. 2
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoicePoolServiceImpl.java
  9. 14
      dxhy-erp/src/main/resources/bootstrap-dev.yaml
  10. 4
      dxhy-erp/src/main/resources/bootstrap-test.yaml
  11. 16
      dxhy-extend/src/main/java/com/dxhy/extend/controller/ExtInvoicePoolController.java
  12. 10
      pom.xml

@ -0,0 +1,28 @@
package com.dxhy.admin.sys.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 系统用户
*
* @author jiaohongyang
*/
@Data
public class SaleTaxnoEntity implements Serializable {
private static final long serialVersionUID = 1L;
private String groupId;
private String groupName;
private String xhfNsrsbh;
}

@ -52,6 +52,8 @@ public interface SysUserService extends IService<SysUserEntity> {
*/
void saveUser(SysUserEntity user);
void saveUser(SysUserEntity user,Map<String, String> taxnos);
/**
* 修改用户
*

@ -1,14 +1,13 @@
package com.dxhy.admin.sys.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.alibaba.fastjson.JSONArray;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
@ -32,6 +31,12 @@ import lombok.extern.slf4j.Slf4j;
@Service("ssoLoginService")
@Slf4j
public class SsoLoginServiceImpl implements SsoLoginService {
private static final String LOGGER_MSG = "(请求http访问)";
@Value("${sdny.xxUrl}")
private String xxUrl;
@Resource
private SysUserService sysUserService;
@Resource
@ -50,14 +55,21 @@ public class SsoLoginServiceImpl implements SsoLoginService {
@Override
public boolean saveUser(SsoUser user) {
String taxNoInfo = getTaxNoInfo(xxUrl, "");
JSONObject object = JSONObject.parseObject(taxNoInfo);
String taxnoListInfo = object.getString("groupInfo");
List<SaleTaxnoEntity> taxnoList = JSONObject.parseArray(taxnoListInfo,SaleTaxnoEntity.class);
Map<String, String> taxnos = taxnoList.stream().collect(Collectors.toMap(SaleTaxnoEntity::getGroupId, SaleTaxnoEntity::getXhfNsrsbh));
log.info("从销项获取的税号列表为:{}",taxnos);
if (user.getUserSource() == 1) {
// 保存 机构信息
boolean insertOrg = this.insertOrg(user);
boolean insertOrg = this.insertOrg(user,taxnos);
// 保存角色信息
boolean insertRole = this.insertRole(user);
// 保存用户信息
boolean insertUser = this.insertUser(user);
boolean insertUser = this.insertUser(user,taxnos);
log.info("insertOrg = {},insertRole={},insertUser",insertOrg,insertRole,insertUser);
@ -70,12 +82,12 @@ public class SsoLoginServiceImpl implements SsoLoginService {
}
public boolean insertUser(SsoUser user) {
public boolean insertUser(SsoUser user,Map<String, String> taxnos) {
try {
SysUserEntity userEntity = this.toUser(user);
// 先删除用户信息,在新增
sysUserService.deleteUserBigb(userEntity.getUserId());
sysUserService.saveUser(userEntity);
sysUserService.saveUser(userEntity,taxnos);
return true;
} catch (Exception e) {
log.error("insertUser 报错信息为{}",e);
@ -110,9 +122,9 @@ public class SsoLoginServiceImpl implements SsoLoginService {
* 用户信息
* @return 返回信息
*/
public boolean insertOrg(SsoUser user) {
public boolean insertOrg(SsoUser user,Map<String, String> taxnos) {
try {
List<SysDeptEntity> deptList = this.toDept(user);
List<SysDeptEntity> deptList = this.toDept(user,taxnos);
if (deptList != null && deptList.size() > 0) {
sysDeptService.saveDeptList(deptList);
}
@ -125,7 +137,7 @@ public class SsoLoginServiceImpl implements SsoLoginService {
}
public List<SysDeptEntity> toDept(SsoUser user) {
public List<SysDeptEntity> toDept(SsoUser user,Map<String, String> taxnos) {
List<SysDeptEntity> deptList = new ArrayList<>();
int deptSum = 0;
SysDeptEntity dept;
@ -135,7 +147,13 @@ public class SsoLoginServiceImpl implements SsoLoginService {
dept = new SysDeptEntity();
dept.setDeptId(entity.getDeptId());
dept.setParentId(entity.getParentId());
if(StringUtils.isNotBlank(entity.getTaxpayerCode())){
dept.setTaxno(entity.getTaxpayerCode());
}else{
String deptId = String.valueOf(entity.getDeptId());
dept.setTaxno(taxnos.get(deptId));
}
dept.setTaxname(entity.getName());
dept.setName(entity.getName());
dept.setLinkman("");
@ -712,4 +730,12 @@ public class SsoLoginServiceImpl implements SsoLoginService {
}
}
public String getTaxNoInfo(String url, String request) {
long startTime = System.currentTimeMillis();
String body = HttpRequest.post(url).body(request).timeout(300000).execute().body();
long endTime = System.currentTimeMillis();
log.debug("{}以字符串调用post请求url:{},耗时:{}", LOGGER_MSG, url, endTime - startTime);
return body;
}
}

@ -113,6 +113,18 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
this.uploadUser(user);
}
@Override
public void saveUser(SysUserEntity user,Map<String, String> taxnos) {
DynamicContextHolder.push(DbConstant.BASICS_WRITE);
user.setCreateTime(DateUtil.date());
user.setUpdateTime(DateUtil.date());
// 查询用户关联菜单信息
Aops.getSelf(this).insertUser(user,taxnos);
this.insertRedis(user);
DynamicContextHolder.push(DbConstant.BASICS_READ);
this.uploadUser(user);
}
@Transactional(rollbackFor = Exception.class)
public void insertUser(SysUserEntity user) {
user.setCreateTime(new Date());
@ -133,6 +145,34 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserDao, SysUserEntity> i
}
@Transactional(rollbackFor = Exception.class)
public void insertUser(SysUserEntity user,Map<String, String> taxnos) {
user.setCreateTime(new Date());
String salt = RandomStringUtils.randomAlphanumeric(20);
user.setSalt(salt);
user.setScanType("5");
user.setPlpassword(Base64.encode(user.getPassword()));
user.setPassword(new BCryptPasswordEncoder(UserConstant.PW_ENCORDER_SALT).encode(user.getPassword()));
this.saveOrUpdate(user);
// 保存用户与角色关系
sysUserRoleService.saveOrUpdate(user.getUserId(), user.getRoleIdList());
// 保存客户信息,更新企业税号
user.getUserOrgEntities().stream().forEach(userOrg -> {
if(StringUtils.isEmpty(userOrg.getTaxno())){
if(StringUtils.isNotEmpty(taxnos.get(userOrg.getDeptId()))) {
userOrg.setTaxno(taxnos.get(userOrg.getDeptId()));
}
}
});
// 获取关联 数据权限
sysUserOrgService.saveOrUpdate(user.getUserId(), user.getUserOrgEntities());
// 保存用户与业务单元关系
if (user.getBusinessList() != null && user.getBusinessList().size() > 0) {
sysUserBusinessService.saveOrUpdate(user.getUserId(), user.getBusinessList());
}
}
@Override
public void update(SysUserEntity user) {
DynamicContextHolder.push(DbConstant.BASICS_WRITE);

@ -4,9 +4,9 @@ spring:
nacos:
config:
# Nacos config 地址
server-addr: 172.31.36.143:33000
server-addr: 172.31.36.146:33000
# Nacos config 命名空间,对应配置中的名称(dxhy-jxpt-namespace)
namespace: b271ba8e-84d9-4393-88b8-9271aff9465c
namespace: c8ce91b7-c3a9-4a6e-a354-8405ce60d66c
# Nacos config 分组
group: dxhy-admin-group
# Nacos config 登录用户名
@ -19,9 +19,9 @@ spring:
file-extension: yaml
# Nacos discovery 配置
discovery:
server-addr: 172.31.36.143:33000
server-addr: 172.31.36.146:33000
# Nacos config 登录用户名
username: admin
# Nacos config 登录密码
password: Invoice.nacos.!1
namespace: b271ba8e-84d9-4393-88b8-9271aff9465c
namespace: c8ce91b7-c3a9-4a6e-a354-8405ce60d66c

@ -111,6 +111,7 @@ public class SDNYMainProcessController extends AbstractController {
@Resource
private RequestRecordService requestRecordService;
/**
* 查验发票
*/
@ -274,7 +275,6 @@ public class SDNYMainProcessController extends AbstractController {
DynamicContextHolder.push("business" + DbConstant.DETAIL_READ);
baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper);
}
DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ);
if ((baseTDxRecordInvoiceDetail == null || baseTDxRecordInvoiceDetail.size() == 0) && (vehicleList == null || vehicleList.size() == 0)) {
@ -301,6 +301,7 @@ public class SDNYMainProcessController extends AbstractController {
baseTDxRecordInvoiceDetail = baseTDxRecordInvoiceDetailDao.selectList(detailWrapper);
DynamicContextHolder.push("business" + DbConstant.BUSINESS_READ);
}
}
} else if (checkInvoiceResult.containsKey("cyjg") && !"0001".equals(checkInvoiceResult.getString("cyjg"))) {
data = errorInfo(checkInvoiceResult, data);
@ -823,6 +824,209 @@ public class SDNYMainProcessController extends AbstractController {
String taxRate = "";
List<Map<String, String>> returnDetailList = new ArrayList<>();
JSONArray detailList = detailArray;
for (int i = 0; i < detailList.size(); i++) {
String taxRateDetail = "";
JSONObject detail = (JSONObject) detailList.get(i);
if (StringUtils.isNotEmpty(detail.getString("goodsName")) && (detail.getString("goodsName").equals("(详见销货清单)") || detail.getString("goodsName").equals("(详见销货清单)"))) {
continue;
}
Map<String, String> snDetailMap = new HashMap<String, String>();
snDetailMap.put("rowNo", i + 1 + "");
snDetailMap.put("commodityCode", detail.getString("goodsNum"));
snDetailMap.put("commodityName", detail.getString("goodsName"));
snDetailMap.put("specificationModel", detail.getString("model"));
snDetailMap.put("unit", detail.getString("unit"));
String quantity = detail.getString("num");
snDetailMap.put("quantity", quantity);
String unitPrice = detail.getString("unitPrice");
snDetailMap.put("unitPrice", unitPrice);
if ("11".equals(invoiceType)) {
snDetailMap.put("tax", "0");
//如果是卷票计算合计金额
String hjje = null;
if (detail.getString("detailAmount") != null && detail.getString("taxAmount") != null) {
BigDecimal je = new BigDecimal(detail.getString("detailAmount"));
if (detail.getString("taxAmount") != null) {
hjje = je.add(new BigDecimal(detail.getString("taxAmount"))).toPlainString();
} else {
hjje = je.toPlainString();
}
}
if (StringUtils.isNotBlank(hjje))
snDetailMap.put("amount", hjje);
} else {
snDetailMap.put("tax", "***".equals(detail.getString("taxAmount")) ? "0.00" : detail.getString("taxAmount"));
snDetailMap.put("amount", detail.getString("detailAmount"));
}
if ("免税".equals(detail.getString("taxRate")) || "不征税".equals(detail.getString("taxRate")) || "***".equals(detail.getString("taxRate"))) {
taxRateDetail = "0";
snDetailMap.put("taxRate", taxRateDetail);
} else {
if (detail.get("taxRate") != null && StringUtils.isNoneBlank(detail.get("taxRate").toString())) {
try {
taxRateDetail = detail.get("taxRate").toString();
if (!"0".equals(taxRateDetail)) {
if (StringUtils.isNoneBlank(taxRateDetail)) {
if (taxRateDetail.contains("%")) {
taxRateDetail = taxRateDetail.replace("%", "");
}
BigDecimal tax = new BigDecimal(taxRateDetail);
BigDecimal tax1 = tax.divide(new BigDecimal("100"));
if (tax.compareTo(new BigDecimal("0.99")) < 1) {
taxRateDetail = tax.toPlainString();
} else {
taxRateDetail = tax1.toPlainString();
}
}
}
} catch (Exception e) {
log.error("报错的原因为:{}", e);
taxRateDetail = "0.00";
}
if ("11".equals(invoiceType)) {
taxRateDetail = "0.000";
}
log.info("明细-发票税率为:{}", taxRateDetail);
snDetailMap.put("taxRate", taxRateDetail);
}
}
log.info("明细-tax={}", detail.get("taxAmount"));
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);
}
private void convertToResult(JSONObject checkInvoice, JSONArray detailArray, JSONObject vehicleList) throws ParseException {
checkInvoice.put("totalTax", checkInvoice.getString("taxAmount"));
checkInvoice.put("amountTax", checkInvoice.getString("totalAmount"));
checkInvoice.put("totalAmount", checkInvoice.getString("invoiceAmount"));
// 增加备注字段
checkInvoice.put("remarks", checkInvoice.getString("remark"));
//添加非空判断
String invoiceCode = null;
if (checkInvoice.get("invoiceCode") != null) {
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", "");
if ("31".equals(invoiceType) || "32".equals(invoiceType) || "185".equals(invoiceType) || "186".equals(invoiceType)) {
checkInvoice.put("invoiceCode", "");
checkInvoice.put("invoiceNumber", invoiceCode == null ? checkInvoice.get("invoiceNo").toString() : invoiceCode + checkInvoice.get("invoiceNo").toString());
} else {
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"));
if("1".equals(checkInvoice.get("invoiceStatus"))){
checkInvoice.put("state", "3");
}else if("2".equals(checkInvoice.get("invoiceStatus"))){
checkInvoice.put("state", "1");
}else if("3".equals(checkInvoice.get("invoiceStatus")) || "7".equals(checkInvoice.get("invoiceStatus")) || "8".equals(checkInvoice.get("invoiceStatus"))){
checkInvoice.put("state", "2");
}else if("4".equals(checkInvoice.get("invoiceStatus"))){
checkInvoice.put("state", "4");
}else if("0".equals(checkInvoice.get("invoiceStatus"))){
checkInvoice.put("state", "0");
}
checkInvoice.put("tollSign", "07");
//机动车
if ("03".equals(invoiceType)) {
checkInvoice.put("vehicleType", vehicleList.getString("vehicleType"));
checkInvoice.put("brandModel", vehicleList.getString("factoryModel"));
checkInvoice.put("originPlace", vehicleList.getString("productPlace"));
checkInvoice.put("certificateNo", vehicleList.getString("certificate"));
checkInvoice.put("inspectionListNo", vehicleList.getString("inspectionNum"));
checkInvoice.put("engineNo", vehicleList.getString("engineNo"));
checkInvoice.put("vehicleNo", vehicleList.getString("vehicleNo"));
checkInvoice.put("paymentVoucherNo", vehicleList.getString("taxRecords"));
checkInvoice.put("passengersLimited", vehicleList.getString("limitPeople"));
checkInvoice.put("taxAuthorityNo", vehicleList.getString("taxBureauCode"));
checkInvoice.put("taxAuthorityName", vehicleList.getString("taxBureauName"));
checkInvoice.put("idcardNo", vehicleList.getString("buyerIdNum"));
checkInvoice.put("amountTax", vehicleList.getString("carPrice"));
}
//二手车
if ("15".equals(invoiceType)) {
checkInvoice.put("vehicleType", vehicleList.getString("vehicleType"));
checkInvoice.put("vehicleNo", vehicleList.getString("vehicleNo"));
checkInvoice.put("brandModel", vehicleList.getString("factoryModel"));
checkInvoice.put("licensePlate", vehicleList.getString("plateNo"));
checkInvoice.put("buyerUnitOrIndividual", vehicleList.getString("buyerUnit"));
checkInvoice.put("buyerUnitCodeOrIdNo", vehicleList.getString("buyerUnitCode"));
checkInvoice.put("buyerUnitOrIndividualAddress", vehicleList.getString("buyerUnitAddress"));
checkInvoice.put("sellerUnitOrIndividual", vehicleList.getString("sellerUnit"));
checkInvoice.put("sellerUnitCodeOrIdNo", vehicleList.getString("sellerUnitCode"));
checkInvoice.put("sellerUnitOrIndividualAddress", vehicleList.getString("sellerUnitAddress"));
checkInvoice.put("sellerPhone", vehicleList.getString("sellerPhone"));
checkInvoice.put("lemonMarket", vehicleList.getString("carMarket"));
checkInvoice.put("lemonMarketAddress", vehicleList.getString("carMarketAddress"));
checkInvoice.put("lemonMarketPhone", vehicleList.getString("carMarketPhone"));
checkInvoice.put("lemonMarketBankAndAccount", vehicleList.getString("carMarketBank"));
checkInvoice.put("vehicleAdminOffice", vehicleList.getString("vehicleAdminOffice"));
checkInvoice.put("registrationNo", vehicleList.getString("registrationNo"));
checkInvoice.put("lemonMarketTaxNo", vehicleList.getString("carMarketTaxNo"));
checkInvoice.put("idcardNo", vehicleList.getString("buyerIdNum"));
checkInvoice.put("amountTax", vehicleList.getString("carPrice"));
}
String taxRate = "";
List<Map<String, String>> returnDetailList = new ArrayList<>();
JSONArray detailList = detailArray;
if (detailList != null) {
for (int i = 0; i < detailList.size(); i++) {
@ -1043,9 +1247,26 @@ public class SDNYMainProcessController extends AbstractController {
result = snPushCheckRecordService.pushCheckResultToSAP(request.toJSONString());
record.setActiveCallResponse(JSONObject.toJSONString(result));
R data = new R();
JSONObject sapResult = JSONObject.parseObject(result);
String es_output = sapResult.getString("ES_OUTPUT");
if(StringUtils.isNotEmpty(es_output)) {
JSONObject outputResult = JSONObject.parseObject(es_output);
R data = new R(1000, "default success");
if ("S".equals(outputResult.getString("ZTYPE"))) {
data = new R(1000, "default success");
data.put("data", result);
} else if ("E".equals(outputResult.getString("ZTYPE"))) {
data = new R(1001, "request error");
data.put("data", result);
} else {
data = new R(1002, "unknown error");
data.put("data", result);
}
}else{
data = new R(1002, "unknown error");
data.put("data", result);
}
try {
DynamicContextHolder.push("business" + DbConstant.BUSINESS_WRITE);
@ -1136,7 +1357,7 @@ public class SDNYMainProcessController extends AbstractController {
log.error("发票同步接口记录保存失败,errormsg:{}", e);
}
return ResponseEntity.status(HttpStatus.GATEWAY_TIMEOUT).body(JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT)));
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT)));
} catch (NullPointerException exception) {
log.error("同步SAP失败,报错信息为:{}", exception);
exception.printStackTrace();
@ -1149,7 +1370,7 @@ public class SDNYMainProcessController extends AbstractController {
log.error("发票同步接口记录保存失败,errormsg:{}", e);
}
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT)));
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT)));
} catch (Exception exception) {
log.error("同步SAP失败,报错信息为:{}", exception);
exception.printStackTrace();

@ -79,9 +79,6 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
@Resource
private ApiUtils apiUtils;
@Autowired
private AreaDao areaDao;
@Resource
private BaseTDxTaxCurrentDao baseTDxTaxCurrentDao;
@ -109,6 +106,9 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
@Resource
private TdxPlatformCheckLogService platformCheckLogService;
@Resource
private VihicleInvoiceDetailDao vihicleInvoiceDetailDao;
public String pushCheckResultToSAP(String requestParam) {
log.info("获取请求参数:{} , 请求地址:{}", requestParam, snYxUrl);
String post = HttpUtils.sendPo(snYxUrl, requestParam, userName, password);
@ -275,6 +275,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
/**
* 发票查验API
*
* @param pramsMap
* @param isInteger
* @return
@ -403,11 +404,11 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
jsonObject.put("checkCode", invoiceData.get("jym"));
if ("N".equals(invoiceData.get("zfbz"))) {
if ("N".equals(invoiceData.get("fpzt"))) {
jsonObject.put("state", "0");
} else if ("H".equals(invoiceData.get("zfbz"))) {
} else if ("3".equals(invoiceData.get("fpzt")) || "7".equals(invoiceData.get("fpzt")) || "8".equals(invoiceData.get("fpzt"))) {
jsonObject.put("state", "2");
} else if ("Y".equals(invoiceData.get("zfbz"))) {
} else if ("Y".equals(invoiceData.get("fpzt"))) {
jsonObject.put("state", "1");
}
@ -894,6 +895,7 @@ public class SNPushCheckRecordService extends AbstractServiceAdapter {
}
private InvoiceInfo convertToInvoiceInfo(SNInvoice snInvoice) {
InvoiceInfo invoice = new InvoiceInfo();
invoice.setInvoiceTypeCode(snInvoice.getInvoiceType());

@ -1709,7 +1709,9 @@ public class InvoicePoolServiceImpl implements InvoicePoolService {
&& detailInfo.getGoodsName().indexOf("详见") >= 0) {
detailInfo.setGoodsName(changeBrackets(detailInfo.getGoodsName()));
}
if(StringUtils.isNotEmpty(detailInfo.getIncentiveFlag())) {
set.add(detailInfo.getIncentiveFlag().trim());
}
detailInfo.setInvoiceCode(invoiceCode);
detailInfo.setInvoiceNo(invoiceNo);
detailInfo.setUuid(invoiceCode + invoiceNo);

@ -4,13 +4,13 @@ spring:
nacos:
config:
# Nacos config 地址
server-addr: 172.31.36.147:33000
server-addr: 172.31.36.146:33000
# Nacos config 命名空间,对应配置中的名称(dxhy-jxpt-namespace)
namespace: eb6eab27-62a4-4ccf-8640-b8e91df0a1a6
namespace: b271ba8e-84d9-4393-88b8-9271aff9465c
# Nacos config 分组
group: dxhy-erp-group
# Nacos config 登录用户名
username: nacos
username: admin
# Nacos config 登录密码
password: Invoice.nacos.!1
# Nacos config 配置文件前缀
@ -19,9 +19,7 @@ spring:
file-extension: yaml
# Nacos discovery 配置
discovery:
server-addr: 172.31.36.147:33000
# Nacos config 登录用户名
username: nacos
# Nacos config 登录密码
server-addr: 172.31.36.146:33000
username: admin
password: Invoice.nacos.!1
namespace: eb6eab27-62a4-4ccf-8640-b8e91df0a1a6
namespace: b271ba8e-84d9-4393-88b8-9271aff9465c

@ -4,7 +4,7 @@ spring:
nacos:
config:
# Nacos config 地址
server-addr: 172.31.36.143:33000
server-addr: 172.31.36.146:33000
# Nacos config 命名空间,对应配置中的名称(dxhy-jxpt-namespace)
namespace: b271ba8e-84d9-4393-88b8-9271aff9465c
# Nacos config 分组
@ -19,7 +19,7 @@ spring:
file-extension: yaml
# Nacos discovery 配置
discovery:
server-addr: 172.31.36.143:33000
server-addr: 172.31.36.146:33000
username: admin
password: Invoice.nacos.!1
namespace: b271ba8e-84d9-4393-88b8-9271aff9465c

@ -178,8 +178,20 @@ public class ExtInvoicePoolController extends AbstractController {
pramsMap.put("accountPeriod", accountPeriod);
log.info("accountPeriod:{}",accountPeriod);
}
int curr = (int)pramsMap.get("curr");
int size = (int)pramsMap.get("size");
if (StringHelper.isNotBlank(companyCode) && "99".equals(companyCode)){
pramsMap.put("companyCodes",getUserInfo().getCompanyCodes());
log.info("组织编码===>{}", pramsMap.get("companyCodes"));
}
int curr = 1;
int size = 20;
if(pramsMap.get("curr") != null) {
curr = (int) pramsMap.get("curr");
}
if(pramsMap.get("size") != null) {
size = (int) pramsMap.get("size");
}
try {
log.info("其他发票采集接收参数 {}" ,pramsMap);
return ResponseEntity.ok(R.ok().put("data", extInvoicePoolService.listOther(pramsMap, curr, size)));

@ -188,7 +188,10 @@
<deployType>test</deployType>
<logging.file>/home/dxhy/logs/</logging.file>
</properties>
<!-- 默认激活 -->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!-- 伊利测试环境 -->
<profile>
@ -221,10 +224,7 @@
<deployType>std</deployType>
<logging.file>/home/dxhy/logs/</logging.file>
</properties>
<!-- 默认激活 -->
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>

Loading…
Cancel
Save