| | |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | |
| | | @Service |
| | | public class FinSysTenantServiceImpl extends BaseServiceImpl implements FinSysTenantService { |
| | | |
| | |
| | | |
| | | List<Map<String, Object>> list = this.select(sql.toString(), paramts); |
| | | long id = 0L; |
| | | if (!CollectionUtils.isEmpty(list) && list.get(0).get("max(id)") != null) { |
| | | if (!CollectionUtils.isEmpty(list)) { |
| | | id = (Long)list.get(0).get("max(id)") + 1; |
| | | } else { |
| | | id = param.getParentId() * 1000 + 1; |
| | |
| | | finSysTenant.setCode(param.getCode()); |
| | | // 设置详细地址及经纬度 |
| | | finSysTenant.setName(param.getName()); |
| | | finSysTenant.setCreateTime3(DateUtils.getDate("yyyy-MM-dd HH:mm:ss")); |
| | | finSysTenant.setCreateTime3(DateUtil.date()); |
| | | finSysTenant.setCreateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | finSysTenant.setSummary(param.getSummary()); |
| | | finSysTenant.setCreateBy(sysInfo.getUserName()); |
| | |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/4 |
| | | */ |
| | | @Override |
| | | public void setLvIdAndName(FinSysTenantParam param, FinSysTenant finSysTenant, long id, int lv) { |
| | | if (lv == 2) { // 新增市级机构 |
| | | // 查询上一级 - 省级 |
| | |
| | | } else { |
| | | finSysTenant.setLv3Name(finSysTenant.getName()); |
| | | } |
| | | finSysTenant.setModified(DateUtils.getDate("yyyy-MM-dd HH:mm:ss")); |
| | | finSysTenant.setModified(DateUtil.date()); |
| | | finSysTenant.setUpdateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | finSysTenant.setUpdateBy(sysInfo.getUserName()); |
| | | return this.update(finSysTenant); |
| | |
| | | tenant.setName(tenantName); |
| | | return this.select(tenant).stream().findFirst().orElse(null); |
| | | } |
| | | |
| | | @Override |
| | | public FinSysTenant selectByNameAndPid(Long pid, String tenantName) { |
| | | FinSysTenant tenant = new FinSysTenant(); |
| | | tenant.setName(tenantName); |
| | | tenant.setParentId(pid); |
| | | return this.select(tenant).stream().findFirst().orElse(null); |
| | | } |
| | | |
| | | @Override |
| | | public FinSysTenant selectByNameAndPid100(Long pid, String tenantName) { |
| | | FinSysTenant tenant = new FinSysTenant(); |
| | | tenant.setName(tenantName); |
| | | tenant.setParentId(100L); |
| | | return this.select(tenant).stream().findFirst().orElse(null); |
| | | } |
| | | |
| | | @Override |
| | | public FinSysTenant selectByNameAndPid0(Long pid, String tenantName) { |
| | | FinSysTenant tenant = new FinSysTenant(); |
| | | tenant.setName(tenantName); |
| | | tenant.setParentId(0L); |
| | | return this.select(tenant).stream().findFirst().orElse(null); |
| | | } |
| | | } |