南歧nc65对接
This commit is contained in:
@@ -11,7 +11,10 @@ import java.util.Date;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
Date date = new Date();
|
||||
//ys();
|
||||
//sk();
|
||||
}
|
||||
/* public static void ys(){Date date = new Date();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String dateString = sdf.format(date);
|
||||
Ysitem item=new Ysitem();
|
||||
@@ -35,8 +38,8 @@ public class Test {
|
||||
billhead.setPk_org("NG0401");
|
||||
billhead.setSett_org("NG0401");
|
||||
billhead.setCreationtime(dateString);
|
||||
billhead.setCreator("xiangna");
|
||||
billhead.setPk_billtype("F0");
|
||||
billhead.setCreator("xiangna");
|
||||
billhead.setPk_tradetype("D0");
|
||||
billhead.setBillclass("ys");
|
||||
billhead.setIsinit("N");
|
||||
@@ -83,6 +86,78 @@ public class Test {
|
||||
} catch (JAXBException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
public static void sk(){Date date = new Date();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String dateString = sdf.format(date);
|
||||
SKitem item=new SKitem();
|
||||
item.setSo_deptid("NG040104");
|
||||
item.setPk_deptid("NG040104");
|
||||
item.setCheckdirection("ar");
|
||||
item.setPk_psndoc("111");
|
||||
item.setCustomer("25849");
|
||||
item.setPurchaseorder("sk96321");
|
||||
item.setObjtype("0");
|
||||
item.setDirection("1");
|
||||
item.setScomment("新永鸿工业气体有限公司");
|
||||
item.setPk_currtype("CMY");
|
||||
item.setMoney_cr("1000.00");
|
||||
item.setMoney_bal("1000.00");
|
||||
SKbodys bodys=new SKbodys();
|
||||
bodys.setItem(item);
|
||||
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("zhanghongming");
|
||||
billhead.setPk_tradetype("D2");
|
||||
billhead.setBillclass("sk");
|
||||
billhead.setBilldate(dateString);
|
||||
billhead.setSyscode("0");
|
||||
billhead.setBillno("");
|
||||
billhead.setDef59("1111111");
|
||||
billhead.setSrc_syscode("0");
|
||||
billhead.setBillstatus("0");
|
||||
billhead.setBillmaker("zhanghongming");
|
||||
billhead.setPk_busitype("");
|
||||
billhead.setBillyear("2025");
|
||||
billhead.setBillperiod("12");
|
||||
billhead.setEffectstatus("0");
|
||||
billhead.setDef28("nqyw");
|
||||
billhead.setDef29("11111111");
|
||||
billhead.setBodys(bodys);
|
||||
SKbill bill=new SKbill();
|
||||
bill.setId("1111");
|
||||
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\">";
|
||||
try {
|
||||
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);
|
||||
} catch (JAXBException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
};*/
|
||||
}
|
||||
|
||||
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.linke.finance.application.server.ncLog;
|
||||
|
||||
import com.linke.finance.domain.ncLog.repository.po.NcLogPO;
|
||||
import com.linke.finance.domain.ncLog.repository.todo.NcLogDO;
|
||||
import com.linke.finance.domain.ncLog.service.NcLogDomainService;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 【请填写功能名称】ApplicationService
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-12-04
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class NcLogApplicationService {
|
||||
@Autowired
|
||||
private NcLogDomainService ncLogDomainService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询【请填写功能名称】列表
|
||||
*/
|
||||
|
||||
public List<NcLogPO> queryList(NcLogDO ncLogDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1){
|
||||
ncLogDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
}
|
||||
return ncLogDomainService.queryList(ncLogDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增【请填写功能名称】
|
||||
*/
|
||||
public Boolean insert(NcLogDO ncLogDO) {
|
||||
|
||||
return ncLogDomainService.insert(ncLogDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改【请填写功能名称】
|
||||
*/
|
||||
public Boolean update(NcLogDO ncLogDO) {
|
||||
return ncLogDomainService.update(ncLogDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*/
|
||||
public boolean delete(Long[] ncLogIds) {
|
||||
return ncLogDomainService.delete(ncLogIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取【请填写功能名称】详细信息
|
||||
*/
|
||||
public NcLogPO getInfo(Long ncLogId)
|
||||
{
|
||||
return ncLogDomainService.getInfo(ncLogId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+4
@@ -614,6 +614,10 @@ public class ReconciliationApplicationService {
|
||||
{
|
||||
return reconciliationDomainService.synchronousNc(businessDocumentDetaliIds);
|
||||
}
|
||||
public boolean synchronousNcSK(String businessDocumentDetaliIds)
|
||||
{
|
||||
return reconciliationDomainService.synchronousNcSK(businessDocumentDetaliIds);
|
||||
}
|
||||
|
||||
public int editIsInvoice(String innerNumber, Integer isInvoice, String invoiceId, String invoiceMakeTime,String applyNumber)
|
||||
{
|
||||
|
||||
+5
-2
@@ -29,7 +29,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 收款单ApplicationService
|
||||
*
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-04-28
|
||||
*/
|
||||
@@ -136,5 +136,8 @@ public class TmsReceiptApplicationService {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean synchronousNc(String businessDocumentDetaliIds)
|
||||
{
|
||||
return tmsReceiptDomainService.synchronousNc(businessDocumentDetaliIds);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.linke.finance.domain.ncLog.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 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;
|
||||
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.linke.finance.domain.ncLog.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.linke.finance.domain.ncLog.entity.NcLog;
|
||||
import com.linke.finance.domain.ncLog.repository.po.NcLogPO;
|
||||
import com.linke.finance.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);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.linke.finance.domain.ncLog.repository.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.linke.finance.domain.ncLog.entity.NcLog;
|
||||
import com.linke.finance.domain.ncLog.repository.po.NcLogPO;
|
||||
import com.linke.finance.domain.ncLog.repository.todo.NcLogDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 【请填写功能名称】Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-12-04
|
||||
*/
|
||||
public interface NcLogMapper extends BaseMapper<NcLog>
|
||||
{
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*/
|
||||
public List<NcLogPO> queryList(NcLogDO ncLogDO);
|
||||
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.linke.finance.domain.ncLog.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.linke.finance.domain.ncLog.entity.NcLog;
|
||||
import com.linke.finance.domain.ncLog.repository.facade.INcLogService;
|
||||
import com.linke.finance.domain.ncLog.repository.mapper.NcLogMapper;
|
||||
import com.linke.finance.domain.ncLog.repository.po.NcLogPO;
|
||||
import com.linke.finance.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,58 @@
|
||||
package com.linke.finance.domain.ncLog.repository.po;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.math.BigDecimal;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 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,61 @@
|
||||
package com.linke.finance.domain.ncLog.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
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;
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.linke.finance.domain.ncLog.service;
|
||||
|
||||
import com.linke.finance.domain.ncLog.repository.facade.INcLogService;
|
||||
import com.linke.finance.domain.ncLog.repository.po.NcLogPO;
|
||||
import com.linke.finance.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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+24
@@ -218,4 +218,28 @@ public class Reconciliation extends BaseVOEntity{
|
||||
|
||||
@ApiModelProperty(value = "申请发票单号")
|
||||
private String applyNumber;
|
||||
|
||||
@ApiModelProperty("nc同步状态 0-未同步 1-已同步")
|
||||
private Integer synchronousStatus;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "nc同步时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date synchronousTime;
|
||||
|
||||
@ApiModelProperty(value = "nc唯一标识")
|
||||
private String ncId;
|
||||
|
||||
@ApiModelProperty("nc同步状态 0-未同步 1-已同步")
|
||||
private Integer skSynchronousStatus;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "nc同步时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date skSynchronousTime;
|
||||
|
||||
@ApiModelProperty(value = "nc唯一标识")
|
||||
private String skNcId;
|
||||
}
|
||||
|
||||
+2
@@ -64,5 +64,7 @@ public interface IReconciliationService extends IService<Reconciliation>
|
||||
|
||||
public boolean synchronousNc(String businessDocumentDetaliIds);
|
||||
|
||||
public boolean synchronousNcSK(String businessDocumentDetaliIds);
|
||||
|
||||
public int editIsInvoice(String innerNumber, Integer isInvoice, String invoiceId, String invoiceMakeTime,String applyNumber);
|
||||
}
|
||||
|
||||
+225
-24
@@ -14,14 +14,20 @@ import com.linke.finance.domain.approvalDocument.repository.mapper.ApprovalDocum
|
||||
import com.linke.finance.domain.approvalDocument.service.ApprovalDocumentDomainService;
|
||||
import com.linke.finance.domain.businessDocument.entity.BusinessDocument;
|
||||
import com.linke.finance.domain.businessDocumentDetali.entity.BusinessDocumentDetali;
|
||||
import com.linke.finance.domain.ncLog.entity.NcLog;
|
||||
import com.linke.finance.domain.ncLog.repository.mapper.NcLogMapper;
|
||||
import com.linke.finance.domain.reconciliation.entity.Reconciliation;
|
||||
import com.linke.finance.domain.reconciliation.entity.ReconciliationBusinessDocument;
|
||||
import com.linke.finance.domain.reconciliation.repository.facade.IReconciliationService;
|
||||
import com.linke.finance.domain.reconciliation.repository.mapper.ReconciliationMapper;
|
||||
import com.linke.finance.domain.reconciliation.repository.po.ReconciliationPO;
|
||||
import com.linke.finance.domain.reconciliation.repository.todo.ReconciliationDO;
|
||||
import com.mhd.common.core.domain.dto.ReconciliationDTO;
|
||||
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.domain.po.UserShipperPo;
|
||||
import com.mhd.common.core.domain.thirdparty.dingtalk.DetailsDTO;
|
||||
import com.mhd.common.core.domain.thirdparty.dingtalk.FormComponentValuesDTO;
|
||||
import com.mhd.common.core.domain.thirdparty.dingtalk.WorkflowProcessInstancesDTO;
|
||||
@@ -31,7 +37,14 @@ import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.UserServiceFeign;
|
||||
import com.mhd.system.api.WlhyServiceFeign;
|
||||
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;
|
||||
@@ -39,8 +52,10 @@ import org.springframework.stereotype.Service;
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Marshaller;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.NClob;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -58,15 +73,22 @@ import java.util.Map;
|
||||
public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconciliation> implements IReconciliationService{
|
||||
@Autowired
|
||||
private ReconciliationMapper reconciliationMapper;
|
||||
|
||||
@Autowired
|
||||
private NcLogMapper ncLogMapper;
|
||||
@Autowired
|
||||
private UserServiceFeign userServiceFeign;
|
||||
@Autowired
|
||||
private ThirdPartyServiceFeign thirdPartyServiceFeign;
|
||||
|
||||
@Autowired
|
||||
private WlhyServiceFeign wlhyServiceFeign;
|
||||
|
||||
@Autowired
|
||||
private ApprovalDocumentMapper approvalDocumentMapper;
|
||||
@Autowired
|
||||
private ApprovalDocumentDomainService approvalDocumentDomainService;
|
||||
private String url="http://10.0.0.212/service/XChangeServlet?account=NKNC&groupcode=CNK";
|
||||
/**
|
||||
* 查询对账单列表
|
||||
*/
|
||||
@@ -364,42 +386,67 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
||||
public boolean synchronousNc(String businessDocumentDetaliIds) {
|
||||
String [] businessDocumentDetaliIdArray=businessDocumentDetaliIds.split(",");
|
||||
LoginUser loginUser= SecurityUtils.getLoginUser();
|
||||
UserPo userPo=loginUser.getUserPo();
|
||||
for (String businessDocumentDetaliId:businessDocumentDetaliIdArray){
|
||||
Reconciliation reconciliation=reconciliationMapper.selectById(businessDocumentDetaliId);
|
||||
if(reconciliation.getSynchronousStatus()==1){
|
||||
throw new ServiceException("该记录已同步,不需要再次同步");
|
||||
}
|
||||
if(reconciliation.getIsInvoice()!=2){
|
||||
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);
|
||||
Ysitem item=new Ysitem();
|
||||
item.setSo_deptid("NG040104");
|
||||
item.setPk_deptid("NG040104");
|
||||
item.setPk_psndoc("0035");
|
||||
item.setCustomer("25849");
|
||||
item.setObjtype("0");
|
||||
item.setDirection("1");
|
||||
item.setScomment("新永鸿工业气体有限公司");
|
||||
item.setPk_currtype("HKD");
|
||||
item.setTaxrate("0");
|
||||
item.setQuantity_de("0");
|
||||
item.setMoney_de(String.valueOf(reconciliation.getVerificationMoney()));
|
||||
item.setMoney_bal(String.valueOf(reconciliation.getVerificationMoney()));
|
||||
item.setNotax_de(String.valueOf(reconciliation.getVerificationMoney()));
|
||||
item.setLocal_tax_de("0");
|
||||
item.setTax_de("0");
|
||||
item.setPrice(String.valueOf(reconciliation.getVerificationMoney()));
|
||||
item.setTaxprice("0");
|
||||
item.setDef75("T10");
|
||||
item.setInvoiceno("");
|
||||
List<Ysitem> ysitemList=new ArrayList<Ysitem>();
|
||||
ReconciliationDTO reconciliationDTO=new ReconciliationDTO();
|
||||
reconciliationDTO.setInnerNumber(reconciliation.getInnerNumber());
|
||||
R<List<TmsOrder>> result=wlhyServiceFeign.getOrderListByReconciliation(reconciliationDTO);
|
||||
if(result.getCode()==200){
|
||||
List<TmsOrder> list=result.getData();
|
||||
if(ObjectUtil.isNotNull(list)){
|
||||
for(TmsOrder tmsOrder:list){
|
||||
AjaxResult ajaxResult=userServiceFeign.getShipperSummaryData(Long.valueOf(reconciliation.getSettlementPartyId()));
|
||||
if(ajaxResult.get("code").equals("200")){
|
||||
UserShipperPo userShipperPo= (UserShipperPo) ajaxResult.get("data");
|
||||
Ysitem item=new Ysitem();
|
||||
item.setSo_deptid("NG040104");
|
||||
item.setPk_deptid("NG040104");
|
||||
item.setPk_psndoc(userPo.getSalespersonNcCode());
|
||||
item.setCustomer(userShipperPo.getCustomerNcCode());
|
||||
item.setObjtype("0");
|
||||
item.setDirection("1");
|
||||
item.setScomment(userShipperPo.getShipperEnterpriseName());
|
||||
item.setPk_currtype("CNY");
|
||||
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()));
|
||||
item.setNotax_de(String.valueOf(tmsOrder.getDeliveryFreight()));
|
||||
item.setLocal_tax_de(String.valueOf(tmsOrder.getDeliveryFreight()));
|
||||
item.setTax_de(String.valueOf(tmsOrder.getDeliveryFreight()));
|
||||
item.setPrice(String.valueOf(tmsOrder.getDeliveryFreight()));
|
||||
item.setTaxprice(String.valueOf(tmsOrder.getDeliveryFreight()));
|
||||
item.setDef75("T10");
|
||||
item.setInvoiceno("");
|
||||
ysitemList.add(item);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Ysbodys bodys=new Ysbodys();
|
||||
bodys.setItem(item);
|
||||
bodys.setItem(ysitemList);
|
||||
Ysbillhead billhead=new Ysbillhead();
|
||||
billhead.setPk_group("CNK");
|
||||
billhead.setPk_org("NG0401");
|
||||
billhead.setSett_org("NG0401");
|
||||
billhead.setCreationtime(dateString);
|
||||
billhead.setCreator("zhanghongming");
|
||||
billhead.setCreator(userPo.getDocumentPreparerNcCode());
|
||||
billhead.setPk_billtype("F0");
|
||||
billhead.setPk_tradetype("D0");
|
||||
billhead.setBillclass("ys");
|
||||
@@ -410,7 +457,7 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
||||
billhead.setDef59("");
|
||||
billhead.setSrc_syscode("0");
|
||||
billhead.setBillstatus("0");
|
||||
billhead.setBillmaker("zhanghongming");
|
||||
billhead.setBillmaker(userPo.getDocumentPreparerNcCode());
|
||||
billhead.setPk_busitype("");
|
||||
billhead.setBillyear(sdf1.format(date));
|
||||
billhead.setBillperiod(sdf2.format(date));
|
||||
@@ -419,7 +466,7 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
||||
billhead.setDef29(reconciliation.getInnerNumber());
|
||||
billhead.setBodys(bodys);
|
||||
Ysbill bill=new Ysbill();
|
||||
bill.setId(String.valueOf(reconciliation.getReconciliationId()));
|
||||
bill.setId("ys"+String.valueOf(reconciliation.getReconciliationId()));
|
||||
bill.setBillhead(billhead);
|
||||
Ysufinterface ufinterface=new Ysufinterface();
|
||||
ufinterface.setAccount("NKNC");
|
||||
@@ -441,6 +488,160 @@ public class ReconciliationImpl extends ServiceImpl<ReconciliationMapper, Reconc
|
||||
marshaller.marshal(ufinterface, sw);
|
||||
String xmlString = sw.toString(); // 这是要发送的XML字符串
|
||||
System.out.println(xmlString);
|
||||
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
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);
|
||||
response.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
httpClient.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
NcLog ncLog=new NcLog();
|
||||
ncLog.setOrderId(reconciliation.getReconciliationId());
|
||||
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.getReconciliationId()));
|
||||
reconciliationMapper.updateById(reconciliation);
|
||||
} 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){
|
||||
Reconciliation reconciliation=reconciliationMapper.selectById(businessDocumentDetaliId);
|
||||
if(reconciliation.getSkSynchronousStatus()==1){
|
||||
throw new ServiceException("该记录已同步,不需要再次同步");
|
||||
}
|
||||
if(reconciliation.getIsInvoice()!=2){
|
||||
throw new ServiceException("该记录还未开票,不允许同步");
|
||||
}
|
||||
if(reconciliation.getCollectionState()!=2){
|
||||
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>();
|
||||
ReconciliationDTO reconciliationDTO=new ReconciliationDTO();
|
||||
reconciliationDTO.setInnerNumber(reconciliation.getInnerNumber());
|
||||
R<List<TmsOrder>> result=wlhyServiceFeign.getOrderListByReconciliation(reconciliationDTO);
|
||||
if(result.getCode()==200){
|
||||
List<TmsOrder> list=result.getData();
|
||||
if(ObjectUtil.isNotNull(list)){
|
||||
for(TmsOrder tmsOrder:list){
|
||||
AjaxResult ajaxResult=userServiceFeign.getShipperSummaryData(Long.valueOf(reconciliation.getSettlementPartyId()));
|
||||
if(ajaxResult.get("code").equals("200")){
|
||||
UserShipperPo userShipperPo= (UserShipperPo) ajaxResult.get("data");
|
||||
SKitem item=new SKitem();
|
||||
item.setSo_deptid("NG040104");
|
||||
item.setPk_deptid("NG040104");
|
||||
item.setCheckdirection("ar");
|
||||
item.setPk_psndoc(userPo.getSalespersonNcCode());
|
||||
item.setCustomer(userShipperPo.getCustomerNcCode());
|
||||
item.setPurchaseorder(tmsOrder.getGoodsNumber());
|
||||
item.setObjtype("0");
|
||||
item.setDirection("1");
|
||||
item.setScomment(userShipperPo.getShipperEnterpriseName());
|
||||
item.setPk_currtype("CNY");
|
||||
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(userPo.getDocumentPreparerNcCode());
|
||||
billhead.setPk_tradetype("D2");
|
||||
billhead.setBillclass("sk");
|
||||
billhead.setBilldate(dateString);
|
||||
billhead.setSyscode("0");
|
||||
billhead.setBillno("");
|
||||
billhead.setDef59(reconciliation.getInnerNumber());
|
||||
billhead.setSrc_syscode("0");
|
||||
billhead.setBillstatus("0");
|
||||
billhead.setBillmaker(userPo.getDocumentPreparerNcCode());
|
||||
billhead.setPk_busitype("");
|
||||
billhead.setBillyear(sdf1.format(date));
|
||||
billhead.setBillperiod(sdf2.format(date));
|
||||
billhead.setEffectstatus("0");
|
||||
billhead.setDef28("nqyw");
|
||||
billhead.setDef29(reconciliation.getInnerNumber());
|
||||
billhead.setBodys(bodys);
|
||||
SKbill bill=new SKbill();
|
||||
bill.setId("sk"+String.valueOf(reconciliation.getReconciliationId()));
|
||||
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.getReconciliationId());
|
||||
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.getReconciliationId()));
|
||||
reconciliationMapper.updateById(reconciliation);
|
||||
} catch (JAXBException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
+5
@@ -162,6 +162,11 @@ public class ReconciliationDomainService {
|
||||
return reconciliationService.synchronousNc(businessDocumentDetaliIds);
|
||||
}
|
||||
|
||||
public boolean synchronousNcSK(String businessDocumentDetaliIds)
|
||||
{
|
||||
return reconciliationService.synchronousNcSK(businessDocumentDetaliIds);
|
||||
}
|
||||
|
||||
public int editIsInvoice(String innerNumber, Integer isInvoice, String invoiceId, String invoiceMakeTime,String applyNumber)
|
||||
{
|
||||
return reconciliationService.editIsInvoice(innerNumber,isInvoice,invoiceId,invoiceMakeTime,applyNumber);
|
||||
|
||||
+11
-1
@@ -9,11 +9,12 @@ import java.math.BigDecimal;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
|
||||
/**
|
||||
* 收款单对象 tms_receipt
|
||||
*
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-04-28
|
||||
*/
|
||||
@@ -97,4 +98,13 @@ public class TmsReceipt extends BaseVOEntity{
|
||||
private Integer delFlag;
|
||||
|
||||
|
||||
@ApiModelProperty("nc同步状态 0-未同步 1-已同步")
|
||||
private Integer synchronousStatus;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "nc同步时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private java.util.Date synchronousTime;
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* 收款单Service接口
|
||||
*
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-04-28
|
||||
*/
|
||||
@@ -42,4 +42,6 @@ public interface ITmsReceiptService extends IService<TmsReceipt>
|
||||
public TmsReceiptPO getInfo(Long id);
|
||||
|
||||
public int updateAssignableAmount(TmsReceiptPO receiptPo);
|
||||
|
||||
public boolean synchronousNc(String businessDocumentDetaliIds);
|
||||
}
|
||||
|
||||
+117
-1
@@ -1,23 +1,35 @@
|
||||
package com.linke.finance.domain.tmsReceipt.repository.persistence;
|
||||
|
||||
import com.aliyun.oss.ServiceException;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.linke.finance.domain.ncLog.entity.NcLog;
|
||||
import com.linke.finance.domain.ncLog.repository.mapper.NcLogMapper;
|
||||
import com.linke.finance.domain.reconciliation.entity.Reconciliation;
|
||||
import com.linke.finance.domain.tmsReceipt.entity.TmsReceipt;
|
||||
import com.linke.finance.domain.tmsReceipt.repository.facade.ITmsReceiptService;
|
||||
import com.linke.finance.domain.tmsReceipt.repository.mapper.TmsReceiptMapper;
|
||||
import com.linke.finance.domain.tmsReceipt.repository.po.TmsReceiptPO;
|
||||
import com.linke.finance.domain.tmsReceipt.repository.todo.TmsReceiptDO;
|
||||
import com.mhd.common.core.domain.dto.nc.*;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Marshaller;
|
||||
import java.io.StringWriter;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 收款单Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-04-28
|
||||
*/
|
||||
@@ -26,6 +38,9 @@ public class TmsReceiptImpl extends ServiceImpl<TmsReceiptMapper, TmsReceipt> im
|
||||
@Autowired
|
||||
private TmsReceiptMapper tmsReceiptMapper;
|
||||
|
||||
@Autowired
|
||||
private NcLogMapper ncLogMapper;
|
||||
|
||||
/**
|
||||
* 查询收款单列表
|
||||
*/
|
||||
@@ -88,4 +103,105 @@ public class TmsReceiptImpl extends ServiceImpl<TmsReceiptMapper, TmsReceipt> im
|
||||
.set(TmsReceipt::getAssignmentStatus, receiptPo.getAssignmentStatus())
|
||||
.eq(TmsReceipt::getId, receiptPo.getId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean synchronousNc(String businessDocumentDetaliIds) {
|
||||
String [] businessDocumentDetaliIdArray=businessDocumentDetaliIds.split(",");
|
||||
LoginUser loginUser= SecurityUtils.getLoginUser();
|
||||
for (String businessDocumentDetaliId:businessDocumentDetaliIdArray){
|
||||
TmsReceipt tmsReceipt = this.getById(businessDocumentDetaliId);
|
||||
/* if(reconciliation.getSynchronousStatus()==1){
|
||||
throw new ServiceException("该记录已同步,不需要再次同步");
|
||||
}
|
||||
if(reconciliation.getIsInvoice()!=2){
|
||||
throw new ServiceException("该记录还未开票,不允许同步");
|
||||
}*/
|
||||
try {
|
||||
Date date = tmsReceipt.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>();
|
||||
SKitem item=new SKitem();
|
||||
item.setSo_deptid("NG040104");
|
||||
item.setPk_deptid("NG040104");
|
||||
item.setCheckdirection("ar");
|
||||
item.setPk_psndoc("111");
|
||||
item.setCustomer("25849");
|
||||
item.setPurchaseorder(tmsReceipt.getReceivePaymentNumber());
|
||||
item.setObjtype("0");
|
||||
item.setDirection("1");
|
||||
item.setScomment("新永鸿工业气体有限公司");
|
||||
item.setPk_currtype("CMY");
|
||||
item.setMoney_cr(String.valueOf(tmsReceipt.getReceivePaymentAmount()));
|
||||
item.setMoney_bal(String.valueOf(tmsReceipt.getReceivePaymentAmount()));
|
||||
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("zhanghongming");
|
||||
billhead.setPk_tradetype("D2");
|
||||
billhead.setBillclass("sk");
|
||||
billhead.setBilldate(dateString);
|
||||
billhead.setSyscode("0");
|
||||
billhead.setBillno("");
|
||||
billhead.setDef59(tmsReceipt.getReceivePaymentNumber());
|
||||
billhead.setSrc_syscode("0");
|
||||
billhead.setBillstatus("0");
|
||||
billhead.setBillmaker("zhanghongming");
|
||||
billhead.setPk_busitype("");
|
||||
billhead.setBillyear("2025");
|
||||
billhead.setBillperiod("12");
|
||||
billhead.setEffectstatus("0");
|
||||
billhead.setDef28("nqyw");
|
||||
billhead.setDef29(tmsReceipt.getReceivePaymentNumber());
|
||||
billhead.setBodys(bodys);
|
||||
SKbill bill=new SKbill();
|
||||
bill.setId(String.valueOf(tmsReceipt.getId()));
|
||||
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(tmsReceipt.getOrganizationId());
|
||||
ncLog.setRequestBody(xmlString);
|
||||
ncLog.setResponeBody("");
|
||||
ncLog.setType(0L);
|
||||
ncLog.setOrganizationId(tmsReceipt.getOrganizationId());
|
||||
ncLog.setOrganizationName(tmsReceipt.getOrganizationName());
|
||||
ncLog.setTopOrganizationId(tmsReceipt.getTopOrganizationId());
|
||||
ncLogMapper.insert(ncLog);
|
||||
tmsReceipt.setSynchronousStatus(1);
|
||||
tmsReceipt.setSynchronousTime(new Date());
|
||||
tmsReceiptMapper.updateById(tmsReceipt);
|
||||
} catch (JAXBException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+7
-1
@@ -30,7 +30,7 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
/**
|
||||
* 收款单
|
||||
*
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-04-28
|
||||
*/
|
||||
@@ -285,4 +285,10 @@ public class TmsReceiptDomainService {
|
||||
public int updateAssignableAmount(TmsReceiptPO receiptPo) {
|
||||
return tmsReceiptService.updateAssignableAmount(receiptPo);
|
||||
}
|
||||
|
||||
|
||||
public boolean synchronousNc(String businessDocumentDetaliIds)
|
||||
{
|
||||
return tmsReceiptService.synchronousNc(businessDocumentDetaliIds);
|
||||
}
|
||||
}
|
||||
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.linke.finance.interfaces.assemble.ncLog;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.linke.finance.domain.ncLog.repository.todo.NcLogDO;
|
||||
import com.linke.finance.interfaces.dto.ncLog.NcLogDTO;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.core.utils.IgnoreNullUtil;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Assembler
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-12-04
|
||||
*/
|
||||
@Component
|
||||
public class NcLogAssembler {
|
||||
|
||||
/**
|
||||
* 转换实体
|
||||
*/
|
||||
public NcLogDO toDO(NcLogDTO ncLogDTO) {
|
||||
NcLogDO ncLogDO = new NcLogDO();
|
||||
// 拷贝
|
||||
BeanUtils.copyProperties(ncLogDTO, ncLogDO, IgnoreNullUtil.getNullPropertyNames(ncLogDTO));
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
String userName = loginUser.getUsername();
|
||||
// 获取登录人id
|
||||
Long userId = loginUser.getUserid();
|
||||
if(ncLogDTO.getNcLogId() != null){
|
||||
if(userId != null){
|
||||
ncLogDO.setUpdateBy(userId);
|
||||
}else {
|
||||
ncLogDO.setUpdateBy(new Long("0"));
|
||||
}
|
||||
ncLogDO.setUpdateByName(userName);
|
||||
ncLogDO.setUpdateTime(new Date());
|
||||
|
||||
}else {
|
||||
if(userId != null){
|
||||
ncLogDO.setCreateBy(userId);
|
||||
ncLogDO.setUpdateBy(userId);
|
||||
}else {
|
||||
ncLogDO.setCreateBy(new Long("0"));
|
||||
ncLogDO.setUpdateBy(new Long("0"));
|
||||
}
|
||||
ncLogDO.setCreateByName(userName);
|
||||
ncLogDO.setUpdateByName(userName);
|
||||
ncLogDO.setCreateTime(new Date());
|
||||
ncLogDO.setUpdateTime(new Date());
|
||||
ncLogDO.setDelFlag(1);
|
||||
}
|
||||
return ncLogDO;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.linke.finance.interfaces.dto.ncLog;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.math.BigDecimal;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 nc_log
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-12-04
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class NcLogDTO 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,99 @@
|
||||
package com.linke.finance.interfaces.facade.ncLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.linke.finance.interfaces.dto.ncLog.NcLogDTO;
|
||||
import com.linke.finance.domain.ncLog.repository.todo.NcLogDO;
|
||||
import com.linke.finance.domain.ncLog.repository.po.NcLogPO;
|
||||
import com.linke.finance.application.server.ncLog.NcLogApplicationService;
|
||||
import com.linke.finance.interfaces.assemble.ncLog.NcLogAssembler;
|
||||
import javax.annotation.Resource;
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Api
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-12-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ncLogApi")
|
||||
public class NcLogApi extends BaseController{
|
||||
@Autowired
|
||||
private NcLogApplicationService ncLogApplicationService;
|
||||
|
||||
@Resource
|
||||
private NcLogAssembler ncLogAssembler;
|
||||
|
||||
/**
|
||||
* 分页查询【请填写功能名称】列表
|
||||
*/
|
||||
@ApiOperation("查询【请填写功能名称】列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(NcLogDTO ncLogDTO)
|
||||
{
|
||||
//转换实体
|
||||
NcLogDO ncLogDO = ncLogAssembler.toDO(ncLogDTO);
|
||||
startPage();
|
||||
List<NcLogPO> list = ncLogApplicationService.queryList(ncLogDO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑【请填写功能名称】
|
||||
*/
|
||||
@ApiOperation("编辑【请填写功能名称】")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody NcLogDTO ncLogDTO)
|
||||
{
|
||||
//转换实体
|
||||
NcLogDO ncLogDO = ncLogAssembler.toDO(ncLogDTO);
|
||||
if(ncLogDTO.getNcLogId() != null){
|
||||
return toAjax(ncLogApplicationService.update(ncLogDO));
|
||||
}else {
|
||||
return toAjax(ncLogApplicationService.insert(ncLogDO));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除【请填写功能名称】
|
||||
*/
|
||||
@ApiOperation("批量删除【请填写功能名称】")
|
||||
@DeleteMapping("/deleteByIds/{ncLogIds}")
|
||||
public AjaxResult delete(@PathVariable Long[] ncLogIds)
|
||||
{
|
||||
return toAjax(ncLogApplicationService.delete(ncLogIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取【请填写功能名称】详细信息
|
||||
*/
|
||||
@ApiOperation("获取【请填写功能名称】")
|
||||
@GetMapping(value = "/getInfo/{ncLogId}")
|
||||
public AjaxResult getInfo(@PathVariable("ncLogId") Long ncLogId)
|
||||
{
|
||||
return AjaxResult.success(ncLogApplicationService.getInfo(ncLogId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+14
-3
@@ -265,14 +265,25 @@ public class ReconciliationApi extends BaseController{
|
||||
}
|
||||
|
||||
/**
|
||||
* 应收账单同步用户nc65
|
||||
* 应收账单应收单同步用户nc65
|
||||
*/
|
||||
@Log(title = "应收账单同步用户nc65", description = "应收账单同步用户nc65", businessType = BusinessType.OTHER)
|
||||
@ApiOperation("应收账单同步用户nc65")
|
||||
@Log(title = "应收账单应收单同步用户nc65", description = "应收账单应收单同步用户nc65", businessType = BusinessType.OTHER)
|
||||
@ApiOperation("应收账单应收单同步用户nc65")
|
||||
@GetMapping(value = "/synchronousNc")
|
||||
public AjaxResult synchronousNc(@RequestParam(name="reconciliationId") String reconciliationId)
|
||||
{
|
||||
return AjaxResult.success(reconciliationApplicationService.synchronousNc(reconciliationId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 应收账单收款单同步用户nc65
|
||||
*/
|
||||
@Log(title = "应收账单收款单同步用户nc65", description = "应收账单收款单同步用户nc65", businessType = BusinessType.OTHER)
|
||||
@ApiOperation("应收账单收款单同步用户nc65")
|
||||
@GetMapping(value = "/synchronousNcSK")
|
||||
public AjaxResult synchronousNcSK(@RequestParam(name="reconciliationId") String reconciliationId)
|
||||
{
|
||||
return AjaxResult.success(reconciliationApplicationService.synchronousNcSK(reconciliationId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+12
-3
@@ -22,7 +22,7 @@ import com.mhd.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 收款单Api
|
||||
*
|
||||
*
|
||||
* @author gen
|
||||
* @date 2025-04-28
|
||||
*/
|
||||
@@ -117,11 +117,20 @@ public class TmsReceiptApi extends BaseController{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 收款单同步用友nc65
|
||||
*/
|
||||
@Log(title = "收款单同步用友nc65", description = "收款单同步用友nc65", businessType = BusinessType.OTHER)
|
||||
@ApiOperation("收款单同步用友nc65")
|
||||
@GetMapping(value = "/synchronousNc")
|
||||
public AjaxResult synchronousNc(@RequestParam(name="ids") String ids)
|
||||
{
|
||||
return AjaxResult.success(tmsReceiptApplicationService.synchronousNc(ids));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user