|
|
@@ -260,7 +260,9 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
{
|
|
|
String accountName=settlement.getBelongCompany();
|
|
|
//测试账套-销售保存凭证
|
|
|
- this.testSaleCollectionSaveVoucher(accountName,corpsName,settlement.getAmount().toString());
|
|
|
+ this.testSaleCollectionSaveVoucher(settlement,accountName,corpsName,settlement.getAmount().toString());
|
|
|
+ //更新绑定
|
|
|
+ baseMapper.updateById(settlement);
|
|
|
}
|
|
|
catch (Exception exception)
|
|
|
{
|
|
|
@@ -278,7 +280,9 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
{
|
|
|
String accountName=settlement.getBelongCompany();
|
|
|
//测试账套-销售保存凭证
|
|
|
- this.testPurchaseSaveVoucher(accountName,createUser,corpsName,settlement.getAmount().toString());
|
|
|
+ this.testPurchaseSaveVoucher(settlement,accountName,createUser,corpsName,settlement.getAmount().toString());
|
|
|
+ //更新绑定
|
|
|
+ baseMapper.updateById(settlement);
|
|
|
}
|
|
|
catch (Exception exception)
|
|
|
{
|
|
|
@@ -367,7 +371,7 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
model.setFinanceStatus("结算完成");
|
|
|
model.setUpdateTime(new Date());
|
|
|
model.setUpdateUser(AuthUtil.getUserId());
|
|
|
- model.setSettlementDate(new Date());
|
|
|
+ /*model.setSettlementDate(new Date());*/
|
|
|
model.setUpdateUserName(AuthUtil.getUser().getRoleName());
|
|
|
baseMapper.updateById(model);
|
|
|
|
|
|
@@ -897,7 +901,7 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
public void paymentApply(List<Items> itemsList, String billType,String belongCompany) {
|
|
|
itemsList.forEach(e -> {
|
|
|
//产生凭证: 销售订单-生成账单
|
|
|
- if(e.getSrcType()==1 && e.getItemType().equals("销售"))
|
|
|
+ /* if(e.getSrcType()==1 && e.getItemType().equals("销售"))
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
@@ -909,7 +913,7 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
{
|
|
|
throw new SecurityException(exception.getMessage());
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
if (e.getSrcType() == 2) {
|
|
|
OrderFees orderFees = orderFeesClient.getById(e.getSrcFeesId());
|
|
|
if (orderFees == null) {
|
|
|
@@ -1305,11 +1309,19 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<JdyTool.supplier> getSupplierList() throws Exception
|
|
|
+ {
|
|
|
+ //获取token
|
|
|
+ String token = this.getAccountGroupRequest();
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
//金蝶保存凭证测试-采购付款生成凭证
|
|
|
- public void toPurchaseJinDie(String Account,String createUser,String corpName,String accountId,String groupName,JdTenant jdTenant)
|
|
|
+ public JdyTool.voucher toPurchaseJinDie(Date date,String Account,String createUser,String corpName,String accountId,String groupName,JdTenant jdTenant)
|
|
|
{
|
|
|
JDYitems item = new JDYitems();
|
|
|
- item.setDate(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
|
|
|
+ item.setDate(new SimpleDateFormat("yyyy-MM-dd").format(date));
|
|
|
List<JDYentries> entriesList = new ArrayList<>();
|
|
|
List<JDYitems> jdYitems = new ArrayList<>();
|
|
|
|
|
|
@@ -1328,10 +1340,10 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
{
|
|
|
throw new SecurityException("获取采购订单科目号失败");
|
|
|
}
|
|
|
- d.setExplanation("供应商付款-"+ corpName);
|
|
|
+ d.setExplanation(dModule.getAbstractStatic()+"-"+ corpName);
|
|
|
d.setAccount_number(dModule.getProjectCode());
|
|
|
d.setDebitamount(Account);
|
|
|
- entriesList.add(d);
|
|
|
+
|
|
|
|
|
|
//财务贷方
|
|
|
JDYentries c = new JDYentries();
|
|
|
@@ -1349,7 +1361,7 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
{
|
|
|
throw new SecurityException("获取采购订单科目号失败");
|
|
|
}
|
|
|
- c.setExplanation("供应商付款-"+ corpName);
|
|
|
+ c.setExplanation(cModule.getAbstractStatic()+"-"+ corpName);
|
|
|
c.setAccount_number(cModule.getProjectCode());
|
|
|
c.setCreditamount(Account);
|
|
|
|
|
|
@@ -1395,8 +1407,9 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
jdYassist2.setNumber(jdCorps2.getCorpsCode());
|
|
|
}
|
|
|
cList.add(jdYassist2);
|
|
|
- c.setAssist(cList);
|
|
|
+ d.setAssist(cList);
|
|
|
//===========辅助核算=================
|
|
|
+ entriesList.add(d);
|
|
|
entriesList.add(c);
|
|
|
|
|
|
//组装数据
|
|
|
@@ -1405,7 +1418,8 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
try {
|
|
|
String token = this.getAccountGroupRequest();
|
|
|
String saveUrl="http://api.kingdee.com/jdy/gl/voucher_save?access_token="+token;
|
|
|
- JdyTool.testSaveVoucher(saveUrl,accountId,groupName,jdYitems);
|
|
|
+ JdyTool.voucher voucher = JdyTool.testSaveVoucher(token, saveUrl, accountId, groupName, jdYitems);
|
|
|
+ return voucher;
|
|
|
} catch (Exception exception) {
|
|
|
throw new SecurityException("操作失败,保存金蝶错误:"+exception.getMessage());
|
|
|
}
|
|
|
@@ -1414,10 +1428,10 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
|
|
|
|
|
|
//金蝶保存凭证测试-销售收款生成凭证
|
|
|
- public void toSaleCollectionJinDie(String Account,String corpName,String accountId,String groupName,JdTenant jdTenant)
|
|
|
+ public JdyTool.voucher toSaleCollectionJinDie(Date date,String Account,String corpName,String accountId,String groupName,JdTenant jdTenant)
|
|
|
{
|
|
|
JDYitems item = new JDYitems();
|
|
|
- item.setDate(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
|
|
|
+ item.setDate(new SimpleDateFormat("yyyy-MM-dd").format(date));
|
|
|
List<JDYentries> entriesList = new ArrayList<>();
|
|
|
List<JDYitems> jdYitems = new ArrayList<>();
|
|
|
|
|
|
@@ -1436,7 +1450,7 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
{
|
|
|
throw new SecurityException("获取销售订单科目号失败");
|
|
|
}
|
|
|
- d.setExplanation("收款-"+ corpName);
|
|
|
+ d.setExplanation(dModule.getAbstractStatic()+"-"+ corpName);
|
|
|
d.setAccount_number(dModule.getProjectCode());
|
|
|
d.setDebitamount(Account);
|
|
|
entriesList.add(d);
|
|
|
@@ -1459,7 +1473,7 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
{
|
|
|
throw new SecurityException("获取销售订单科目号失败");
|
|
|
}
|
|
|
- c.setExplanation("收款-"+ corpName);
|
|
|
+ c.setExplanation(cModule.getAbstractStatic()+"-"+ corpName);
|
|
|
c.setAccount_number(cModule.getProjectCode());
|
|
|
c.setCreditamount(Account);
|
|
|
|
|
|
@@ -1498,7 +1512,8 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
try {
|
|
|
String token = this.getAccountGroupRequest();
|
|
|
String saveUrl="http://api.kingdee.com/jdy/gl/voucher_save?access_token="+token;
|
|
|
- JdyTool.testSaveVoucher(saveUrl,accountId,groupName,jdYitems);
|
|
|
+ JdyTool.voucher voucher = JdyTool.testSaveVoucher(token, saveUrl, accountId, groupName, jdYitems);
|
|
|
+ return voucher;
|
|
|
} catch (Exception exception) {
|
|
|
throw new SecurityException("操作失败,保存金蝶错误:"+exception.getMessage());
|
|
|
}
|
|
|
@@ -1507,7 +1522,7 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
|
|
|
|
|
|
//金蝶保存凭证测试-销售生成凭证
|
|
|
- public void toSaleJinDie(Items items,String accountId,String groupName,JdTenant jdTenant) {
|
|
|
+ public JdyTool.voucher toSaleJinDie(Items items,String accountId,String groupName,JdTenant jdTenant) {
|
|
|
//不是某一家 直接返回
|
|
|
/*if (!AuthUtil.getTenantId().equals("681169")) {
|
|
|
return;
|
|
|
@@ -1574,7 +1589,8 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
try {
|
|
|
String token = this.getAccountGroupRequest();
|
|
|
String saveUrl="http://api.kingdee.com/jdy/gl/voucher_save?access_token="+token;
|
|
|
- JdyTool.testSaveVoucher(saveUrl,accountId,groupName,jdYitems);
|
|
|
+ JdyTool.voucher voucher = JdyTool.testSaveVoucher(token, saveUrl, accountId, groupName, jdYitems);
|
|
|
+ return voucher;
|
|
|
} catch (Exception exception) {
|
|
|
throw new SecurityException("操作失败,保存金蝶错误:"+exception.getMessage());
|
|
|
}
|
|
|
@@ -1607,7 +1623,7 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
}
|
|
|
|
|
|
//采购付款生成凭证
|
|
|
- public void testPurchaseSaveVoucher(String accountName,String createUser,String corpName,String account)throws Exception
|
|
|
+ public void testPurchaseSaveVoucher(Settlement settlement,String accountName,String createUser,String corpName,String account)throws Exception
|
|
|
{
|
|
|
|
|
|
//非达沃特用户直接返回
|
|
|
@@ -1662,13 +1678,21 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
return;
|
|
|
}
|
|
|
//2.销售收款-保存凭证
|
|
|
- toPurchaseJinDie(account,createUser,corpName,jdTenant.getAccountId(),group.getGroupName(),jdTenant);
|
|
|
+ JdyTool.voucher voucher = toPurchaseJinDie(settlement.getSettlementDate(),account, createUser, corpName, jdTenant.getAccountId(), group.getGroupName(), jdTenant);
|
|
|
+ if(voucher == null)
|
|
|
+ {
|
|
|
+ throw new SecurityException("获取凭证信息失败");
|
|
|
+ }
|
|
|
+ //绑定凭证id和凭证号
|
|
|
+ settlement.setVoucherId(voucher.getId());
|
|
|
+ settlement.setVoucherNo(voucher.getVoucherno());
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//销售收款生成账单
|
|
|
- public void testSaleCollectionSaveVoucher(String accountName,String corpName,String account)throws Exception
|
|
|
+ public void testSaleCollectionSaveVoucher(Settlement settlement,String accountName,String corpName,String account)throws Exception
|
|
|
{
|
|
|
//非达沃特用户直接返回
|
|
|
if(!AuthUtil.getTenantId().equals("681169"))
|
|
|
@@ -1721,7 +1745,15 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
return;
|
|
|
}
|
|
|
//2.销售收款-保存凭证
|
|
|
- toSaleCollectionJinDie(account,corpName,jdTenant.getAccountId(),group.getGroupName(),jdTenant);
|
|
|
+ JdyTool.voucher voucher = toSaleCollectionJinDie(settlement.getSettlementDate(),account, corpName, jdTenant.getAccountId(), group.getGroupName(), jdTenant);
|
|
|
+ if(voucher == null)
|
|
|
+ {
|
|
|
+ throw new SecurityException("获取凭证信息失败");
|
|
|
+ }
|
|
|
+ //绑定凭证id和凭证号
|
|
|
+ settlement.setVoucherId(voucher.getId());
|
|
|
+ settlement.setVoucherNo(voucher.getVoucherno());
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1774,7 +1806,8 @@ public class SettlementServiceImpl extends ServiceImpl<SettlementMapper, Settlem
|
|
|
return;
|
|
|
}
|
|
|
//2.销售保存凭证
|
|
|
- toSaleJinDie(items,jdTenant.getAccountId(),group.getGroupName(),jdTenant);
|
|
|
+ JdyTool.voucher voucher = toSaleJinDie(items, jdTenant.getAccountId(), group.getGroupName(), jdTenant);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//测试获取AccountGroupRequest
|