杜函宇 1 month ago
parent af81be3e2f
commit a7f4e932af

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

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

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

@ -37,14 +37,12 @@ public class Pjpz extends BaseModel implements Serializable {
*
*/
@ApiModelProperty(value = "评价要素")
@TableField("pjys")
private String pjys;
/**
*
*/
@ApiModelProperty(value = "评分规则")
@TableField("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.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.gysl.entity.baseModel.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -25,47 +26,41 @@ import java.time.LocalDateTime;
@EqualsAndHashCode(callSuper = false)
@TableName("plan_information")
@ApiModel(value = "PlanInformation", description = "规划信息")
public class PlanInformation implements Serializable {
public class PlanInformation extends BaseModel implements Serializable {
private static final long serialVersionUID = 949116362621294280L;
@ApiModelProperty(value = "${column.comment}")
@TableField("id")
@TableId(type = IdType.AUTO)
private Integer id;
private Long id;
/**
* id
*/
@ApiModelProperty(value = "项目id")
@TableField("xm_id")
private Long xmId;
/**
*
*/
@ApiModelProperty(value = "总用地面积 ")
@TableField("zydmj")
private BigDecimal zydmj;
/**
*
*/
@ApiModelProperty(value = "容积率")
@TableField("rjl")
private BigDecimal rjl;
/**
*
*/
@ApiModelProperty(value = "总建筑面积 ")
@TableField("zjzmj")
private BigDecimal zjzmj;
/**
*
*/
@ApiModelProperty(value = "标准层建筑面积")
@TableField("bzcjzmj")
private BigDecimal bzcjzmj;
/**
@ -73,21 +68,18 @@ public class PlanInformation implements Serializable {
* 
*/
@ApiModelProperty(value = "计容积率建筑面积")
@TableField(" jrjljzmj")
private BigDecimal jrjljzmj;
/**
*
*/
@ApiModelProperty(value = "建筑密度")
@TableField("jzmd")
private BigDecimal jzmd;
/**
* 绿
*/
@ApiModelProperty(value = "绿地率")
@TableField("ldl")
private BigDecimal ldl;
/**
@ -95,7 +87,6 @@ public class PlanInformation implements Serializable {
* 
*/
@ApiModelProperty(value = "建筑栋数")
@TableField(" jzds")
private Integer jzds;
/**
@ -103,7 +94,6 @@ public class PlanInformation implements Serializable {
* 
*/
@ApiModelProperty(value = "地上建筑面积")
@TableField(" dsjzmj")
private BigDecimal dsjzmj;
/**
@ -111,21 +101,18 @@ public class PlanInformation implements Serializable {
* 
*/
@ApiModelProperty(value = "地下建筑面积")
@TableField(" dxjzmj")
private BigDecimal dxjzmj;
/**
*
*/
@ApiModelProperty(value = "最高建筑层数")
@TableField("zgjzcs")
private Integer zgjzcs;
/**
*
*/
@ApiModelProperty(value = "最高建筑高度")
@TableField("zgjzgd")
private BigDecimal zgjzgd;
/**
@ -133,73 +120,23 @@ public class PlanInformation implements Serializable {
*
*/
@ApiModelProperty(value = "机动车停车位")
@TableField(" jdctcw")
private Integer jdctcw;
/**
*
*/
@ApiModelProperty(value = "非机动车停车位")
@TableField("fjdctcw")
private Integer fjdctcw;
/**
*
*/
@ApiModelProperty(value = "规划文件")
@TableField("ghwj")
private String ghwj;
/**
*
*/
@ApiModelProperty(value = "防火等级")
@TableField("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
*/
@ApiModelProperty(value = "项目id")
@TableField("xm_id")
private Long xmId;
@ApiModelProperty("要素名称")

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

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

@ -1,37 +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.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>

Loading…
Cancel
Save