|
@@ -7,6 +7,9 @@ import com.ruoyi.business.domain.BizDevice;
|
|
|
import com.ruoyi.business.mapper.BizDeviceMapper;
|
|
|
import com.ruoyi.business.mapper.SysRegionMapper;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.common.utils.SecurityUtils;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
+import com.ruoyi.system.mapper.SysUserMapper;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -32,6 +35,9 @@ public class TOrganizationServiceImpl implements ITOrganizationService
|
|
|
@Autowired
|
|
|
private SysRegionMapper sysRegionMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SysUserMapper sysUserMapper;
|
|
|
+
|
|
|
/**
|
|
|
* 查询机构管理
|
|
|
*
|
|
@@ -60,6 +66,14 @@ public class TOrganizationServiceImpl implements ITOrganizationService
|
|
|
organization.setProvinceName(this.sysRegionMapper.selectNameByCode(organization.getProvinceCode()));
|
|
|
organization.setCityName(this.sysRegionMapper.selectNameByCode(organization.getCityCode()));
|
|
|
organization.setCountryName(this.sysRegionMapper.selectNameByCode(organization.getCountryCode()));
|
|
|
+ //2025年03月13日11:16:04 额外返回创建人和编辑人对象
|
|
|
+ String createBy = organization.getCreateBy();
|
|
|
+ String updateBy = organization.getUpdateBy();
|
|
|
+ if(StringUtils.isNotBlank(createBy))
|
|
|
+ organization.setCreateUser(this.sysUserMapper.selectUserById(Long.valueOf(createBy)));
|
|
|
+ if(StringUtils.isNotBlank(updateBy))
|
|
|
+ organization.setUpdateUser(this.sysUserMapper.selectUserById(Long.valueOf(updateBy)));
|
|
|
+
|
|
|
|
|
|
//如果是集团,获取下面的所有的水厂列表
|
|
|
Integer type = organization.getType();
|
|
@@ -74,6 +88,13 @@ public class TOrganizationServiceImpl implements ITOrganizationService
|
|
|
tOrganization.setProvinceName(this.sysRegionMapper.selectNameByCode(tOrganization.getProvinceCode()));
|
|
|
tOrganization.setCityName(this.sysRegionMapper.selectNameByCode(tOrganization.getCityCode()));
|
|
|
tOrganization.setCountryName(this.sysRegionMapper.selectNameByCode(tOrganization.getCountryCode()));
|
|
|
+ //2025年03月13日11:16:04 额外返回创建人和编辑人对象
|
|
|
+ createBy = tOrganization.getCreateBy();
|
|
|
+ updateBy = tOrganization.getUpdateBy();
|
|
|
+ if(StringUtils.isNotBlank(createBy))
|
|
|
+ tOrganization.setCreateUser(this.sysUserMapper.selectUserById(Long.valueOf(createBy)));
|
|
|
+ if(StringUtils.isNotBlank(updateBy))
|
|
|
+ tOrganization.setUpdateUser(this.sysUserMapper.selectUserById(Long.valueOf(updateBy)));
|
|
|
}
|
|
|
}
|
|
|
organization.setChildren(tOrganizations);
|
|
@@ -108,6 +129,8 @@ public class TOrganizationServiceImpl implements ITOrganizationService
|
|
|
public int insertTOrganization(TOrganization tOrganization)
|
|
|
{
|
|
|
tOrganization.setCreateTime(DateUtils.getNowDate());
|
|
|
+ //存放的是用户ID
|
|
|
+ tOrganization.setCreateBy(String.valueOf(SecurityUtils.getUserId()));
|
|
|
return tOrganizationMapper.insertTOrganization(tOrganization);
|
|
|
}
|
|
|
|
|
@@ -121,6 +144,8 @@ public class TOrganizationServiceImpl implements ITOrganizationService
|
|
|
public int updateTOrganization(TOrganization tOrganization)
|
|
|
{
|
|
|
tOrganization.setUpdateTime(DateUtils.getNowDate());
|
|
|
+ //存放的是用户ID
|
|
|
+ tOrganization.setUpdateBy(String.valueOf(SecurityUtils.getUserId()));
|
|
|
return tOrganizationMapper.updateTOrganization(tOrganization);
|
|
|
}
|
|
|
|