From 11e6a2de930e889047e1bbd1d5eedc9f16e862bc Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Fri, 24 Nov 2023 11:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E9=80=9F=E5=BB=BA=E6=88=BF=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=80=BB=E8=BE=91=20=20--renpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pojo/dtos/house/AutoHouseDTO.java | 10 ++++++ .../service/house/impl/HouseServiceImpl.java | 11 +++++-- .../resources/templates/house/save-quick.html | 32 ++++++++++++++++++- 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/cm/population/pojo/dtos/house/AutoHouseDTO.java b/src/main/java/com/cm/population/pojo/dtos/house/AutoHouseDTO.java index fc47bf8..b0f1ddc 100644 --- a/src/main/java/com/cm/population/pojo/dtos/house/AutoHouseDTO.java +++ b/src/main/java/com/cm/population/pojo/dtos/house/AutoHouseDTO.java @@ -23,6 +23,8 @@ public class AutoHouseDTO { private Integer appointNum; @ApiModelProperty(name = "sortType", value = "排序类型:1:重复排序;2:连续排序") private Integer sortType; + @ApiModelProperty(name = "startNum", value = "起始编号") + private Integer startNum; public String getBuildingId() { return buildingId; @@ -55,4 +57,12 @@ public class AutoHouseDTO { public void setSortType(Integer sortType) { this.sortType = sortType; } + + public Integer getStartNum() { + return startNum; + } + + public void setStartNum(Integer startNum) { + this.startNum = startNum; + } } diff --git a/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java b/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java index ac6ee18..15c2cfe 100644 --- a/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java +++ b/src/main/java/com/cm/population/service/house/impl/HouseServiceImpl.java @@ -412,14 +412,16 @@ public class HouseServiceImpl extends AbstractService implements IHouseService { // 指定单元数 Integer appointNum = autoHouseDTO.getAppointNum(); + Integer startNum = autoHouseDTO.getStartNum(); + // 排序类型 int sortType = autoHouseDTO.getSortType(); if (null != appointNum) { hasUnit(sortType, appointNum, floorsNum, houseCount, - buildingDTO, appointNum, houseVOList); + buildingDTO, appointNum, startNum, houseVOList); } else { hasUnit(sortType, 1, floorsNum, houseCount, - buildingDTO, unitNum, houseVOList); + buildingDTO, unitNum, startNum, houseVOList); } @@ -504,11 +506,14 @@ public class HouseServiceImpl extends AbstractService implements IHouseService { * @param houseVOList */ private void hasUnit(int sortType, int forNum, int floorsNum, int houseCount, - BuildingDTO buildingDTO, int unitNum, List houseVOList) { + BuildingDTO buildingDTO, int unitNum, Integer startNum, List houseVOList) { String houseNum = ""; for (int floor = 1; floor <= floorsNum; floor++) { int flagNum = 0; + if (null != startNum) { + flagNum = startNum - 1; + } for (int unit = forNum; unit <= unitNum; unit++) { for (int house = 1; house <= houseCount; house++) { if (1 == sortType) { diff --git a/src/main/resources/templates/house/save-quick.html b/src/main/resources/templates/house/save-quick.html index c3a4e2c..1dc0ba4 100644 --- a/src/main/resources/templates/house/save-quick.html +++ b/src/main/resources/templates/house/save-quick.html @@ -35,12 +35,25 @@
- +
+
@@ -67,12 +80,29 @@ var laydate = layui.laydate; var buildingId = top.restAjax.params(window.location.href).buildingId; + form.on('radio(sortType)', function(data){ + //data.value为当前radio的value值,即value属性值 + if(data.value == 2) { + $('#startNumDiv').show(); + }else { + $('#startNumDiv').hide(); + } + }); + function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); } // 提交表单 form.on('submit(submitForm)', function(formData) { + var sortType = $('input[name=sortType]:checked').val(); + if(2 == sortType) { + var startNum = $('#startNum').val(); + if(!startNum) { + top.dialog.msg('起始号码不能为空'); + return false; + } + } top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex;