|
|
@@ -85,15 +85,26 @@ public class rebateaccounthead extends Controller {
|
|
|
return getSucReturnObject().setData(row).toString();
|
|
|
}
|
|
|
|
|
|
+ @API(title = "返利结算单导出", apiversion = R.ID20230829161203.v1.class)
|
|
|
+ @CACHEING
|
|
|
+ public String expportrebateaccountheadMain() throws YosException, IOException {
|
|
|
+ Long sa_rebateaccountheadid = content.getLong("sa_rebateaccountheadid");
|
|
|
+ System.out.println(1111);
|
|
|
+ SQLFactory sqlFactory = new SQLFactory(this, "返利结算单导出");
|
|
|
+ sqlFactory.addParameter("sa_rebateaccountheadid", sa_rebateaccountheadid);
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
+ Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
+ Rows uploadRows = uploadExcelToObs("rebateaccount", " 返利结算单数据列表", rows, getTitleMap());
|
|
|
+ return getSucReturnObject().setData(uploadRows).toString();
|
|
|
+ }
|
|
|
+
|
|
|
//返回导出的标题
|
|
|
public HashMap<String, String> getTitleMap() {
|
|
|
HashMap<String, String> titleMap = new HashMap<>();
|
|
|
+ titleMap.put("billno", "单号");
|
|
|
titleMap.put("agentnum", "经销商编码");
|
|
|
- titleMap.put("enterprisename", "经销商名称");
|
|
|
- titleMap.put("accumulatedamount", "累计订购返利商品金额");
|
|
|
- titleMap.put("rebateamount", "装修返利金额");
|
|
|
titleMap.put("sonum", "订单号");
|
|
|
- titleMap.put("amount", "订单金额(活动商品)");
|
|
|
+ titleMap.put("amount", "订单金额");
|
|
|
titleMap.put("rateamount", "返利金额");
|
|
|
return titleMap;
|
|
|
}
|
|
|
@@ -412,27 +423,33 @@ public class rebateaccounthead extends Controller {
|
|
|
|
|
|
if (ischeck) {
|
|
|
for (Row row :rebateaccounts) {
|
|
|
- CashbillEntity entity = new CashbillEntity();
|
|
|
- entity.setAmount(row.getBigDecimal("rebateamount"));
|
|
|
- entity.setOwnerid(row.getLong("sa_rebateaccountid"));
|
|
|
- entity.setOwnertable("sa_rebateaccount");
|
|
|
- entity.setSource("返利");
|
|
|
- entity.setSourcenote(row.getString("billno")+"结算单返利");
|
|
|
- entity.setRemarks(row.getString("billno")+"结算单装修补贴返利");
|
|
|
- sqlList.addAll(Accountbalance.createCashbillIncome(this, row.getLong("sys_enterpriseid"),sa_accountclassid,entity,true));
|
|
|
- sqlList.addAll(Accountbalance.rebateupdate(this, row.getLong("sys_enterpriseid"), true, row.getBigDecimal("rebateamount")));
|
|
|
+ if(row.getBigDecimal("rebateamount").compareTo(BigDecimal.ZERO)>0){
|
|
|
+ CashbillEntity entity = new CashbillEntity();
|
|
|
+ entity.setAmount(row.getBigDecimal("rebateamount"));
|
|
|
+ entity.setOwnerid(row.getLong("sa_rebateaccountid"));
|
|
|
+ entity.setOwnertable("sa_rebateaccount");
|
|
|
+ entity.setSource("返利");
|
|
|
+ entity.setSourcenote(row.getString("billno")+"结算单返利");
|
|
|
+ entity.setRemarks(row.getString("billno")+"结算单装修补贴返利");
|
|
|
+ sqlList.addAll(Accountbalance.createCashbillIncome(this, row.getLong("sys_enterpriseid"),sa_accountclassid,entity,true));
|
|
|
+ sqlList.addAll(Accountbalance.rebateupdate(this, row.getLong("sys_enterpriseid"), true, row.getBigDecimal("rebateamount")));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}else{
|
|
|
for (Row row :rebateaccounts) {
|
|
|
- CashbillEntity entity = new CashbillEntity();
|
|
|
- entity.setAmount(row.getBigDecimal("rebateamount").negate());
|
|
|
- entity.setOwnerid(row.getLong("sa_rebateaccountid"));
|
|
|
- entity.setOwnertable("sa_rebateaccount");
|
|
|
- entity.setSource("返利");
|
|
|
- entity.setSourcenote(row.getString("billno")+"结算单反审核");
|
|
|
- entity.setRemarks("装修补贴返利反审核生成");
|
|
|
- sqlList.addAll(Accountbalance.createCashbillIncome(this, row.getLong("sys_enterpriseid"),sa_accountclassid,entity,true));
|
|
|
- sqlList.addAll(Accountbalance.rebateupdate(this, row.getLong("sys_enterpriseid"), false, row.getBigDecimal("rebateamount")));
|
|
|
+ if(row.getBigDecimal("rebateamount").compareTo(BigDecimal.ZERO)>0){
|
|
|
+ CashbillEntity entity = new CashbillEntity();
|
|
|
+ entity.setAmount(row.getBigDecimal("rebateamount").negate());
|
|
|
+ entity.setOwnerid(row.getLong("sa_rebateaccountid"));
|
|
|
+ entity.setOwnertable("sa_rebateaccount");
|
|
|
+ entity.setSource("返利");
|
|
|
+ entity.setSourcenote(row.getString("billno")+"结算单反审核");
|
|
|
+ entity.setRemarks("装修补贴返利反审核生成");
|
|
|
+ sqlList.addAll(Accountbalance.createCashbillIncome(this, row.getLong("sys_enterpriseid"),sa_accountclassid,entity,true));
|
|
|
+ sqlList.addAll(Accountbalance.rebateupdate(this, row.getLong("sys_enterpriseid"), false, row.getBigDecimal("rebateamount")));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|