提交 33d54b3f 作者: 张小凤

OrgBack(update)

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