Commit c1344fb2 authored by KeYong's avatar KeYong

更新

parent 5209a24b
package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -339,6 +340,17 @@ public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IA
public Object updateArea(AreaResquest areaResquest) {
// 更新基础数据
Area areaOld = this.baseMapper.selectById(areaResquest.getId());
String bizOrgCode = areaResquest.getBizOrgCode();
if (StringUtil.isNotEmpty(areaOld.getBizOrgCode()) && !areaOld.getBizOrgCode().equals(bizOrgCode)) {
LambdaQueryWrapper<Area> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Area::getParentId, areaOld.getId());
List<Area> list = this.baseMapper.selectList(queryWrapper);
for (Area area : list) {
area.setBizOrgCode(areaResquest.getBizOrgCode());
area.setBizOrgName(areaResquest.getBizOrgName());
this.baseMapper.updateById(area);
}
}
Area area = new Area();
Bean.copyExistPropertis(areaResquest, area);
boolean flag = this.updateById(area);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment