三江安全环保资料中心,中建五局-增加整改率和闭合率字段,中建五局-PC端按部门进行整改排名接口编写,中建五局-筛选区域字段添加
This commit is contained in:
parent
b842d467f1
commit
aab253c919
@ -4,9 +4,11 @@ import com.zhgd.annotation.OperLog;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityInspectionRecord;
|
||||
import com.zhgd.xmgl.modules.quality.entity.dto.DepartmentRectifiedRankDto;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndThisWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndTodayDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.DepartmentRectifiedRankVo;
|
||||
import com.zhgd.xmgl.modules.quality.service.IQualityInspectionRecordService;
|
||||
import com.zhgd.xmgl.util.MessageUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
@ -16,6 +18,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@ -256,4 +259,10 @@ public class QualityInspectionRecordController {
|
||||
public Result<List<EntityMap>> selectPersonChargeQualityInspectionCountList(@RequestBody Map<String, Object> map) {
|
||||
return Result.success(qualityInspectionRecordService.selectPersonChargeQualityInspectionCountList(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "PC端按部门进行整改排名(已整改数量)", notes = "PC端按部门进行整改排名(已整改数量)", httpMethod = "GET")
|
||||
@GetMapping(value = "/department/rectified/rank")
|
||||
public Result<List<DepartmentRectifiedRankVo>> getDepartmentRectifiedRank(@Validated DepartmentRectifiedRankDto rectifiedRank) {
|
||||
return qualityInspectionRecordService.getDepartmentRectifiedRank(rectifiedRank);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
package com.zhgd.xmgl.modules.quality.entity.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "DepartmentRectifiedRankDto")
|
||||
public class DepartmentRectifiedRankDto {
|
||||
@ApiModelProperty(value = "项目sn")
|
||||
@NotBlank
|
||||
private String projectSn;
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.zhgd.xmgl.modules.quality.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "DepartmentRectifiedRankVo")
|
||||
public class DepartmentRectifiedRankVo {
|
||||
|
||||
@ApiModelProperty(value = "部门名称")
|
||||
private java.lang.String departmentName;
|
||||
@ApiModelProperty(value = "已整改数量")
|
||||
private Integer rectifiedNumber;
|
||||
}
|
||||
@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityInspectionRecord;
|
||||
import com.zhgd.xmgl.modules.quality.entity.dto.DepartmentRectifiedRankDto;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndThisWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndTodayDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.DepartmentRectifiedRankVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -43,4 +45,6 @@ public interface QualityInspectionRecordMapper extends BaseMapper<QualityInspect
|
||||
AllAndWeekDataVO getAllAndWeekData(String projectSn);
|
||||
|
||||
AllAndThisWeekDataVO getQualityAcceptanceAndRectificationNumThisWeek(String projectSn);
|
||||
|
||||
List<DepartmentRectifiedRankVo> getDepartmentRectifiedRank(DepartmentRectifiedRankDto rectifiedRank);
|
||||
}
|
||||
|
||||
@ -116,17 +116,19 @@
|
||||
</select>
|
||||
<select id="selectQualityInspectionRecordPageTotal" resultType="java.util.Map">
|
||||
select tp.*,
|
||||
round(IFNULL(TRUNCATE(IFNULL(closeNum, 0) / IFNULL(totalNum, 0), 4), 0) * 100, 2) completeRatio
|
||||
round(IFNULL(TRUNCATE(IFNULL(closeNum, 0) / IFNULL(totalNum, 0), 4), 0) * 100, 2) completeRatio,<!--闭合率-->
|
||||
round(IFNULL(TRUNCATE(IFNULL(totalNum-rectificationNum, 0) / IFNULL(totalNum, 0), 4), 0) * 100, 2)
|
||||
rectificationRatio <!--整改率-->
|
||||
from (
|
||||
SELECT count(1) totalNum,
|
||||
IFNULL(SUM((CASE WHEN a.record_type = 2 THEN 1 ELSE 0 END)), 0) investigateNum,
|
||||
IFNULL(SUM((CASE WHEN a.status = 5 THEN 1 ELSE 0 END)), 0) closeNum,
|
||||
IFNULL(SUM((CASE
|
||||
WHEN a.status = 1 OR a.status = 2 OR a.status = 3 OR a.status = 4 OR a.status = 6 THEN 1
|
||||
ELSE 0 END)), 0) notCloseNum,
|
||||
IFNULL(SUM((CASE
|
||||
WHEN (a.status = 1 OR a.status = 2 OR a.status = 3 OR a.status = 4 OR a.status = 6)
|
||||
AND DATE_FORMAT(now(), "%Y-%m-%d") > a.change_limit_time THEN 1
|
||||
SELECT count(1) totalNum,
|
||||
IFNULL(SUM((CASE WHEN a.record_type = 2 THEN 1 ELSE 0 END)), 0) investigateNum,
|
||||
IFNULL(SUM((CASE WHEN a.status = 5 THEN 1 ELSE 0 END)), 0) closeNum,
|
||||
IFNULL(SUM((CASE
|
||||
WHEN a.status = 1 OR a.status = 2 OR a.status = 3 OR a.status = 4 OR a.status = 6 THEN 1
|
||||
ELSE 0 END)), 0) notCloseNum,
|
||||
IFNULL(SUM((CASE
|
||||
WHEN (a.status = 1 OR a.status = 2 OR a.status = 3 OR a.status = 4 OR a.status = 6)
|
||||
AND DATE_FORMAT(now(), "%Y-%m-%d") > a.change_limit_time THEN 1
|
||||
ELSE 0 END)), 0) overdueNotCloseNum,
|
||||
IFNULL(SUM((CASE
|
||||
WHEN a.status = 2 AND DATE_FORMAT(now(), "%Y-%m-%d") > a.change_limit_time THEN 1
|
||||
@ -370,4 +372,15 @@
|
||||
from quality_inspection_record a
|
||||
WHERE a.project_sn = #{projectSn}
|
||||
</select>
|
||||
</mapper>
|
||||
<select id="getDepartmentRectifiedRank"
|
||||
resultType="com.zhgd.xmgl.modules.quality.entity.vo.DepartmentRectifiedRankVo"
|
||||
parameterType="com.zhgd.xmgl.modules.quality.entity.dto.DepartmentRectifiedRankDto">
|
||||
SELECT di.department_name,
|
||||
count(*) AS rectified_number
|
||||
FROM department_info di
|
||||
LEFT JOIN worker_info wi ON wi.department_id = di.id
|
||||
LEFT JOIN quality_inspection_record qir ON qir.change_id = wi.id
|
||||
WHERE qir.project_sn = #{projectSn}
|
||||
GROUP BY di.id
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
package com.zhgd.xmgl.modules.quality.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityInspectionRecord;
|
||||
import com.zhgd.xmgl.modules.quality.entity.dto.DepartmentRectifiedRankDto;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndThisWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndTodayDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.DepartmentRectifiedRankVo;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
@ -44,4 +47,6 @@ public interface IQualityInspectionRecordService extends IService<QualityInspect
|
||||
AllAndWeekDataVO getAllAndWeekData(String projectSn);
|
||||
|
||||
List<QualityInspectionRecord> limitListBySubdivision(String projectSn, Long subsectionId, Long subentryId, Integer size);
|
||||
|
||||
Result<List<DepartmentRectifiedRankVo>> getDepartmentRectifiedRank(DepartmentRectifiedRankDto rectifiedRank);
|
||||
}
|
||||
|
||||
@ -7,15 +7,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.jeecg.common.mybatis.EntityMap;
|
||||
import com.zhgd.xmgl.call.SanjiangDataCall;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.INoticeService;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityInspectionRecord;
|
||||
import com.zhgd.xmgl.modules.quality.entity.QualityRectifyRecord;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndThisWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndTodayDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllAndWeekDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.AllDataVO;
|
||||
import com.zhgd.xmgl.modules.quality.entity.dto.DepartmentRectifiedRankDto;
|
||||
import com.zhgd.xmgl.modules.quality.entity.vo.*;
|
||||
import com.zhgd.xmgl.modules.quality.mapper.QualityInspectionRecordMapper;
|
||||
import com.zhgd.xmgl.modules.quality.mapper.QualityRectifyRecordMapper;
|
||||
import com.zhgd.xmgl.modules.quality.service.IQualityInspectionRecordService;
|
||||
@ -243,6 +242,12 @@ public class QualityInspectionRecordServiceImpl extends ServiceImpl<QualityInspe
|
||||
return qualityInspectionRecordMapper.selectPage(new Page<>(1, size), wrapper).getRecords();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<DepartmentRectifiedRankVo>> getDepartmentRectifiedRank(DepartmentRectifiedRankDto rectifiedRank) {
|
||||
List<DepartmentRectifiedRankVo> voList = qualityInspectionRecordMapper.getDepartmentRectifiedRank(rectifiedRank);
|
||||
return Result.success(voList);
|
||||
}
|
||||
|
||||
private void setWeekRatioData(AllAndWeekDataVO allAndWeekDataVO) {
|
||||
long weekClose = allAndWeekDataVO.getWeekClose();
|
||||
long weekNoClose = allAndWeekDataVO.getWeekNoClose();
|
||||
|
||||
@ -0,0 +1,276 @@
|
||||
package com.zhgd.xmgl.modules.sanjiang.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
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.sanjiang.entity.SjSafeEnvironmentFile;
|
||||
import com.zhgd.xmgl.modules.sanjiang.service.ISjSafeEnvironmentFileService;
|
||||
|
||||
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.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;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 三江安全环保资料中心
|
||||
* @author: pds
|
||||
* @date: 2023-04-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/sjSafeEnvironmentFile")
|
||||
@Slf4j
|
||||
@Api(tags = "三江安全环保资料中心Controller")
|
||||
public class SjSafeEnvironmentFileController {
|
||||
@Autowired
|
||||
private ISjSafeEnvironmentFileService sjSafeEnvironmentFileService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sjSafeEnvironmentFile
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = " 分页列表查询三江安全环保资料中心信息", notes = "分页列表查询三江安全环保资料中心信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<SjSafeEnvironmentFile>> queryPageList(SjSafeEnvironmentFile sjSafeEnvironmentFile,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<SjSafeEnvironmentFile>> result = new Result<IPage<SjSafeEnvironmentFile>>();
|
||||
QueryWrapper<SjSafeEnvironmentFile> queryWrapper = QueryGenerator.initQueryWrapper(sjSafeEnvironmentFile, req.getParameterMap());
|
||||
Page<SjSafeEnvironmentFile> page = new Page<SjSafeEnvironmentFile>(pageNo, pageSize);
|
||||
IPage<SjSafeEnvironmentFile> pageList = sjSafeEnvironmentFileService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param sjSafeEnvironmentFile
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = " 列表查询三江安全环保资料中心信息", notes = "列表查询三江安全环保资料中心信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<SjSafeEnvironmentFile>> queryList(SjSafeEnvironmentFile sjSafeEnvironmentFile,
|
||||
HttpServletRequest req) {
|
||||
|
||||
QueryWrapper<SjSafeEnvironmentFile> queryWrapper = QueryGenerator.initQueryWrapper(sjSafeEnvironmentFile, req.getParameterMap());
|
||||
return Result.success(sjSafeEnvironmentFileService.list(queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param sjSafeEnvironmentFile
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = " 添加三江安全环保资料中心信息", notes = "添加三江安全环保资料中心信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<SjSafeEnvironmentFile> add(@RequestBody SjSafeEnvironmentFile sjSafeEnvironmentFile) {
|
||||
Result<SjSafeEnvironmentFile> result = new Result<SjSafeEnvironmentFile>();
|
||||
try {
|
||||
sjSafeEnvironmentFileService.save(sjSafeEnvironmentFile);
|
||||
result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info(e.getMessage());
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sjSafeEnvironmentFile
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑三江安全环保资料中心信息", notes = "编辑三江安全环保资料中心信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<SjSafeEnvironmentFile> edit(@RequestBody SjSafeEnvironmentFile sjSafeEnvironmentFile) {
|
||||
Result<SjSafeEnvironmentFile> result = new Result<SjSafeEnvironmentFile>();
|
||||
SjSafeEnvironmentFile sjSafeEnvironmentFileEntity = sjSafeEnvironmentFileService.getById(sjSafeEnvironmentFile.getId());
|
||||
if (sjSafeEnvironmentFileEntity == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
sjSafeEnvironmentFileService.updateById(sjSafeEnvironmentFile);
|
||||
result.success("修改成功!");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除三江安全环保资料中心信息", notes = "删除三江安全环保资料中心信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<SjSafeEnvironmentFile> delete(@RequestBody String id) {
|
||||
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
|
||||
id = String.valueOf(jsonObject.get("id"));
|
||||
Result<SjSafeEnvironmentFile> result = new Result<SjSafeEnvironmentFile>();
|
||||
SjSafeEnvironmentFile sjSafeEnvironmentFile = sjSafeEnvironmentFileService.getById(id);
|
||||
if (sjSafeEnvironmentFile == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = sjSafeEnvironmentFileService.removeById(id);
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "批量删除三江安全环保资料中心信息", notes = "批量删除三江安全环保资料中心信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "三江安全环保资料中心ID字符串", paramType = "query", required = true, dataType = "String")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<SjSafeEnvironmentFile> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
Result<SjSafeEnvironmentFile> result = new Result<SjSafeEnvironmentFile>();
|
||||
if (ids == null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
} else {
|
||||
this.sjSafeEnvironmentFileService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("删除成功!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询三江安全环保资料中心信息", notes = "通过id查询三江安全环保资料中心信息", httpMethod = "GET")
|
||||
@ApiImplicitParam(name = "id", value = "三江安全环保资料中心ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<SjSafeEnvironmentFile> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
Result<SjSafeEnvironmentFile> result = new Result<SjSafeEnvironmentFile>();
|
||||
SjSafeEnvironmentFile sjSafeEnvironmentFile = sjSafeEnvironmentFileService.getById(id);
|
||||
if (sjSafeEnvironmentFile == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(sjSafeEnvironmentFile);
|
||||
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<SjSafeEnvironmentFile> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
SjSafeEnvironmentFile sjSafeEnvironmentFile = JSON.parseObject(deString, SjSafeEnvironmentFile.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(sjSafeEnvironmentFile, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<SjSafeEnvironmentFile> pageList = sjSafeEnvironmentFileService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "三江安全环保资料中心列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, SjSafeEnvironmentFile.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<SjSafeEnvironmentFile> listSjSafeEnvironmentFiles = ExcelImportUtil.importExcel(file.getInputStream(), SjSafeEnvironmentFile.class, params);
|
||||
for (SjSafeEnvironmentFile sjSafeEnvironmentFileExcel : listSjSafeEnvironmentFiles) {
|
||||
sjSafeEnvironmentFileService.save(sjSafeEnvironmentFileExcel);
|
||||
}
|
||||
return Result.ok("文件导入成功!数据行数:" + listSjSafeEnvironmentFiles.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,276 @@
|
||||
package com.zhgd.xmgl.modules.sanjiang.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zhgd.xmgl.modules.sanjiang.entity.SjSafeEnvironmentFileType;
|
||||
import com.zhgd.xmgl.modules.sanjiang.service.ISjSafeEnvironmentFileTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
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.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.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;
|
||||
|
||||
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 三江安全环保资料中心文件类型
|
||||
* @author: pds
|
||||
* @date: 2023-04-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/xmgl/sjSafeEnvironmentFileType")
|
||||
@Slf4j
|
||||
@Api(tags = "SjSafeEnvironmentFileTypeController相关Api")
|
||||
public class SjSafeEnvironmentFileTypeController {
|
||||
@Autowired
|
||||
private ISjSafeEnvironmentFileTypeService sjSafeEnvironmentFileTypeService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param sjSafeEnvironmentFileType
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = " 分页列表查询三江安全环保资料中心文件类型信息", notes = "分页列表查询三江安全环保资料中心文件类型信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<IPage<SjSafeEnvironmentFileType>> queryPageList(SjSafeEnvironmentFileType sjSafeEnvironmentFileType,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<SjSafeEnvironmentFileType>> result = new Result<IPage<SjSafeEnvironmentFileType>>();
|
||||
QueryWrapper<SjSafeEnvironmentFileType> queryWrapper = QueryGenerator.initQueryWrapper(sjSafeEnvironmentFileType, req.getParameterMap());
|
||||
Page<SjSafeEnvironmentFileType> page = new Page<SjSafeEnvironmentFileType>(pageNo, pageSize);
|
||||
IPage<SjSafeEnvironmentFileType> pageList = sjSafeEnvironmentFileTypeService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param sjSafeEnvironmentFileType
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = " 列表查询三江安全环保资料中心文件类型信息", notes = "列表查询三江安全环保资料中心文件类型信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<SjSafeEnvironmentFileType>> queryList(SjSafeEnvironmentFileType sjSafeEnvironmentFileType,
|
||||
HttpServletRequest req) {
|
||||
|
||||
QueryWrapper<SjSafeEnvironmentFileType> queryWrapper = QueryGenerator.initQueryWrapper(sjSafeEnvironmentFileType, req.getParameterMap());
|
||||
return Result.success(sjSafeEnvironmentFileTypeService.list(queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param sjSafeEnvironmentFileType
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = " 添加三江安全环保资料中心文件类型信息", notes = "添加三江安全环保资料中心文件类型信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<SjSafeEnvironmentFileType> add(@RequestBody SjSafeEnvironmentFileType sjSafeEnvironmentFileType) {
|
||||
Result<SjSafeEnvironmentFileType> result = new Result<SjSafeEnvironmentFileType>();
|
||||
try {
|
||||
sjSafeEnvironmentFileTypeService.save(sjSafeEnvironmentFileType);
|
||||
result.success("添加成功!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.info(e.getMessage());
|
||||
result.error500("操作失败");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param sjSafeEnvironmentFileType
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "编辑三江安全环保资料中心文件类型信息", notes = "编辑三江安全环保资料中心文件类型信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<SjSafeEnvironmentFileType> edit(@RequestBody SjSafeEnvironmentFileType sjSafeEnvironmentFileType) {
|
||||
Result<SjSafeEnvironmentFileType> result = new Result<SjSafeEnvironmentFileType>();
|
||||
SjSafeEnvironmentFileType sjSafeEnvironmentFileTypeEntity = sjSafeEnvironmentFileTypeService.getById(sjSafeEnvironmentFileType.getId());
|
||||
if (sjSafeEnvironmentFileTypeEntity == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
sjSafeEnvironmentFileTypeService.updateById(sjSafeEnvironmentFileType);
|
||||
result.success("修改成功!");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除三江安全环保资料中心文件类型信息", notes = "删除三江安全环保资料中心文件类型信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<SjSafeEnvironmentFileType> delete(@RequestBody String id) {
|
||||
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
|
||||
id = String.valueOf(jsonObject.get("id"));
|
||||
Result<SjSafeEnvironmentFileType> result = new Result<SjSafeEnvironmentFileType>();
|
||||
SjSafeEnvironmentFileType sjSafeEnvironmentFileType = sjSafeEnvironmentFileTypeService.getById(id);
|
||||
if (sjSafeEnvironmentFileType == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
boolean ok = sjSafeEnvironmentFileTypeService.removeById(id);
|
||||
if (ok) {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "批量删除三江安全环保资料中心文件类型信息", notes = "批量删除三江安全环保资料中心文件类型信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "三江安全环保资料中心文件类型ID字符串", paramType = "query", required = true, dataType = "String")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
public Result<SjSafeEnvironmentFileType> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||
Result<SjSafeEnvironmentFileType> result = new Result<SjSafeEnvironmentFileType>();
|
||||
if (ids == null || "".equals(ids.trim())) {
|
||||
result.error500("参数不识别!");
|
||||
} else {
|
||||
this.sjSafeEnvironmentFileTypeService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
result.success("删除成功!");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询三江安全环保资料中心文件类型信息", notes = "通过id查询三江安全环保资料中心文件类型信息", httpMethod = "GET")
|
||||
@ApiImplicitParam(name = "id", value = "三江安全环保资料中心文件类型ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<SjSafeEnvironmentFileType> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
Result<SjSafeEnvironmentFileType> result = new Result<SjSafeEnvironmentFileType>();
|
||||
SjSafeEnvironmentFileType sjSafeEnvironmentFileType = sjSafeEnvironmentFileTypeService.getById(id);
|
||||
if (sjSafeEnvironmentFileType == null) {
|
||||
result.error500("未找到对应实体");
|
||||
} else {
|
||||
result.setResult(sjSafeEnvironmentFileType);
|
||||
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<SjSafeEnvironmentFileType> queryWrapper = null;
|
||||
try {
|
||||
String paramsStr = request.getParameter("paramsStr");
|
||||
if (oConvertUtils.isNotEmpty(paramsStr)) {
|
||||
String deString = URLDecoder.decode(paramsStr, "UTF-8");
|
||||
SjSafeEnvironmentFileType sjSafeEnvironmentFileType = JSON.parseObject(deString, SjSafeEnvironmentFileType.class);
|
||||
queryWrapper = QueryGenerator.initQueryWrapper(sjSafeEnvironmentFileType, request.getParameterMap());
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
//Step.2 AutoPoi 导出Excel
|
||||
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||
List<SjSafeEnvironmentFileType> pageList = sjSafeEnvironmentFileTypeService.list(queryWrapper);
|
||||
//导出文件名称
|
||||
mv.addObject(NormalExcelConstants.FILE_NAME, "三江安全环保资料中心文件类型列表");
|
||||
mv.addObject(NormalExcelConstants.CLASS, SjSafeEnvironmentFileType.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<SjSafeEnvironmentFileType> listSjSafeEnvironmentFileTypes = ExcelImportUtil.importExcel(file.getInputStream(), SjSafeEnvironmentFileType.class, params);
|
||||
for (SjSafeEnvironmentFileType sjSafeEnvironmentFileTypeExcel : listSjSafeEnvironmentFileTypes) {
|
||||
sjSafeEnvironmentFileTypeService.save(sjSafeEnvironmentFileTypeExcel);
|
||||
}
|
||||
return Result.ok("文件导入成功!数据行数:" + listSjSafeEnvironmentFileTypes.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,83 @@
|
||||
package com.zhgd.xmgl.modules.sanjiang.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* @Description: 三江安全环保资料中心
|
||||
* @author: pds
|
||||
* @date: 2023-04-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sj_safe_environment_file")
|
||||
@ApiModel(value = "SjSafeEnvironmentFile实体类", description = "SjSafeEnvironmentFile")
|
||||
public class SjSafeEnvironmentFile implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* fileId
|
||||
*/
|
||||
@Excel(name = "fileId", width = 15)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Long id;
|
||||
/**
|
||||
* 项目SN
|
||||
*/
|
||||
@Excel(name = "项目SN", width = 15)
|
||||
@ApiModelProperty(value = "项目SN")
|
||||
private java.lang.String projectSn;
|
||||
/**
|
||||
* 文件名
|
||||
*/
|
||||
@Excel(name = "文件名", width = 15)
|
||||
@ApiModelProperty(value = "文件名")
|
||||
private java.lang.String fileName;
|
||||
/**
|
||||
* 文件路径
|
||||
*/
|
||||
@Excel(name = "文件路径", width = 15)
|
||||
@ApiModelProperty(value = "文件路径")
|
||||
private java.lang.String filePath;
|
||||
/**
|
||||
* 扩展名
|
||||
*/
|
||||
@Excel(name = "扩展名", width = 15)
|
||||
@ApiModelProperty(value = "扩展名")
|
||||
private java.lang.String extendName;
|
||||
/**
|
||||
* 是否是目录 0-否, 1-是
|
||||
*/
|
||||
@Excel(name = "是否是目录 0-否, 1-是", width = 15)
|
||||
@ApiModelProperty(value = "是否是目录 0-否, 1-是")
|
||||
private java.lang.Integer isDir;
|
||||
/**
|
||||
* 文件url
|
||||
*/
|
||||
@Excel(name = "文件url", width = 15)
|
||||
@ApiModelProperty(value = "文件url")
|
||||
private java.lang.String fileUrl;
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@Excel(name = "上传时间", width = 15)
|
||||
@ApiModelProperty(value = "上传时间")
|
||||
private java.lang.String uploadTime;
|
||||
/**
|
||||
* 父级ID
|
||||
*/
|
||||
@Excel(name = "父级ID", width = 15)
|
||||
@ApiModelProperty(value = "父级ID")
|
||||
private java.lang.Long parentId;
|
||||
/**
|
||||
* 文件大小
|
||||
*/
|
||||
@Excel(name = "文件大小", width = 15)
|
||||
@ApiModelProperty(value = "文件大小")
|
||||
private java.lang.String fileSize;
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.zhgd.xmgl.modules.sanjiang.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: pds
|
||||
* @date: 2023-04-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("sj_safe_environment_file_type")
|
||||
@ApiModel(value = "SjSafeEnvironmentFileType实体类", description = "SjSafeEnvironmentFileType")
|
||||
public class SjSafeEnvironmentFileType implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.Integer id;
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@Excel(name = "类型名称", width = 15)
|
||||
@ApiModelProperty(value = "类型名称")
|
||||
private java.lang.String name;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.zhgd.xmgl.modules.sanjiang.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zhgd.xmgl.modules.sanjiang.entity.SjSafeEnvironmentFile;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 三江安全环保资料中心
|
||||
* @author: pds
|
||||
* @date: 2023-04-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface SjSafeEnvironmentFileMapper extends BaseMapper<SjSafeEnvironmentFile> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.zhgd.xmgl.modules.sanjiang.mapper;
|
||||
|
||||
import com.zhgd.xmgl.modules.sanjiang.entity.SjSafeEnvironmentFileType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 三江安全环保资料中心文件类型
|
||||
* @author: pds
|
||||
* @date: 2023-04-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface SjSafeEnvironmentFileTypeMapper extends BaseMapper<SjSafeEnvironmentFileType> {
|
||||
|
||||
}
|
||||
@ -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.sanjiang.mapper.SjSafeEnvironmentFileMapper">
|
||||
|
||||
</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.sanjiang.mapper.SjSafeEnvironmentFileTypeMapper">
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,14 @@
|
||||
package com.zhgd.xmgl.modules.sanjiang.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.sanjiang.entity.SjSafeEnvironmentFile;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 三江安全环保资料中心
|
||||
* @author: pds
|
||||
* @date: 2023-04-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface ISjSafeEnvironmentFileService extends IService<SjSafeEnvironmentFile> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.zhgd.xmgl.modules.sanjiang.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.sanjiang.entity.SjSafeEnvironmentFileType;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 三江安全环保资料中心文件类型
|
||||
* @author: pds
|
||||
* @date: 2023-04-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
public interface ISjSafeEnvironmentFileTypeService extends IService<SjSafeEnvironmentFileType> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.zhgd.xmgl.modules.sanjiang.service.impl;
|
||||
|
||||
import com.zhgd.xmgl.modules.sanjiang.entity.SjSafeEnvironmentFile;
|
||||
import com.zhgd.xmgl.modules.sanjiang.mapper.SjSafeEnvironmentFileMapper;
|
||||
import com.zhgd.xmgl.modules.sanjiang.service.ISjSafeEnvironmentFileService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 三江安全环保资料中心
|
||||
* @author: pds
|
||||
* @date: 2023-04-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class SjSafeEnvironmentFileServiceImpl extends ServiceImpl<SjSafeEnvironmentFileMapper, SjSafeEnvironmentFile> implements ISjSafeEnvironmentFileService {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.zhgd.xmgl.modules.sanjiang.service.impl;
|
||||
|
||||
import com.zhgd.xmgl.modules.sanjiang.entity.SjSafeEnvironmentFileType;
|
||||
import com.zhgd.xmgl.modules.sanjiang.mapper.SjSafeEnvironmentFileTypeMapper;
|
||||
import com.zhgd.xmgl.modules.sanjiang.service.ISjSafeEnvironmentFileTypeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 三江安全环保资料中心文件类型
|
||||
* @author: pds
|
||||
* @date: 2023-04-20
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class SjSafeEnvironmentFileTypeServiceImpl extends ServiceImpl<SjSafeEnvironmentFileTypeMapper, SjSafeEnvironmentFileType> implements ISjSafeEnvironmentFileTypeService {
|
||||
|
||||
}
|
||||
@ -51,7 +51,7 @@ import com.alibaba.fastjson.JSON;
|
||||
public class ${entityName}Controller {
|
||||
@Autowired
|
||||
private I${entityName}Service ${entityName?uncap_first}Service;
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @param ${entityName?uncap_first}
|
||||
@ -78,8 +78,6 @@ public class ${entityName}Controller {
|
||||
/**
|
||||
* 列表查询
|
||||
* @param ${entityName?uncap_first}
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 条数
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ -111,7 +109,7 @@ public class ${entityName}Controller {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param ${entityName?uncap_first}
|
||||
@ -128,10 +126,10 @@ public class ${entityName}Controller {
|
||||
${entityName?uncap_first}Service.updateById(${entityName?uncap_first});
|
||||
result.success("修改成功!");
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @param id
|
||||
@ -152,10 +150,10 @@ public class ${entityName}Controller {
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
@ -174,7 +172,7 @@ public class ${entityName}Controller {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param id
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
#mysql
|
||||
diver_name=com.mysql.jdbc.Driver
|
||||
url=jdbc:mysql://127.0.0.1:3306/wisdomsite_yanshi?useUnicode=true&characterEncoding=UTF-8&useSSL=false
|
||||
url=jdbc:mysql://127.0.0.1:3306/wisdomsite_sj?useUnicode=true&characterEncoding=UTF-8&useSSL=false
|
||||
#url=jdbc:mysql://127.0.0.1:3306/itbgp_bank?useUnicode=true&characterEncoding=UTF-8
|
||||
#url=jdbc:mysql://139.9.66.234:3306/dev_manage?useUnicode=true&characterEncoding=UTF-8
|
||||
username=root
|
||||
password=root
|
||||
database_name=wisdomsite_yanshi
|
||||
database_name=wisdomsite_sj
|
||||
#database_name=dev_manage
|
||||
|
||||
#oracle
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user