|
|
@@ -19,9 +19,11 @@ import common.data.RowsMap;
|
|
|
import common.data.SQLFactory;
|
|
|
import restcontroller.R;
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
|
|
|
public class rebateaccounthead extends Controller {
|
|
|
/**
|
|
|
@@ -35,7 +37,7 @@ public class rebateaccounthead extends Controller {
|
|
|
|
|
|
@API(title = "返利结算单新增更新", apiversion = R.ID20230627091003.v1.class)
|
|
|
@CACHEING_CLEAN(apiClass = {rebateaccounthead.class})
|
|
|
- public String insertormodify_rebateaccounthead() throws YosException {
|
|
|
+ public String insertormodify_rebateaccounthead() throws YosException , IOException{
|
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
|
// 表名
|
|
|
String tableName = "sa_rebateaccounthead";
|
|
|
@@ -61,7 +63,8 @@ public class rebateaccounthead extends Controller {
|
|
|
|
|
|
@API(title = "返利结算单详情", apiversion = R.ID20230627091503.v1.class)
|
|
|
@CACHEING
|
|
|
- public String queryrebateaccountheadMain() throws YosException {
|
|
|
+ public String queryrebateaccountheadMain() throws YosException, IOException {
|
|
|
+ boolean isExport=content.getBooleanValue("isExport");
|
|
|
Long sa_rebateaccountheadid = content.getLong("sa_rebateaccountheadid");
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "返利结算单详情查询");
|
|
|
sqlFactory.addParameter("sa_rebateaccountheadid", sa_rebateaccountheadid);
|
|
|
@@ -69,9 +72,32 @@ public class rebateaccounthead extends Controller {
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
Row row = rows.isNotEmpty() ? rows.get(0) : new Row();
|
|
|
|
|
|
+ if(isExport){
|
|
|
+ System.out.println(1111);
|
|
|
+ sqlFactory = new SQLFactory(this, "返利结算单导出数据查询");
|
|
|
+ sqlFactory.addParameter("sa_rebateaccountheadid", sa_rebateaccountheadid);
|
|
|
+ sqlFactory.addParameter("siteid", siteid);
|
|
|
+ rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
+ Rows uploadRows = uploadExcelToObs("rebateaccount", " 返利结算单数据列表", rows, getTitleMap());
|
|
|
+ return getSucReturnObject().setData(uploadRows).toString();
|
|
|
+ }
|
|
|
+
|
|
|
return getSucReturnObject().setData(row).toString();
|
|
|
}
|
|
|
|
|
|
+ //返回导出的标题
|
|
|
+ public HashMap<String, String> getTitleMap() {
|
|
|
+ HashMap<String, String> titleMap = new HashMap<>();
|
|
|
+ titleMap.put("agentnum", "经销商编码");
|
|
|
+ titleMap.put("enterprisename", "经销商名称");
|
|
|
+ titleMap.put("accumulatedamount", "累计订购返利商品金额");
|
|
|
+ titleMap.put("rebateamount", "装修返利金额");
|
|
|
+ titleMap.put("sonum", "订单号");
|
|
|
+ titleMap.put("amount", "订单金额(活动商品)");
|
|
|
+ titleMap.put("rateamount", "返利金额");
|
|
|
+ return titleMap;
|
|
|
+ }
|
|
|
+
|
|
|
@API(title = "查询返利结算单列表", apiversion = R.ID20230627091603.v1.class)
|
|
|
@CACHEING
|
|
|
public String queryrebateaccountheadList() throws YosException {
|