初验调整
This commit is contained in:
parent
729a202e63
commit
d48aa923bf
@ -10,7 +10,6 @@ import com.zhgd.xmgl.modules.cost.entity.CostSubject;
|
||||
import com.zhgd.xmgl.modules.project.entity.vo.ProjectInfoExtVo;
|
||||
import com.zhgd.xmgl.modules.project.service.IProjectService;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import io.loadkit.Res;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
|
||||
@ -57,8 +57,8 @@ public class CostBudgetServiceImpl extends ServiceImpl<CostBudgetMapper, CostBud
|
||||
List<CostBudget> budgetList = this.list(Wrappers.<CostBudget>lambdaQuery()
|
||||
.eq(CostBudget::getProjectSn, projectSn)
|
||||
.eq(CostBudget::getVersion, version));
|
||||
List<CostContract> contractList = costContractService.getList(Wrappers.<CostContract>lambdaQuery()
|
||||
.eq(CostContract::getProjectSn, projectSn));
|
||||
List<CostContract> contractList = costContractService.getList(Wrappers.<CostContract>query()
|
||||
.eq("d.project_sn", projectSn));
|
||||
// List<CostContractDetail> contractList = costContractDetailService.list(Wrappers.<CostContractDetail>lambdaQuery()
|
||||
// .eq(CostContractDetail::getProjectId, projectSn));
|
||||
List<CostContractPay> costContractPayList = new ArrayList<>();
|
||||
|
||||
@ -203,76 +203,4 @@ public class JzDailyController {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@ApiOperation(value = "导出excel施工日志信息", notes = "导出excel施工日志信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<JzDaily> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
JzDaily jzDaily = JSON.parseObject(deString, JzDaily.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(jzDaily, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<JzDaily> pageList = jzDailyService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "施工日志列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, JzDaily.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("施工日志列表数据", "导出人:Jeecg", "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过excel导入施工日志信息", notes = "通过excel导入施工日志信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<JzDaily> listJzDailys = ExcelImportUtil.importExcel(file.getInputStream(), JzDaily.class, params);
|
||||
for (JzDaily jzDailyExcel : listJzDailys) {
|
||||
jzDailyService.save(jzDailyExcel);
|
||||
}
|
||||
return Result.ok("文件导入成功!数据行数:" + listJzDailys.size());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return Result.error("文件导入失败!");
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.ok("文件导入失败!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,289 @@
|
||||
package com.zhgd.xmgl.modules.jz.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.xmgl.modules.basicdata.entity.Company;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.ICompanyService;
|
||||
import com.zhgd.xmgl.modules.project.entity.vo.ProjectInfoExtVo;
|
||||
import com.zhgd.xmgl.modules.project.service.IProjectService;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import com.zhgd.xmgl.modules.jz.entity.JzInvest;
|
||||
import com.zhgd.xmgl.modules.jz.service.IJzInvestService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 项目投资
|
||||
* @author: pengj
|
||||
* @date: 2024-12-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/jzInvest")
|
||||
@Slf4j
|
||||
@Api(tags = "项目投资管理")
|
||||
public class JzInvestController {
|
||||
@Autowired
|
||||
private IJzInvestService jzInvestService;
|
||||
|
||||
@Autowired
|
||||
private IProjectService projectService;
|
||||
|
||||
@Autowired
|
||||
private ICompanyService companyService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目投资管理", operType = "分页查询", operDesc = "分页列表查询项目投资信息")
|
||||
@ApiOperation(value = " 分页列表查询项目投资信息", notes = "分页列表查询项目投资信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "current", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "size", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer")
|
||||
})
|
||||
@PostMapping(value = "/page")
|
||||
public Result<IPage<JzInvest>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
QueryWrapper<JzInvest> queryWrapper = QueryGenerator.initPageQueryWrapper(JzInvest.class, map);
|
||||
Page<JzInvest> page = PageUtil.getPage(map);
|
||||
IPage<JzInvest> pageList = jzInvestService.page(page, queryWrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param jzInvest
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目投资管理", operType = "列表查询", operDesc = "列表查询项目投资信息")
|
||||
@ApiOperation(value = " 列表查询项目投资信息", notes = "列表查询项目投资信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/list")
|
||||
public Result<List<JzInvest>> queryList(@RequestBody JzInvest jzInvest) {
|
||||
QueryWrapper<JzInvest> queryWrapper = QueryGenerator.initQueryWrapper(jzInvest);
|
||||
List<JzInvest> list = jzInvestService.list(queryWrapper);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param jzInvest
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目投资管理", operType = "新增", operDesc = "添加项目投资信息")
|
||||
@ApiOperation(value = " 添加项目投资信息", notes = "添加项目投资信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody JzInvest jzInvest) {
|
||||
ProjectInfoExtVo projectInfoBySn = projectService.getProjectInfoBySn(jzInvest.getProjectSn());
|
||||
jzInvest.setEnterpriseName(projectInfoBySn.getCompanyName());
|
||||
jzInvest.setProjectName(projectInfoBySn.getProjectName());
|
||||
jzInvest.setBuildUnit(projectInfoBySn.getConstructionUnit());
|
||||
jzInvestService.save(jzInvest);
|
||||
return Result.success("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param jzInvest
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目投资管理", operType = "修改", operDesc = "编辑项目投资信息")
|
||||
@ApiOperation(value = "编辑项目投资信息", notes = "编辑项目投资信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<JzInvest> edit(@RequestBody JzInvest jzInvest) {
|
||||
Result<JzInvest> result = new Result<JzInvest>();
|
||||
JzInvest jzInvestEntity = jzInvestService.getById(jzInvest.getId());
|
||||
if (jzInvestEntity == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = jzInvestService.updateById(jzInvest);
|
||||
if (ok) {
|
||||
result.success("修改成功!");
|
||||
} else {
|
||||
result.success("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目投资管理", operType = "删除", operDesc = "删除项目投资信息")
|
||||
@ApiOperation(value = "删除项目投资信息", notes = "删除项目投资信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "项目投资ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<JzInvest> delete(@ApiIgnore @RequestBody JzInvest jzInvest) {
|
||||
Result<JzInvest> result = new Result<JzInvest>();
|
||||
JzInvest jzInvestEntity = jzInvestService.getById(jzInvest.getId());
|
||||
if (jzInvestEntity == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = jzInvestService.removeById(jzInvest.getId());
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
} else {
|
||||
result.success("操作失败!");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目投资管理", operType = "批量删除", operDesc = "批量删除项目投资信息")
|
||||
@ApiOperation(value = "批量删除项目投资信息", notes = "批量删除项目投资信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "ids", value = "项目投资ID字符串", paramType = "body", required = true, dataType = "String")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<JzInvest> deleteBatch(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
Result<JzInvest> result = new Result<JzInvest>();
|
||||
String ids = MapUtils.getString(map, "ids");
|
||||
if (ids == null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
} else {
|
||||
this.jzInvestService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("删除成功!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目投资管理", operType = "查询", operDesc = "通过id查询项目投资信息")
|
||||
@ApiOperation(value = "通过id查询项目投资信息", notes = "通过id查询项目投资信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "项目投资ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/queryById")
|
||||
public Result<JzInvest> queryById(@ApiIgnore @RequestBody JzInvest jzInvestVo) {
|
||||
Result<JzInvest> result = new Result<JzInvest>();
|
||||
JzInvest jzInvest = jzInvestService.getById(jzInvestVo.getId());
|
||||
if (jzInvest == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(jzInvest);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
*/
|
||||
@ApiOperation(value = "导出excel项目投资信息", notes = "导出excel项目投资信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
|
||||
// Step.1 组装查询条件
|
||||
QueryWrapper<JzInvest> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
JzInvest jzInvest = JSON.parseObject(deString, JzInvest.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(jzInvest, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<JzInvest> pageList = jzInvestService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "项目投资列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, JzInvest.class);
|
||||
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("项目投资列表数据", "导出人:" + SecurityUtils.getUser().getRealName(), "导出信息"));
|
||||
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过excel导入项目投资信息", notes = "通过excel导入项目投资信息", httpMethod = "POST")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(2);
|
||||
params.setHeadRows(1);
|
||||
params.setNeedSave(true);
|
||||
try {
|
||||
List<JzInvest> listJzInvests = ExcelImportUtil.importExcel(file.getInputStream(), JzInvest.class, params);
|
||||
for (JzInvest jzInvestExcel : listJzInvests) {
|
||||
jzInvestService.save(jzInvestExcel);
|
||||
}
|
||||
return Result.ok("文件导入成功!数据行数:" + listJzInvests.size());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return Result.error("文件导入失败!");
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.ok("文件导入失败!");
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,205 @@
|
||||
package com.zhgd.xmgl.modules.jz.controller;
|
||||
|
||||
import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.xmgl.security.util.SecurityUtils;
|
||||
import com.zhgd.xmgl.util.PageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.jeecg.common.util.oConvertUtils;
|
||||
import com.zhgd.xmgl.modules.jz.entity.JzSafetyDaily;
|
||||
import com.zhgd.xmgl.modules.jz.service.IJzSafetyDailyService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 安全日志
|
||||
* @author: pengj
|
||||
* @date: 2024-12-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/jzSafetyDaily")
|
||||
@Slf4j
|
||||
@Api(tags = "安全日志管理")
|
||||
public class JzSafetyDailyController {
|
||||
@Autowired
|
||||
private IJzSafetyDailyService jzSafetyDailyService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "安全日志管理", operType = "分页查询", operDesc = "分页列表查询安全日志信息")
|
||||
@ApiOperation(value = " 分页列表查询安全日志信息", notes = "分页列表查询安全日志信息", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "current", value = "页数", paramType = "body", required = true, defaultValue = "1", dataType = "Integer"),
|
||||
@ApiImplicitParam(name = "size", value = "每页条数", paramType = "body", required = true, defaultValue = "10", dataType = "Integer")
|
||||
})
|
||||
@PostMapping(value = "/page")
|
||||
public Result<IPage<JzSafetyDaily>> queryPageList(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
QueryWrapper<JzSafetyDaily> queryWrapper = QueryGenerator.initPageQueryWrapper(JzSafetyDaily.class, map);
|
||||
Page<JzSafetyDaily> page = PageUtil.getPage(map);
|
||||
IPage<JzSafetyDaily> pageList = jzSafetyDailyService.page(page, queryWrapper);
|
||||
return Result.success(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param jzSafetyDaily
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "安全日志管理", operType = "列表查询", operDesc = "列表查询安全日志信息")
|
||||
@ApiOperation(value = " 列表查询安全日志信息", notes = "列表查询安全日志信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/list")
|
||||
public Result<List<JzSafetyDaily>> queryList(@RequestBody JzSafetyDaily jzSafetyDaily) {
|
||||
QueryWrapper<JzSafetyDaily> queryWrapper = QueryGenerator.initQueryWrapper(jzSafetyDaily);
|
||||
List<JzSafetyDaily> list = jzSafetyDailyService.list(queryWrapper);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param jzSafetyDaily
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "安全日志管理", operType = "新增", operDesc = "添加安全日志信息")
|
||||
@ApiOperation(value = " 添加安全日志信息", notes = "添加安全日志信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody JzSafetyDaily jzSafetyDaily) {
|
||||
jzSafetyDaily.setCreateBy(SecurityUtils.getUser().getRealName());
|
||||
jzSafetyDaily.setCreateTime(new Date());
|
||||
jzSafetyDailyService.save(jzSafetyDaily);
|
||||
return Result.success("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param jzSafetyDaily
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "安全日志管理", operType = "修改", operDesc = "编辑安全日志信息")
|
||||
@ApiOperation(value = "编辑安全日志信息", notes = "编辑安全日志信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<JzSafetyDaily> edit(@RequestBody JzSafetyDaily jzSafetyDaily) {
|
||||
Result<JzSafetyDaily> result = new Result<JzSafetyDaily>();
|
||||
JzSafetyDaily jzSafetyDailyEntity = jzSafetyDailyService.getById(jzSafetyDaily.getId());
|
||||
if (jzSafetyDailyEntity == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = jzSafetyDailyService.updateById(jzSafetyDaily);
|
||||
if (ok) {
|
||||
result.success("修改成功!");
|
||||
} else {
|
||||
result.success("操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "安全日志管理", operType = "删除", operDesc = "删除安全日志信息")
|
||||
@ApiOperation(value = "删除安全日志信息", notes = "删除安全日志信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "安全日志ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<JzSafetyDaily> delete(@ApiIgnore @RequestBody JzSafetyDaily jzSafetyDaily) {
|
||||
Result<JzSafetyDaily> result = new Result<JzSafetyDaily>();
|
||||
JzSafetyDaily jzSafetyDailyEntity = jzSafetyDailyService.getById(jzSafetyDaily.getId());
|
||||
if (jzSafetyDailyEntity == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = jzSafetyDailyService.removeById(jzSafetyDaily.getId());
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
} else {
|
||||
result.success("操作失败!");
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "安全日志管理", operType = "批量删除", operDesc = "批量删除安全日志信息")
|
||||
@ApiOperation(value = "批量删除安全日志信息", notes = "批量删除安全日志信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "ids", value = "安全日志ID字符串", paramType = "body", required = true, dataType = "String")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<JzSafetyDaily> deleteBatch(@ApiIgnore @RequestBody Map<String, Object> map) {
|
||||
Result<JzSafetyDaily> result = new Result<JzSafetyDaily>();
|
||||
String ids = MapUtils.getString(map, "ids");
|
||||
if (ids == null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
} else {
|
||||
this.jzSafetyDailyService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("删除成功!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "安全日志管理", operType = "查询", operDesc = "通过id查询安全日志信息")
|
||||
@ApiOperation(value = "通过id查询安全日志信息", notes = "通过id查询安全日志信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "安全日志ID", paramType = "body", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/queryById")
|
||||
public Result<JzSafetyDaily> queryById(@ApiIgnore @RequestBody JzSafetyDaily jzSafetyDailyVo) {
|
||||
Result<JzSafetyDaily> result = new Result<JzSafetyDaily>();
|
||||
JzSafetyDaily jzSafetyDaily = jzSafetyDailyService.getById(jzSafetyDailyVo.getId());
|
||||
if (jzSafetyDaily == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(jzSafetyDaily);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
119
src/main/java/com/zhgd/xmgl/modules/jz/entity/JzInvest.java
Normal file
119
src/main/java/com/zhgd/xmgl/modules/jz/entity/JzInvest.java
Normal file
@ -0,0 +1,119 @@
|
||||
package com.zhgd.xmgl.modules.jz.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @Description: 项目投资
|
||||
* @author: pengj
|
||||
* @date: 2024-12-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("jz_invest")
|
||||
@ApiModel(value = "JzInvest实体类", description = "JzInvest")
|
||||
public class JzInvest implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 投资统计ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "投资统计ID")
|
||||
private Long id;
|
||||
/**
|
||||
* 项目SN
|
||||
*/
|
||||
@ApiModelProperty(value = "项目SN")
|
||||
private String projectSn;
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
@Excel(name = "企业名称", width = 15)
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
private String enterpriseName;
|
||||
/**
|
||||
* 项目名称
|
||||
*/
|
||||
@Excel(name = "项目名称", width = 15)
|
||||
@ApiModelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
/**
|
||||
* 项目建设单位
|
||||
*/
|
||||
@Excel(name = "项目建设单位", width = 15)
|
||||
@ApiModelProperty(value = "项目建设单位")
|
||||
private String buildUnit;
|
||||
/**
|
||||
* 年度投资计划
|
||||
*/
|
||||
@Excel(name = "年度投资计划", width = 15)
|
||||
@ApiModelProperty(value = "年度投资计划")
|
||||
private String planAmount;
|
||||
/**
|
||||
* 总投资
|
||||
*/
|
||||
@Excel(name = "总投资", width = 15)
|
||||
@ApiModelProperty(value = "总投资")
|
||||
private String totalAmount;
|
||||
/**
|
||||
* 年
|
||||
*/
|
||||
@Excel(name = "年", width = 15)
|
||||
@ApiModelProperty(value = "年")
|
||||
private String year;
|
||||
/**
|
||||
* 月
|
||||
*/
|
||||
@Excel(name = "月", width = 15)
|
||||
@ApiModelProperty(value = "月")
|
||||
private String month;
|
||||
/**
|
||||
* 实际完成投资
|
||||
*/
|
||||
@Excel(name = "实际完成投资", width = 15)
|
||||
@ApiModelProperty(value = "实际完成投资")
|
||||
private String amount;
|
||||
/**
|
||||
* 本年累计完成投资
|
||||
*/
|
||||
@Excel(name = "本年累计完成投资", width = 15)
|
||||
@ApiModelProperty(value = "本年累计完成投资")
|
||||
private String yearAmount;
|
||||
/**
|
||||
* 上年同期累计完成投资
|
||||
*/
|
||||
@Excel(name = "上年同期累计完成投资", width = 15)
|
||||
@ApiModelProperty(value = "上年同期累计完成投资")
|
||||
private String lastYearAmount;
|
||||
/**
|
||||
* 实际开工时间
|
||||
*/
|
||||
@Excel(name = "实际开工时间", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "实际开工时间")
|
||||
private Date startTime;
|
||||
/**
|
||||
* 预计建成时间
|
||||
*/
|
||||
@Excel(name = "预计建成时间", width = 15)
|
||||
@ApiModelProperty(value = "预计建成时间")
|
||||
private String planComplete;
|
||||
/**
|
||||
* 自开工以来累计完成投资
|
||||
*/
|
||||
@Excel(name = "自开工以来累计完成投资", width = 15)
|
||||
@ApiModelProperty(value = "自开工以来累计完成投资")
|
||||
private String totalYearAmount;
|
||||
}
|
||||
108
src/main/java/com/zhgd/xmgl/modules/jz/entity/JzSafetyDaily.java
Normal file
108
src/main/java/com/zhgd/xmgl/modules/jz/entity/JzSafetyDaily.java
Normal file
@ -0,0 +1,108 @@
|
||||
package com.zhgd.xmgl.modules.jz.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @Description: 安全日志
|
||||
* @author: pengj
|
||||
* @date: 2024-12-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("jz_safety_daily")
|
||||
@ApiModel(value = "JzSafetyDaily实体类", description = "JzSafetyDaily")
|
||||
public class JzSafetyDaily implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 日报ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "日报ID")
|
||||
private Long id;
|
||||
/**
|
||||
* 项目SN
|
||||
*/
|
||||
@Excel(name = "项目SN", width = 15)
|
||||
@ApiModelProperty(value = "项目SN")
|
||||
private String projectSn;
|
||||
/**
|
||||
* 项目日志标题
|
||||
*/
|
||||
@Excel(name = "项目日志标题", width = 15)
|
||||
@ApiModelProperty(value = "项目日志标题")
|
||||
private String title;
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@Excel(name = "编号", width = 15)
|
||||
@ApiModelProperty(value = "编号")
|
||||
private String code;
|
||||
/**
|
||||
* 天气情况
|
||||
*/
|
||||
@Excel(name = "天气情况", width = 15)
|
||||
@ApiModelProperty(value = "天气情况")
|
||||
private String tqqk;
|
||||
/**
|
||||
* 星期
|
||||
*/
|
||||
@Excel(name = "星期", width = 15)
|
||||
@ApiModelProperty(value = "星期")
|
||||
private String xq;
|
||||
/**
|
||||
* 申请日期
|
||||
*/
|
||||
@Excel(name = "申请日期", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "申请日期")
|
||||
private Date sqrq;
|
||||
/**
|
||||
* 现场班组
|
||||
*/
|
||||
@Excel(name = "现场班组", width = 15)
|
||||
@ApiModelProperty(value = "现场班组")
|
||||
private String xcbz;
|
||||
/**
|
||||
* 日志内容
|
||||
*/
|
||||
@Excel(name = "日志内容", width = 15)
|
||||
@ApiModelProperty(value = "日志内容")
|
||||
private Object rznr;
|
||||
/**
|
||||
* 现场影像
|
||||
*/
|
||||
@Excel(name = "现场影像", width = 15)
|
||||
@ApiModelProperty(value = "现场影像")
|
||||
private Object xcyx;
|
||||
/**
|
||||
* 附件
|
||||
*/
|
||||
@Excel(name = "附件", width = 15)
|
||||
@ApiModelProperty(value = "附件")
|
||||
private Object fj;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Excel(name = "创建人", width = 15)
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.zhgd.xmgl.modules.jz.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.zhgd.xmgl.modules.jz.entity.JzInvest;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 项目投资
|
||||
* @author: pengj
|
||||
* @date: 2024-12-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface JzInvestMapper extends BaseMapper<JzInvest> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.zhgd.xmgl.modules.jz.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.zhgd.xmgl.modules.jz.entity.JzSafetyDaily;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 安全日志
|
||||
* @author: pengj
|
||||
* @date: 2024-12-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface JzSafetyDailyMapper extends BaseMapper<JzSafetyDaily> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.jz.mapper.JzInvestMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.jz.mapper.JzSafetyDailyMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,14 @@
|
||||
package com.zhgd.xmgl.modules.jz.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.jz.entity.JzInvest;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 项目投资
|
||||
* @author: pengj
|
||||
* @date: 2024-12-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IJzInvestService extends IService<JzInvest> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.zhgd.xmgl.modules.jz.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.jz.entity.JzSafetyDaily;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 安全日志
|
||||
* @author: pengj
|
||||
* @date: 2024-12-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface IJzSafetyDailyService extends IService<JzSafetyDaily> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.zhgd.xmgl.modules.jz.service.impl;
|
||||
|
||||
import com.zhgd.xmgl.modules.jz.entity.JzInvest;
|
||||
import com.zhgd.xmgl.modules.jz.mapper.JzInvestMapper;
|
||||
import com.zhgd.xmgl.modules.jz.service.IJzInvestService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 项目投资
|
||||
* @author: pengj
|
||||
* @date: 2024-12-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class JzInvestServiceImpl extends ServiceImpl<JzInvestMapper, JzInvest> implements IJzInvestService {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.zhgd.xmgl.modules.jz.service.impl;
|
||||
|
||||
import com.zhgd.xmgl.modules.jz.entity.JzSafetyDaily;
|
||||
import com.zhgd.xmgl.modules.jz.mapper.JzSafetyDailyMapper;
|
||||
import com.zhgd.xmgl.modules.jz.service.IJzSafetyDailyService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 安全日志
|
||||
* @author: pengj
|
||||
* @date: 2024-12-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class JzSafetyDailyServiceImpl extends ServiceImpl<JzSafetyDailyMapper, JzSafetyDaily> implements IJzSafetyDailyService {
|
||||
|
||||
}
|
||||
@ -89,7 +89,7 @@ public class ProgressPanoramaNodePlan implements Serializable {
|
||||
* 状态
|
||||
*/
|
||||
@Excel(name = "状态", width = 15)
|
||||
@ApiModelProperty(value = "状态(1:未开始[默认状态];2:进行中;3:延期完成;4:按期完成)")
|
||||
@ApiModelProperty(value = "状态(0:未开始[默认状态];1:进行中;2:延期;3:延期完成;4:按期完成)")
|
||||
private Integer status;
|
||||
/**
|
||||
* 实际偏差
|
||||
|
||||
@ -51,15 +51,15 @@ public class ProgressPanoramaNodePlanAlarmTask {
|
||||
/**
|
||||
* 每天0点5分处理报警数据
|
||||
*/
|
||||
@Scheduled(cron = "0 17 15 * * ?")
|
||||
@Scheduled(cron = "0 0 10 * * ?")
|
||||
public void manageAlarmData() {
|
||||
log.info("定时处理项目计划任务");
|
||||
String today = DateUtil.today();
|
||||
// 预计开始时间已过未开始、预计结束时间已过进行中任务
|
||||
List<ProgressPanoramaNodePlan> planList = progressPanoramaNodePlanService.list(Wrappers.lambdaQuery(ProgressPanoramaNodePlan.class)
|
||||
.eq(ProgressPanoramaNodePlan::getApprovalStatue, 2)
|
||||
.eq(ProgressPanoramaNodePlan::getStatus, 1).lt(ProgressPanoramaNodePlan::getPlanStartDate, today)
|
||||
.or(wrapper -> wrapper.eq(ProgressPanoramaNodePlan::getStatus, 2).lt(ProgressPanoramaNodePlan::getFinishDate, today)));
|
||||
.eq(ProgressPanoramaNodePlan::getStatus, 0).lt(ProgressPanoramaNodePlan::getPlanStartDate, today)
|
||||
.or(wrapper -> wrapper.eq(ProgressPanoramaNodePlan::getStatus, 1).lt(ProgressPanoramaNodePlan::getPlanFinishDate, today)));
|
||||
// 判断是否有逾期任务
|
||||
if (CollUtil.isNotEmpty(planList)) {
|
||||
List<ProgressPanoramaNodePlanAlarm> alarmList = new LinkedList<>();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user