杜函宇 2 weeks ago
parent a1c2f09c30
commit 96e26ef9d9

@ -26,6 +26,11 @@
<artifactId>jsoup</artifactId> <artifactId>jsoup</artifactId>
<version>1.14.3</version> <version>1.14.3</version>
</dependency> </dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.3.3</version>
</dependency>
<!-- 本地文件转为MultipartFile file 因为我加了oss上传无上传可不加 如有启动错误请改变版本号--> <!-- 本地文件转为MultipartFile file 因为我加了oss上传无上传可不加 如有启动错误请改变版本号-->
<dependency> <dependency>

@ -67,9 +67,9 @@ public class SmartReminders extends BaseModel implements Serializable {
private Integer alertType; private Integer alertType;
/** /**
* *
*/ */
@ApiModelProperty("提前数提醒") @ApiModelProperty("提前数提醒")
private Integer daysAdvance; private Integer daysAdvance;
/** /**

@ -26,7 +26,7 @@ import javax.annotation.Resource;
@Api(tags = "政务统计") @Api(tags = "政务统计")
@RestController @RestController
@RequestMapping("/gysl/zwStats") @RequestMapping("/gysl/zwStats")
@PreAuthorize("@ss.hasAnyRoles('admin,common')") //@PreAuthorize("@ss.hasAnyRoles('admin,common')")
public class ZwStatsController extends BaseController { public class ZwStatsController extends BaseController {
@Resource @Resource
@ -40,8 +40,8 @@ public class ZwStatsController extends BaseController {
*/ */
@ApiOperation("整体项目情况") @ApiOperation("整体项目情况")
@GetMapping("/allProject") @GetMapping("/allProject")
public AjaxResult allProject() { public AjaxResult allProject(String years) {
return success(zwStatsService.allProject()); return success(zwStatsService.allProject(years));
} }
/** /**
@ -49,8 +49,8 @@ public class ZwStatsController extends BaseController {
*/ */
@ApiOperation("功能区") @ApiOperation("功能区")
@GetMapping("/ribbon") @GetMapping("/ribbon")
public AjaxResult ribbon() { public AjaxResult ribbon(String years) {
return success(zwStatsService.ribbon()); return success(zwStatsService.ribbon(years));
} }
/** /**
@ -58,8 +58,8 @@ public class ZwStatsController extends BaseController {
*/ */
@ApiOperation("投资主体") @ApiOperation("投资主体")
@GetMapping("/investors") @GetMapping("/investors")
public AjaxResult investors() { public AjaxResult investors(String years) {
return success(zwStatsService.investors()); return success(zwStatsService.investors(years));
} }
/** /**

@ -4,18 +4,15 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; 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.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.gysl.entity.baseModel.BaseModel; 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;
import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.ss.usermodel.IndexedColors;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
/** /**
* (BasicInformation) * (BasicInformation)
@ -55,7 +52,7 @@ public class BasicInformation extends BaseModel {
@NotBlank @NotBlank
@Excel(name = "项目法人单位", sort = 4, required = true,type= Excel.Type.ALL) @Excel(name = "项目法人单位*", sort = 4, required = true,type= Excel.Type.ALL,headerBackgroundColor= IndexedColors.RED1)
@ApiModelProperty("项目法人单位") @ApiModelProperty("项目法人单位")
private String xmfrdwxz; private String xmfrdwxz;
@ -83,17 +80,13 @@ public class BasicInformation extends BaseModel {
private Integer ssgnq; private Integer ssgnq;
@ApiModelProperty("建设开始时间") @ApiModelProperty("建设开始时间 yyyy-MM")
@Excel(name = "建设开始时间", dateFormat = "yyyy-MM-dd", sort = 5,type= Excel.Type.ALL) @Excel(name = "建设开始时间", sort = 5,type= Excel.Type.ALL)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") private String begainTime;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate begainTime;
@ApiModelProperty("建设结束时间") @ApiModelProperty("建设结束时间 yyyy-MM")
@Excel(name = "建设结束时间", dateFormat = "yyyy-MM-dd", sort = 6,type= Excel.Type.ALL) @Excel(name = "建设结束时间", sort = 6,type= Excel.Type.ALL)
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") private String endTime;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate endTime;
@NotBlank @NotBlank
@Excel(name = "现状分类", sort = 3, dictType = "xzfl", comboReadDict = true,type= Excel.Type.ALL) @Excel(name = "现状分类", sort = 3, dictType = "xzfl", comboReadDict = true,type= Excel.Type.ALL)
@ -169,5 +162,9 @@ public class BasicInformation extends BaseModel {
@ApiModelProperty("0非负面清单 1是负面清单") @ApiModelProperty("0非负面清单 1是负面清单")
private Integer isFmqd; private Integer isFmqd;
@ApiModelProperty("计划投资额")
@Excel(name = "计划投资额",type = Excel.Type.EXPORT )
private BigDecimal jhtze;
} }

@ -66,7 +66,7 @@ public class PlanInformation extends BaseModel implements Serializable {
*/ */
@Excel(name = "标准层建筑面积",headerBackgroundColor= IndexedColors.RED1,required = true) @Excel(name = "标准层建筑面积",headerBackgroundColor= IndexedColors.RED1,required = true)
@ApiModelProperty(value = "标准层建筑面积") @ApiModelProperty(value = "标准层建筑面积")
private BigDecimal bzcjzmj; private String bzcjzmj;
/** /**
* *

@ -7,6 +7,7 @@ import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date; import java.util.Date;
/** /**
@ -23,15 +24,15 @@ public class BasicInformationPageReq {
@ApiModelProperty("项目法人单位") @ApiModelProperty("项目法人单位")
private String xmfrdwxz; private String xmfrdwxz;
@ApiModelProperty("建设起止时间-开始时间") @ApiModelProperty("建设起止时间-开始时间 yyyy-MM")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") // @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd") // @DateTimeFormat(pattern = "yyyy-MM")
private Date startTime; private String startTime;
@ApiModelProperty("建设起止时间-结束时间") @ApiModelProperty("建设起止时间-结束时间 yyyy-MM")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") // @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd") // @DateTimeFormat(pattern = "yyyy-MM")
private Date endTime; private String endTime;
@ApiModelProperty("现状分类") @ApiModelProperty("现状分类")
private Integer xzfl; private Integer xzfl;

@ -1,82 +0,0 @@
package com.ruoyi.gysl.entity.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @author dong
* @since 2025/2/26 9:20
*/
@Data
@ApiModel("基本信息导出类")
public class BasicRequest implements Serializable {
@Excel(name = "序号")
private Integer id;
//项目名称
@Excel(name = "项目名称")
@ApiModelProperty("项目名称")
private String name;
//项目法人单位
@Excel(name = "项目法人单位")
@ApiModelProperty("项目法人单位")
private String xmfrdwxz;
//总投资额
@Excel(name = "总投资额(万元)")
@ApiModelProperty("总投资额")
private BigDecimal ztze;
//所属功能区
@Excel(name = "所属功能区")
@ApiModelProperty("所属功能区")
private Integer ssgnq;
//建设开始时间
@Excel(name = "建设开始时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("建设开始时间")
private LocalDateTime begainTime;
//建设结束时间
@Excel(name = "建设结束时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("建设结束时间")
private LocalDateTime endTime;
//现状分类
@Excel(name = "现状分类")
@ApiModelProperty("现状分类")
private Integer xzfl;
/**
*
*/
@ApiModelProperty(value = "总用地面积(平方米)")
@Excel(name = "总用地面积")
private BigDecimal zydmj;
}

@ -1,11 +1,14 @@
package com.ruoyi.gysl.entity.response; package com.ruoyi.gysl.entity.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List; import java.time.LocalDate;
/** /**
* *
@ -14,41 +17,81 @@ import java.util.List;
*/ */
@Data @Data
public class ProjectExcelInfo { public class ProjectExcelInfo {
@Excel(name = "项目法人单位",height=30)
@ApiModelProperty("项目法人单位")
private String xmfrdwxz;
//--基本信息
@Excel(name="id",group = "序号")
@ApiModelProperty("序号")
private String id;
@Excel(name = "项目名称",group = "项目基础信息") @Excel(name = "项目法人单位性质",dictType = "xmfrdwxz",width = 20)
@ApiModelProperty("项目法人单位性质")
private Integer nature;
@Excel(name = "项目名称")
@ApiModelProperty("项目名称") @ApiModelProperty("项目名称")
private String name; private String name;
@Excel(name = "项目法人单位",group = "项目基础信息") @Excel(name = "现状分类(已建/在建/拟建)",dictType = "xzfl", comboReadDict = true,width = 24)
@ApiModelProperty("项目法人单位") @ApiModelProperty("现状分类")
private String xmfrdwxz; private Integer xzfl;
@Excel(name = "项目法人单位性质",group = "项目基础信息",dictType = "xmfrdwxz") @ApiModelProperty("项目建设开始时间 yyyy-MM")
@ApiModelProperty("项目法人单位性质") @Excel(name = "项目建设开始时间")
private Integer nature; private String begainTime;
@ApiModelProperty("项目建设结束时间 yyyy-MM")
@Excel(name = "项目建设结束时间")
private String endTime;
@ApiModelProperty("计划投资额")
@Excel(name = "计划投资额(亿元)",width = 20)
private BigDecimal jhtze;
//--规划信息 //--规划信息
@Excel(name = "总用地面积",group = "项目规划信息") @Excel(name = "总用地面积(平方米)",width = 20)
@ApiModelProperty(value = "总用地面积") @ApiModelProperty(value = "总用地面积(平方米)")
private BigDecimal zydmj; private BigDecimal zydmj;
@Excel(name = "容积率",group = "项目规划信息") @Excel(name = "容积率")
@ApiModelProperty(value = "容积率") @ApiModelProperty(value = "容积率")
private BigDecimal rjl; private BigDecimal rjl;
@Excel(name = "总建筑面积",group = "项目规划信息") @Excel(name = "总建筑面积(平方米)")
@ApiModelProperty(value = "总建筑面积") @ApiModelProperty(value = "总建筑面积")
private BigDecimal zjzmj; private BigDecimal zjzmj;
@Excel(name = "标准层建筑面积",group = "项目规划信息") @Excel(name = "标准层建筑面积(千平方米)",width = 20)
@ApiModelProperty(value = "标准层建筑面积") @ApiModelProperty(value = "标准层建筑面积")
private BigDecimal bzcjzmj; private String bzcjzmj;
//---------
@Excel(name = "重点发展产业(原则上不超过三个)",width = 20)
@ApiModelProperty("重点发展产业")
private String prioritize;
@ApiModelProperty("项目负责人")
@Excel(name = "项目负责人")
private String projectLeader;
@NotBlank
@ApiModelProperty("联系方式")
@Excel(name = "联系方式",type = Excel.Type.EXPORT)
private String phone;
@ApiModelProperty("建设进度")
@Excel(name = "建设进度(或运营情况)")
private String jsjd;
@Excel(name = "建设模式(新供地实施/利用存量用地改扩建)",width = 22,dictType = "jsms",comboReadDict = true)
@ApiModelProperty("建设模式")
private Integer jsms;
//=====已有项目导入需要的字段
@ApiModelProperty("项目建设起止时间")
@Excel(name = "项目建设起止时间")
private String a1;
//--建筑信息
private List<ProjectBuildingExcel> xmjzxx;
} }

@ -41,4 +41,7 @@ public class AllProjectResponse {
@ApiModelProperty("当年_在建数量") @ApiModelProperty("当年_在建数量")
private Integer currentBuilding2; private Integer currentBuilding2;
@ApiModelProperty("当年_拟建数量")
private Integer currentBuilding3;
} }

@ -18,9 +18,9 @@ import java.util.List;
public interface BasicInformationMapper extends BaseMapper<BasicInformation> { public interface BasicInformationMapper extends BaseMapper<BasicInformation> {
/** /**
* id *
*/ */
List<ProjectExcelInfo> selectList(@Param("idList") List<Long> idList); List<ProjectExcelInfo> selectList();
/** /**
* *

@ -17,17 +17,17 @@ public interface ZwStatsMapper {
/** /**
* *
*/ */
AllProjectResponse allProject(); AllProjectResponse allProject(@Param("years") String years);
/** /**
* *
*/ */
List<RibbonResponse> ribbon(); List<RibbonResponse> ribbon(@Param("years") String years);
/** /**
* *
*/ */
List<RibbonResponse> investors(); List<RibbonResponse> investors(@Param("years") String years);
/** /**
* *

@ -5,11 +5,14 @@ import com.ruoyi.docking.entity.SmartReminders;
import com.ruoyi.docking.service.*; import com.ruoyi.docking.service.*;
import com.ruoyi.gysl.entity.BasicInformation; import com.ruoyi.gysl.entity.BasicInformation;
import com.ruoyi.gysl.service.BasicInformationService; import com.ruoyi.gysl.service.BasicInformationService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.time.format.ResolverStyle;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -84,22 +87,37 @@ public class NoticeTiming {
//获取所有的项目 //获取所有的项目
List<BasicInformation> list = basicInformationService.list(); List<BasicInformation> list = basicInformationService.list();
List<BasicInformation> list1 = basicInformationService.list(); List<BasicInformation> list1 = basicInformationService.list();
//如果当前时间在该项目的结束时间前自定义的提前数之前,就去掉 //如果当前时间在该项目的结束时间前自定义的提前数之前,就去掉
list.removeIf(x -> list.removeIf(x ->
!(LocalDate.now().equals(x.getEndTime().minusDays(qy.getDaysAdvance()))) LocalDate.now().isBefore(convertToLocalDate(x.getEndTime()).minusMonths(qy.getDaysAdvance()))
); );
list.forEach(x -> { list.forEach(x -> {
SmartDeclaration smartDeclaration = new SmartDeclaration(); SmartDeclaration smartDeclaration = new SmartDeclaration();
smartDeclaration.setSmartRemindersId(1L); smartDeclaration.setSmartRemindersId(1L);
smartDeclaration.setTyshxydm(x.getTyshxydm()); smartDeclaration.setTyshxydm(x.getTyshxydm());
smartDeclaration.setAlertTime(x.getEndTime().atStartOfDay()); smartDeclaration.setAlertTime(convertToLocalDate(x.getEndTime()).atTime(0,0,0));
smdList.add(smartDeclaration); smdList.add(smartDeclaration);
}); });
list1.removeIf(x -> list1.removeIf(x ->
!(LocalDate.now().equals(x.getEndTime().minusDays(zw.getDaysAdvance()))) LocalDate.now().isBefore(convertToLocalDate(x.getEndTime()).minusMonths(zw.getDaysAdvance()))
); );
//获取到所有的符合条件的政务用户 //获取到所有的符合条件的政务用户
list1.forEach(x -> userService.getAllZwUser(null, null, 2L, String.valueOf(x.getEndTime().atStartOfDay()))); list1.forEach(x -> userService.getAllZwUser(null, null, 2L,
String.valueOf(convertToLocalDate(x.getEndTime()).atTime(0,0,0))));
smartDeclarationService.saveBatch(smdList); smartDeclarationService.saveBatch(smdList);
} }
public static LocalDate convertToLocalDate(String dateStr) {
try {
// 定义格式化器,使用严格模式(拒绝无效月份,如 "2023-13"
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM")
.withResolverStyle(ResolverStyle.STRICT);
// 解析为 YearMonth 对象
YearMonth yearMonth = YearMonth.parse(dateStr, formatter);
// 指定默认日为每月第一天
return yearMonth.atDay(1);
} catch (DateTimeParseException e) {
throw new IllegalArgumentException("无效的日期格式: " + dateStr, e);
}
}
} }

@ -34,24 +34,24 @@ public interface BasicInformationService extends IService<BasicInformation> {
/** /**
* id *
*/ */
List<ProjectExcelInfo> selectList(List<Long> idList); List<ProjectExcelInfo> selectList();
/** // /**
* // * 填充数据
*/ // */
void approvalMethodfillInData(XSSFSheet sheet, XSSFCellStyle contentStyle, int rowNum, List<ProjectExcelInfo> info,List<String> sc,List<String> ec,int a) ; // void approvalMethodfillInData(XSSFSheet sheet, XSSFCellStyle contentStyle, int rowNum, List<ProjectExcelInfo> info,List<String> sc,List<String> ec,int a) ;
//
/** // /**
* - // * 填充数据-项目基础信息获取
*/ // */
String getExcelData(ProjectExcelInfo item,String str); // String getExcelData(ProjectExcelInfo item,String str);
//
/** // /**
* - // * 填充数据-项目建筑信息获取
*/ // */
String getBuildingData(ProjectBuildingExcel item,String str); // String getBuildingData(ProjectBuildingExcel item,String str);
/** /**
* *
@ -66,7 +66,7 @@ public interface BasicInformationService extends IService<BasicInformation> {
/** /**
* *
*/ */
Long audit(AuditRequest req,int status); Long audit(AuditRequest req,int status,int oldStatus);
/** /**
* () * ()
* *

@ -17,17 +17,17 @@ public interface ZwStatsService {
/** /**
* *
*/ */
AllProjectResponse allProject(); AllProjectResponse allProject(String years);
/** /**
* *
*/ */
List<RibbonResponse> ribbon(); List<RibbonResponse> ribbon(String years);
/** /**
* *
*/ */
List<RibbonResponse> investors(); List<RibbonResponse> investors(String years);
/** /**

@ -124,132 +124,132 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
/** /**
* id *
*/ */
@Override @Override
public List<ProjectExcelInfo> selectList(List<Long> idList) { public List<ProjectExcelInfo> selectList() {
return baseMapper.selectList(idList); return baseMapper.selectList();
} }
/** // /**
* // * 填充数据
*/ // */
@Override // @Override
public void approvalMethodfillInData(XSSFSheet sheet, XSSFCellStyle contentStyle, int rowNum, List<ProjectExcelInfo> info, List<String> sc, List<String> ec, int num) { // public void approvalMethodfillInData(XSSFSheet sheet, XSSFCellStyle contentStyle, int rowNum, List<ProjectExcelInfo> info, List<String> sc, List<String> ec, int num) {
Class<?> classBuilding = ProjectBuildingExcel.class; // Class<?> classBuilding = ProjectBuildingExcel.class;
for (ProjectExcelInfo projectExcelInfo : info) { // for (ProjectExcelInfo projectExcelInfo : info) {
XSSFRow tempRow = sheet.createRow(rowNum++); // XSSFRow tempRow = sheet.createRow(rowNum++);
tempRow.setHeight((short) 1400); // tempRow.setHeight((short) 1400);
int i1; // int i1;
for (i1 = 0; i1 < sc.size(); i1++) { // for (i1 = 0; i1 < sc.size(); i1++) {
XSSFCell tempCell = tempRow.createCell(i1); // XSSFCell tempCell = tempRow.createCell(i1);
tempCell.setCellStyle(contentStyle);
if (!ec.get(i1).endsWith("厂房")) {
if (Objects.equals(sc.get(i1), "")) {
tempCell.setCellValue(projectExcelInfo.getId());
} else {
tempCell.setCellValue(getExcelData(projectExcelInfo, sc.get(i1)));
}
}
}
// XSSFCell tempCell = tempRow.createCell(8);
// tempCell.setCellStyle(contentStyle); // tempCell.setCellStyle(contentStyle);
// tempCell.setCellValue("12312321"); // if (!ec.get(i1).endsWith("厂房")) {
// if (Objects.equals(sc.get(i1), "")) {
for (int i2 = 0; i2 < projectExcelInfo.getXmjzxx().size(); i2++) { // tempCell.setCellValue(projectExcelInfo.getId());
switch (projectExcelInfo.getXmjzxx().get(i2).getFloor()) { // } else {
case 1: // tempCell.setCellValue(getExcelData(projectExcelInfo, sc.get(i1)));
i1 = ec.indexOf("一层厂房"); // }
break; // }
case 2: // }
i1 = ec.indexOf("双层厂房"); //// XSSFCell tempCell = tempRow.createCell(8);
break; //// tempCell.setCellStyle(contentStyle);
case 3: //// tempCell.setCellValue("12312321");
i1 = ec.indexOf("三层厂房"); //
break; // for (int i2 = 0; i2 < projectExcelInfo.getXmjzxx().size(); i2++) {
case 4: // switch (projectExcelInfo.getXmjzxx().get(i2).getFloor()) {
i1 = ec.indexOf("四层厂房"); // case 1:
break; // i1 = ec.indexOf("一层厂房");
case 5: // break;
i1 = ec.indexOf("五层厂房"); // case 2:
break; // i1 = ec.indexOf("双层厂房");
default: // break;
i1 = ec.indexOf("六层及以上厂房"); // case 3:
} // i1 = ec.indexOf("三层厂房");
for (Field field : classBuilding.getDeclaredFields()) { // break;
XSSFCell tempCell = tempRow.createCell(i1); // case 4:
tempCell.setCellStyle(contentStyle); // i1 = ec.indexOf("四层厂房");
Excel excelColumn = field.getAnnotation(Excel.class); // break;
if (excelColumn != null) { // case 5:
tempCell.setCellValue(getBuildingData(projectExcelInfo.getXmjzxx().get(i2), sc.get(i1))); // i1 = ec.indexOf("五层厂房");
i1++; // break;
} // default:
} // i1 = ec.indexOf("六层及以上厂房");
} // }
} // for (Field field : classBuilding.getDeclaredFields()) {
} // XSSFCell tempCell = tempRow.createCell(i1);
// tempCell.setCellStyle(contentStyle);
/** // Excel excelColumn = field.getAnnotation(Excel.class);
* - // if (excelColumn != null) {
*/ // tempCell.setCellValue(getBuildingData(projectExcelInfo.getXmjzxx().get(i2), sc.get(i1)));
@Override // i1++;
public String getExcelData(ProjectExcelInfo item, String str) { // }
String a = null; // }
switch (str) { // }
case "": // }
a = item.getId() == null ? "-" : item.getId(); // }
break; //
case "项目名称": // /**
a = item.getName() == null ? "-" : item.getName(); // * 填充数据-项目基础信息获取
break; // */
case "项目法人单位": // @Override
a = item.getXmfrdwxz() == null ? "-" : item.getXmfrdwxz(); // public String getExcelData(ProjectExcelInfo item, String str) {
break; // String a = null;
case "项目法人单位性质": // switch (str) {
a = String.valueOf(item.getNature() == null ? "-" : item.getNature()); // case "":
break; // a = item.getId() == null ? "-" : item.getId();
case "总用地面积": // break;
a = String.valueOf(item.getZydmj() == null ? "-" : item.getZydmj()); // case "项目名称":
break; // a = item.getName() == null ? "-" : item.getName();
case "容积率": // break;
a = String.valueOf(item.getRjl() == null ? "-" : item.getRjl()); // case "项目法人单位":
break; // a = item.getXmfrdwxz() == null ? "-" : item.getXmfrdwxz();
case "总建筑面积": // break;
a = String.valueOf(item.getZjzmj() == null ? "-" : item.getZjzmj()); // case "项目法人单位性质":
break; // a = String.valueOf(item.getNature() == null ? "-" : item.getNature());
case "标准层建筑面积": // break;
a = String.valueOf(item.getBzcjzmj() == null ? "-" : item.getBzcjzmj()); // case "总用地面积":
break; // a = String.valueOf(item.getZydmj() == null ? "-" : item.getZydmj());
} // break;
return a; // case "容积率":
} // a = String.valueOf(item.getRjl() == null ? "-" : item.getRjl());
// break;
/** // case "总建筑面积":
* - // a = String.valueOf(item.getZjzmj() == null ? "-" : item.getZjzmj());
*/ // break;
@Override // case "标准层建筑面积":
public String getBuildingData(ProjectBuildingExcel item, String str) { // a = String.valueOf(item.getBzcjzmj() == null ? "-" : item.getBzcjzmj());
String a = null; // break;
switch (str) { // }
case "层数": // return a;
a = item.getFloor() == null ? "-" : String.valueOf(item.getFloor()); // }
break; //
case "总建筑高度": // /**
a = item.getTotalBuildingHeight() == null ? "-" : String.valueOf(item.getTotalBuildingHeight()); // * 填充数据-项目建筑信息获取
break; // */
case "首层高度": // @Override
a = String.valueOf(item.getScgd() == null ? "-" : item.getScgd()); // public String getBuildingData(ProjectBuildingExcel item, String str) {
break; // String a = null;
case "2至4层高": // switch (str) {
a = String.valueOf(item.getTwoAndFourCg() == null ? "-" : item.getTwoAndFourCg()); // case "层数":
break; // a = item.getFloor() == null ? "-" : String.valueOf(item.getFloor());
case "4层以上层高": // break;
a = String.valueOf(item.getFourYscg() == null ? "-" : item.getFourYscg()); // case "总建筑高度":
break; // a = item.getTotalBuildingHeight() == null ? "-" : String.valueOf(item.getTotalBuildingHeight());
} // break;
return a; // case "首层高度":
} // a = String.valueOf(item.getScgd() == null ? "-" : item.getScgd());
// break;
// case "2至4层高":
// a = String.valueOf(item.getTwoAndFourCg() == null ? "-" : item.getTwoAndFourCg());
// break;
// case "4层以上层高":
// a = String.valueOf(item.getFourYscg() == null ? "-" : item.getFourYscg());
// break;
// }
// return a;
// }
/** /**
* *
@ -282,8 +282,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,int oldStatus) {
req.getBasicInformation().setStatus(status);
//企业端提交审核直接修改,不需要挂起等待审批 //企业端提交审核直接修改,不需要挂起等待审批
//修改项目基本信息,和是否是负面清单 //修改项目基本信息,和是否是负面清单
List<WysmxInformation> collect1 = req.getWysmxInformations().stream().filter(x -> List<WysmxInformation> collect1 = req.getWysmxInformations().stream().filter(x ->
@ -303,7 +302,7 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
collect2.get(0).getZdinfor(), collect2.get(0).getZdinfor(),
collect3.get(0).getZdinfor()) ? 1 : 0); collect3.get(0).getZdinfor()) ? 1 : 0);
} }
updateById(req.getBasicInformation());
//修改项目规划信息 //修改项目规划信息
planInformationService.updateById(req.getPlanInformation()); planInformationService.updateById(req.getPlanInformation());
//修改企业入驻信息 //修改企业入驻信息
@ -316,15 +315,21 @@ public class BasicInformationServiceImpl extends ServiceImpl<BasicInformationMap
otherInfoService.saveBatch(req.getProjectOtherInfos()); otherInfoService.saveBatch(req.getProjectOtherInfos());
if (status == 2) { if (status == 2) {
if(oldStatus==1){
userService.getAllZwUser("关于" + req.getBasicInformation().getName() + "项目,待审核的通知", req.getBasicInformation().getId(), null, null); userService.getAllZwUser("关于" + req.getBasicInformation().getName() + "项目,待审核的通知", req.getBasicInformation().getId(), null, null);
} }
}
if (status == 3) { if (status == 3) {
if(oldStatus==2) {
SmartDeclaration sd = new SmartDeclaration(); SmartDeclaration sd = new SmartDeclaration();
sd.setTyshxydm((req.getBasicInformation().getTyshxydm())); sd.setTyshxydm((req.getBasicInformation().getTyshxydm()));
sd.setProjectId(req.getBasicInformation().getId()); sd.setProjectId(req.getBasicInformation().getId());
sd.setContent("关于" + req.getBasicInformation().getName() + "项目,审核通过的通知"); sd.setContent("关于" + req.getBasicInformation().getName() + "项目,审核通过的通知");
smartDeclarationService.save(sd); smartDeclarationService.save(sd);
} }
}
req.getBasicInformation().setStatus(status);
updateById(req.getBasicInformation());
return req.getBasicInformation().getId(); return req.getBasicInformation().getId();
} }

@ -10,6 +10,7 @@ import com.ruoyi.gysl.entity.response.XmhxResponse;
import com.ruoyi.gysl.entity.response.XmpjqdOneResponse; import com.ruoyi.gysl.entity.response.XmpjqdOneResponse;
import com.ruoyi.gysl.mapper.XmpjqdMapper; import com.ruoyi.gysl.mapper.XmpjqdMapper;
import com.ruoyi.gysl.service.BuildingInformationService; import com.ruoyi.gysl.service.BuildingInformationService;
import com.ruoyi.gysl.service.PjpzService;
import com.ruoyi.gysl.service.XmpjqdService; import com.ruoyi.gysl.service.XmpjqdService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -18,7 +19,6 @@ import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -38,6 +38,9 @@ public class XmpjqdServiceImpl extends ServiceImpl<XmpjqdMapper, Xmpjqd> impleme
@Resource @Resource
private BuildingInformationService buildingInformationService; private BuildingInformationService buildingInformationService;
@Resource
private PjpzService pjpzService;
/** /**
* *
* *
@ -62,66 +65,73 @@ public class XmpjqdServiceImpl extends ServiceImpl<XmpjqdMapper, Xmpjqd> impleme
@Override @Override
public List<XmpjqdOneResponse> selectOnePj(Long id) { public List<XmpjqdOneResponse> selectOnePj(Long id) {
List<XmpjqdOneResponse> xmpjqdOneResponses = xmpjqdMapper.selectOnePj(id); List<XmpjqdOneResponse> xmpjqdOneResponses = xmpjqdMapper.selectOnePj(id);
//获取项目评价配置
pjpzService.list().forEach(x->{
XmpjqdOneResponse xr = new XmpjqdOneResponse();
xr.setYsmc(x.getPjys());
xmpjqdOneResponses.add(xr);
});
//查询所有的建筑信息,只保留是重要楼栋的随机一条 //查询所有的建筑信息,只保留是重要楼栋的随机一条
List<BuildingInformation> list = xmpjqdMapper.getImportantBuildings(); // List<BuildingInformation> list = xmpjqdMapper.getImportantBuildings();
//层数
list.sort(Comparator.comparing(BuildingInformation::getFloor).reversed());
XmpjqdOneResponse a1 = new XmpjqdOneResponse();
a1.setYsmc("层数");
for (int i = 0; i < list.size(); i++) {
if (Objects.equals(list.get(i).getXmId(), id)) {
a1.setPjpm(i + 1);
}
}
a1.setCount(String.valueOf(list.size()));
xmpjqdOneResponses.add(a1);
//首层层高
XmpjqdOneResponse a2 = new XmpjqdOneResponse();
list.sort(Comparator.comparing(BuildingInformation::getScgd).reversed());
a2.setYsmc("首层层高");
for (int i = 0; i < list.size(); i++) {
if (Objects.equals(list.get(i).getXmId(), id)) {
a2.setPjpm(i + 1);
}
}
a2.setCount(String.valueOf(list.size()));
xmpjqdOneResponses.add(a2);
//二层及以上层高 // //层数
XmpjqdOneResponse a3 = new XmpjqdOneResponse(); // list.sort(Comparator.comparing(BuildingInformation::getFloor).reversed());
list.sort(Comparator.comparing(BuildingInformation::getTwoAndFourCg).reversed()); // XmpjqdOneResponse a1 = new XmpjqdOneResponse();
a3.setYsmc("二层及以上层高"); // a1.setYsmc("层数");
for (int i = 0; i < list.size(); i++) { // for (int i = 0; i < list.size(); i++) {
if (Objects.equals(list.get(i).getXmId(), id)) { // if (Objects.equals(list.get(i).getXmId(), id)) {
a3.setPjpm(i + 1); // a1.setPjpm(i + 1);
} // }
} // }
a3.setCount(String.valueOf(list.size())); // a1.setCount(String.valueOf(list.size()));
xmpjqdOneResponses.add(a3); // xmpjqdOneResponses.add(a1);
// //首层层高
//首层地面载荷 // XmpjqdOneResponse a2 = new XmpjqdOneResponse();
XmpjqdOneResponse a4 = new XmpjqdOneResponse(); // list.sort(Comparator.comparing(BuildingInformation::getScgd).reversed());
list.sort(Comparator.comparing(BuildingInformation::getScdmhz).reversed()); // a2.setYsmc("首层层高");
a4.setYsmc("首层地面载荷"); // for (int i = 0; i < list.size(); i++) {
for (int i = 0; i < list.size(); i++) { // if (Objects.equals(list.get(i).getXmId(), id)) {
if (Objects.equals(list.get(i).getXmId(), id)) { // a2.setPjpm(i + 1);
a4.setPjpm(i + 1); // }
} // }
} // a2.setCount(String.valueOf(list.size()));
a4.setCount(String.valueOf(list.size())); // xmpjqdOneResponses.add(a2);
xmpjqdOneResponses.add(a4); //
// //二层及以上层高
//二层及以上楼面荷载 // XmpjqdOneResponse a3 = new XmpjqdOneResponse();
XmpjqdOneResponse a5 = new XmpjqdOneResponse(); // list.sort(Comparator.comparing(BuildingInformation::getTwoAndFourCg).reversed());
list.sort(Comparator.comparing(BuildingInformation::getTwoAndThreeLmhz).reversed()); // a3.setYsmc("二层及以上层高");
a5.setYsmc("二层及以上楼面荷载"); // for (int i = 0; i < list.size(); i++) {
for (int i = 0; i < list.size(); i++) { // if (Objects.equals(list.get(i).getXmId(), id)) {
if (Objects.equals(list.get(i).getXmId(), id)) { // a3.setPjpm(i + 1);
a5.setPjpm(i + 1); // }
} // }
} // a3.setCount(String.valueOf(list.size()));
a5.setCount(String.valueOf(list.size())); // xmpjqdOneResponses.add(a3);
xmpjqdOneResponses.add(a5); //
// //首层地面载荷
// XmpjqdOneResponse a4 = new XmpjqdOneResponse();
// list.sort(Comparator.comparing(BuildingInformation::getScdmhz).reversed());
// a4.setYsmc("首层地面载荷");
// for (int i = 0; i < list.size(); i++) {
// if (Objects.equals(list.get(i).getXmId(), id)) {
// a4.setPjpm(i + 1);
// }
// }
// a4.setCount(String.valueOf(list.size()));
// xmpjqdOneResponses.add(a4);
//
// //二层及以上楼面荷载
// XmpjqdOneResponse a5 = new XmpjqdOneResponse();
// list.sort(Comparator.comparing(BuildingInformation::getTwoAndThreeLmhz).reversed());
// a5.setYsmc("二层及以上楼面荷载");
// for (int i = 0; i < list.size(); i++) {
// if (Objects.equals(list.get(i).getXmId(), id)) {
// a5.setPjpm(i + 1);
// }
// }
// a5.setCount(String.valueOf(list.size()));
// xmpjqdOneResponses.add(a5);
return xmpjqdOneResponses; return xmpjqdOneResponses;
} }
@ -188,9 +198,13 @@ public class XmpjqdServiceImpl extends ServiceImpl<XmpjqdMapper, Xmpjqd> impleme
if (floor.size() % 2 == 1) { if (floor.size() % 2 == 1) {
xmhxDetail.setPjpm(String.valueOf(floor.get(floor.size() / 2))); xmhxDetail.setPjpm(String.valueOf(floor.get(floor.size() / 2)));
} else { } else {
if(!floor.isEmpty()){
Integer lower = floor.get(floor.size() / 2 - 1); Integer lower = floor.get(floor.size() / 2 - 1);
Integer upper = floor.get(floor.size() / 2); Integer upper = floor.get(floor.size() / 2);
xmhxDetail.setPjpm(String.valueOf((lower + upper) / 2)); xmhxDetail.setPjpm(String.valueOf((lower + upper) / 2));
}else {
xmhxDetail.setPjpm("0");
}
} }
zws.add(xmhxDetail); zws.add(xmhxDetail);
//首层层高 //首层层高
@ -231,6 +245,7 @@ public class XmpjqdServiceImpl extends ServiceImpl<XmpjqdMapper, Xmpjqd> impleme
if (length % 2 == 1) { if (length % 2 == 1) {
xmhxDetail.setPjpm(String.valueOf(bigDecimals.get(middleIndex))); xmhxDetail.setPjpm(String.valueOf(bigDecimals.get(middleIndex)));
} else { } else {
if(!bigDecimals.isEmpty()){
BigDecimal lower = bigDecimals.get(middleIndex - 1); BigDecimal lower = bigDecimals.get(middleIndex - 1);
BigDecimal upper = bigDecimals.get(middleIndex); BigDecimal upper = bigDecimals.get(middleIndex);
xmhxDetail.setPjpm( xmhxDetail.setPjpm(
@ -239,6 +254,9 @@ public class XmpjqdServiceImpl extends ServiceImpl<XmpjqdMapper, Xmpjqd> impleme
.divide(BigDecimal.valueOf(2), 2, RoundingMode.HALF_UP) // 2 表示保留两位小数 .divide(BigDecimal.valueOf(2), 2, RoundingMode.HALF_UP) // 2 表示保留两位小数
) )
); );
}else {
xmhxDetail.setPjpm("0");
}
} }
return xmhxDetail; return xmhxDetail;
} }

@ -33,24 +33,24 @@ public class ZwStatsServiceImpl implements ZwStatsService {
* *
*/ */
@Override @Override
public AllProjectResponse allProject() { public AllProjectResponse allProject(String years) {
return zwStatsMapper.allProject(); return zwStatsMapper.allProject(years);
} }
/** /**
* *
*/ */
@Override @Override
public List<RibbonResponse> ribbon() { public List<RibbonResponse> ribbon(String years) {
return zwStatsMapper.ribbon(); return zwStatsMapper.ribbon(years);
} }
/** /**
* *
*/ */
@Override @Override
public List<RibbonResponse> investors() { public List<RibbonResponse> investors(String years) {
return zwStatsMapper.investors(); return zwStatsMapper.investors(years);
} }
/** /**

@ -5,29 +5,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.gysl.mapper.BasicInformationMapper"> <mapper namespace="com.ruoyi.gysl.mapper.BasicInformationMapper">
<resultMap id="ProjectExcelInfoResult" type="com.ruoyi.gysl.entity.response.ProjectExcelInfo"> <resultMap id="ProjectExcelInfoResult" type="com.ruoyi.gysl.entity.response.ProjectExcelInfo">
<!-- 基础信息字段 -->
<id property="id" column="id"/>
<result property="name" column="name"/> <result property="name" column="name"/>
<result property="xmfrdwxz" column="xmfrdwxz"/> <result property="xmfrdwxz" column="xmfrdwxz"/>
<result property="nature" column="nature"/> <result property="nature" column="nature"/>
<!-- 规划信息字段 --> <result property="xzfl" column="xzfl"/>
<result property="begainTime" column="begain_time"/>
<result property="endTime" column="end_time"/>
<result property="jhtze" column="jhtze"/>
<result property="zydmj" column="zydmj"/> <result property="zydmj" column="zydmj"/>
<result property="rjl" column="rjl"/> <result property="rjl" column="rjl"/>
<result property="zjzmj" column="zjzmj"/> <result property="zjzmj" column="zjzmj"/>
<result property="bzcjzmj" column="bzcjzmj"/> <result property="bzcjzmj" column="bzcjzmj"/>
<!-- 嵌套集合:建筑信息(一对多) --> <result property="prioritize" column="prioritize"/>
<collection <result property="projectLeader" column="project_leader"/>
property="xmjzxx" <result property="phone" column="phone"/>
ofType="com.ruoyi.gysl.entity.response.ProjectBuildingExcel" <result property="jsjd" column="jsjd"/>
javaType="java.util.List"> <result property="jsms" column="jsms"/>
<result property="floor" column="floor"/>
<result property="totalBuildingHeight" column="total_building_height"/>
<result property="scgd" column="scgd"/>
<result property="twoAndFourCg" column="two_and_four_cg"/>
<result property="fourYscg" column="four_yscg"/>
</collection>
</resultMap> </resultMap>
<insert id="insert1" parameterType="BasicInformation"> <insert id="insert1" parameterType="BasicInformation">
insert into copy_gysl_basic_information insert into copy_gysl_basic_information
@ -66,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tyshxydm != null">tyshxydm,</if> <if test="tyshxydm != null">tyshxydm,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="isFmqd != null">is_fmqd,</if> <if test="isFmqd != null">is_fmqd,</if>
<if test="jhtze != null">jhtze,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if> <if test="id != null">#{id},</if>
@ -102,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="tyshxydm != null">#{tyshxydm},</if> <if test="tyshxydm != null">#{tyshxydm},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="isFmqd != null">#{isFmqd},</if> <if test="isFmqd != null">#{isFmqd},</if>
<if test="jhtze != null">#{jhtze},</if>
</trim> </trim>
</insert> </insert>
<insert id="insert2" parameterType="PlanInformation"> <insert id="insert2" parameterType="PlanInformation">
@ -292,29 +291,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectList" resultMap="ProjectExcelInfoResult"> <select id="selectList" resultMap="ProjectExcelInfoResult">
SELECT SELECT
a.id,
a.name,
a.xmfrdwxz, a.xmfrdwxz,
a.nature, a.nature,
a.name,
a.xzfl,
a.begain_time,
a.end_time,
a.jhtze,
a.project_leader,
a.phone,
a.jsjd,
a.jsms,
b.zydmj, b.zydmj,
b.rjl, b.rjl,
b.zjzmj, b.zjzmj,
b.bzcjzmj, b.bzcjzmj,
<!-- 建筑信息字段添加 c_ 前缀 --> a.prioritize
c.floor,
c.total_building_height,
c.scgd,
c.two_and_four_cg,
c.four_yscg
FROM FROM
gysl_basic_information a gysl_basic_information a
LEFT JOIN gysl_plan_information b ON a.id = b.xm_id LEFT JOIN gysl_plan_information b ON a.id = b.xm_id
LEFT JOIN gysl_building_information c ON a.id = c.xm_id
WHERE
a.id IN
<foreach collection="idList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</select> </select>
<select id="page" resultType="com.ruoyi.gysl.entity.BasicInformation"> <select id="page" resultType="com.ruoyi.gysl.entity.BasicInformation">
SELECT a.*,b.zydmj SELECT a.*,b.zydmj

@ -8,18 +8,18 @@
IFNULL(SUM(CASE WHEN a.xzfl = 1 THEN 1 ELSE 0 END), 0) AS allBuilding1, IFNULL(SUM(CASE WHEN a.xzfl = 1 THEN 1 ELSE 0 END), 0) AS allBuilding1,
IFNULL(SUM(CASE WHEN a.xzfl = 2 THEN 1 ELSE 0 END), 0) AS allBuilding2, IFNULL(SUM(CASE WHEN a.xzfl = 2 THEN 1 ELSE 0 END), 0) AS allBuilding2,
IFNULL(SUM(CASE WHEN a.xzfl = 3 THEN 1 ELSE 0 END), 0) AS allBuilding3,-- 当前年度统计 IFNULL(SUM(CASE WHEN a.xzfl = 3 THEN 1 ELSE 0 END), 0) AS allBuilding3,-- 当前年度统计
COUNT(CASE WHEN YEAR ( a.create_time ) = YEAR ( CURRENT_DATE ()) THEN 1 END ) AS currentYearProject, COUNT(CASE WHEN YEAR ( a.begain_time ) = YEAR ( CURRENT_DATE ()) THEN 1 END ) AS currentYearProject,
ROUND( ROUND(
IFNULL(SUM(CASE WHEN YEAR ( a.create_time ) = YEAR ( CURRENT_DATE ()) THEN b.zjzmj END ), 0) / IFNULL(SUM(CASE WHEN YEAR ( a.begain_time ) = YEAR ( CURRENT_DATE ()) THEN b.zjzmj END ), 0) /
10000, 10000,
2 2
) AS currentYearGrossArea, ) AS currentYearGrossArea,
IFNULL( IFNULL(
SUM(CASE WHEN a.xzfl = 1 AND YEAR ( a.create_time ) = YEAR ( CURRENT_DATE ()) THEN 1 ELSE 0 END ), SUM(CASE WHEN a.xzfl = 1 AND YEAR ( a.begain_time ) = YEAR ( CURRENT_DATE ()) THEN 1 ELSE 0 END ),
0 0
) AS currentYearBuilding1, ) AS currentYearBuilding1,
IFNULL( IFNULL(
SUM(CASE WHEN a.xzfl = 2 AND YEAR ( a.create_time ) = YEAR ( CURRENT_DATE ()) THEN 1 ELSE 0 END ), SUM(CASE WHEN a.xzfl = 2 AND YEAR ( a.begain_time ) = YEAR ( CURRENT_DATE ()) THEN 1 ELSE 0 END ),
0 0
) AS currentYearBuilding2 ) AS currentYearBuilding2
FROM gysl_basic_information a FROM gysl_basic_information a

@ -4,35 +4,86 @@
<select id="allProject" resultType="com.ruoyi.gysl.entity.stats.AllProjectResponse"> <select id="allProject" resultType="com.ruoyi.gysl.entity.stats.AllProjectResponse">
SELECT COUNT(*) AS allProject, SELECT COUNT(*) AS allProject,
ROUND(IFNULL(SUM(b.zjzmj), 0) / 10000, 2) AS allGrossArea, ROUND(IFNULL(SUM(b.zjzmj), 0) / 10000, 1) AS allGrossArea,
IFNULL(SUM(CASE WHEN a.xzfl = 1 THEN 1 ELSE 0 END), 0) AS allBuilding1, IFNULL(SUM(CASE WHEN a.xzfl = 1 THEN 1 ELSE 0 END), 0) AS allBuilding1,
IFNULL(SUM(CASE WHEN a.xzfl = 2 THEN 1 ELSE 0 END), 0) AS allBuilding2, IFNULL(SUM(CASE WHEN a.xzfl = 2 THEN 1 ELSE 0 END), 0) AS allBuilding2,
IFNULL(SUM(CASE WHEN a.xzfl = 3 THEN 1 ELSE 0 END), 0) AS allBuilding3,-- 当前年度统计 IFNULL(SUM(CASE WHEN a.xzfl = 3 THEN 1 ELSE 0 END), 0) AS allBuilding3,
COUNT(CASE WHEN YEAR ( a.begain_time ) = YEAR ( CURRENT_DATE ()) THEN 1 END ) AS currentYearProject, <!-- 当前新开工项目数 -->
ROUND( IFNULL(SUM(
IFNULL(SUM(CASE WHEN YEAR ( a.begain_time ) = YEAR ( CURRENT_DATE ()) THEN b.zjzmj END ), 0) / <choose>
10000, <when test="years != null and years != ''">
2 CASE WHEN LEFT(a.begain_time, 4) = #{years} THEN 1 ELSE 0 END
) AS currentYearGrossArea, </when>
IFNULL( <otherwise>
SUM(CASE WHEN a.xzfl = 1 AND YEAR ( a.begain_time ) = YEAR ( CURRENT_DATE ()) THEN 1 ELSE 0 END ), CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) THEN 1 ELSE 0 END
0 </otherwise>
) AS currentYearBuilding1, </choose>
IFNULL( ), 0) AS currentYearProject,
SUM(CASE WHEN a.xzfl = 2 AND YEAR ( a.begain_time ) = YEAR ( CURRENT_DATE ()) THEN 1 ELSE 0 END ), <!-- 当年_建筑面积 -->
0 ROUND(IFNULL(SUM(
) AS currentYearBuilding2 <choose>
<when test="years != null and years != ''">
CASE WHEN LEFT(a.begain_time, 4) = #{years} THEN b.zjzmj ELSE 0 END
</when>
<otherwise>
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) THEN b.zjzmj ELSE 0 END
</otherwise>
</choose>
), 0)/10000,1) AS currentYearGrossArea,
<!-- 当年_已建数量 -->
IFNULL(SUM(
<choose>
<when test="years != null and years != ''">
CASE WHEN LEFT(a.begain_time, 4) = #{years} and a.xzfl = 1 THEN 1 ELSE 0 END
</when>
<otherwise>
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) and a.xzfl = 1 THEN 1 ELSE 0 END
</otherwise>
</choose>
), 0) AS currentYearBuilding1,
<!-- 当年_在建数量 -->
IFNULL(SUM(
<choose>
<when test="years != null and years != ''">
CASE WHEN LEFT(a.begain_time, 4) = #{years} and a.xzfl = 2 THEN 1 ELSE 0 END
</when>
<otherwise>
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) and a.xzfl = 2 THEN 1 ELSE 0 END
</otherwise>
</choose>
), 0) AS currentBuilding2,
<!-- 当年_拟建数量 -->
IFNULL(SUM(
<choose>
<when test="years != null and years != ''">
CASE WHEN LEFT(a.begain_time, 4) = #{years} and a.xzfl = 3 THEN 1 ELSE 0 END
</when>
<otherwise>
CASE WHEN LEFT(a.begain_time, 4) = YEAR(NOW()) and a.xzfl = 3 THEN 1 ELSE 0 END
</otherwise>
</choose>
), 0) AS currentBuilding3
FROM gysl_basic_information a FROM gysl_basic_information a
LEFT JOIN gysl_plan_information b ON a.id = b.xm_id LEFT JOIN gysl_plan_information b ON a.id = b.xm_id
<where>
<if test="years != null and years != ''">
LEFT(a.begain_time, 4) &lt;= #{years}
</if>
</where>
</select> </select>
<select id="ribbon" resultType="com.ruoyi.gysl.entity.stats.RibbonResponse"> <select id="ribbon" resultType="com.ruoyi.gysl.entity.stats.RibbonResponse">
SELECT COUNT(a.ssgnq) AS count, -- 统计左表实际存在的记录数 SELECT COUNT(*) AS count, -- 统计左表实际存在的记录数
b.dict_label AS ssgnq b.dict_label AS ssgnq
FROM FROM
(SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'ssgnq') b -- 先获取所有字典项 (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'ssgnq') b -- 先获取所有字典项
LEFT JOIN LEFT JOIN
gysl_basic_information a gysl_basic_information a
ON a.ssgnq = b.dict_value AND a.ssgnq IS NOT NULL -- 左连接并过滤空值 ON a.ssgnq = b.dict_value AND a.ssgnq IS NOT NULL -- 左连接并过滤空值
<where>
<if test="years != null and years != ''">
LEFT(a.begain_time, 4) = #{years}
</if>
</where>
GROUP BY GROUP BY
b.dict_label, b.dict_value -- 按字典项的标签和值分组 b.dict_label, b.dict_value -- 按字典项的标签和值分组
ORDER BY ORDER BY
@ -40,12 +91,17 @@
</select> </select>
<select id="investors" resultType="com.ruoyi.gysl.entity.stats.RibbonResponse"> <select id="investors" resultType="com.ruoyi.gysl.entity.stats.RibbonResponse">
SELECT SELECT
COUNT( a.ssgnq ) AS count,-- 统计左表实际存在的记录数 COUNT( * ) AS count,-- 统计左表实际存在的记录数
b.dict_label AS ssgnq b.dict_label AS ssgnq
FROM FROM
( SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'xmfrdwxz' ) b -- 先获取所有字典项 ( SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'xmfrdwxz' ) b -- 先获取所有字典项
LEFT JOIN gysl_basic_information a ON a.nature = b.dict_value LEFT JOIN gysl_basic_information a ON a.nature = b.dict_value
AND a.nature IS NOT NULL -- 左连接并过滤空值 AND a.nature IS NOT NULL -- 左连接并过滤空值
<where>
<if test="years != null and years != ''">
LEFT(a.begain_time, 4) = #{years}
</if>
</where>
GROUP BY GROUP BY
b.dict_label, b.dict_label,
b.dict_value -- 按字典项的标签和值分组 b.dict_value -- 按字典项的标签和值分组

@ -475,25 +475,27 @@ public class ExcelUtil<T>
val = Convert.toBigDecimal(val); val = Convert.toBigDecimal(val);
} }
// 新增 LocalDate 类型处理 // 新增 LocalDate 类型处理
else if (fieldType == LocalDate.class) // else if (fieldType == LocalDate.class)
{ // {
if (val instanceof String) // if(val!=null&&val!=""){
{ // if (val instanceof String)
val = LocalDate.parse((String) val, DateTimeFormatter.ofPattern("yyyy-MM-dd")); // {
} // val = LocalDate.parse((String) val, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
else if (val instanceof Long) // }
{ // else if (val instanceof Long)
val = Instant.ofEpochMilli((Long) val) // {
.atZone(ZoneId.systemDefault()) // val = Instant.ofEpochMilli((Long) val)
.toLocalDate(); // .atZone(ZoneId.systemDefault())
} // .toLocalDate();
else if (val instanceof Date) // }
{ // else if (val instanceof Date)
val = ((Date) val).toInstant() // {
.atZone(ZoneId.systemDefault()) // val = ((Date) val).toInstant()
.toLocalDate(); // .atZone(ZoneId.systemDefault())
} // .toLocalDate();
} // }
// }
// }
else if (Date.class == fieldType) else if (Date.class == fieldType)
{ {
if (val instanceof String) if (val instanceof String)

Loading…
Cancel
Save