|
@@ -238,11 +238,16 @@ public class BerthingServiceImpl implements BerthingService {
|
|
|
if (count > 0){
|
|
|
throw new BaseException("起测水位已存在");
|
|
|
}
|
|
|
+ BerthingPointConfig maxPlanid = berthingPointConfigMapper.queryMaxPlanid(berthingPointConfigDTO.getSiteId());
|
|
|
+ if (maxPlanid == null) {
|
|
|
+ maxPlanid = new BerthingPointConfig();
|
|
|
+ maxPlanid.setPlanid(1L);
|
|
|
+ }
|
|
|
berthingPointConfig.setStopId(0L);
|
|
|
berthingPointConfig.setSiteId(siteInfo.getSiteId());
|
|
|
berthingPointConfig.setBerthingId(berthingPoint.getBerthingId());
|
|
|
berthingPointConfig.setPositions(JSONUtil.toJsonStr(positions));
|
|
|
- berthingPointConfig.setPlanid(0L);
|
|
|
+ berthingPointConfig.setPlanid(maxPlanid.getPlanid() + 1);
|
|
|
berthingPointConfig.setWlevel(berthingPointConfigDTO.getWlevel());
|
|
|
berthingPointConfig.setFactors(JSONUtil.toJsonStr(berthingPointConfigDTO.getFactors()));
|
|
|
berthingPointConfig.setCreateTime(new Date());
|
|
@@ -256,7 +261,6 @@ public class BerthingServiceImpl implements BerthingService {
|
|
|
berthingPointConfigMapper.update(berthingPointConfig);
|
|
|
berthingPointConfig.setStopId(0L);
|
|
|
berthingPointConfig.setPositions(JSONUtil.toJsonStr(positions));
|
|
|
- berthingPointConfig.setPlanid(0L);
|
|
|
berthingPointConfig.setWlevel(berthingPointConfigDTO.getWlevel());
|
|
|
berthingPointConfig.setFactors(JSONUtil.toJsonStr(berthingPointConfigDTO.getFactors()));
|
|
|
res = berthingPointConfigMapper.insert(berthingPointConfig) > 0;
|