|
|
@@ -296,7 +296,8 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
{
|
|
|
String accountName=select.getBelongCompany();
|
|
|
//测试账套-收货生成凭证
|
|
|
- this.testDeliverGoodsSaveVoucher(accountName,corpName,wareHouse,purchaseTotalAmount,deliveryAmount,saleOrderNo,purchaseOrderNo);
|
|
|
+ this.testDeliverGoodsSaveVoucher(select,accountName,corpName,wareHouse,purchaseTotalAmount,deliveryAmount,saleOrderNo,purchaseOrderNo);
|
|
|
+ baseMapper.updateById(select);
|
|
|
}
|
|
|
catch (Exception exception)
|
|
|
{
|
|
|
@@ -485,7 +486,9 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
{
|
|
|
String accountName=select.getBelongCompany();
|
|
|
//测试账套-收货生成凭证
|
|
|
- this.testTakeGoodsSaveVoucher(accountName,corpName,wareHouse,acoount,orderNo);
|
|
|
+ this.testTakeGoodsSaveVoucher(select,accountName,corpName,wareHouse,acoount,orderNo);
|
|
|
+ baseMapper.updateById(select);
|
|
|
+
|
|
|
}
|
|
|
catch (Exception exception)
|
|
|
{
|
|
|
@@ -812,7 +815,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
}
|
|
|
|
|
|
//发货生成凭证
|
|
|
- public void testDeliverGoodsSaveVoucher(String accountName,String copsName,String warehouse ,String purchaseTotalAmount,String deliveryAmount,String saleOrderNo,String purchaseOrder) throws Exception
|
|
|
+ public void testDeliverGoodsSaveVoucher(Delivery delivery,String accountName,String copsName,String warehouse ,String purchaseTotalAmount,String deliveryAmount,String saleOrderNo,String purchaseOrder) throws Exception
|
|
|
{
|
|
|
//非达沃特用户直接返回
|
|
|
if(!AuthUtil.getTenantId().equals("681169"))
|
|
|
@@ -859,19 +862,19 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
}
|
|
|
|
|
|
//2.收货,组装model,保存凭证
|
|
|
- toDeliverJinDie(saleOrderNo,purchaseOrder,purchaseTotalAmount,deliveryAmount,copsName,warehouse,jdTenant.getAccountId(),group.getGroupName(),jdTenant);
|
|
|
-
|
|
|
+ JdyTool.voucher voucher = toDeliverJinDie(delivery.getBusinessDate(),saleOrderNo, purchaseOrder, purchaseTotalAmount, deliveryAmount, copsName, warehouse, jdTenant.getAccountId(), group.getGroupName(), jdTenant);
|
|
|
+ if(voucher==null)
|
|
|
+ {
|
|
|
+ throw new SecurityException("获取凭证信息失败");
|
|
|
+ }
|
|
|
+ delivery.setVoucherId(voucher.getId());
|
|
|
+ delivery.setVoucherId(voucher.getVoucherno());
|
|
|
}
|
|
|
|
|
|
//收货生成凭证
|
|
|
- public void testTakeGoodsSaveVoucher(String accountName,String copsName,String warehouse ,String acoount,String orderNo) throws Exception
|
|
|
+ public void testTakeGoodsSaveVoucher(Delivery delivery,String accountName,String copsName,String warehouse ,String acoount,String orderNo) throws Exception
|
|
|
{
|
|
|
|
|
|
- //非达沃特用户直接返回
|
|
|
- if(!AuthUtil.getTenantId().equals("681169"))
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
//获取token
|
|
|
String token = this.getAccountGroupRequest();
|
|
|
//获取套账url
|
|
|
@@ -910,22 +913,24 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
return;
|
|
|
}
|
|
|
//2.收货,组装model,保存凭证
|
|
|
- toTakeJinDie(orderNo,acoount,copsName,warehouse,jdTenant.getAccountId(),group.getGroupName(),jdTenant);
|
|
|
+ JdyTool.voucher voucher = toTakeJinDie(delivery.getBusinessDate(),orderNo, acoount, copsName, warehouse, jdTenant.getAccountId(), group.getGroupName(), jdTenant);
|
|
|
+ if(voucher==null)
|
|
|
+ {
|
|
|
+ throw new SecurityException("获取凭证信息失败");
|
|
|
+ }
|
|
|
+ delivery.setVoucherId(voucher.getId());
|
|
|
+ delivery.setVoucherId(voucher.getVoucherno());
|
|
|
}
|
|
|
|
|
|
- public void toDeliverJinDie(String saleOrderNo,String purchaseOrder,String purchaseTotalAmount,String deliveryAmount,String copsName,String warehouse,String accountId,String groupName,JdTenant jdTenant)
|
|
|
+ public JdyTool.voucher toDeliverJinDie(Date date,String saleOrderNo,String purchaseOrder,String purchaseTotalAmount,String deliveryAmount,String copsName,String warehouse,String accountId,String groupName,JdTenant jdTenant)
|
|
|
{
|
|
|
- //不是某一家 直接返回
|
|
|
- if (!AuthUtil.getTenantId().equals("681169"))
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
+
|
|
|
List<JDYitems> jdYitems= new ArrayList<>();
|
|
|
//凭证1
|
|
|
JDYitems item1 = new JDYitems();
|
|
|
JDYitems item2 = new JDYitems();
|
|
|
- item1.setDate(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
|
|
|
- item2.setDate(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
|
|
|
+ item1.setDate(new SimpleDateFormat("yyyy-MM-dd").format(date));
|
|
|
+ item2.setDate(new SimpleDateFormat("yyyy-MM-dd").format(date));
|
|
|
List<JDYentries> entriesList1 = new ArrayList<>();
|
|
|
List<JDYentries> entriesList2 = new ArrayList<>();
|
|
|
List<JDYentries> entriesList3 = new ArrayList<>();
|
|
|
@@ -949,7 +954,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
{
|
|
|
throw new SecurityException("获取销售订单科目号失败");
|
|
|
}
|
|
|
- d.setExplanation(saleOrderNo + "-收入");
|
|
|
+ d.setExplanation(saleOrderNo + "-"+dModule.getAbstractStatic());
|
|
|
d.setAccount_number(dModule.getProjectCode());
|
|
|
d.setDebitamount(deliveryAmount);
|
|
|
|
|
|
@@ -996,7 +1001,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
throw new SecurityException("获取销售订单科目号失败");
|
|
|
}
|
|
|
|
|
|
- c.setExplanation(saleOrderNo + "-收入");
|
|
|
+ c.setExplanation(saleOrderNo + "-"+cModule.getAbstractStatic());
|
|
|
c.setAccount_number(cModule.getProjectCode());
|
|
|
c.setCreditamount(deliveryAmount);
|
|
|
entriesList1.add(c);
|
|
|
@@ -1023,7 +1028,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
{
|
|
|
throw new SecurityException("获取销售订单科目号失败");
|
|
|
}
|
|
|
- d2.setExplanation(purchaseOrder + "-结转成本");
|
|
|
+ d2.setExplanation(purchaseOrder + "-"+dModule2.getAbstractStatic());
|
|
|
d2.setAccount_number(dModule2.getProjectCode());
|
|
|
d2.setDebitamount(purchaseTotalAmount);
|
|
|
entriesList2.add(d2);
|
|
|
@@ -1044,7 +1049,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
{
|
|
|
throw new SecurityException("获取销售订单科目号失败");
|
|
|
}
|
|
|
- c2.setExplanation(purchaseOrder + "-结转成本");
|
|
|
+ c2.setExplanation(purchaseOrder + "-"+cModule2.getAbstractStatic());
|
|
|
c2.setAccount_number(cModule2.getProjectCode());
|
|
|
c2.setCreditamount(purchaseTotalAmount);
|
|
|
|
|
|
@@ -1083,7 +1088,8 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
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());
|
|
|
}
|
|
|
@@ -1092,15 +1098,11 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
|
|
|
|
|
|
//金蝶保存凭证测试-销售生成凭证
|
|
|
- public void toTakeJinDie(String orderNo,String acoount,String copsName,String warehouse,String accountId,String groupName,JdTenant jdTenant) {
|
|
|
- //不是某一家 直接返回
|
|
|
- if (!AuthUtil.getTenantId().equals("681169"))
|
|
|
- {
|
|
|
- return;
|
|
|
- }
|
|
|
+ public JdyTool.voucher toTakeJinDie(Date date,String orderNo,String acoount,String copsName,String warehouse,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<>();
|
|
|
|
|
|
@@ -1121,7 +1123,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
throw new SecurityException("获取销售订单科目号失败");
|
|
|
}
|
|
|
|
|
|
- d.setExplanation(orderNo + "采购入库");
|
|
|
+ d.setExplanation(dModule.getAbstractStatic()+"-" + "采购入库");
|
|
|
d.setAccount_number(dModule.getProjectCode());
|
|
|
d.setDebitamount(acoount);
|
|
|
|
|
|
@@ -1170,7 +1172,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
throw new SecurityException("获取销售订单科目号失败");
|
|
|
}
|
|
|
|
|
|
- c.setExplanation(orderNo +"采购入库");
|
|
|
+ c.setExplanation(cModule.getAbstractStatic()+"-" +"采购入库");
|
|
|
c.setAccount_number(cModule.getProjectCode());
|
|
|
c.setCreditamount(acoount);
|
|
|
|
|
|
@@ -1207,7 +1209,8 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
|
|
|
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());
|
|
|
}
|