|
@@ -1,8 +1,5 @@
|
|
|
package com.cloudcross.ssp.web.advertiser.main.finance;
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
import java.io.IOException;
|
|
|
import java.io.PrintWriter;
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -14,20 +11,16 @@ import java.util.Map;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
-import org.apache.log4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
|
-import com.cloudcross.ssp.advertiser.model.Account;
|
|
|
-import com.cloudcross.ssp.advertiser.model.Finance;
|
|
|
-import com.cloudcross.ssp.advertiser.model.Order;
|
|
|
-import com.cloudcross.ssp.advertiser.service.IFinanceService;
|
|
|
-import com.cloudcross.ssp.advertiser.service.impl.FinanceService;
|
|
|
+import com.cloudcross.ssp.model.Account;
|
|
|
+import com.cloudcross.ssp.model.Finance;
|
|
|
+import com.cloudcross.ssp.service.IFinanceService;
|
|
|
import com.cloudcross.ssp.base.utils.freemarker.FreemarkerTemplateProcessor;
|
|
|
import com.cloudcross.ssp.base.web.SimpleController;
|
|
|
import com.cloudcross.ssp.common.utils.Pager;
|
|
@@ -54,14 +47,9 @@ public class FinanceDataController extends SimpleController {
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/list")
|
|
|
- public String list(Model model,
|
|
|
- @RequestParam HashMap<String, Object> paramMap,
|
|
|
- @RequestParam(defaultValue="1") int page) {
|
|
|
-// Map<String,Object> paramMap = new HashMap<String, Object>();
|
|
|
-
|
|
|
+ public String list(Model model,@RequestParam HashMap<String, Object> paramMap,@RequestParam(defaultValue="1") int page) {
|
|
|
//获取当前登录的帐号
|
|
|
- com.cloudcross.ssp.back.model.Account account = getLoginUser();
|
|
|
- System.out.println("account" + account + "haoshuai01010101010101");
|
|
|
+ Account account = getLoginUser();
|
|
|
model.addAttribute("loginAccountName",account.getAccountName());
|
|
|
/**
|
|
|
* 判断登录用户是广告主还是广告主代理商,广告主则advertiserId和agentId都不为0
|
|
@@ -85,13 +73,7 @@ public class FinanceDataController extends SimpleController {
|
|
|
|
|
|
model.addAttribute("accountId",account.getId());
|
|
|
model.addAttribute("agentId", account.getAgentId());
|
|
|
-
|
|
|
- System.out.println("accountId" + account.getId() + "222222222222333333");
|
|
|
- System.out.println("agentId" + account.getAgentId() + "222222222222333333");
|
|
|
-
|
|
|
//下拉框搜索用到的是selectedAdvertiserId,这是代理商登录查询的
|
|
|
- System.out.println("jinjin" + paramMap);
|
|
|
- System.out.println("shuai" + paramMap.get("selectedAdvertiserId"));
|
|
|
Long advertiserId = null;
|
|
|
String advertiserName = "全部广告主";
|
|
|
if (null == paramMap.get("selectedAdvertiserId")
|
|
@@ -125,14 +107,11 @@ public class FinanceDataController extends SimpleController {
|
|
|
|
|
|
|
|
|
int totalRow = financeService.countByParams(paramMap);
|
|
|
- System.out.println("totalRow" + totalRow + "rrrrrrrrrrr");
|
|
|
-
|
|
|
Pager pager = new Pager();
|
|
|
pager.setPage(page);
|
|
|
pager.setTotalRow(totalRow);
|
|
|
|
|
|
List<Finance> financeList = financeService.findByParams(paramMap, pager);
|
|
|
- System.out.println("financeList" + financeList + "Haoshuai");
|
|
|
|
|
|
|
|
|
// 前端写好后传值为agentBalance,此为广告主代理商的账户余额,
|
|
@@ -162,16 +141,10 @@ public class FinanceDataController extends SimpleController {
|
|
|
* 资金分配跳转
|
|
|
*/
|
|
|
@RequestMapping("/allocation")
|
|
|
- public String edit(Model model, @RequestParam Long id,
|
|
|
- //从前端页面传过来的账户余额的值
|
|
|
- @RequestParam Double agentBalance){
|
|
|
- System.out.println("gggggggggg" + agentBalance);
|
|
|
+ public String edit(Model model, @RequestParam Long id,@RequestParam Double agentBalance){//从前端页面传过来的账户余额的值
|
|
|
Finance finance = financeService.findById(id);
|
|
|
-
|
|
|
- System.out.println("finance" + finance + "33333333333333333");
|
|
|
model.addAttribute("agentBalance",agentBalance);
|
|
|
model.addAttribute("finance",finance);
|
|
|
-
|
|
|
return page("allocation");
|
|
|
}
|
|
|
|
|
@@ -182,16 +155,12 @@ public class FinanceDataController extends SimpleController {
|
|
|
Finance f= financeService.findById(finance.getId());
|
|
|
f.setAllocate(finance.getAllocate());
|
|
|
f.setMemo(finance.getMemo());
|
|
|
- System.out.println("finance" + finance + "333333444444555555");
|
|
|
-
|
|
|
financeService.edit(f);
|
|
|
- System.out.println("f" + f + "55555566666677777");
|
|
|
// 代理商分配后,自身账户余额减少,增加分配后代理商余额记录
|
|
|
f.setAgentBalance(finance.getAgentBalance());
|
|
|
- com.cloudcross.ssp.back.model.Account account = getLoginUser();
|
|
|
+ Account account = getLoginUser();
|
|
|
f.setAccountId((long) account.getId());
|
|
|
financeService.add(f);
|
|
|
- System.out.println("f" + f + "88888888888899999999999" + finance);
|
|
|
return redirect(page("list"));
|
|
|
}
|
|
|
|
|
@@ -210,7 +179,7 @@ public class FinanceDataController extends SimpleController {
|
|
|
System.out.println("yuyuyu");
|
|
|
|
|
|
//获取当前登录的帐号
|
|
|
- com.cloudcross.ssp.back.model.Account account = getLoginUser();
|
|
|
+ Account account = getLoginUser();
|
|
|
System.out.println("account" + account + "haoshuai01010101010101");
|
|
|
model.addAttribute("loginAccountName",account.getAccountName());
|
|
|
/**
|