po接口兼容发票号码为发票号码和发票代码拼串的情况

release
yishiqihuasheng 2 years ago
parent b6682fd59f
commit 7e55595765
  1. 28
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java
  2. 22
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java

@ -840,6 +840,21 @@ public class BaseInvoiceController extends AbstractController {
String menuId = (String)map.get("menuId"); String menuId = (String)map.get("menuId");
String company = (String)map.get("company"); String company = (String)map.get("company");
int curr = 0;
if (map.get("curr") != null){
curr = (int) map.get("curr");
}else {
ResponseEntity.ok(R.error("分页数据不能为空"));
}
int size = 0;
if (map.get("size")!= null){
size = (int) map.get("size");
}else {
ResponseEntity.ok(R.error("分页大小不能为空"));
}
if (StringUtils.isNotBlank(inAccountStatus)){ if (StringUtils.isNotBlank(inAccountStatus)){
return ResponseEntity.ok(R.error("入账状态不能为空")); return ResponseEntity.ok(R.error("入账状态不能为空"));
} }
@ -851,7 +866,13 @@ public class BaseInvoiceController extends AbstractController {
try { try {
BigDecimal tax = new BigDecimal(maxTax); BigDecimal tax = new BigDecimal(maxTax);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
return ResponseEntity.ok(R.error("输入税额上线格式不对,请重新输入")); return ResponseEntity.ok(R.error("输入税额上限格式不对,请重新输入"));
}
String allIn = "88";
if (map.get("sign") != null && "99".equals((String)map.get("sign"))){
allIn = "99";
} }
@ -890,6 +911,9 @@ public class BaseInvoiceController extends AbstractController {
pramsMap.put("menuId", menuId); pramsMap.put("menuId", menuId);
pramsMap.put("menuId", "118061"); pramsMap.put("menuId", "118061");
pramsMap.put("maxTax",maxTax); pramsMap.put("maxTax",maxTax);
pramsMap.put("sign",allIn);
pramsMap.put("curr",curr);
pramsMap.put("size",size);
pramsMap.put("business", getUserInfo().getBusiness()); pramsMap.put("business", getUserInfo().getBusiness());
pramsMap.put("dbName", getUserInfo().getDbName()); pramsMap.put("dbName", getUserInfo().getDbName());
List<Tax> taxList = getUserInfo().getOrg(); List<Tax> taxList = getUserInfo().getOrg();
@ -901,6 +925,8 @@ public class BaseInvoiceController extends AbstractController {
} else { } else {
gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg()); gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg());
} }
if (ObjectUtils.isNotEmpty(gfshList)){ if (ObjectUtils.isNotEmpty(gfshList)){
pramsMap.put("gfsh", gfshList); pramsMap.put("gfsh", gfshList);
}else { }else {

@ -10,6 +10,7 @@ import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.enums.FplxEnum; import com.dxhy.common.enums.FplxEnum;
import com.dxhy.common.enums.ReturnCodeEnum; import com.dxhy.common.enums.ReturnCodeEnum;
import com.dxhy.common.service.impl.MpBaseServiceImpl; import com.dxhy.common.service.impl.MpBaseServiceImpl;
import com.dxhy.common.util.StringHelper;
import com.dxhy.common.util.pojo.Authorize; import com.dxhy.common.util.pojo.Authorize;
import com.dxhy.common.util.pojo.GlobalInfo; import com.dxhy.common.util.pojo.GlobalInfo;
import com.dxhy.erp.dao.*; import com.dxhy.erp.dao.*;
@ -19,6 +20,7 @@ import com.dxhy.erp.model.auth.InterfaceCode;
import com.dxhy.erp.service.InvoiceAuthService; import com.dxhy.erp.service.InvoiceAuthService;
import com.dxhy.erp.service.TDxInvoiceReimburseService; import com.dxhy.erp.service.TDxInvoiceReimburseService;
import com.dxhy.erp.utils.CheckUtils; import com.dxhy.erp.utils.CheckUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -34,6 +36,7 @@ import java.util.*;
*/ */
@SuppressWarnings({"AlibabaMethodTooLong", "AlibabaUndefineMagicConstant"}) @SuppressWarnings({"AlibabaMethodTooLong", "AlibabaUndefineMagicConstant"})
@Service @Service
@Slf4j
public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao, RecordInvoice> public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao, RecordInvoice>
implements InvoiceAuthService { implements InvoiceAuthService {
@ -339,7 +342,15 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
fplxList.add("31"); fplxList.add("31");
fplxList.add("32"); fplxList.add("32");
for(ZDATA zdata1:zdata){ for(ZDATA zdata1:zdata){
String uuid = zdata1.getZFPDM()+zdata1.getZFPHM(); log.info("zdata1.getZFPHM()===>{}",zdata1.getZFPHM().length());
String fphm = zdata1.getZFPHM();
if (StringHelper.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){
fphm = fphm.substring(fphm.length() - 8);
log.info("非全电但是号码");
}
log.info("发票号码{}",fphm);
String uuid = zdata1.getZFPDM()+fphm;
zdata1.setZFPLX(convertFpzldm(zdata1.getZFPLX())); zdata1.setZFPLX(convertFpzldm(zdata1.getZFPLX()));
TdxRecordInvoice recordInvoiceByUuid = tDxrecordInvoiceDao.getRecordInvoiceByUuid(uuid); TdxRecordInvoice recordInvoiceByUuid = tDxrecordInvoiceDao.getRecordInvoiceByUuid(uuid);
//查询票池 //查询票池
@ -361,7 +372,14 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
for(ZDATA zdata1:zdata){ for(ZDATA zdata1:zdata){
//成功或者失败标识 //成功或者失败标识
boolean flag = false; boolean flag = false;
String uuid = zdata1.getZFPDM()+zdata1.getZFPHM(); log.info("zdata1.getZFPHM(){}",zdata1.getZFPHM().length());
String fphm = zdata1.getZFPHM();
if (StringHelper.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){
fphm = fphm.substring(fphm.length() - 8);
log.info("非全电但是号码");
}
log.info("发票号码{}",fphm);
String uuid = zdata1.getZFPDM()+fphm;
DynamicContextHolder.push("business"+DbConstant.BUSINESS_READ); DynamicContextHolder.push("business"+DbConstant.BUSINESS_READ);
if(fplxList.contains(zdata1.getZFPLX())){ if(fplxList.contains(zdata1.getZFPLX())){
TdxRecordInvoice recordInvoiceByUuid = tDxrecordInvoiceDao.getRecordInvoiceByUuid(uuid); TdxRecordInvoice recordInvoiceByUuid = tDxrecordInvoiceDao.getRecordInvoiceByUuid(uuid);

Loading…
Cancel
Save