|
@@ -3,6 +3,7 @@ package com.huimv.guowei.admin.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -87,7 +88,7 @@ public class BaseBuildingServiceImpl extends ServiceImpl<BaseBuildingMapper, Bas
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- @Transactional
|
|
|
+// @Transactional
|
|
|
public Result updateBuilding(BaseBuilding baseBuilding) {
|
|
|
Integer cageNum = baseBuildingMapper.selectById(baseBuilding).getCageNum();
|
|
|
if (cageNum > baseBuilding.getCageNum()){
|
|
@@ -109,15 +110,13 @@ public class BaseBuildingServiceImpl extends ServiceImpl<BaseBuildingMapper, Bas
|
|
|
baseDuckInfoMapper.updateById(baseDuckInfo);
|
|
|
}
|
|
|
}
|
|
|
- List<GroupDuckInfo> groupDuckInfos = duckInfoMapper.selectList(new QueryWrapper<GroupDuckInfo>().eq("unit_id", building.getId()));
|
|
|
- if (groupDuckInfos.size() != 0) {
|
|
|
- for (GroupDuckInfo groupDuckInfo : groupDuckInfos) {
|
|
|
- groupDuckInfo.setUnitName(baseBuilding.getBuildName());
|
|
|
- duckInfoMapper.updateById(groupDuckInfo);
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ GroupDuckInfo groupDuckInfo = new GroupDuckInfo();
|
|
|
+ groupDuckInfo.setUnitName(baseBuilding.getBuildName());
|
|
|
+ duckInfoMapper.update(groupDuckInfo ,new UpdateWrapper<GroupDuckInfo>().eq("unit_id",id));
|
|
|
+
|
|
|
for (int i = cageNum+1; i <= baseBuilding.getCageNum(); i++) {
|
|
|
BaseBuilding building = new BaseBuilding();
|
|
|
building.setBuildName(baseBuilding.getBuildName()+i+"笼");
|