杜函宇 1 month ago
parent af81be3e2f
commit a7f4e932af

@ -20,6 +20,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.poi.xssf.usermodel.*; import org.apache.poi.xssf.usermodel.*;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -41,14 +42,11 @@ import java.util.*;
@RestController @RestController
@RequestMapping("/gysl/basicInformation") @RequestMapping("/gysl/basicInformation")
public class BasicInformationController extends BaseController { public class BasicInformationController extends BaseController {
/**
*
*/
@Resource
/** /**
* *
*/ */
@Resource
private BasicInformationService basicInformationService; private BasicInformationService basicInformationService;
/** /**
@ -82,6 +80,12 @@ public class BasicInformationController extends BaseController {
@Resource @Resource
private QyrzInformationService qyrzInformationService; private QyrzInformationService qyrzInformationService;
/**
*
*/
@Resource
private ProjectOtherInfoService projectOtherInfoService;
/** /**
* *
* *
@ -94,7 +98,7 @@ public class BasicInformationController extends BaseController {
public AjaxResult selectAll(Page<BasicInformation> page, BasicInformationPageReq basicInformationPageReq) { public AjaxResult selectAll(Page<BasicInformation> page, BasicInformationPageReq basicInformationPageReq) {
// 获取当前登录用户是否是企业端 // 获取当前登录用户是否是企业端
try { try {
if (SecurityUtils.hasRole("company")) { if (SecurityUtils.hasRole("company") && !SecurityUtils.isAdmin(SecurityUtils.getUserId())) {
basicInformationPageReq.setTyshxydm(SecurityUtils.getUsername()); basicInformationPageReq.setTyshxydm(SecurityUtils.getUsername());
} }
} catch (Exception ignored) { } catch (Exception ignored) {
@ -111,7 +115,7 @@ public class BasicInformationController extends BaseController {
public AjaxResult fill(@RequestBody AuditRequest req) { public AjaxResult fill(@RequestBody AuditRequest req) {
BasicInformation byId = basicInformationService.getById(req.getBasicInformation().getId()); BasicInformation byId = basicInformationService.getById(req.getBasicInformation().getId());
if (byId.getStatus() != 1) { if (byId.getStatus() != 1) {
throw new ServiceException("暂不能提交!"); throw new ServiceException("暂不能提交!");
} }
return success(basicInformationService.audit(req, 2)); return success(basicInformationService.audit(req, 2));
} }
@ -125,7 +129,7 @@ public class BasicInformationController extends BaseController {
public AjaxResult audit(@RequestBody AuditRequest req) { public AjaxResult audit(@RequestBody AuditRequest req) {
BasicInformation byId = basicInformationService.getById(req.getBasicInformation().getId()); BasicInformation byId = basicInformationService.getById(req.getBasicInformation().getId());
if (byId.getStatus() == 1) { if (byId.getStatus() == 1) {
throw new ServiceException("请等待企业填报!"); throw new ServiceException("请等待企业填报!");
} }
return success(basicInformationService.audit(req, 3)); return success(basicInformationService.audit(req, 3));
} }
@ -162,8 +166,9 @@ public class BasicInformationController extends BaseController {
* *
*/ */
@ApiOperation(value = "项目基本信息批量导入") @ApiOperation(value = "项目基本信息批量导入")
// @PreAuthorize("@ss.hasAnyRoles('admin,common')") @PreAuthorize("@ss.hasAnyRoles('admin,common')")
@PostMapping(value = "/import", consumes = "multipart/form-data") @PostMapping(value = "/import", consumes = "multipart/form-data")
@Transactional(rollbackFor = Exception.class)
public AjaxResult importTemplateProject(@RequestPart("file") MultipartFile file) throws Exception { public AjaxResult importTemplateProject(@RequestPart("file") MultipartFile file) throws Exception {
ExcelUtil<BasicInformation> util = new ExcelUtil<>(BasicInformation.class); ExcelUtil<BasicInformation> util = new ExcelUtil<>(BasicInformation.class);
List<BasicInformation> proList = util.importExcel(file.getInputStream()); List<BasicInformation> proList = util.importExcel(file.getInputStream());
@ -171,10 +176,10 @@ public class BasicInformationController extends BaseController {
if (proList == null || proList.isEmpty()) { if (proList == null || proList.isEmpty()) {
throw new ServiceException("项目导入数据不能为空"); throw new ServiceException("项目导入数据不能为空");
} else { } else {
basicInformationService.saveBatch(proList);
List<Mx> list = mxService.list(); List<Mx> list = mxService.list();
proList.forEach(x -> { proList.forEach(x -> {
x.setStatus(1); x.setStatus(1);
basicInformationService.save(x);
//添加项目规划信息 //添加项目规划信息
PlanInformation planInformation = new PlanInformation(); PlanInformation planInformation = new PlanInformation();
planInformation.setXmId(x.getId()); planInformation.setXmId(x.getId());
@ -202,6 +207,7 @@ public class BasicInformationController extends BaseController {
projectOtherInfo.setZdname(y); projectOtherInfo.setZdname(y);
saveOther.add(projectOtherInfo); saveOther.add(projectOtherInfo);
}); });
projectOtherInfoService.saveBatch(saveOther);
//新增消息 //新增消息
Notice notice = new Notice(); Notice notice = new Notice();
notice.setType(2); notice.setType(2);

@ -37,27 +37,23 @@ public class Mx extends BaseModel implements Serializable {
* 1:2 * 1:2
*/ */
@ApiModelProperty(value = "1:关键要素2重要要素") @ApiModelProperty(value = "1:关键要素2重要要素")
@TableField("type")
private String type; private String type;
/** /**
* *
*/ */
@ApiModelProperty(value = "要素名称") @ApiModelProperty(value = "要素名称")
@TableField("name")
private String name; private String name;
/** /**
* *
*/ */
@ApiModelProperty(value = "具体指标") @ApiModelProperty(value = "具体指标")
@TableField("jtzb")
private String jtzb; private String jtzb;
/** /**
* *
*/ */
@ApiModelProperty(value = "详细要求") @ApiModelProperty(value = "详细要求")
@TableField("xxyq")
private String xxyq; private String xxyq;
} }

@ -20,8 +20,8 @@ import java.time.LocalDateTime;
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("mx") @TableName("notice")
@ApiModel(value = "Mx", description = "项目通知") @ApiModel(value = "notice", description = "项目通知")
public class Notice implements Serializable { public class Notice implements Serializable {
/** /**

@ -37,14 +37,12 @@ public class Pjpz extends BaseModel implements Serializable {
* *
*/ */
@ApiModelProperty(value = "评价要素") @ApiModelProperty(value = "评价要素")
@TableField("pjys")
private String pjys; private String pjys;
/** /**
* *
*/ */
@ApiModelProperty(value = "评分规则") @ApiModelProperty(value = "评分规则")
@TableField("pfgz")
private String pfgz; private String pfgz;

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.gysl.entity.baseModel.BaseModel;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -25,47 +26,41 @@ import java.time.LocalDateTime;
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("plan_information") @TableName("plan_information")
@ApiModel(value = "PlanInformation", description = "规划信息") @ApiModel(value = "PlanInformation", description = "规划信息")
public class PlanInformation implements Serializable { public class PlanInformation extends BaseModel implements Serializable {
private static final long serialVersionUID = 949116362621294280L; private static final long serialVersionUID = 949116362621294280L;
@ApiModelProperty(value = "${column.comment}")
@TableField("id") @TableField("id")
@TableId(type = IdType.AUTO) @TableId(type = IdType.AUTO)
private Integer id; private Long id;
/** /**
* id * id
*/ */
@ApiModelProperty(value = "项目id") @ApiModelProperty(value = "项目id")
@TableField("xm_id")
private Long xmId; private Long xmId;
/** /**
* *
*/ */
@ApiModelProperty(value = "总用地面积 ") @ApiModelProperty(value = "总用地面积 ")
@TableField("zydmj")
private BigDecimal zydmj; private BigDecimal zydmj;
/** /**
* *
*/ */
@ApiModelProperty(value = "容积率") @ApiModelProperty(value = "容积率")
@TableField("rjl")
private BigDecimal rjl; private BigDecimal rjl;
/** /**
* *
*/ */
@ApiModelProperty(value = "总建筑面积 ") @ApiModelProperty(value = "总建筑面积 ")
@TableField("zjzmj")
private BigDecimal zjzmj; private BigDecimal zjzmj;
/** /**
* *
*/ */
@ApiModelProperty(value = "标准层建筑面积") @ApiModelProperty(value = "标准层建筑面积")
@TableField("bzcjzmj")
private BigDecimal bzcjzmj; private BigDecimal bzcjzmj;
/** /**
@ -73,21 +68,18 @@ public class PlanInformation implements Serializable {
*  * 
*/ */
@ApiModelProperty(value = "计容积率建筑面积") @ApiModelProperty(value = "计容积率建筑面积")
@TableField(" jrjljzmj")
private BigDecimal jrjljzmj; private BigDecimal jrjljzmj;
/** /**
* *
*/ */
@ApiModelProperty(value = "建筑密度") @ApiModelProperty(value = "建筑密度")
@TableField("jzmd")
private BigDecimal jzmd; private BigDecimal jzmd;
/** /**
* 绿 * 绿
*/ */
@ApiModelProperty(value = "绿地率") @ApiModelProperty(value = "绿地率")
@TableField("ldl")
private BigDecimal ldl; private BigDecimal ldl;
/** /**
@ -95,7 +87,6 @@ public class PlanInformation implements Serializable {
*  * 
*/ */
@ApiModelProperty(value = "建筑栋数") @ApiModelProperty(value = "建筑栋数")
@TableField(" jzds")
private Integer jzds; private Integer jzds;
/** /**
@ -103,7 +94,6 @@ public class PlanInformation implements Serializable {
*  * 
*/ */
@ApiModelProperty(value = "地上建筑面积") @ApiModelProperty(value = "地上建筑面积")
@TableField(" dsjzmj")
private BigDecimal dsjzmj; private BigDecimal dsjzmj;
/** /**
@ -111,21 +101,18 @@ public class PlanInformation implements Serializable {
*  * 
*/ */
@ApiModelProperty(value = "地下建筑面积") @ApiModelProperty(value = "地下建筑面积")
@TableField(" dxjzmj")
private BigDecimal dxjzmj; private BigDecimal dxjzmj;
/** /**
* *
*/ */
@ApiModelProperty(value = "最高建筑层数") @ApiModelProperty(value = "最高建筑层数")
@TableField("zgjzcs")
private Integer zgjzcs; private Integer zgjzcs;
/** /**
* *
*/ */
@ApiModelProperty(value = "最高建筑高度") @ApiModelProperty(value = "最高建筑高度")
@TableField("zgjzgd")
private BigDecimal zgjzgd; private BigDecimal zgjzgd;
/** /**
@ -133,73 +120,23 @@ public class PlanInformation implements Serializable {
* *
*/ */
@ApiModelProperty(value = "机动车停车位") @ApiModelProperty(value = "机动车停车位")
@TableField(" jdctcw")
private Integer jdctcw; private Integer jdctcw;
/** /**
* *
*/ */
@ApiModelProperty(value = "非机动车停车位") @ApiModelProperty(value = "非机动车停车位")
@TableField("fjdctcw")
private Integer fjdctcw; private Integer fjdctcw;
/** /**
* *
*/ */
@ApiModelProperty(value = "规划文件") @ApiModelProperty(value = "规划文件")
@TableField("ghwj")
private String ghwj; private String ghwj;
/** /**
* *
*/ */
@ApiModelProperty(value = "防火等级") @ApiModelProperty(value = "防火等级")
@TableField("fhdj")
private String fhdj; private String fhdj;
/**
* id
*/
@ApiModelProperty(value = "创建者id")
@TableField("create_id")
private Integer createId;
/**
*
*/
@ApiModelProperty(value = "创建时间")
@TableField("create_time")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
/**
*
*/
@ApiModelProperty(value = "创建者")
@TableField("create_by")
private String createBy;
/**
* ID
*/
@ApiModelProperty(value = "更新者ID")
@TableField("update_id")
private Long updateId;
/**
*
*/
@ApiModelProperty(value = "更新者")
@TableField("update_by")
private String updateBy;
/**
*
*/
@ApiModelProperty(value = "更新时间")
@TableField("update_time")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
} }

@ -34,7 +34,6 @@ public class WysmxInformation extends BaseModel implements Serializable {
* id * id
*/ */
@ApiModelProperty(value = "项目id") @ApiModelProperty(value = "项目id")
@TableField("xm_id")
private Long xmId; private Long xmId;
@ApiModelProperty("要素名称") @ApiModelProperty("要素名称")

@ -36,9 +36,7 @@ public class Xmxl extends BaseModel implements Serializable {
private String xmmc; private String xmmc;
@ApiModelProperty("年度") @ApiModelProperty("年度")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy", timezone = "GMT+8") private String year;
@DateTimeFormat(pattern = "yyyy")
private LocalDate year;
@ApiModelProperty("网页地址") @ApiModelProperty("网页地址")
private String webUrl; private String webUrl;

@ -13,23 +13,5 @@ import com.ruoyi.gysl.entity.Notice;
* @since 2025-03-23 16:34:27 * @since 2025-03-23 16:34:27
*/ */
public interface NoticeMapper extends BaseMapper<Notice> { public interface NoticeMapper extends BaseMapper<Notice> {
/**
* MyBatisforeach
*
* @param entities List<Notice>
* @return
*/
int insertBatch(@Param("entities") List<Notice> entities);
/**
* MyBatisforeach
*
* @param entities List<Notice>
* @return
* @throws org.springframework.jdbc.BadSqlGrammarException ListSQL
*/
int insertOrUpdateBatch(@Param("entities") List<Notice> entities);
} }

@ -268,7 +268,7 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public Long audit(AuditRequest req,int status) { public Long audit(AuditRequest req, int status) {
req.getBasicInformation().setStatus(status); req.getBasicInformation().setStatus(status);
//企业端提交审核直接修改,不需要挂起等待审批 //企业端提交审核直接修改,不需要挂起等待审批
//修改项目基本信息 //修改项目基本信息
@ -289,16 +289,16 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
otherInfoService.saveBatch(req.getProjectOtherInfos()); otherInfoService.saveBatch(req.getProjectOtherInfos());
Notice one = noticeService.lambdaQuery().eq(Notice::getXmId, req.getBasicInformation().getId()).one(); Notice one = noticeService.lambdaQuery().eq(Notice::getXmId, req.getBasicInformation().getId()).one();
if(status == 2){ if (status == 2 && one != null) {
//修改消息 //修改消息
one.setType(1); one.setType(1);
one.setContent("关于"+req.getBasicInformation().getId()+"项目,待审核的通知"); one.setContent("关于" + req.getBasicInformation().getId() + "项目,待审核的通知");
noticeService.updateById(one); noticeService.updateById(one);
} }
if(status == 3){ if (status == 3 && one != null) {
//修改消息 //修改消息
one.setType(2); one.setType(2);
one.setContent("关于"+req.getBasicInformation().getId()+"项目,审核通过的通知"); one.setContent("关于" + req.getBasicInformation().getId() + "项目,审核通过的通知");
noticeService.updateById(one); noticeService.updateById(one);
} }
@ -348,10 +348,10 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void removeByXmIds(List<Long> idList) { public void removeByXmIds(List<Long> idList) {
idList.forEach(x->{ idList.forEach(x -> {
//删除项目基本信息 //删除项目基本信息
lambdaUpdate() lambdaUpdate()
.eq(BasicInformation::getId,x) .eq(BasicInformation::getId, x)
.remove(); .remove();
//删除项目规划信息 //删除项目规划信息
planInformationService.lambdaUpdate() planInformationService.lambdaUpdate()
@ -359,11 +359,11 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
.remove(); .remove();
//删除项目建筑信息 //删除项目建筑信息
buildingInformationService.lambdaUpdate() buildingInformationService.lambdaUpdate()
.eq(BuildingInformation::getXmId,x) .eq(BuildingInformation::getXmId, x)
.remove(); .remove();
//删除五要素模型信息 //删除五要素模型信息
wysmxInformationService.lambdaUpdate() wysmxInformationService.lambdaUpdate()
.eq(WysmxInformation::getXmId,x) .eq(WysmxInformation::getXmId, x)
.remove(); .remove();
//删除月度进展信息 //删除月度进展信息
// projectMonthInfoService.lambdaUpdate() // projectMonthInfoService.lambdaUpdate()
@ -371,11 +371,11 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
// .remove(); // .remove();
//删除企业入驻信息 //删除企业入驻信息
qyrzInformationService.lambdaUpdate() qyrzInformationService.lambdaUpdate()
.eq(QyrzInformation::getXmId,x) .eq(QyrzInformation::getXmId, x)
.remove(); .remove();
//删除项目图例 //删除项目图例
projectLegendService.lambdaUpdate() projectLegendService.lambdaUpdate()
.eq(ProjectLegend::getXmId,x) .eq(ProjectLegend::getXmId, x)
.remove(); .remove();
//删除项目巡礼 //删除项目巡礼
xmxlService.lambdaUpdate() xmxlService.lambdaUpdate()

@ -1,37 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.gysl.mapper.NoticeMapper"> <mapper namespace="com.ruoyi.gysl.mapper.NoticeMapper">
<resultMap type="com.ruoyi.gysl.entity.Notice" id="NoticeMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="type" column="type" jdbcType="INTEGER"/>
<result property="content" column="content" jdbcType="VARCHAR"/>
<result property="tyshxydm" column="tyshxydm" jdbcType="VARCHAR"/>
<result property="createId" column="create_id" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="createBy" column="create_by" jdbcType="VARCHAR"/>
<result property="updateId" column="update_id" jdbcType="INTEGER"/>
<result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<!-- 批量插入 -->
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into gysl.notice(typecontenttyshxydmcreate_idcreate_timecreate_byupdate_idupdate_byupdate_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.type}#{entity.content}#{entity.tyshxydm}#{entity.createId}#{entity.createTime}#{entity.createBy}#{entity.updateId}#{entity.updateBy}#{entity.updateTime})
</foreach>
</insert>
<!-- 批量插入或按主键更新 -->
<insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
insert into gysl.notice(typecontenttyshxydmcreate_idcreate_timecreate_byupdate_idupdate_byupdate_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.type}#{entity.content}#{entity.tyshxydm}#{entity.createId}#{entity.createTime}#{entity.createBy}#{entity.updateId}#{entity.updateBy}#{entity.updateTime})
</foreach>
on duplicate key update
type = values(type) content = values(content) tyshxydm = values(tyshxydm) create_id = values(create_id) create_time = values(create_time) create_by = values(create_by) update_id = values(update_id) update_by = values(update_by) update_time = values(update_time) </insert>
</mapper> </mapper>

Loading…
Cancel
Save