|
@@ -7,6 +7,8 @@ import cn.com.ctop.toutiao.modules.material.entity.FirstDeliveryValidRatio;
|
|
|
import cn.com.ctop.toutiao.modules.material.mapper.FirstDeliveryValidMapper;
|
|
|
import cn.com.ctop.toutiao.modules.material.service.FirstDeliveryValidService;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
@@ -99,6 +101,46 @@ public class FirstDeliveryValidServiceImpl implements FirstDeliveryValidService
|
|
|
return Result.successMsg("导入成功", null);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Result<Object> projectData(String date, Integer pageSize, Integer pageNo) {
|
|
|
+ String[] split = date.split("-");
|
|
|
+ String year = split[0];
|
|
|
+ String monthStr = split[1];
|
|
|
+ String month = "";
|
|
|
+ if ("10".equals(month)) {
|
|
|
+ month = "10";
|
|
|
+ } else {
|
|
|
+ month = monthStr.replace("0", "");
|
|
|
+ }
|
|
|
+ Integer total = deliveryValidMapper.projectDataTotal(year, month);
|
|
|
+ PageHelper.startPage(pageNo, pageSize, true);
|
|
|
+ List<JSONObject> data = deliveryValidMapper.projectData(year, month);
|
|
|
+ PageInfo<JSONObject> page = new PageInfo<>();
|
|
|
+ page.setList(data);
|
|
|
+ page.setTotal(total);
|
|
|
+ return Result.OK(page);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Result<Object> getTotalData(String date, Integer pageSize, Integer pageNo) {
|
|
|
+ String[] split = date.split("-");
|
|
|
+ String year = split[0];
|
|
|
+ String monthStr = split[1];
|
|
|
+ String month = "";
|
|
|
+ if ("10".equals(month)) {
|
|
|
+ month = "10";
|
|
|
+ } else {
|
|
|
+ month = monthStr.replace("0", "");
|
|
|
+ }
|
|
|
+ Integer total = deliveryValidMapper.getTotalDataSum(year, month);
|
|
|
+ PageHelper.startPage(pageNo, pageSize, true);
|
|
|
+ List<JSONObject> data = deliveryValidMapper.getTotalData(year, month);
|
|
|
+ PageInfo<JSONObject> page = new PageInfo<>();
|
|
|
+ page.setList(data);
|
|
|
+ page.setTotal(total);
|
|
|
+ return Result.OK(page);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public static List<JSONObject> analysisFile(MultipartFile file, String fileName) throws Exception {
|
|
|
JSONObject returnJson = new JSONObject();
|