提交 33d54b3f 作者: 张小凤

OrgBack(update)

上级 bf9aa58c
......@@ -7,10 +7,12 @@ import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;
/**
......@@ -85,4 +87,13 @@ public class LicenseOrganizationsDTO {
@ApiModelProperty(value = "纬度", example = "50.892313123", required = true)
private Double latitude;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间", example = "2023-07-14", required = true)
private Date createTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间", example = "2023-07-14", required = true)
private Date update_time;
}
package com.mmc.csf.licence.qo;
import com.mmc.csf.release.model.group.Freeze;
import com.mmc.csf.release.model.group.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @Author small
* @Date 2023/7/14 16:58
......@@ -47,13 +42,13 @@ public class LicenseOrganizationsQO {
private String region;
@ApiModelProperty(value = "当前页", required = true, example = "1")
@NotNull(message = "当前页不能为空", groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
//@NotNull(message = "当前页不能为空", groups = {Page.class, Freeze.class})
//@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "页大小", required = true, example = "10")
@NotNull(message = "页大小不能为空", groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
// @NotNull(message = "页大小不能为空", groups = {Page.class, Freeze.class})
// @Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
......
......@@ -9,9 +9,11 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
/**
......@@ -83,6 +85,14 @@ public class LicenseOrganizationsDO {
@ApiModelProperty(value = "纬度", example = "50.892313123", required = true)
private Double latitude;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间", example = "2023-07-14", required = true)
private Date createTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间", example = "2023-07-14", required = true)
private Date updateTime;
/**
* VO类转换
*/
......@@ -127,6 +137,8 @@ public class LicenseOrganizationsDO {
.regionName(this.regionName)
.longitude(this.longitude)
.latitude(this.latitude)
.createTime(this.createTime)
.update_time(this.updateTime)
.build();
}
}
......@@ -128,7 +128,6 @@ public class LicenceBackgroundServiceImpl implements LicenceBackgroundService {
}
Integer pageNo = organizationsQO.getPageNo();
organizationsQO.buildCurrentPage();
List<LicenseOrganizationsDO> licenseOrganizationsDOS = licenceBackgroundDao.listOrgPage(organizationsQO);
List<LicenseOrganizationsDTO> orgList = licenseOrganizationsDOS.stream().map(t -> t.organizationsDTO()).collect(Collectors.toList());
//培训项目数据
......@@ -149,11 +148,9 @@ public class LicenceBackgroundServiceImpl implements LicenceBackgroundService {
}
return true;
}).collect(Collectors.toList());
if (collect.size() == 0) {
count = 0;
}
count = collect.size();
return PageResult.buildPage(pageNo, organizationsQO.getPageSize(), count, collect);
List<LicenseOrganizationsDTO> subList = collect.stream().skip((pageNo - 1) * organizationsQO.getPageSize()).limit(organizationsQO.getPageSize()).
collect(Collectors.toList());
return PageResult.buildPage(pageNo, organizationsQO.getPageSize(), subList.size(), subList);
}
......
......@@ -256,7 +256,9 @@
lo.detailed_address AS detailedAddress,
lo.region_name AS regionName,
lo.longitude,
lo.latitude
lo.latitude,
lo.create_time AS createTime,
lo.update_time AS updateTime
FROM license_organizations lo
LEFT JOIN licence_scale ls ON lo.scale_id = ls.id
where 1=1
......@@ -273,9 +275,7 @@
and lo.id =#{id}
</if>
order by lo.id desc
<if test=" pageNo != null and pageNo != '' and pageSize != null and pageSize != '' ">
limit #{pageNo}, #{pageSize}
</if>
</select>
<select id="trainingProgram" resultType="com.mmc.csf.release.entity.licence.LicenseProgramsDO">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论