| | |
| | | params, |
| | | }); |
| | | } |
| | | |
| | | // 机构新增 |
| | | export function addTenant(data) { |
| | | return request({ |
| | | url: '/pc/fin/sys/tenant/add', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | // 机构编辑 |
| | | export function editTenant(data) { |
| | | return request({ |
| | | url: '/pc/fin/sys/tenant/edit', |
| | | method: 'post', |
| | | data: data |
| | | }); |
| | | } |
| | | |
| | |
| | | import winSm from '@/components/win/win-sm' |
| | | import myButton from '@/components/myButton/myButton' |
| | | import * as finsystenant from '@/api/baseSetting/finsystenant' |
| | | import {addTenant, editTenant} from "@/api/baseSetting/finsystenant"; |
| | | |
| | | export default { |
| | | components: {winSm, myButton}, |
| | |
| | | name: '', |
| | | status: 1, |
| | | summary: '', |
| | | parentId: '', |
| | | }, |
| | | rules: { |
| | | code: [ |
| | |
| | | const params = Object.assign({}, this.formData) |
| | | if(this.setting.id){ |
| | | // 编辑接口 |
| | | finsystenant.edit(params).then(res => { |
| | | finsystenant.editTenant(params).then(res => { |
| | | if (res) { |
| | | this.$message.success('保存成功!') |
| | | this.close() |
| | |
| | | } |
| | | }) |
| | | }else{ |
| | | params.orgId = this.setting.orgId |
| | | finsystenant.add(params).then(res => { |
| | | params.parentId = this.setting.orgId |
| | | finsystenant.addTenant(params).then(res => { |
| | | if (res) { |
| | | this.$message.success('保存成功!') |
| | | this.close() |
| | |
| | | |
| | | int addFinSysTenant(FinSysTenantParam param, FinSysTenantUser sysInfo, int lv); |
| | | |
| | | void setLvIdAndName(FinSysTenantParam param, FinSysTenant finSysTenant, long id, int lv); |
| | | |
| | | void insertFinSysTenantBatch(List<FinSysTenantParam> params, FinSysTenantUser sysInfo, int lv); |
| | | |
| | | int updateFinSysTenant(FinSysTenant finSysTenant, FinSysTenantUser sysInfo); |
| | |
| | | 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); |