diff --git a/src/main/java/com/zhgd/xmgl/modules/cost/controller/CostCalculateController.java b/src/main/java/com/zhgd/xmgl/modules/cost/controller/CostCalculateController.java index eb7d7d938..c47703ec9 100644 --- a/src/main/java/com/zhgd/xmgl/modules/cost/controller/CostCalculateController.java +++ b/src/main/java/com/zhgd/xmgl/modules/cost/controller/CostCalculateController.java @@ -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; diff --git a/src/main/java/com/zhgd/xmgl/modules/cost/service/impl/CostBudgetServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/cost/service/impl/CostBudgetServiceImpl.java index 8826da8e2..dc1c806eb 100644 --- a/src/main/java/com/zhgd/xmgl/modules/cost/service/impl/CostBudgetServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/cost/service/impl/CostBudgetServiceImpl.java @@ -57,8 +57,8 @@ public class CostBudgetServiceImpl extends ServiceImpl budgetList = this.list(Wrappers.lambdaQuery() .eq(CostBudget::getProjectSn, projectSn) .eq(CostBudget::getVersion, version)); - List contractList = costContractService.getList(Wrappers.lambdaQuery() - .eq(CostContract::getProjectSn, projectSn)); + List contractList = costContractService.getList(Wrappers.query() + .eq("d.project_sn", projectSn)); // List contractList = costContractDetailService.list(Wrappers.lambdaQuery() // .eq(CostContractDetail::getProjectId, projectSn)); List costContractPayList = new ArrayList<>(); diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzDailyController.java b/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzDailyController.java index 0d311240c..fae001426 100644 --- a/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzDailyController.java +++ b/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzDailyController.java @@ -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 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 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 fileMap = multipartRequest.getFileMap(); - for (Map.Entry entity : fileMap.entrySet()) { - MultipartFile file = entity.getValue();// 获取上传文件对象 - ImportParams params = new ImportParams(); - params.setTitleRows(2); - params.setHeadRows(1); - params.setNeedSave(true); - try { - List 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("文件导入失败!"); - } - } diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzInvestController.java b/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzInvestController.java new file mode 100644 index 000000000..8134c53eb --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzInvestController.java @@ -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> queryPageList(@ApiIgnore @RequestBody Map map) { + QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(JzInvest.class, map); + Page page = PageUtil.getPage(map); + IPage 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> queryList(@RequestBody JzInvest jzInvest) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(jzInvest); + List 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 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 edit(@RequestBody JzInvest jzInvest) { + Result result = new Result(); + 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 delete(@ApiIgnore @RequestBody JzInvest jzInvest) { + Result result = new Result(); + 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 deleteBatch(@ApiIgnore @RequestBody Map map) { + Result result = new Result(); + 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 queryById(@ApiIgnore @RequestBody JzInvest jzInvestVo) { + Result result = new Result(); + 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 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 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 fileMap = multipartRequest.getFileMap(); + for (Map.Entry entity : fileMap.entrySet()) { + MultipartFile file = entity.getValue();// 获取上传文件对象 + ImportParams params = new ImportParams(); + params.setTitleRows(2); + params.setHeadRows(1); + params.setNeedSave(true); + try { + List 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("文件导入失败!"); + } + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzSafetyDailyController.java b/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzSafetyDailyController.java new file mode 100644 index 000000000..e10ccb3ef --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/jz/controller/JzSafetyDailyController.java @@ -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> queryPageList(@ApiIgnore @RequestBody Map map) { + QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(JzSafetyDaily.class, map); + Page page = PageUtil.getPage(map); + IPage 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> queryList(@RequestBody JzSafetyDaily jzSafetyDaily) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(jzSafetyDaily); + List 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 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 edit(@RequestBody JzSafetyDaily jzSafetyDaily) { + Result result = new Result(); + 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 delete(@ApiIgnore @RequestBody JzSafetyDaily jzSafetyDaily) { + Result result = new Result(); + 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 deleteBatch(@ApiIgnore @RequestBody Map map) { + Result result = new Result(); + 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 queryById(@ApiIgnore @RequestBody JzSafetyDaily jzSafetyDailyVo) { + Result result = new Result(); + JzSafetyDaily jzSafetyDaily = jzSafetyDailyService.getById(jzSafetyDailyVo.getId()); + if (jzSafetyDaily == null) { + result.error500("未找到对应实体"); + } else { + result.setResult(jzSafetyDaily); + result.setSuccess(true); + } + return result; + } +} diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzInvest.java b/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzInvest.java new file mode 100644 index 000000000..9d3549244 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzInvest.java @@ -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; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzSafetyDaily.java b/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzSafetyDaily.java new file mode 100644 index 000000000..a63ebe339 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/jz/entity/JzSafetyDaily.java @@ -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; +} diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/mapper/JzInvestMapper.java b/src/main/java/com/zhgd/xmgl/modules/jz/mapper/JzInvestMapper.java new file mode 100644 index 000000000..18abccda6 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/jz/mapper/JzInvestMapper.java @@ -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 { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/mapper/JzSafetyDailyMapper.java b/src/main/java/com/zhgd/xmgl/modules/jz/mapper/JzSafetyDailyMapper.java new file mode 100644 index 000000000..d6c74cf68 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/jz/mapper/JzSafetyDailyMapper.java @@ -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 { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/mapper/xml/JzInvestMapper.xml b/src/main/java/com/zhgd/xmgl/modules/jz/mapper/xml/JzInvestMapper.xml new file mode 100644 index 000000000..5bc4ec2ae --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/jz/mapper/xml/JzInvestMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/mapper/xml/JzSafetyDailyMapper.xml b/src/main/java/com/zhgd/xmgl/modules/jz/mapper/xml/JzSafetyDailyMapper.xml new file mode 100644 index 000000000..cb6fd07b4 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/jz/mapper/xml/JzSafetyDailyMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzInvestService.java b/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzInvestService.java new file mode 100644 index 000000000..cb5ded9f4 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzInvestService.java @@ -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 { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzSafetyDailyService.java b/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzSafetyDailyService.java new file mode 100644 index 000000000..740cb08f4 --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/jz/service/IJzSafetyDailyService.java @@ -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 { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzInvestServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzInvestServiceImpl.java new file mode 100644 index 000000000..1384bcb9f --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzInvestServiceImpl.java @@ -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 implements IJzInvestService { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzSafetyDailyServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzSafetyDailyServiceImpl.java new file mode 100644 index 000000000..796acc81d --- /dev/null +++ b/src/main/java/com/zhgd/xmgl/modules/jz/service/impl/JzSafetyDailyServiceImpl.java @@ -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 implements IJzSafetyDailyService { + +} diff --git a/src/main/java/com/zhgd/xmgl/modules/project/entity/ProgressPanoramaNodePlan.java b/src/main/java/com/zhgd/xmgl/modules/project/entity/ProgressPanoramaNodePlan.java index d5ba66039..eeb6a7796 100644 --- a/src/main/java/com/zhgd/xmgl/modules/project/entity/ProgressPanoramaNodePlan.java +++ b/src/main/java/com/zhgd/xmgl/modules/project/entity/ProgressPanoramaNodePlan.java @@ -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; /** * 实际偏差 diff --git a/src/main/java/com/zhgd/xmgl/task/ProgressPanoramaNodePlanAlarmTask.java b/src/main/java/com/zhgd/xmgl/task/ProgressPanoramaNodePlanAlarmTask.java index 49e28287d..443192b64 100644 --- a/src/main/java/com/zhgd/xmgl/task/ProgressPanoramaNodePlanAlarmTask.java +++ b/src/main/java/com/zhgd/xmgl/task/ProgressPanoramaNodePlanAlarmTask.java @@ -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 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 alarmList = new LinkedList<>();