|
@@ -72,6 +72,7 @@ import com.ssj.framework.files.service.FileInfoService;
|
|
|
import com.ssj.framework.idworker.IdWorker;
|
|
|
import com.ssj.service.conch.conch.service.ConchDerverService;
|
|
|
import com.ssj.service.conch.parents.v1.dto.PositionSchoolV1Dto;
|
|
|
+import com.ssj.service.sys.finance.service.IFinanceService;
|
|
|
import com.ssj.service.sys.fx.service.DeviceActService;
|
|
|
import com.ssj.service.sys.fx.service.DevicePartsActService;
|
|
|
import com.ssj.service.sys.fx.service.DevicePartsService;
|
|
@@ -147,6 +148,9 @@ public class FxController extends BaseController {
|
|
|
private ILibJoinService libJoinService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private IFinanceService financeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private ILibJoinConsumeService libJoinConsumeService;
|
|
|
|
|
|
@Autowired
|
|
@@ -3932,6 +3936,84 @@ public class FxController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @RequestMapping(value = "/exportMerchantBalanceOldList", method = RequestMethod.POST)
|
|
|
+ @ResponseBody
|
|
|
+ public void exportMerchantBalanceOldList( HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ ServletOutputStream os = null;
|
|
|
+ try {
|
|
|
+ String libName="塾币结存流水列表";
|
|
|
+ os = response.getOutputStream(); //获得输出流
|
|
|
+ response.reset(); //清空输出流
|
|
|
+ String fileName = new String(libName.getBytes("gb2312"), "ISO8859-1") +".xlsx";
|
|
|
+ response.setHeader("Content-disposition", "attachment; filename="+ fileName); //设定输出文件头
|
|
|
+ response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
|
|
+ response.setCharacterEncoding("utf-8");
|
|
|
+
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ params.put("merchantId", request.getParameter("merchantId")==null?"":request.getParameter("merchantId"));
|
|
|
+ params.put("type", request.getParameter("type")==null?"":request.getParameter("type"));
|
|
|
+ params.put("createTime", request.getParameter("createTime")==null?"2020-10-09":request.getParameter("createTime"));
|
|
|
+ params.put("endCreateTime", request.getParameter("endCreateTime")==null?DateHelper.format(new Date(), "yyyy-MM-dd") :request.getParameter("endCreateTime"));
|
|
|
+
|
|
|
+ Page<Map<String, Object>> page = financeService.findMerchantBalanceOldByPage(params, initPage(1, 10000, Direction.DESC, new String[]{"createTime"}));
|
|
|
+
|
|
|
+ List<Map<String, Object>> mapList=page.getContent();
|
|
|
+ for (Map<String, Object> map : mapList) {
|
|
|
+ map.put("pr_1",new BigDecimal(new BigDecimal(map.get("price").toString()).doubleValue()*(Integer.parseInt(map.get("count_1").toString()))).setScale(2, RoundingMode.UP).doubleValue());
|
|
|
+ map.put("pr_2",new BigDecimal(new BigDecimal(map.get("price").toString()).doubleValue()*(Integer.parseInt(map.get("count_2").toString()))).setScale(2, RoundingMode.UP).doubleValue());
|
|
|
+ map.put("count_3",new BigDecimal(map.get("count_1").toString()).doubleValue()-new BigDecimal(map.get("count_2").toString()).doubleValue());
|
|
|
+ map.put("pr_3",new BigDecimal(map.get("pr_1").toString()).doubleValue()-new BigDecimal(map.get("pr_2").toString()).doubleValue());
|
|
|
+
|
|
|
+ switch (map.get("type").toString()) {
|
|
|
+ case "1":
|
|
|
+ map.put("type","直接签约(塾币模式)");
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ map.put("type","内部消耗");
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ map.put("type","外部签约");
|
|
|
+ break;
|
|
|
+ case "4":
|
|
|
+ map.put("type","内部不结算(财务)");
|
|
|
+ break;
|
|
|
+ case "5":
|
|
|
+ map.put("type","直接签约(端口模式)");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<ExcelColumn> myColumns3 = new ArrayList<ExcelColumn>();
|
|
|
+ myColumns3.add(new ExcelColumn("商户账号", "pos_code", 20));
|
|
|
+ myColumns3.add(new ExcelColumn("商户名称", "unit_name", 20));
|
|
|
+ myColumns3.add(new ExcelColumn("商户类型", "type", 20));
|
|
|
+ myColumns3.add(new ExcelColumn("签约端口数", "port_num", 20));
|
|
|
+ myColumns3.add(new ExcelColumn("本期增加数量", "count_1", 20));
|
|
|
+ myColumns3.add(new ExcelColumn("本期增加金额", "pr_1", 20));
|
|
|
+ myColumns3.add(new ExcelColumn("本期减少数量", "count_2", 20));
|
|
|
+ myColumns3.add(new ExcelColumn("本期减少金额", "pr_2", 20));
|
|
|
+ myColumns3.add(new ExcelColumn("结存数量", "count_3", 20));
|
|
|
+ myColumns3.add(new ExcelColumn("结存金额", "pr_3", 20));
|
|
|
+
|
|
|
+ CustomizeToExcel.downFile(myColumns3, mapList, os);
|
|
|
+ }catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }catch (Exception e1){
|
|
|
+ e1.printStackTrace();
|
|
|
+ }finally{
|
|
|
+ if(os != null){
|
|
|
+ try {
|
|
|
+ os.flush();
|
|
|
+ os.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
@RequestMapping(value = "/exportMerchantActiveCapList", method = RequestMethod.POST)
|
|
|
@ResponseBody
|
|
@@ -4092,7 +4174,7 @@ public class FxController extends BaseController {
|
|
|
myColumns3.add(new ExcelColumn("月单价(成本)", "unit_price", 20));
|
|
|
myColumns3.add(new ExcelColumn("购买时间", "create_time", 20));
|
|
|
|
|
|
- CustomizeToExcel.downFile(myColumns3, page.getContent(), os);
|
|
|
+ CustomizeToExcel.downFile(myColumns3, mapList, os);
|
|
|
}catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}catch (Exception e1){
|
|
@@ -4156,7 +4238,7 @@ public class FxController extends BaseController {
|
|
|
myColumns3.add(new ExcelColumn("结束日期", "end_sign_time", 20));
|
|
|
myColumns3.add(new ExcelColumn("购买时间", "create_time", 20));
|
|
|
|
|
|
- CustomizeToExcel.downFile(myColumns3, page.getContent(), os);
|
|
|
+ CustomizeToExcel.downFile(myColumns3, mapList, os);
|
|
|
}catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
}catch (Exception e1){
|
|
@@ -4675,6 +4757,45 @@ public class FxController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //塾币结存表
|
|
|
+ @RequestMapping("/merchantBalanceOldList")
|
|
|
+ public String merchantBalanceOldList(Model model,
|
|
|
+ @RequestParam(required = false, defaultValue = "100") int pageSize,
|
|
|
+ @RequestParam(required = false, defaultValue = "1") int pageNo)throws Exception {
|
|
|
+
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ params.put("merchantId", request.getParameter("merchantId")==null?"":request.getParameter("merchantId"));
|
|
|
+ params.put("type", request.getParameter("type")==null?"":request.getParameter("type"));
|
|
|
+ params.put("createTime", request.getParameter("createTime")==null?"2020-10-09":request.getParameter("createTime"));
|
|
|
+ params.put("endCreateTime", request.getParameter("endCreateTime")==null?DateHelper.format(new Date(), "yyyy-MM-dd") :request.getParameter("endCreateTime"));
|
|
|
+
|
|
|
+
|
|
|
+ SplitPage sp = new SplitPage();
|
|
|
+ sp.setAction(request.getRequestURI());
|
|
|
+ sp.setPageNo(pageNo);
|
|
|
+ sp.setPageSize(pageSize);
|
|
|
+ sp.setParams(params);
|
|
|
+ Page<Map<String, Object>> page = financeService.findMerchantBalanceOldByPage(params, initPage(pageNo, pageSize, Direction.DESC, new String[]{"createTime"}));
|
|
|
+ sp.setRowCnt((int) page.getTotalElements());
|
|
|
+
|
|
|
+ List<Map<String, Object>> mapList=page.getContent();
|
|
|
+ for (Map<String, Object> map : mapList) {
|
|
|
+ map.put("pr_1",new BigDecimal(new BigDecimal(map.get("price").toString()).doubleValue()*(Integer.parseInt(map.get("count_1").toString()))).setScale(2, RoundingMode.UP).doubleValue());
|
|
|
+ map.put("pr_2",new BigDecimal(new BigDecimal(map.get("price").toString()).doubleValue()*(Integer.parseInt(map.get("count_2").toString()))).setScale(2, RoundingMode.UP).doubleValue());
|
|
|
+ map.put("count_3",new BigDecimal(map.get("count_1").toString()).doubleValue()-new BigDecimal(map.get("count_2").toString()).doubleValue());
|
|
|
+ map.put("pr_3",new BigDecimal(map.get("pr_1").toString()).doubleValue()-new BigDecimal(map.get("pr_2").toString()).doubleValue());
|
|
|
+ }
|
|
|
+ model.addAttribute("list", mapList);
|
|
|
+ model.addAttribute("listNavigatHtml", sp.getSysPaginHtml());
|
|
|
+ model.addAttribute("page", sp);
|
|
|
+ model.addAttribute("search", params);
|
|
|
+ List<Merchant> list=merchantService.findMerchantByPage();
|
|
|
+ model.addAttribute("poslist", list);
|
|
|
+ return "sys/fx/merchantBalanceOldList";
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|