|
@@ -9,6 +9,7 @@ import com.iamberry.rst.core.dm.FinancialReceipt;
|
|
|
import com.iamberry.rst.core.order.ProductColor;
|
|
|
import com.iamberry.rst.core.page.PageRequest;
|
|
|
import com.iamberry.rst.core.page.PagedResult;
|
|
|
+import com.iamberry.rst.core.pts.PtsBatch;
|
|
|
import com.iamberry.rst.core.sys.Admin;
|
|
|
import com.iamberry.rst.faces.cm.CompanyInfoService;
|
|
|
import com.iamberry.rst.faces.cm.SalesOrderService;
|
|
@@ -19,6 +20,7 @@ import com.iamberry.rst.faces.sys.SysService;
|
|
|
import com.iamberry.rst.utils.AdminUtils;
|
|
|
import com.iamberry.rst.utils.ExcelUtil;
|
|
|
import com.iamberry.rst.utils.StitchAttrUtil;
|
|
|
+import com.iamberry.wechat.tools.ObjectExcelView;
|
|
|
import com.iamberry.wechat.tools.ResponseJson;
|
|
|
import net.sf.json.JSONArray;
|
|
|
import org.apache.shiro.authz.annotation.Logical;
|
|
@@ -34,10 +36,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.IOException;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Controller
|
|
|
@RequestMapping("/admin/financial_receipt")
|
|
@@ -657,4 +656,67 @@ public class FinanciaReceController {
|
|
|
return mv;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 下载订单
|
|
|
+ * @param request
|
|
|
+ * @return
|
|
|
+ * @throws IOException
|
|
|
+ */
|
|
|
+ @RequestMapping("/download_fIle")
|
|
|
+ @RequiresPermissions("dm:FinancialReceipt:statistic")
|
|
|
+ public ModelAndView downloadFIle(HttpServletRequest request,DmDealer dmDealer) throws Exception {
|
|
|
+ List<DmDealer> dmDealerList = dmDealerService.listDmDealerFile(dmDealer);
|
|
|
+
|
|
|
+ // 准备model
|
|
|
+ Map<String, Object> model = new HashMap<String, Object>();
|
|
|
+ model.put("fileName", "财务统计"); // 下载文件名称
|
|
|
+
|
|
|
+ // 标题 客户名称 销售渠道 订单总额 订单总成本 已认领金额
|
|
|
+ List<String> titles = new ArrayList<String>();
|
|
|
+ titles.add("客户经理");
|
|
|
+ titles.add("客户名称");
|
|
|
+ titles.add("销售渠道");
|
|
|
+ titles.add("订单总额");
|
|
|
+ titles.add("订单总成本");
|
|
|
+ titles.add("已认领金额");
|
|
|
+ model.put("titles", titles);
|
|
|
+ PtsBatch ptsBatch = new PtsBatch();
|
|
|
+ List<List<Object>> countexts = new ArrayList<List<Object>>();
|
|
|
+ if(dmDealerList != null && dmDealerList.size() >0){
|
|
|
+ for (DmDealer dealer : dmDealerList) {
|
|
|
+ List<Object> row = new ArrayList<Object>();
|
|
|
+ row.add(dealer.getAdminName() == null ? null:dealer.getAdminName());
|
|
|
+ row.add(dealer.getDealerName() == null ? null:dealer.getDealerName());
|
|
|
+ row.add(dealer.getDealChannelName() == null ? null:dealer.getDealChannelName());
|
|
|
+ if(dealer.getItemTotal() == null){
|
|
|
+ row.add(0);
|
|
|
+ }else{
|
|
|
+ Double itemTotal = Double.valueOf(dealer.getItemTotal());
|
|
|
+ itemTotal = itemTotal/100;
|
|
|
+ row.add(itemTotal);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(dealer.getItemCostTotal() == null){
|
|
|
+ row.add(0);
|
|
|
+ }else{
|
|
|
+ Double itemCostTotal = Double.valueOf(dealer.getItemCostTotal());
|
|
|
+ itemCostTotal = itemCostTotal/100;
|
|
|
+ row.add(itemCostTotal);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(dealer.getClaimOrderTotal() == null){
|
|
|
+ row.add(0);
|
|
|
+ }else{
|
|
|
+ Double claimOrderTotal = Double.valueOf(dealer.getClaimOrderTotal());
|
|
|
+ claimOrderTotal = claimOrderTotal/100;
|
|
|
+ row.add(claimOrderTotal);
|
|
|
+ }
|
|
|
+ countexts.add(row);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ model.put("varList", countexts);
|
|
|
+ ObjectExcelView erv = new ObjectExcelView();
|
|
|
+ ModelAndView mv = new ModelAndView(erv,model);
|
|
|
+ return mv;
|
|
|
+ }
|
|
|
}
|