feat: 新增批复文件curd
This commit is contained in:
parent
7650d20e13
commit
c5b181f29a
@ -0,0 +1,60 @@
|
||||
package com.yfd.platform.qgc_base.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.qgc_base.domain.MsEiaApprovalB;
|
||||
import com.yfd.platform.qgc_base.domain.SdEngInfoBHOperateRequest;
|
||||
import com.yfd.platform.qgc_base.service.IMsEiaApprovalBService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 生态环保批复文件管理
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/eiaApproval")
|
||||
@Tag(name = "生态环保批复文件管理")
|
||||
public class MsEiaApprovalBController {
|
||||
|
||||
@Resource
|
||||
private IMsEiaApprovalBService service;
|
||||
|
||||
@Resource
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@PostMapping("/page")
|
||||
@Operation(summary = "分页查询")
|
||||
public ResponseResult queryPageList(@RequestBody DataSourceRequest request) {
|
||||
Page<MsEiaApprovalB> page = service.queryPageList(request);
|
||||
return ResponseResult.successData(page);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@Operation(summary = "新增")
|
||||
public ResponseResult add(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
MsEiaApprovalB entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), MsEiaApprovalB.class);
|
||||
boolean result = service.add(entity, request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("新增成功") : ResponseResult.error("新增失败");
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
@Operation(summary = "修改")
|
||||
public ResponseResult update(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
MsEiaApprovalB entity = request == null || request.getEngInfo() == null ? null
|
||||
: objectMapper.convertValue(request.getEngInfo(), MsEiaApprovalB.class);
|
||||
boolean result = service.update(entity, request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("修改成功") : ResponseResult.error("修改失败");
|
||||
}
|
||||
|
||||
@PostMapping("/delete")
|
||||
@Operation(summary = "删除")
|
||||
public ResponseResult delete(@RequestBody SdEngInfoBHOperateRequest request) {
|
||||
boolean result = service.delete(request == null ? null : request.getIds(), request == null ? null : request.getSource());
|
||||
return result ? ResponseResult.success("删除成功") : ResponseResult.error("删除失败");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,148 @@
|
||||
package com.yfd.platform.qgc_base.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 生态环保批复文件表
|
||||
*
|
||||
* @author migration
|
||||
*/
|
||||
@Data
|
||||
@TableName("MS_EIAAPPROVAL_B")
|
||||
public class MsEiaApprovalB implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/** 电站编码 */
|
||||
@TableField("STCD")
|
||||
private String stcd;
|
||||
|
||||
/** 电站名称 */
|
||||
@TableField("ENNM")
|
||||
private String ennm;
|
||||
|
||||
/** 所属流域 */
|
||||
@TableField("BASIN")
|
||||
private String basin;
|
||||
|
||||
/** 所属河流 */
|
||||
@TableField("RIVER")
|
||||
private String river;
|
||||
|
||||
/** 所属水电基地 */
|
||||
@TableField("BASEID")
|
||||
private String baseid;
|
||||
|
||||
/** 所属水电基地流域 */
|
||||
@TableField("HBRVCD")
|
||||
private String hbrvcd;
|
||||
|
||||
/** 批复文号 */
|
||||
@TableField("APPROVAL_FILE_NO")
|
||||
private String approvalFileNo;
|
||||
|
||||
/** 批复文件标题 */
|
||||
@TableField("APPROVAL_FILE_TITLE")
|
||||
private String approvalFileTitle;
|
||||
|
||||
/** 文件名 */
|
||||
@TableField("FILE_NAME")
|
||||
private String fileName;
|
||||
|
||||
/** 附件下载地址 */
|
||||
@TableField("FLPATH")
|
||||
private String flpath;
|
||||
|
||||
/** 生态流量 */
|
||||
@TableField("ECOLOGICAL_FLOW")
|
||||
private String ecologicalFlow;
|
||||
|
||||
/** 水环境保护措施 */
|
||||
@TableField("WATER_ENV_PROTECTION")
|
||||
private String waterEnvProtection;
|
||||
|
||||
/** 低温水减缓措施 */
|
||||
@TableField("COLD_WATER_MITIGATION")
|
||||
private String coldWaterMitigation;
|
||||
|
||||
/** 栖息地保护 */
|
||||
@TableField("HABITAT_PROTECTION")
|
||||
private String habitatProtection;
|
||||
|
||||
/** 过鱼措施 */
|
||||
@TableField("FISH_PASSAGE_MEASURES")
|
||||
private String fishPassageMeasures;
|
||||
|
||||
/** 鱼类增殖放流 */
|
||||
@TableField("FISH_STOCKING")
|
||||
private String fishStocking;
|
||||
|
||||
/** 陆生生态保护/水土保持措施 */
|
||||
@TableField("TERRESTRIAL_ECO_SOIL_CONS")
|
||||
private String terrestrialEcoSoilCons;
|
||||
|
||||
/** 珍稀植物保护措施 */
|
||||
@TableField("RARE_PLANT_PROTECTION")
|
||||
private String rarePlantProtection;
|
||||
|
||||
/** 动物救助 */
|
||||
@TableField("ANIMAL_RESCUE")
|
||||
private String animalRescue;
|
||||
|
||||
/** 移民安置 */
|
||||
@TableField("RESETTLEMENT_MEASURES")
|
||||
private String resettlementMeasures;
|
||||
|
||||
/** 施工期防治措施或其他环境保护措施 */
|
||||
@TableField("CONSTRUCTION_POLLUTION_CTRL")
|
||||
private String constructionPollutionCtrl;
|
||||
|
||||
/** 地下水及地质环境保护措施 */
|
||||
@TableField("GROUNDWATER_GEO_PROTECT")
|
||||
private String groundwaterGeoProtect;
|
||||
|
||||
/** 风景名胜区保护措施 */
|
||||
@TableField("SCENIC_AREA_PROTECTION")
|
||||
private String scenicAreaProtection;
|
||||
|
||||
/** 环境监测要求 */
|
||||
@TableField("ENV_MONITORING_REQUIRE")
|
||||
private String envMonitoringRequire;
|
||||
|
||||
/** 附件ID */
|
||||
@TableField("FLID")
|
||||
private String flid;
|
||||
|
||||
// ---------- 审计字段 ----------
|
||||
|
||||
@TableField("RECORD_USER")
|
||||
private String recordUser;
|
||||
|
||||
@TableField("RECORD_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date recordTime;
|
||||
|
||||
@TableField("MODIFY_USER")
|
||||
private String modifyUser;
|
||||
|
||||
@TableField("MODIFY_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date modifyTime;
|
||||
|
||||
@TableField("IS_DELETED")
|
||||
private Integer isDeleted;
|
||||
|
||||
@TableField("DELETE_USER")
|
||||
private String deleteUser;
|
||||
|
||||
@TableField("DELETE_TIME")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date deleteTime;
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
package com.yfd.platform.qgc_base.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yfd.platform.qgc_base.domain.MsEiaApprovalB;
|
||||
|
||||
public interface MsEiaApprovalBMapper extends BaseMapper<MsEiaApprovalB> {
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
package com.yfd.platform.qgc_base.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.MsEiaApprovalB;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生态环保批复文件 Service 接口
|
||||
*/
|
||||
public interface IMsEiaApprovalBService extends IService<MsEiaApprovalB> {
|
||||
Page<MsEiaApprovalB> queryPageList(DataSourceRequest request);
|
||||
boolean add(MsEiaApprovalB entity, String source);
|
||||
boolean update(MsEiaApprovalB entity, String source);
|
||||
boolean delete(List<String> ids, String source);
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package com.yfd.platform.qgc_base.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.yfd.platform.common.DataSourceRequest;
|
||||
import com.yfd.platform.qgc_base.domain.MsEiaApprovalB;
|
||||
import com.yfd.platform.qgc_base.mapper.MsEiaApprovalBMapper;
|
||||
import com.yfd.platform.qgc_base.service.IMsEiaApprovalBService;
|
||||
import com.yfd.platform.qgc_base.service.IMsOperationLogService;
|
||||
import com.yfd.platform.utils.DataSourceRequestUtil;
|
||||
import com.yfd.platform.utils.SecurityUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 生态环保批复文件 Service 实现类
|
||||
*/
|
||||
@Service
|
||||
public class MsEiaApprovalBServiceImpl extends ServiceImpl<MsEiaApprovalBMapper, MsEiaApprovalB> implements IMsEiaApprovalBService {
|
||||
|
||||
private static final String TABLE_NAME = "MS_EIAAPPROVAL_B";
|
||||
|
||||
@Resource
|
||||
private IMsOperationLogService msOperationLogService;
|
||||
|
||||
@Override
|
||||
public Page<MsEiaApprovalB> queryPageList(DataSourceRequest request) {
|
||||
return DataSourceRequestUtil.executeQuery(request, MsEiaApprovalB.class, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean add(MsEiaApprovalB entity, String source) {
|
||||
boolean result = this.save(entity);
|
||||
if (result) {
|
||||
msOperationLogService.recordAddDetailLog(TABLE_NAME, entity, source);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean update(MsEiaApprovalB entity, String source) {
|
||||
MsEiaApprovalB before = this.getById(entity.getId());
|
||||
boolean result = this.updateById(entity);
|
||||
if (result && before != null) {
|
||||
msOperationLogService.recordModifyDetailLog(TABLE_NAME, before, entity, source);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean delete(List<String> ids, String source) {
|
||||
if (ids == null || ids.isEmpty()) return false;
|
||||
int count = 0;
|
||||
for (String id : ids) {
|
||||
LambdaUpdateWrapper<MsEiaApprovalB> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(MsEiaApprovalB::getId, id);
|
||||
wrapper.set(MsEiaApprovalB::getIsDeleted, 1);
|
||||
wrapper.set(MsEiaApprovalB::getDeleteUser, SecurityUtils.getCurrentUsername());
|
||||
wrapper.set(MsEiaApprovalB::getDeleteTime, new Date());
|
||||
if (this.update(wrapper)) {
|
||||
MsEiaApprovalB entity = this.getById(id);
|
||||
msOperationLogService.recordDeleteDetailLog(TABLE_NAME, entity, source);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count > 0;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user