|
@@ -4,6 +4,8 @@ import cn.com.ctop.common.module.entity.AccountCompensation;
|
|
|
import cn.com.ctop.common.module.service.IAccountCompensationService;
|
|
|
import cn.com.ctop.common.module.service.ISysUserService;
|
|
|
import cn.com.ctop.common.module.utils.Check;
|
|
|
+import cn.com.ctop.common.module.utils.ExportExcelUtils;
|
|
|
+import cn.com.ctop.common.module.utils.HttpUtils;
|
|
|
import cn.com.ctop.kuaishou.modules.report.entity.KuaishouOperationReport;
|
|
|
import cn.com.ctop.kuaishou.modules.report.service.IKuaishouOperationReportService;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
@@ -12,6 +14,7 @@ import com.github.pagehelper.PageInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.system.entity.SysUser;
|
|
|
import org.jeecg.modules.system.service.ISysRoleService;
|
|
@@ -24,6 +27,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.OutputStream;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
@@ -254,4 +259,124 @@ public class KuaishouOperationReportController {
|
|
|
return Result.error("修改失败");
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 导出应季月度消耗
|
|
|
+ */
|
|
|
+ @GetMapping("/queryMonthlyDataExcel")
|
|
|
+ public void queryMonthlyDataExcel(HttpServletResponse response, String mediaId, Integer time, String role, String userId) {
|
|
|
+ try {
|
|
|
+ Result<Object> result = null;
|
|
|
+ if (mediaId.equals("1")) {
|
|
|
+ result = kuaishouOperationReportService.queryToutiaoMonthlyData(time, role, userId, 1, 99999);
|
|
|
+ } else {
|
|
|
+ result = kuaishouOperationReportService.queryKuaishouMonthlyData(time, role, userId, 1, 99999);
|
|
|
+ }
|
|
|
+ List<List<Object>> excelList = new ArrayList<>();
|
|
|
+ PageInfo pageInfo = (PageInfo) result.getResult();
|
|
|
+ if (!Check.isNull(pageInfo)) {
|
|
|
+ List<JSONObject> list = pageInfo.getList();
|
|
|
+ if (!list.isEmpty()) {
|
|
|
+ list.forEach(data -> {
|
|
|
+ List<Object> temp = new ArrayList<>();
|
|
|
+ temp.add(data.getString("userName"));
|
|
|
+ temp.add(data.getString("roleName"));
|
|
|
+ temp.add(data.getString("upTime"));
|
|
|
+ temp.add(data.getString("1totalCharge"));
|
|
|
+ temp.add(data.getString("2totalCharge"));
|
|
|
+ temp.add(data.getString("3totalCharge"));
|
|
|
+ temp.add(data.getString("1KFCharge"));
|
|
|
+ temp.add(data.getString("2KFCharge"));
|
|
|
+ temp.add(data.getString("3KFCharge"));
|
|
|
+ temp.add(data.getString("1FWCharge"));
|
|
|
+ temp.add(data.getString("2FWCharge"));
|
|
|
+ temp.add(data.getString("3FWCharge"));
|
|
|
+ temp.add(data.getString("quitTime"));
|
|
|
+ excelList.add(temp);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ List<Integer> monthInt = kuaishouOperationReportService.getMonthInt(time);
|
|
|
+ OutputStream os = response.getOutputStream();
|
|
|
+ ExportExcelUtils eeu = new ExportExcelUtils();
|
|
|
+ XSSFWorkbook workbook = new XSSFWorkbook();
|
|
|
+ String[] titles = {"运营", "岗位", "晋升时间",
|
|
|
+ monthInt.get(0) + "月总消耗", monthInt.get(1) + "月总消耗", monthInt.get(2) + "月总消耗",
|
|
|
+ monthInt.get(0) + "月框返消耗", monthInt.get(1) + "月框返消耗", monthInt.get(2) + "月框返消耗",
|
|
|
+ monthInt.get(0) + "月服务消耗", monthInt.get(1) + "月服务消耗", monthInt.get(2) + "月服务消耗", "离职时间"};
|
|
|
+ eeu.exportExcelForAttendance(workbook, 0, "运营数据", titles, excelList);
|
|
|
+ HttpUtils.setResponseHeader(response, "clockIn.xlsx");
|
|
|
+ workbook.write(os);
|
|
|
+ os.flush();
|
|
|
+ os.close();
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询季度消耗 导出
|
|
|
+ * 条件:日期,岗位,人员
|
|
|
+ */
|
|
|
+ @ApiOperation(value = "运营绩效-分页列表查询", notes = "运营绩效-分页列表查询")
|
|
|
+ @GetMapping(value = "/queryQuarterlyDataExcel")
|
|
|
+ public void queryQuarterlyDataExcel(HttpServletResponse response, String mediaId, Integer time, String role, String userId) {
|
|
|
+ try {
|
|
|
+ Result<Object> result = null;
|
|
|
+ if ("1".equals(mediaId)) {
|
|
|
+ result = kuaishouOperationReportService.queryToutiaoQuarterlyCharge(time, role, userId, 1, 99999);
|
|
|
+ } else {
|
|
|
+ result = kuaishouOperationReportService.queryKuaishouQuarterlyCharge(time, role, userId, 1, 99999);
|
|
|
+ }
|
|
|
+
|
|
|
+ List<List<Object>> excelList = new ArrayList<>();
|
|
|
+ List<JSONObject> list = (List<JSONObject>) result.getResult();
|
|
|
+ if (!Check.isNull(list)) {
|
|
|
+ if (!list.isEmpty()) {
|
|
|
+ list.forEach(data -> {
|
|
|
+ List<Object> temp = new ArrayList<>();
|
|
|
+ temp.add(data.getString("userName"));
|
|
|
+ temp.add(data.getString("roleName"));
|
|
|
+ temp.add(data.getString("upTime"));
|
|
|
+ temp.add(data.getString("quitTime"));
|
|
|
+ temp.add(data.getString("totalCharge"));
|
|
|
+ temp.add(data.getString("KFCharge"));
|
|
|
+ temp.add(data.getString("FWCharge"));
|
|
|
+ temp.add(data.getString("KFChargeIsOk"));
|
|
|
+ temp.add(data.getString("manageCharge"));
|
|
|
+ temp.add(data.getString("assistantCharge"));
|
|
|
+ temp.add(data.getString("FWChargeCommission"));
|
|
|
+ temp.add(data.getString("KFChargeCommission"));
|
|
|
+ temp.add(data.getString("manageChargeCommission"));
|
|
|
+ temp.add(data.getString("operateCompensation"));
|
|
|
+ temp.add(data.getString("manageCompensation"));
|
|
|
+ temp.add(data.getString("FWChargeIsOk"));
|
|
|
+ temp.add(data.getString("compMoney"));
|
|
|
+ temp.add(data.getString("paySalary"));
|
|
|
+ temp.add(data.getString("putMoney"));
|
|
|
+ temp.add(data.getString("paySalaryRatio"));
|
|
|
+ temp.add(data.getString("finalPutMoney"));
|
|
|
+ excelList.add(temp);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ List<Integer> monthInt = kuaishouOperationReportService.getMonthInt(time);
|
|
|
+ OutputStream os = response.getOutputStream();
|
|
|
+ ExportExcelUtils eeu = new ExportExcelUtils();
|
|
|
+ XSSFWorkbook workbook = new XSSFWorkbook();
|
|
|
+ String[] titles = {"运营", "岗位", "晋升时间", "离职时间",
|
|
|
+ "Q" + time + "总消耗", "Q" + time + "框返消耗", "Q" + time + "服务消耗", "框返消耗是否满足30W",
|
|
|
+ "管理消耗", "助理消耗", "服务消耗提成", "框返消耗提成",
|
|
|
+ "管理消耗提成", "运营赔付扣罚比例", "经理/总监赔付扣罚比例", "是否达标",
|
|
|
+ "扣减金额", "是否符合发放", "发放金额", "发放系数", "最终发放金额"
|
|
|
+ };
|
|
|
+ eeu.exportExcelForAttendance(workbook, 0, "运营绩效", titles, excelList);
|
|
|
+ HttpUtils.setResponseHeader(response, "clockIn.xlsx");
|
|
|
+ workbook.write(os);
|
|
|
+ os.flush();
|
|
|
+ os.close();
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|