199 lines
7.4 KiB
Plaintext
199 lines
7.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.Aes;
|
|
import com.securityControl.common.core.utils.poi.ExcelUtil;
|
|
import com.securityControl.common.core.web.controller.BaseController;
|
|
import com.securityControl.common.core.web.domain.AjaxResult;
|
|
import com.securityControl.common.core.web.page.TableDataInfo;
|
|
import com.securityControl.common.log.annotation.Log;
|
|
import com.securityControl.common.log.enums.BusinessType;
|
|
import com.securityControl.common.log.enums.OperationType;
|
|
import com.sercurityControl.proteam.domain.ClassData;
|
|
import com.sercurityControl.proteam.domain.ProClassMettingVo;
|
|
import com.sercurityControl.proteam.domain.ProData;
|
|
import com.sercurityControl.proteam.domain.TicketData;
|
|
import com.sercurityControl.proteam.service.ProDataService;
|
|
import com.sercurityControl.proteam.util.RedisCache;
|
|
import io.swagger.annotations.Api;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
@Api(tags = "工程信息")
|
|
@Slf4j
|
|
@RestController
|
|
@RequestMapping("/pot/newPro")
|
|
public class ProDataController extends BaseController {
|
|
@Autowired
|
|
private ProDataService service;
|
|
|
|
/**
|
|
* 作业票
|
|
*
|
|
* @param ticketData 条件
|
|
* @return 集合
|
|
*/
|
|
@PostMapping("/getTicketLists")
|
|
@Log(title = "工程明细", menu = "工程信息->工程明细", businessType = BusinessType.QUERY, details = "作业票列表")
|
|
public TableDataInfo getTicketLists(TicketData ticketData) {
|
|
startPage();
|
|
return getDataTable(service.getTicketLists(ticketData));
|
|
}
|
|
|
|
/**
|
|
* 站班会
|
|
*
|
|
* @param classData 条件
|
|
* @return 集合
|
|
*/
|
|
@PostMapping("/getClassLists")
|
|
@Log(title = "工程明细", menu = "工程信息->工程明细", businessType = BusinessType.QUERY, details = "站班会列表")
|
|
public TableDataInfo getClassLists(ClassData classData) {
|
|
startPage();
|
|
return getDataTable(service.getClassLists(classData));
|
|
}
|
|
|
|
/**
|
|
* 工程列表
|
|
*
|
|
* @param proData 条件
|
|
* @return 集合
|
|
*/
|
|
@PostMapping("/getProList")
|
|
@Log(title = "工程明细", menu = "工程信息->工程明细", businessType = BusinessType.QUERY, details = "工程列表")
|
|
public TableDataInfo getProList(ProData proData) {
|
|
startPage();
|
|
return getDataTable(service.getProList(proData));
|
|
}
|
|
|
|
@PostMapping("/getProdDetail")
|
|
@Log(title = "工程明细", menu = "工程信息->工程详情", businessType = BusinessType.QUERY, details = "工程详情")
|
|
public ProData getProdDetail(ProData proData) {
|
|
return service.getProdDetail(proData);
|
|
}
|
|
|
|
/**
|
|
* 工程列表导出Pro
|
|
*
|
|
* @param proData 条件
|
|
* @return 集合
|
|
*/
|
|
@GetMapping("/exportProData")
|
|
@Log(title = "工程明细", menu = "工程信息->工程明细", businessType = BusinessType.EXPORT, details = "工程列表导出", grade = OperationType.EXPORT_BUSINESS)
|
|
public void exportProData(HttpServletResponse response, ProData proData) {
|
|
List<ProData> list = service.getProList(proData);
|
|
ExcelUtil<ProData> util = new ExcelUtil<ProData>(ProData.class);
|
|
util.exportExcel(response, list, "工程明细");
|
|
}
|
|
|
|
/**
|
|
* 工程数量
|
|
*
|
|
* @return 集合
|
|
*/
|
|
@PostMapping("/getBasicInfoData")
|
|
@Log(title = "工程明细", menu = "工程信息->工程明细", businessType = BusinessType.EXPORT, details = "工程数量")
|
|
public AjaxResult getBasicInfoData(String params) {
|
|
String aesParams = Aes.aesDecrypt(params);
|
|
ProData entity = com.alibaba.fastjson2.JSON.parseObject(aesParams, ProData.class);
|
|
return service.getBasicInfoData(entity);
|
|
}
|
|
|
|
|
|
/**
|
|
* 获取工程下拉框
|
|
*
|
|
* @return 集合
|
|
*/
|
|
@PostMapping("/getProject")
|
|
public AjaxResult getProject(String params) {
|
|
String aesParams = Aes.aesDecrypt(params);
|
|
ProData entity = com.alibaba.fastjson2.JSON.parseObject(aesParams, ProData.class);
|
|
return service.getProject(entity);
|
|
}
|
|
|
|
/**
|
|
* 获取工程下拉框
|
|
*
|
|
* @return 集合
|
|
*/
|
|
@PostMapping("/getProjectSelect")
|
|
public AjaxResult getProjectSelect( ProData entity) {
|
|
try{
|
|
return service.getProjectSelect(entity);
|
|
}catch (Exception e){
|
|
log.error(e.toString(),e);
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 查询改工程下所有的施工的班组
|
|
* @param proData
|
|
* @return
|
|
*/
|
|
@PostMapping(value = "getProWorkTeam")
|
|
@Log(title = "工程管理", menu = "班组记录", businessType = BusinessType.QUERY, details = "班组记录")
|
|
public Map<String, Object> getProWorkTeam(ProData proData) {
|
|
Map<String, Object> map = new HashMap<String, Object>(16);
|
|
try {
|
|
PageHelper.startPage(Integer.parseInt(proData.getPage()), Integer.parseInt(proData.getLimit()));
|
|
PageInfo<ProData> pageInfo = service.getProWorkTeam(proData);
|
|
map.put("code", 200);
|
|
map.put("msg", "获取数据成功");
|
|
map.put("count", pageInfo.getTotal());
|
|
map.put("curr", Integer.parseInt(proData.getPage()));
|
|
map.put("limit", Integer.parseInt(proData.getLimit()));
|
|
map.put("data", pageInfo.getList());
|
|
} catch (Exception e) {
|
|
map.put("code", 500);
|
|
map.put("msg", "服务异常请稍后重试");
|
|
map.put("count", 0);
|
|
map.put("curr", Integer.parseInt(proData.getPage()));
|
|
map.put("limit", Integer.parseInt(proData.getLimit()));
|
|
map.put("data", null);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
/**
|
|
* 获取该工程的站班会记录
|
|
* @param proClassMettingVo
|
|
* @return
|
|
*/
|
|
@PostMapping(value = "getClassMettingList")
|
|
@Log(title = "工程管理", menu = "站班会记录", businessType = BusinessType.QUERY, details = "站班会记录")
|
|
public Map<String, Object> getClassMettingList(ProClassMettingVo proClassMettingVo) {
|
|
Map<String, Object> map = new HashMap<String, Object>(16);
|
|
try {
|
|
PageHelper.startPage(Integer.parseInt(proClassMettingVo.getPage()), Integer.parseInt(proClassMettingVo.getLimit()));
|
|
PageInfo<ProClassMettingVo> pageInfo = service.getClassMettingList(proClassMettingVo);
|
|
map.put("code", 200);
|
|
map.put("msg", "获取数据成功");
|
|
map.put("count", pageInfo.getTotal());
|
|
map.put("curr", Integer.parseInt(proClassMettingVo.getPage()));
|
|
map.put("limit", Integer.parseInt(proClassMettingVo.getLimit()));
|
|
map.put("data", pageInfo.getList());
|
|
} catch (Exception e) {
|
|
map.put("code", 500);
|
|
map.put("msg", "服务异常请稍后重试");
|
|
map.put("count", 0);
|
|
map.put("curr", Integer.parseInt(proClassMettingVo.getPage()));
|
|
map.put("limit", Integer.parseInt(proClassMettingVo.getLimit()));
|
|
map.put("data", null);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
} |