Merge branches '0608-区块链发票' and 'test' of http://192.168.12.182/invoice/pt into test

 Conflicts:
	dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java
release
yefei 2 years ago
commit 7a7582c6b9
  1. 8
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java
  2. 97
      dxhy-erp/src/main/java/com/dxhy/erp/service/impl/InvoiceAuthServiceImpl.java

@ -1011,7 +1011,13 @@ public class SDNYMainProcessController extends AbstractController {
|| "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");
//0608 区块链发票 并且 checkStatus = 3 的时候 提交sap状态为3(刘振和谈楚才提出需求)
if("10".equals(snInvoice.getInvoiceType()) && "3".equals(snInvoice.getCheckStaus())){
info.setZCYZT("3");
}else {
info.setZCYZT("1");
}
} else {
//不可查验发票
info.setZCYZT("3");

@ -10,6 +10,8 @@ import com.dxhy.common.datasource.config.DynamicContextHolder;
import com.dxhy.common.enums.FplxEnum;
import com.dxhy.common.enums.ReturnCodeEnum;
import com.dxhy.common.service.impl.MpBaseServiceImpl;
import com.dxhy.common.util.DateOrderUtil;
import com.dxhy.common.util.StringHelper;
import com.dxhy.common.util.pojo.Authorize;
import com.dxhy.common.util.pojo.GlobalInfo;
import com.dxhy.erp.dao.*;
@ -19,7 +21,11 @@ import com.dxhy.erp.model.auth.InterfaceCode;
import com.dxhy.erp.service.InvoiceAuthService;
import com.dxhy.erp.service.TDxInvoiceReimburseService;
import com.dxhy.erp.utils.CheckUtils;
import com.dxhy.erp.utils.DateUtil;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.joda.time.DateTime;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -28,12 +34,14 @@ import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author dxhy
*/
@SuppressWarnings({"AlibabaMethodTooLong", "AlibabaUndefineMagicConstant"})
@Service
@Slf4j
public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao, RecordInvoice>
implements InvoiceAuthService {
@ -339,7 +347,19 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
fplxList.add("31");
fplxList.add("32");
for(ZDATA zdata1:zdata){
String uuid = zdata1.getZFPDM()+zdata1.getZFPHM();
log.info("zdata1.getZFPHM()===>{}",zdata1.getZFPHM());
String collect = fplxList.stream().collect(Collectors.joining(","));
if(!collect.contains(convertFpzldm(zdata1.getZFPLX()))){
log.info("非增值税先不处理:{}",JSON.toJSONString(zdata1));
continue;
}
String fphm = zdata1.getZFPHM();
if (org.apache.commons.lang3.StringUtils.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){
fphm = fphm.replace(zdata1.getZFPDM(),"");
log.info("非全电但是号码");
}
log.info("发票号码{}",fphm);
String uuid = zdata1.getZFPDM()+fphm;
zdata1.setZFPLX(convertFpzldm(zdata1.getZFPLX()));
TdxRecordInvoice recordInvoiceByUuid = tDxrecordInvoiceDao.getRecordInvoiceByUuid(uuid);
//查询票池
@ -361,6 +381,16 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
for(ZDATA zdata1:zdata){
//成功或者失败标识
boolean flag = false;
log.info("zdata1.getZFPHM():{}",zdata1.getZFPHM());
String fphm = zdata1.getZFPHM();
if (org.apache.commons.lang3.StringUtils.isNotBlank(fphm) && fphm.length() > 8 && !("26".equals(zdata1.getZFPLX()) || "27".equals(zdata1.getZFPLX()))){
fphm = fphm.replace(zdata1.getZFPDM(),"");
log.info("非全电但是号码");
}
log.info("发票号码{}",fphm);
String uuid = zdata1.getZFPDM()+fphm;
//销项标识
String xxbs = zdata1.getXXBS();
String uuid = zdata1.getZFPDM()+zdata1.getZFPHM();
//销项标识
String xxbs = zdata1.getXXBS();
@ -404,24 +434,12 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
}
}
}else {
UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.eq("uuid",uuid);
//凭证号
updateWrapper.set("sn_voucher_number",zdata1.getBELNR());
//凭证过账日期
updateWrapper.set("posting_time",zdata1.getBUDAT());
//账期
updateWrapper.set("account_period",zdata1.getBUDAT().substring(0,7));
//报账单号
updateWrapper.set("bzdh",zdata1.getZBZDH());
//入账状态
updateWrapper.set("inaccount_status",zdata1.getZYWZT());
updateWrapper.set("comp_code",zdata1.getZGSDM());
updateWrapper.set("bzr",zdata1.getZJBRT());
UpdateWrapper updateWrapper = convertRecordInvoice(zdata1,uuid);
DynamicContextHolder.push("business"+DbConstant.BUSINESS_WRITE);
tDxInvoiceReimburseService.getBaseMapper().update(null,updateWrapper);
}
if ("X".equalsIgnoreCase(xxbs)){
<<<<<<<<< Temporary merge branch 1
if ("X".equals(xxbs)){
DynamicContextHolder.push("business"+DbConstant.BUSINESS_WRITE);
UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.set("sn_voucher_number",zdata1.getBELNR());
@ -432,6 +450,11 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
updateWrapper.set("comp_code",zdata1.getZGSDM());
updateWrapper.set("bzr",zdata1.getZJBRT());
updateWrapper.eq("uuid",uuid);
=========
if ("X".equalsIgnoreCase(xxbs)){
DynamicContextHolder.push("business"+DbConstant.BUSINESS_WRITE);
UpdateWrapper updateWrapper = convertRecordInvoice(zdata1,uuid);
>>>>>>>>> Temporary merge branch 2
tdxSaleRecordInvoiceDao.update(null,updateWrapper);
}
@ -446,6 +469,25 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
return es;
}
public UpdateWrapper convertRecordInvoice(ZDATA zdata,String uuid){
UpdateWrapper updateWrapper = new UpdateWrapper();
updateWrapper.set("sn_voucher_number",zdata.getBELNR());
try {
DateTime parse = DateTime.parse(zdata.getBUDAT());
updateWrapper.set("posting_time",zdata.getBUDAT());
//账期
updateWrapper.set("account_period",zdata.getBUDAT().substring(0,7));
} catch (Exception e) {
log.error("时间转换异常:{}",e);
}
updateWrapper.set("bzdh",zdata.getZBZDH());
updateWrapper.set("inaccount_status",zdata.getZYWZT());
updateWrapper.set("comp_code",zdata.getZGSDM());
updateWrapper.set("bzr",zdata.getZJBRT());
updateWrapper.eq("uuid",uuid);
return updateWrapper;
}
public ReturnStateInfo getCheckData(List<Map<String, Object>> authStateList, Integer contentRows) {
ReturnStateInfo run = new ReturnStateInfo();
if (contentRows == null || authStateList.size() != contentRows) {
@ -519,9 +561,26 @@ public class InvoiceAuthServiceImpl extends MpBaseServiceImpl<RecordInvoiceDao,
}
public static void main(String[] args) {
String d="2023";
String substring = d.substring(0, 7);
System.out.println(substring);
Date date = DateUtil.strToDate("0000-00-00");
DateTime parse1 = DateTime.parse("2012-12-01");
Date date11 = parse1.toDate();
HashMap<Object, Object> map = Maps.newHashMap();
map.put("1","3");
try {
DateTime parse = DateTime.parse("0000-00-00");
map.put("2","3");
Date date1 = parse.toDate();
String s = parse.toString("yyyy-MM-dd ");
System.out.println("");
} catch (Exception e) {
// throw new RuntimeException(e);
}
map.put("3","3");
System.out.println();
// String d="2023";
// String substring = d.substring(0, 7);
// System.out.println(substring);
}

Loading…
Cancel
Save