nc及发票修改;
This commit is contained in:
@@ -190,7 +190,7 @@ public class BillManage extends BaseVOEntity{
|
||||
|
||||
|
||||
@ApiModelProperty(value = "发票表ID")
|
||||
private String invoiceId;
|
||||
private Long invoiceId;
|
||||
|
||||
@ApiModelProperty(value = "开票时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
|
||||
+4
@@ -41,5 +41,9 @@ public interface IBillManageService extends IService<BillManage>
|
||||
*/
|
||||
public BillManagePO getInfo(Long billManageId);
|
||||
|
||||
public boolean synchronousNc(String businessDocumentDetaliIds);
|
||||
|
||||
public boolean synchronousNcSK(String businessDocumentDetaliIds);
|
||||
|
||||
public int editIsInvoice(String billNumber, Integer isInvoice, String invoiceId, String invoiceMakeTime,String applyNumber);
|
||||
}
|
||||
+410
-2
@@ -3,18 +3,54 @@ package com.mhd.bms.domain.billManage.repository.persistence;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.mhd.bms.domain.billManage.entity.BillManage;
|
||||
import com.mhd.bms.domain.billManage.repository.facade.IBillManageService;
|
||||
import com.mhd.bms.domain.billManage.repository.mapper.BillManageMapper;
|
||||
import com.mhd.bms.domain.billManage.repository.po.BillManagePO;
|
||||
import com.mhd.bms.domain.billManage.repository.todo.BillManageDO;
|
||||
import com.mhd.bms.domain.bmsInvoiceList.entity.BmsInvoiceList;
|
||||
import com.mhd.bms.domain.bmsInvoiceList.repository.mapper.BmsInvoiceListMapper;
|
||||
import com.mhd.bms.domain.ncLog.entity.NcLog;
|
||||
import com.mhd.bms.domain.ncLog.repository.mapper.NcLogMapper;
|
||||
import com.mhd.bms.interfaces.dto.billManage.BillManageDTO;
|
||||
import com.mhd.common.core.domain.dto.nc.*;
|
||||
import com.mhd.common.core.domain.entity.R;
|
||||
import com.mhd.common.core.domain.entity.TmsOrder;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.WlhyServiceFeign;
|
||||
import com.mhd.system.api.domain.TmsInvoiceListDetailsVO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Marshaller;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -27,7 +63,19 @@ import java.util.List;
|
||||
public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> implements IBillManageService{
|
||||
@Autowired
|
||||
private BillManageMapper billManageMapper;
|
||||
@Autowired
|
||||
private BmsInvoiceListMapper bmsInvoiceListMapper;
|
||||
|
||||
//nc测试环境地址
|
||||
private String url="http://10.0.0.212/service/XChangeServlet?account=NKNC&groupcode=CNK";
|
||||
|
||||
//nc正式环境地址
|
||||
private String zsurl="http://10.0.0.202/service/XChangeServlet?account=NKNC&groupcode=CNK";
|
||||
|
||||
@Autowired
|
||||
private NcLogMapper ncLogMapper;
|
||||
@Resource
|
||||
private WlhyServiceFeign wlhyServiceFeign;
|
||||
/**
|
||||
* 查询账单管理列表
|
||||
*/
|
||||
@@ -83,6 +131,366 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
||||
return billManagePO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean synchronousNc(String businessDocumentDetaliIds) {
|
||||
String [] businessDocumentDetaliIdArray=businessDocumentDetaliIds.split(",");
|
||||
LoginUser loginUser= SecurityUtils.getLoginUser();
|
||||
UserPo userPo=loginUser.getUserPo();
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
for (String businessDocumentDetaliId:businessDocumentDetaliIdArray){
|
||||
BillManage reconciliation=billManageMapper.selectById(businessDocumentDetaliId);
|
||||
if(reconciliation.getSynchronousStatus()==1){
|
||||
throw new ServiceException("该记录已同步,不需要再次同步");
|
||||
}
|
||||
|
||||
try {
|
||||
Date date = reconciliation.getCreateTime();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy");
|
||||
SimpleDateFormat sdf2 = new SimpleDateFormat("MM");
|
||||
String dateString = sdf.format(date);
|
||||
List<Ysitem> ysitemList=new ArrayList<Ysitem>();
|
||||
// BillManageDTO reconciliationDTO=new BillManageDTO();
|
||||
// reconciliationDTO.setBillNumber(reconciliation.getBillNumber());
|
||||
// R<List<TmsOrder>> result=wlhyServiceFeign.getOrderListByReconciliation(reconciliationDTO);
|
||||
String makerCodeNc="";
|
||||
String invoiceNumber="";
|
||||
|
||||
//获取发票信息
|
||||
Long invoiceId = reconciliation.getInvoiceId();
|
||||
BmsInvoiceList bmsInvoiceList = bmsInvoiceListMapper.selectById(invoiceId);
|
||||
invoiceNumber = bmsInvoiceList.getInvoiceNumber();
|
||||
//关联不到订单暂时new
|
||||
List<TmsOrder> list=new ArrayList<>();
|
||||
if(ObjectUtil.isNotNull(list) && list.size()>0){
|
||||
for(TmsOrder tmsOrder:list){
|
||||
date=tmsOrder.getDocumentDate();
|
||||
dateString = sdf.format(date);
|
||||
makerCodeNc=tmsOrder.getMakerCodeNc();
|
||||
Ysitem item=new Ysitem();
|
||||
item.setSo_deptid("NG040104");
|
||||
item.setPk_deptid("NG040104");
|
||||
item.setPk_psndoc(tmsOrder.getSalesmanCodeNc());
|
||||
item.setCustomer(tmsOrder.getCustomerCodeNc());
|
||||
item.setObjtype("0");
|
||||
item.setDirection("1");
|
||||
item.setScomment(tmsOrder.getAppointShipper());
|
||||
// item.setPk_currtype("CNY");
|
||||
item.setPk_currtype(tmsOrder.getSettlementCurrency());
|
||||
item.setPurchaseorder(tmsOrder.getGoodsNumber());
|
||||
item.setTaxrate("0");
|
||||
item.setQuantity_de("0");
|
||||
item.setMoney_de(String.valueOf(tmsOrder.getDeliveryFreight()));
|
||||
item.setMoney_bal(String.valueOf(tmsOrder.getDeliveryFreight()));
|
||||
BigDecimal tax_de=tmsOrder.getDeliveryFreight().multiply(tmsOrder.getTaxRate().divide(BigDecimal.valueOf(100))).setScale(2,BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal notax_de=tmsOrder.getDeliveryFreight().subtract(tax_de);
|
||||
item.setNotax_de(String.valueOf(notax_de));
|
||||
item.setLocal_tax_de(String.valueOf(notax_de));
|
||||
item.setTax_de(String.valueOf(tax_de));
|
||||
item.setPrice(String.valueOf(tmsOrder.getDeliveryFreight()));
|
||||
item.setTaxprice(String.valueOf(tmsOrder.getDeliveryFreight()));
|
||||
item.setDef75("T10");
|
||||
item.setInvoiceno(invoiceNumber);
|
||||
ysitemList.add(item);
|
||||
}
|
||||
Ysbodys bodys=new Ysbodys();
|
||||
bodys.setItem(ysitemList);
|
||||
Ysbillhead billhead=new Ysbillhead();
|
||||
billhead.setPk_group("CNK");
|
||||
billhead.setPk_org("NG0401");
|
||||
billhead.setSett_org("NG0401");
|
||||
billhead.setBilldate(dateString);
|
||||
billhead.setCreator(makerCodeNc);
|
||||
billhead.setPk_billtype("F0");
|
||||
billhead.setPk_tradetype("D0");
|
||||
billhead.setBillclass("ys");
|
||||
billhead.setIsinit("N");
|
||||
date=reconciliation.getCreateTime();
|
||||
dateString = sdf.format(date);
|
||||
billhead.setCreationtime(dateString);
|
||||
billhead.setSyscode("0");
|
||||
billhead.setBillno("");
|
||||
billhead.setDef59("");
|
||||
billhead.setSrc_syscode("0");
|
||||
billhead.setBillstatus("0");
|
||||
billhead.setBillmaker(makerCodeNc);
|
||||
billhead.setPk_busitype("");
|
||||
billhead.setBillyear(sdf1.format(date));
|
||||
billhead.setBillperiod(sdf2.format(date));
|
||||
billhead.setEffectstatus("0");
|
||||
billhead.setDef28("nqyw");
|
||||
billhead.setDef29(reconciliation.getBillNumber());
|
||||
billhead.setBodys(bodys);
|
||||
Ysbill bill=new Ysbill();
|
||||
bill.setId("ys"+String.valueOf(reconciliation.getBillManageId()));
|
||||
bill.setBillhead(billhead);
|
||||
Ysufinterface ufinterface=new Ysufinterface();
|
||||
ufinterface.setAccount("NKNC");
|
||||
ufinterface.setBilltype("F0");
|
||||
ufinterface.setBusinessunitcode("");
|
||||
ufinterface.setFilename("");
|
||||
ufinterface.setIsexchange("Y");
|
||||
ufinterface.setOrgcode("NG0401");
|
||||
ufinterface.setReceiver("NG0401");
|
||||
ufinterface.setReplace("Y");
|
||||
ufinterface.setRoottag("");
|
||||
ufinterface.setSender("nqyw");
|
||||
ufinterface.setBill(bill);
|
||||
JAXBContext jaxbContext = JAXBContext.newInstance(Ysufinterface.class);
|
||||
Marshaller marshaller = jaxbContext.createMarshaller();
|
||||
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
|
||||
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); // 格式化输出,可选
|
||||
StringWriter sw = new StringWriter();
|
||||
marshaller.marshal(ufinterface, sw);
|
||||
String xmlString = sw.toString(); // 这是要发送的XML字符串
|
||||
System.out.println(xmlString);
|
||||
NcLog ncLog=new NcLog();
|
||||
ncLog.setOrderId(reconciliation.getBillManageId());
|
||||
ncLog.setRequestBody(xmlString);
|
||||
ncLog.setResponeBody("");
|
||||
ncLog.setType(0L);
|
||||
ncLog.setOrganizationId(reconciliation.getOrganizationId());
|
||||
ncLog.setOrganizationName(reconciliation.getOrganizationName());
|
||||
ncLog.setTopOrganizationId(reconciliation.getTopOrganizationId());
|
||||
ncLogMapper.insert(ncLog);
|
||||
reconciliation.setSynchronousStatus(1);
|
||||
reconciliation.setSynchronousTime(new Date());
|
||||
reconciliation.setNcId("ys"+String.valueOf(reconciliation.getBillManageId()));
|
||||
//billManageMapper.updateById(reconciliation);
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPost httpPost = new HttpPost(zsurl);
|
||||
StringEntity postingString = new StringEntity(xmlString, "UTF-8");
|
||||
httpPost.setEntity(postingString);
|
||||
httpPost.setHeader("Content-type", "application/xml");
|
||||
try {
|
||||
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||
String responseString = EntityUtils.toString(response.getEntity());
|
||||
System.out.println(responseString);
|
||||
ncLog.setResponeBody(responseString);
|
||||
// 创建DOM解析器
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
Document document = builder.parse(new InputSource(new StringReader(responseString)));
|
||||
|
||||
// 获取根元素
|
||||
Element root = document.getDocumentElement();
|
||||
|
||||
// 获取ufinterface元素的属性
|
||||
String billtype = root.getAttribute("billtype");
|
||||
String filename = root.getAttribute("filename");
|
||||
System.out.println("billtype: " + billtype);
|
||||
System.out.println("filename: " + filename);
|
||||
|
||||
// 获取sendresult节点
|
||||
NodeList sendResultList = root.getElementsByTagName("sendresult");
|
||||
if (sendResultList.getLength() > 0) {
|
||||
Element sendResult = (Element) sendResultList.item(0);
|
||||
|
||||
// 获取子元素内容
|
||||
String bdocid = sendResult.getElementsByTagName("bdocid").item(0).getTextContent();
|
||||
String resultcode = sendResult.getElementsByTagName("resultcode").item(0).getTextContent();
|
||||
String content = sendResult.getElementsByTagName("content").item(0).getTextContent();
|
||||
|
||||
System.out.println("bdocid: " + bdocid);
|
||||
System.out.println("resultcode: " + resultcode);
|
||||
System.out.println("content: " + content);
|
||||
if(resultcode.equals("1")){
|
||||
reconciliation.setSynchronousStatus(1);
|
||||
}else{
|
||||
reconciliation.setSynchronousStatus(2);
|
||||
}
|
||||
}
|
||||
ncLogMapper.updateById(ncLog);
|
||||
billManageMapper.updateById(reconciliation);
|
||||
response.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
httpClient.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (JAXBException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean synchronousNcSK(String businessDocumentDetaliIds) {
|
||||
String [] businessDocumentDetaliIdArray=businessDocumentDetaliIds.split(",");
|
||||
LoginUser loginUser= SecurityUtils.getLoginUser();
|
||||
UserPo userPo=loginUser.getUserPo();
|
||||
for (String businessDocumentDetaliId:businessDocumentDetaliIdArray){
|
||||
BillManage reconciliation=billManageMapper.selectById(businessDocumentDetaliId);
|
||||
if(reconciliation.getSkSynchronousStatus()==1){
|
||||
throw new ServiceException("该记录已同步,不需要再次同步");
|
||||
}
|
||||
|
||||
try {
|
||||
Date date = reconciliation.getCreateTime();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy");
|
||||
SimpleDateFormat sdf2 = new SimpleDateFormat("MM");
|
||||
String dateString = sdf.format(date);
|
||||
List<SKitem> ysitemList=new ArrayList<SKitem>();
|
||||
BillManageDTO reconciliationDTO=new BillManageDTO();
|
||||
reconciliationDTO.setBillNumber(reconciliation.getBillNumber());
|
||||
|
||||
String makerCodeNc="";
|
||||
//关联不到订单暂时new
|
||||
List<TmsOrder> list = new ArrayList<>();
|
||||
if(ObjectUtil.isNotNull(list) && list.size()>0){
|
||||
for(TmsOrder tmsOrder:list){
|
||||
makerCodeNc=tmsOrder.getMakerCodeNc();
|
||||
makerCodeNc="xiangna";
|
||||
SKitem item=new SKitem();
|
||||
item.setSo_deptid("NG040104");
|
||||
item.setPk_deptid("NG040104");
|
||||
item.setCheckdirection("ar");
|
||||
item.setPk_psndoc(tmsOrder.getSalesmanCodeNc());
|
||||
item.setCustomer(tmsOrder.getCustomerCodeNc());
|
||||
item.setPurchaseorder(tmsOrder.getGoodsNumber());
|
||||
item.setObjtype("0");
|
||||
item.setDirection("1");
|
||||
item.setScomment(tmsOrder.getAppointShipper());
|
||||
item.setPk_currtype(tmsOrder.getSettlementCurrency());
|
||||
item.setMoney_cr(String.valueOf(tmsOrder.getCollectedFreight()));
|
||||
item.setMoney_bal(String.valueOf(tmsOrder.getCollectedFreight()));
|
||||
ysitemList.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
SKbodys bodys=new SKbodys();
|
||||
bodys.setItem(ysitemList);
|
||||
SKbillhead billhead=new SKbillhead();
|
||||
billhead.setPk_group("CNK");
|
||||
billhead.setPk_org("NG0401");
|
||||
billhead.setSett_org("NG0401");
|
||||
billhead.setCreationtime(dateString);
|
||||
billhead.setPk_billtype("F2");
|
||||
billhead.setCreator(makerCodeNc);
|
||||
billhead.setPk_tradetype("D2");
|
||||
billhead.setBillclass("sk");
|
||||
billhead.setBilldate(dateString);
|
||||
billhead.setSyscode("0");
|
||||
billhead.setBillno("");
|
||||
billhead.setDef59("");
|
||||
billhead.setSrc_syscode("0");
|
||||
billhead.setBillstatus("0");
|
||||
billhead.setBillmaker(makerCodeNc);
|
||||
billhead.setPk_busitype("");
|
||||
billhead.setBillyear(sdf1.format(date));
|
||||
billhead.setBillperiod(sdf2.format(date));
|
||||
billhead.setEffectstatus("0");
|
||||
billhead.setDef28("nqyw");
|
||||
billhead.setDef29(reconciliation.getBillNumber());
|
||||
billhead.setBodys(bodys);
|
||||
SKbill bill=new SKbill();
|
||||
bill.setId("sk"+String.valueOf(reconciliation.getBillManageId()));
|
||||
bill.setBillhead(billhead);
|
||||
SKufinterface ufinterface=new SKufinterface();
|
||||
ufinterface.setAccount("NKNC");
|
||||
ufinterface.setBilltype("F2");
|
||||
ufinterface.setBusinessunitcode("");
|
||||
ufinterface.setFilename("");
|
||||
ufinterface.setIsexchange("Y");
|
||||
ufinterface.setOrgcode("NG0401");
|
||||
ufinterface.setReceiver("NG0401");
|
||||
ufinterface.setReplace("Y");
|
||||
ufinterface.setRoottag("");
|
||||
ufinterface.setSender("nqyw");
|
||||
ufinterface.setBill(bill);
|
||||
JAXBContext jaxbContext = null;
|
||||
//String xmlString ="<ufinterface account=\"NKNC\" billtype=\"F0\" businessunitcode=\"\" filename=\"\" groupcode=\"CNK\" isexchange=\"Y\" orgcode=\"NG10\" receiver=\"NG10\" replace=\"Y\" roottag=\"\" sender=\"NKT_MY\">";
|
||||
jaxbContext = JAXBContext.newInstance(SKufinterface.class);
|
||||
Marshaller marshaller = jaxbContext.createMarshaller();
|
||||
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, true);
|
||||
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); // 格式化输出,可选
|
||||
StringWriter sw = new StringWriter();
|
||||
marshaller.marshal(ufinterface, sw);
|
||||
String xmlString = sw.toString(); // 这是要发送的XML字符串
|
||||
System.out.println(xmlString);
|
||||
NcLog ncLog=new NcLog();
|
||||
ncLog.setOrderId(reconciliation.getBillManageId());
|
||||
ncLog.setRequestBody(xmlString);
|
||||
ncLog.setResponeBody("");
|
||||
ncLog.setType(1L);
|
||||
ncLog.setOrganizationId(reconciliation.getOrganizationId());
|
||||
ncLog.setOrganizationName(reconciliation.getOrganizationName());
|
||||
ncLog.setTopOrganizationId(reconciliation.getTopOrganizationId());
|
||||
ncLogMapper.insert(ncLog);
|
||||
reconciliation.setSkSynchronousStatus(1);
|
||||
reconciliation.setSkSynchronousTime(new Date());
|
||||
reconciliation.setSkNcId("sk"+String.valueOf(reconciliation.getBillManageId()));
|
||||
//billManageMapper.updateById(reconciliation);
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPost httpPost = new HttpPost(zsurl);
|
||||
StringEntity postingString = new StringEntity(xmlString, "UTF-8");
|
||||
httpPost.setEntity(postingString);
|
||||
httpPost.setHeader("Content-type", "application/xml");
|
||||
try {
|
||||
CloseableHttpResponse response = httpClient.execute(httpPost);
|
||||
String responseString = EntityUtils.toString(response.getEntity());
|
||||
System.out.println(responseString);
|
||||
ncLog.setResponeBody(responseString);
|
||||
// 创建DOM解析器
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
Document document = builder.parse(new InputSource(new StringReader(responseString)));
|
||||
|
||||
// 获取根元素
|
||||
Element root = document.getDocumentElement();
|
||||
|
||||
// 获取ufinterface元素的属性
|
||||
String billtype = root.getAttribute("billtype");
|
||||
String filename = root.getAttribute("filename");
|
||||
System.out.println("billtype: " + billtype);
|
||||
System.out.println("filename: " + filename);
|
||||
|
||||
// 获取sendresult节点
|
||||
NodeList sendResultList = root.getElementsByTagName("sendresult");
|
||||
if (sendResultList.getLength() > 0) {
|
||||
Element sendResult = (Element) sendResultList.item(0);
|
||||
|
||||
// 获取子元素内容
|
||||
String bdocid = sendResult.getElementsByTagName("bdocid").item(0).getTextContent();
|
||||
String resultcode = sendResult.getElementsByTagName("resultcode").item(0).getTextContent();
|
||||
String content = sendResult.getElementsByTagName("content").item(0).getTextContent();
|
||||
|
||||
System.out.println("bdocid: " + bdocid);
|
||||
System.out.println("resultcode: " + resultcode);
|
||||
System.out.println("content: " + content);
|
||||
if(resultcode.equals("1")){
|
||||
reconciliation.setSkSynchronousStatus(1);
|
||||
}else{
|
||||
reconciliation.setSkSynchronousStatus(2);
|
||||
}
|
||||
}
|
||||
ncLogMapper.updateById(ncLog);
|
||||
billManageMapper.updateById(reconciliation);
|
||||
response.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
httpClient.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (JAXBException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int editIsInvoice(String billNumber, Integer isInvoice, String invoiceId, String invoiceMakeTime,String applyNumber) {
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(billNumber)){
|
||||
@@ -91,7 +499,7 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
||||
.eq(BillManage::getDelFlag,1));
|
||||
if(ObjectUtil.isNotNull(billManage)){
|
||||
billManage.setIsInvoice(isInvoice);
|
||||
billManage.setInvoiceId(invoiceId);
|
||||
billManage.setInvoiceId(Long.valueOf(invoiceId));
|
||||
billManage.setApplyNumber(applyNumber);
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(invoiceMakeTime)){
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
@@ -109,7 +517,7 @@ public class BillManageImpl extends ServiceImpl<BillManageMapper, BillManage> im
|
||||
.eq(BillManage::getDelFlag,1));
|
||||
if(ObjectUtil.isNotNull(billManage)){
|
||||
billManage.setIsInvoice(isInvoice);
|
||||
billManage.setInvoiceId(invoiceId);
|
||||
billManage.setInvoiceId(Long.valueOf(invoiceId));
|
||||
billManage.setApplyNumber(applyNumber);
|
||||
if(org.apache.commons.lang3.StringUtils.isNotBlank(invoiceMakeTime)){
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
+9
-2
@@ -5,6 +5,8 @@ import com.aliyun.oss.ServiceException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.billManage.entity.BillManage;
|
||||
import com.mhd.bms.domain.billManage.repository.mapper.BillManageMapper;
|
||||
import com.mhd.bms.domain.bmsInvoiceList.entity.BmsInvoiceList;
|
||||
import com.mhd.bms.domain.bmsInvoiceList.entity.BmsSettlementPartyInvoice;
|
||||
import com.mhd.bms.domain.bmsInvoiceList.repository.facade.IBmsInvoiceListService;
|
||||
@@ -45,6 +47,8 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl<BmsInvoiceListMapper,
|
||||
private BmsInvoiceListMapper bmsInvoiceListMapper;
|
||||
@Resource
|
||||
private BmsMakeOutInvoiceMapper bmsMakeOutInvoiceMapper;
|
||||
@Resource
|
||||
private BillManageMapper billManageMapper;
|
||||
/*@Resource
|
||||
private BmsSettlementPartyInvoiceMapper bmsSettlementPartyInvoiceMapper;*/
|
||||
|
||||
@@ -154,7 +158,11 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl<BmsInvoiceListMapper,
|
||||
}
|
||||
// 保存【销项发票表】数据
|
||||
saveBmsInvoiceList(bmsInvoiceList, bmsInvoiceListAddDTO, sysUser, createBy);
|
||||
|
||||
BillManage billManage = billManageMapper.selectById(bmsInvoiceListAddDTO.getBillManageId());
|
||||
if (billManage != null) {
|
||||
billManage.setIsInvoice(1);
|
||||
billManageMapper.updateById(billManage);
|
||||
}
|
||||
/*AjaxResult ajaxResult = financeServiceFeign.editIsInvoice(transportationId,1,bmsInvoiceList.getId(),"",bmsInvoiceList.getApplyNumber());
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new com.mhd.common.core.exception.ServiceException(ajaxResult.get("msg").toString());
|
||||
@@ -773,7 +781,6 @@ public class BmsInvoiceListServiceImpl extends ServiceImpl<BmsInvoiceListMapper,
|
||||
bmsInvoiceList.setRealCreateBy(sysUser.getId());
|
||||
bmsInvoiceList.setRealCreateName(sysUser.getRealname());
|
||||
|
||||
|
||||
// 设置组织相关字段:从当前登录用户获取组织信息
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null && loginUser.getUserPo() != null) {
|
||||
|
||||
+4
@@ -59,4 +59,8 @@ public class BmsInvoiceListAddDTO implements Serializable {
|
||||
@ApiModelProperty(value = "税务登记证号")
|
||||
@Excel(name = "税务登记证号", width = 15)
|
||||
private String taxRegAccount;
|
||||
|
||||
@ApiModelProperty(value = "对账单id")
|
||||
@Excel(name = "对账单id", width = 15)
|
||||
private String billManageId;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.mhd.bms.domain.ncLog.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 nc_log
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-12-04
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class NcLog extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("nc日志id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long ncLogId;
|
||||
|
||||
@ApiModelProperty("类型 0-应收单 1-收款单")
|
||||
@Excel(name = "类型 0-应收单 1-收款单")
|
||||
private Long type;
|
||||
|
||||
@ApiModelProperty("数据源id")
|
||||
@Excel(name = "数据源id")
|
||||
private Long orderId;
|
||||
|
||||
@ApiModelProperty("请求报文")
|
||||
@Excel(name = "请求报文")
|
||||
private String requestBody;
|
||||
|
||||
@ApiModelProperty("请求报文")
|
||||
@Excel(name = "请求报文")
|
||||
private String responeBody;
|
||||
|
||||
@ApiModelProperty("组织ID")
|
||||
@Excel(name = "组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("一级组织ID")
|
||||
@Excel(name = "一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.mhd.bms.domain.ncLog.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.bms.domain.ncLog.entity.NcLog;
|
||||
import com.mhd.bms.domain.ncLog.repository.po.NcLogPO;
|
||||
import com.mhd.bms.domain.ncLog.repository.todo.NcLogDO;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-12-04
|
||||
*/
|
||||
public interface INcLogService extends IService<NcLog>
|
||||
{
|
||||
/**
|
||||
* 分页查询【请填写功能名称】列表
|
||||
*/
|
||||
public List<NcLogPO> queryList(NcLogDO ncLogDO);
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
public Boolean insert(NcLogDO ncLogDO);
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
public Boolean update(NcLogDO ncLogDO);
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*/
|
||||
public Boolean delete(Long[] ncLogIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
*/
|
||||
public NcLogPO getInfo(Long ncLogId);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.mhd.bms.domain.ncLog.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.bms.domain.ncLog.entity.NcLog;
|
||||
import com.mhd.bms.domain.ncLog.repository.po.NcLogPO;
|
||||
import com.mhd.bms.domain.ncLog.repository.todo.NcLogDO;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-12-04
|
||||
*/
|
||||
public interface NcLogMapper extends BaseMapper<NcLog>
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*/
|
||||
public List<NcLogPO> queryList(NcLogDO ncLogDO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.mhd.bms.domain.ncLog.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.bms.domain.ncLog.entity.NcLog;
|
||||
import com.mhd.bms.domain.ncLog.repository.facade.INcLogService;
|
||||
import com.mhd.bms.domain.ncLog.repository.mapper.NcLogMapper;
|
||||
import com.mhd.bms.domain.ncLog.repository.po.NcLogPO;
|
||||
import com.mhd.bms.domain.ncLog.repository.todo.NcLogDO;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-12-04
|
||||
*/
|
||||
@Service
|
||||
public class NcLogImpl extends ServiceImpl<NcLogMapper, NcLog> implements INcLogService {
|
||||
@Autowired
|
||||
private NcLogMapper ncLogMapper;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*/
|
||||
@Override
|
||||
public List<NcLogPO> queryList(NcLogDO ncLogDO)
|
||||
{
|
||||
return ncLogMapper.queryList(ncLogDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(NcLogDO ncLogDO) {
|
||||
NcLog ncLog = new NcLog();
|
||||
BeanUtils.copyProperties(ncLogDO,ncLog);
|
||||
return this.save(ncLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(NcLogDO ncLogDO) {
|
||||
NcLog ncLog = new NcLog();
|
||||
BeanUtils.copyProperties(ncLogDO,ncLog);
|
||||
return this.updateById(ncLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] ncLogIds ) {
|
||||
List<NcLog> list = new ArrayList<>();
|
||||
for (Long id : ncLogIds) {
|
||||
NcLog ncLog = new NcLog();
|
||||
ncLog.setNcLogId(id);
|
||||
ncLog.setDelFlag(2);
|
||||
list.add(ncLog);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
@Override
|
||||
public NcLogPO getInfo(Long ncLogId) {
|
||||
NcLog ncLog = this.getById(ncLogId);
|
||||
NcLogPO ncLogPO = new NcLogPO();
|
||||
BeanUtils.copyProperties(ncLog,ncLogPO);
|
||||
return ncLogPO;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.mhd.bms.domain.ncLog.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 nc_log
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-12-04
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "【请填写功能名称】对象", description = "【请填写功能名称】响应对象")
|
||||
public class NcLogPO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("nc日志id")
|
||||
private Long ncLogId;
|
||||
|
||||
@ApiModelProperty("类型 0-应收单 1-收款单")
|
||||
@Excel(name = "类型 0-应收单 1-收款单")
|
||||
private Long type;
|
||||
|
||||
@ApiModelProperty("数据源id")
|
||||
@Excel(name = "数据源id")
|
||||
private Long orderId;
|
||||
|
||||
@ApiModelProperty("请求报文")
|
||||
@Excel(name = "请求报文")
|
||||
private String requestBody;
|
||||
|
||||
@ApiModelProperty("请求报文")
|
||||
@Excel(name = "请求报文")
|
||||
private String responeBody;
|
||||
|
||||
@ApiModelProperty("组织ID")
|
||||
@Excel(name = "组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("一级组织ID")
|
||||
@Excel(name = "一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.mhd.bms.domain.ncLog.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 nc_log
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-12-04
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class NcLogDO extends BaseVOEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("nc日志id")
|
||||
private Long ncLogId;
|
||||
|
||||
@ApiModelProperty("类型 0-应收单 1-收款单")
|
||||
@Excel(name = "类型 0-应收单 1-收款单")
|
||||
private Long type;
|
||||
|
||||
@ApiModelProperty("数据源id")
|
||||
@Excel(name = "数据源id")
|
||||
private Long orderId;
|
||||
|
||||
@ApiModelProperty("请求报文")
|
||||
@Excel(name = "请求报文")
|
||||
private String requestBody;
|
||||
|
||||
@ApiModelProperty("请求报文")
|
||||
@Excel(name = "请求报文")
|
||||
private String responeBody;
|
||||
|
||||
@ApiModelProperty("组织ID")
|
||||
@Excel(name = "组织ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("一级组织ID")
|
||||
@Excel(name = "一级组织ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.mhd.bms.domain.ncLog.service;
|
||||
|
||||
import com.mhd.bms.domain.ncLog.repository.facade.INcLogService;
|
||||
import com.mhd.bms.domain.ncLog.repository.po.NcLogPO;
|
||||
import com.mhd.bms.domain.ncLog.repository.todo.NcLogDO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
* 【请填写功能名称】
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-12-04
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class NcLogDomainService {
|
||||
|
||||
@Autowired
|
||||
private INcLogService ncLogService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询【请填写功能名称】列表
|
||||
*/
|
||||
public List<NcLogPO> queryList(NcLogDO ncLogDO) {
|
||||
return ncLogService.queryList(ncLogDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
public Boolean insert(NcLogDO ncLogDO) {
|
||||
|
||||
return ncLogService.insert(ncLogDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
public Boolean update(NcLogDO ncLogDO) {
|
||||
return ncLogService.update(ncLogDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*/
|
||||
public Boolean delete(Long[] ncLogIds) {
|
||||
return ncLogService.delete(ncLogIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取【请填写功能名称】详细信息
|
||||
*/
|
||||
public NcLogPO getInfo(Long ncLogId)
|
||||
{
|
||||
return ncLogService.getInfo(ncLogId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user