131 lines
4.4 KiB
Plaintext
131 lines
4.4 KiB
Plaintext
package com.sercurityControl.proteam.controller;
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.securityControl.common.core.utils.aes.DateTimeHelper;
|
|
import com.securityControl.common.core.utils.aes.StringHelper;
|
|
import com.securityControl.common.log.annotation.Log;
|
|
import com.securityControl.common.log.enums.BusinessType;
|
|
import com.sercurityControl.proteam.domain.vo.DutyChildVo;
|
|
import com.sercurityControl.proteam.domain.vo.NewDutyVo;
|
|
import com.sercurityControl.proteam.service.DutyChildService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import java.lang.reflect.Array;
|
|
import java.util.Arrays;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
*
|
|
* 值长 子页面统计页面
|
|
* @author 黑子
|
|
*/
|
|
@RestController
|
|
@RequestMapping("/duty/child")
|
|
@Slf4j
|
|
public class DutyChildController {
|
|
|
|
@Autowired
|
|
private DutyChildService service;
|
|
|
|
private final static String TYPE="0";
|
|
|
|
/**
|
|
* 分页查询 工程信息统计
|
|
* @param vo
|
|
* @return
|
|
*/
|
|
@PostMapping(value = "getProList")
|
|
public Map<String, Object> getProList(DutyChildVo vo) {
|
|
if(StringHelper.isNotEmpty(vo.getBuildCode())){
|
|
List<String> list= Arrays.asList(vo.getBuildCode().split(",")) ;
|
|
vo.setCityList(list);
|
|
}
|
|
List<DutyChildVo> list = service.getProList(vo);
|
|
PageInfo<DutyChildVo> pageInfo = new PageInfo<DutyChildVo>(list);
|
|
System.out.println("输出分页后的数据:" + pageInfo.getList());
|
|
Map<String, Object> map = new HashMap<String, Object>(6);
|
|
map.put("code", 200);
|
|
map.put("msg", "");
|
|
map.put("count", pageInfo.getTotal());
|
|
map.put("curr", vo.getPage());
|
|
map.put("limit", vo.getLimit());
|
|
map.put("data", pageInfo.getList());
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* 周计划数据
|
|
* @param vo
|
|
* @return
|
|
*/
|
|
@PostMapping(value = "getWeekList")
|
|
public Map<String, Object> getWeekList(DutyChildVo vo) {
|
|
String time= DateTimeHelper.getNowDay();
|
|
String startWeek= DateTimeHelper.getWeekStartOrEndTime(time,true);//本周开始时间
|
|
String endWeek= DateTimeHelper.getWeekStartOrEndTime(time,false);//本周结束时间
|
|
vo.setStartTime(startWeek);
|
|
vo.setEndTime(endWeek);
|
|
if(StringHelper.isNotEmpty(vo.getBuildCode())){
|
|
List<String> list= Arrays.asList(vo.getBuildCode().split(",")) ;
|
|
vo.setCityList(list);
|
|
}
|
|
if(StringHelper.isNotEmpty(vo.getCode())){
|
|
if (TYPE.equals(vo.getCode())){
|
|
vo.setCode(null);
|
|
}
|
|
}
|
|
List<DutyChildVo> list = service.getWeekList(vo);
|
|
PageInfo<DutyChildVo> pageInfo = new PageInfo<DutyChildVo>(list);
|
|
System.out.println("输出分页后的数据:" + pageInfo.getList());
|
|
Map<String, Object> map = new HashMap<String, Object>(6);
|
|
map.put("code", 200);
|
|
map.put("msg", "");
|
|
map.put("count", pageInfo.getTotal());
|
|
map.put("curr", vo.getPage());
|
|
map.put("limit", vo.getLimit());
|
|
map.put("data", pageInfo.getList());
|
|
return map;
|
|
}
|
|
|
|
|
|
/**
|
|
* 周计划数据
|
|
* @param vo
|
|
* @return
|
|
*/
|
|
@PostMapping(value = "getDayList")
|
|
public Map<String, Object> getDayList(DutyChildVo vo) {
|
|
if(StringHelper.isNotEmpty(vo.getBuildCode())){
|
|
List<String> list= Arrays.asList(vo.getBuildCode().split(",")) ;
|
|
vo.setCityList(list);
|
|
}
|
|
if(StringHelper.isNotEmpty(vo.getCode())){
|
|
if (TYPE.equals(vo.getCode())){
|
|
vo.setCode(null);
|
|
}
|
|
}
|
|
List<DutyChildVo> list = service.getDayList(vo);
|
|
PageInfo<DutyChildVo> pageInfo = new PageInfo<DutyChildVo>(list);
|
|
System.out.println("输出分页后的数据:" + pageInfo.getList());
|
|
Map<String, Object> map = new HashMap<String, Object>(6);
|
|
map.put("code", 200);
|
|
map.put("msg", "");
|
|
map.put("count", pageInfo.getTotal());
|
|
map.put("curr", vo.getPage());
|
|
map.put("limit", vo.getLimit());
|
|
map.put("data", pageInfo.getList());
|
|
return map;
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|