快速建房新增逻辑 --renpc
This commit is contained in:
parent
fe65dc6801
commit
11e6a2de93
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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<HouseVO> houseVOList) {
|
||||
BuildingDTO buildingDTO, int unitNum, Integer startNum, List<HouseVO> 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) {
|
||||
|
@ -35,12 +35,25 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" pane>
|
||||
<label class="layui-form-label" style="width: 140px;">排序类型</label>
|
||||
<label class="layui-form-label">排序类型</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="sortType" lay-filter="sortType" value="1" title="重复排序" checked>
|
||||
<input type="radio" name="sortType" lay-filter="sortType" value="2" title="连续排序">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" id="startNumDiv" style="display: none;">
|
||||
<span style="color: red;font-size:14px;">*起始号码填入内容为:让您的录入房号从几开始。
|
||||
比如说,你想让房号从3开始,那么你就填入3,
|
||||
房号就会是103,104,105....
|
||||
203,204,205....
|
||||
303,304,305....
|
||||
</span>
|
||||
<br/>
|
||||
<label class="layui-form-label" style="width: 140px;">起始号码</label>
|
||||
<div class="layui-input-block" style="margin-left: 140px;">
|
||||
<input type="number" id="startNum" name="startNum" class="layui-input" value="" step="1" placeholder="请输入起始号码">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-layout-admin">
|
||||
<div class="layui-input-block">
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user