|
@@ -27,8 +27,9 @@ public class VoucherAdd {
|
|
* 新增凭证
|
|
* 新增凭证
|
|
* @param map 数据
|
|
* @param map 数据
|
|
* @param biz_id 唯一来源id
|
|
* @param biz_id 唯一来源id
|
|
|
|
+ * @param type 数据源 1昆山,3潍坊
|
|
*/
|
|
*/
|
|
- public static void addVoucher(Map<String,Object> map,String biz_id) {
|
|
|
|
|
|
+ public static void addVoucher(Map<String,Object> map,String biz_id,String type) {
|
|
|
|
|
|
Map<String,Object> jsonBodyMap = new HashMap<>();
|
|
Map<String,Object> jsonBodyMap = new HashMap<>();
|
|
Map<String,Object> voucher = new HashMap<>();//凭证数据详情
|
|
Map<String,Object> voucher = new HashMap<>();//凭证数据详情
|
|
@@ -38,27 +39,34 @@ public class VoucherAdd {
|
|
// voucher.put("accounting_period","1");//所属的会计期间,不填写取当前月份
|
|
// voucher.put("accounting_period","1");//所属的会计期间,不填写取当前月份
|
|
voucher.put("date", DateUtils.format(new Date()));//制单日期
|
|
voucher.put("date", DateUtils.format(new Date()));//制单日期
|
|
// voucher.put("enter","DingDing_"+map.get("申请人"));//制单人名称
|
|
// voucher.put("enter","DingDing_"+map.get("申请人"));//制单人名称
|
|
- voucher.put("enter","autoDingDing");//制单人名称
|
|
|
|
|
|
+ voucher.put("enter","OA");//制单人名称
|
|
// voucher.put("cashier",map.get("出纳"));//出纳名称
|
|
// voucher.put("cashier",map.get("出纳"));//出纳名称
|
|
|
|
|
|
Map<String,Object> credit = new HashMap<>(); //voucher > credit
|
|
Map<String,Object> credit = new HashMap<>(); //voucher > credit
|
|
List<Map<String,Object>> entryCredit = new ArrayList<>(); //voucher > credit > entryCredit
|
|
List<Map<String,Object>> entryCredit = new ArrayList<>(); //voucher > credit > entryCredit
|
|
Map<String,Object> entryCreditMap = new HashMap<>(); //voucher > credit > entryCredit > entryCreditMap
|
|
Map<String,Object> entryCreditMap = new HashMap<>(); //voucher > credit > entryCredit > entryCreditMap
|
|
- List<Map<String,Object>> cash_flowListCredit = new ArrayList<>();//voucher > credit > entryCredit > entryCreditMap > cash_flowListCredit
|
|
|
|
- Map<String,Object> cash_flowMapCredit = new HashMap<>(); //voucher > credit > entryCredit > entryCreditMap > cash_flowListCredit > cash_flowMapCredit
|
|
|
|
-
|
|
|
|
|
|
+// List<Map<String,Object>> cash_flowListCredit = new ArrayList<>();//voucher > credit > entryCredit > entryCreditMap > cash_flowListCredit
|
|
|
|
+// Map<String,Object> cash_flowMapCredit = new HashMap<>(); //voucher > credit > entryCredit > entryCreditMap > cash_flowListCredit > cash_flowMapCredit
|
|
|
|
+//
|
|
// cash_flowMapCredit.put("natural_credit_currency","0.00");
|
|
// cash_flowMapCredit.put("natural_credit_currency","0.00");
|
|
// cash_flowMapCredit.put("natural_debit_currency","4.00");
|
|
// cash_flowMapCredit.put("natural_debit_currency","4.00");
|
|
|
|
+// cash_flowMapCredit.put("cdept_id","021");
|
|
|
|
+// cash_flowMapCredit.put("cperson_id","CHK2019001");
|
|
// cash_flowListCredit.add(cash_flowMapCredit);
|
|
// cash_flowListCredit.add(cash_flowMapCredit);
|
|
// entryCreditMap.put("cash_flow",cash_flowListCredit);
|
|
// entryCreditMap.put("cash_flow",cash_flowListCredit);
|
|
|
|
|
|
-// entryCreditMap.put("auxiliary",new HashMap<String,Object>());
|
|
|
|
|
|
+ Map<String,Object> auxiliaryCredit = new HashMap<>();
|
|
|
|
+ auxiliaryCredit.put("dept_id",map.get("dept_code"));
|
|
|
|
+ auxiliaryCredit.put("personnel_id",map.get("job_number"));
|
|
|
|
+// auxiliaryCredit.put("operator","CHK2019001");
|
|
|
|
+ entryCreditMap.put("auxiliary",auxiliaryCredit);
|
|
|
|
+
|
|
// entryCreditMap.put("credit_quantity","0");
|
|
// entryCreditMap.put("credit_quantity","0");
|
|
// entryCreditMap.put("document_date","2021-09-18");
|
|
// entryCreditMap.put("document_date","2021-09-18");
|
|
// entryCreditMap.put("document_id","321654");
|
|
// entryCreditMap.put("document_id","321654");
|
|
// entryCreditMap.put("exchange_rate2","0");
|
|
// entryCreditMap.put("exchange_rate2","0");
|
|
entryCreditMap.put("abstract",map.get("abstract"));
|
|
entryCreditMap.put("abstract",map.get("abstract"));
|
|
- entryCreditMap.put("account_code","1001");
|
|
|
|
|
|
+ entryCreditMap.put("account_code",map.get("account_code"));
|
|
// entryCreditMap.put("entry_id","0");//
|
|
// entryCreditMap.put("entry_id","0");//
|
|
entryCreditMap.put("natural_credit_currency",map.get("naturalCurrency"));//本币贷方发生额*与本币借方发生额不能同时为空
|
|
entryCreditMap.put("natural_credit_currency",map.get("naturalCurrency"));//本币贷方发生额*与本币借方发生额不能同时为空
|
|
// entryCreditMap.put("primary_credit_amount","0");//
|
|
// entryCreditMap.put("primary_credit_amount","0");//
|
|
@@ -69,22 +77,29 @@ public class VoucherAdd {
|
|
Map<String,Object> debit = new HashMap<>(); //voucher > debit
|
|
Map<String,Object> debit = new HashMap<>(); //voucher > debit
|
|
List<Map<String,Object>> entryDebit = new ArrayList<>(); //voucher > debit > entryDebit
|
|
List<Map<String,Object>> entryDebit = new ArrayList<>(); //voucher > debit > entryDebit
|
|
Map<String,Object> entryDebitMap = new HashMap<>(); //voucher > debit > entryDebit > entryDebitMap
|
|
Map<String,Object> entryDebitMap = new HashMap<>(); //voucher > debit > entryDebit > entryDebitMap
|
|
- List<Map<String,Object>> cash_flowListDebit = new ArrayList<>();//voucher > debit > entryDebit > entryDebitMap > cash_flowListDebit
|
|
|
|
- Map<String,Object> cash_flowMapDebit = new HashMap<>(); //voucher > debit > entryDebit > entryDebitMap > cash_flowListDebit > cash_flowMapDebit
|
|
|
|
-
|
|
|
|
|
|
+// List<Map<String,Object>> cash_flowListDebit = new ArrayList<>();//voucher > debit > entryDebit > entryDebitMap > cash_flowListDebit
|
|
|
|
+// Map<String,Object> cash_flowMapDebit = new HashMap<>(); //voucher > debit > entryDebit > entryDebitMap > cash_flowListDebit > cash_flowMapDebit
|
|
|
|
+//
|
|
// cash_flowMapDebit.put("natural_credit_currency","0.00");
|
|
// cash_flowMapDebit.put("natural_credit_currency","0.00");
|
|
// cash_flowMapDebit.put("natural_debit_currency","4.00");
|
|
// cash_flowMapDebit.put("natural_debit_currency","4.00");
|
|
|
|
+// cash_flowMapDebit.put("cdept_id","021");
|
|
|
|
+// cash_flowMapDebit.put("cperson_id","CHK2019001");
|
|
// cash_flowListDebit.add(cash_flowMapDebit);
|
|
// cash_flowListDebit.add(cash_flowMapDebit);
|
|
// entryDebitMap.put("cash_flow",cash_flowListDebit);
|
|
// entryDebitMap.put("cash_flow",cash_flowListDebit);
|
|
-//
|
|
|
|
-// entryDebitMap.put("auxiliary",new HashMap<String,Object>());
|
|
|
|
|
|
+
|
|
|
|
+ Map<String,Object> auxiliaryDebit = new HashMap<>();
|
|
|
|
+ auxiliaryDebit.put("dept_id",map.get("dept_code"));
|
|
|
|
+ auxiliaryDebit.put("personnel_id",map.get("job_number"));
|
|
|
|
+// auxiliaryDebit.put("operator","CHK2019001");
|
|
|
|
+ entryDebitMap.put("auxiliary",auxiliaryDebit);
|
|
|
|
+
|
|
// entryDebitMap.put("settlement","8");
|
|
// entryDebitMap.put("settlement","8");
|
|
entryDebitMap.put("abstract",map.get("abstract"));
|
|
entryDebitMap.put("abstract",map.get("abstract"));
|
|
// entryDebitMap.put("debit_quantity","0");
|
|
// entryDebitMap.put("debit_quantity","0");
|
|
// entryDebitMap.put("document_date","2021-09-18");
|
|
// entryDebitMap.put("document_date","2021-09-18");
|
|
// entryDebitMap.put("document_id","123456");
|
|
// entryDebitMap.put("document_id","123456");
|
|
// entryDebitMap.put("exchange_rate2","0");
|
|
// entryDebitMap.put("exchange_rate2","0");
|
|
- entryDebitMap.put("account_code","1001");
|
|
|
|
|
|
+ entryDebitMap.put("account_code",map.get("account_code"));
|
|
//
|
|
//
|
|
entryDebitMap.put("natural_debit_currency",map.get("naturalCurrency"));//本币贷方发生额*与本币借方发生额不能同时为空
|
|
entryDebitMap.put("natural_debit_currency",map.get("naturalCurrency"));//本币贷方发生额*与本币借方发生额不能同时为空
|
|
// entryDebitMap.put("primary_debit_amount","0");//
|
|
// entryDebitMap.put("primary_debit_amount","0");//
|
|
@@ -101,7 +116,7 @@ public class VoucherAdd {
|
|
|
|
|
|
VoucherService voucherService = new VoucherService();
|
|
VoucherService voucherService = new VoucherService();
|
|
try {
|
|
try {
|
|
- JSONObject record = voucherService.add(jsonBody, biz_id);
|
|
|
|
|
|
+ JSONObject record = voucherService.add(jsonBody, biz_id,type);
|
|
logger.info(record.toString());
|
|
logger.info(record.toString());
|
|
} catch (OpenAPIException e) {
|
|
} catch (OpenAPIException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|