diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 0aa82fb..541a7a7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -1,9 +1,15 @@ package com.ruoyi.system.service.impl; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; import javax.validation.Validator; + +import com.ruoyi.business.domain.BusAgentInfo; +import com.ruoyi.business.mapper.BusAgentInfoMapper; +import com.ruoyi.business.service.IBusAgentInfoService; +import com.ruoyi.common.core.domain.model.LoginUser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -65,6 +71,9 @@ public class SysUserServiceImpl implements ISysUserService @Autowired protected Validator validator; + @Autowired + private BusAgentInfoMapper busAgentInfoMapper; + /** * 根据条件分页查询用户列表 * @@ -266,6 +275,19 @@ public class SysUserServiceImpl implements ISysUserService insertUserPost(user); // 新增用户与角色管理 insertUserRole(user); + if(user.getRoleIds()[0]==100L){ + LoginUser loginUser = SecurityUtils.getLoginUser(); + BusAgentInfo busAgentInfo = new BusAgentInfo(); + busAgentInfo.setId(user.getUserId()); + busAgentInfo.setAgentAccount(user.getUserName()); + busAgentInfo.setAgentName(user.getNickName()); + busAgentInfo.setSuperiorAgentCode(loginUser.getUserId()); + busAgentInfo.setSuperiorAgentAccount(loginUser.getUsername()); + busAgentInfo.setDelStatus("1"); + busAgentInfo.setIntegral("0"); + busAgentInfo.setCreateTime(new Date()); + busAgentInfoMapper.insertBusAgentInfo(busAgentInfo); + } return rows; } @@ -471,6 +493,12 @@ public class SysUserServiceImpl implements ISysUserService userRoleMapper.deleteUserRole(userIds); // 删除用户与岗位关联 userPostMapper.deleteUserPost(userIds); + if(userIds.length==1){ + BusAgentInfo busAgentInfo = new BusAgentInfo(); + busAgentInfo.setId(userIds[0]); + busAgentInfo.setDelStatus("2"); + busAgentInfoMapper.updateBusAgentInfo(busAgentInfo); + } return userMapper.deleteUserByIds(userIds); } diff --git a/ruoyi-ui/src/api/business/store.js b/ruoyi-ui/src/api/business/store.js index 8251bf4..ec03cf7 100644 --- a/ruoyi-ui/src/api/business/store.js +++ b/ruoyi-ui/src/api/business/store.js @@ -61,3 +61,10 @@ export function updateStoreConfig(data) { data: data }) } + +export function refresh(){ + return request({ + url: '/business/store/saveOrUpdate', + method: 'get' + }) +} \ No newline at end of file diff --git a/ruoyi-ui/src/views/agent/list/index.vue b/ruoyi-ui/src/views/agent/list/index.vue index 32e9573..8bcfc32 100644 --- a/ruoyi-ui/src/views/agent/list/index.vue +++ b/ruoyi-ui/src/views/agent/list/index.vue @@ -186,17 +186,7 @@ export default { pageSize: 10, agentAccount: null, agentName: null, - superiorAgentCode: null, - superiorAgentAccount: null, - grantStoreNum: null, - operateStoreNum: null, - lastUseIntegralNum: null, - lastPositiveReviewsNum: null, - aiDurationBalance: null, - lastLoginTime: null, - lastLoginIp: null, - loginNum: null, - delStatus: null + delStatus: "1" }, // 表单参数 form: {}, diff --git a/ruoyi-ui/src/views/market/whole/index.vue b/ruoyi-ui/src/views/market/whole/index.vue index 5fa2015..7b2581c 100644 --- a/ruoyi-ui/src/views/market/whole/index.vue +++ b/ruoyi-ui/src/views/market/whole/index.vue @@ -128,6 +128,15 @@ + + + 一键同步 -import { listStore, changeReturnVisitStatus, getMtUrl, changeSelfDeliveryStatus, getStoreConfig, updateStoreConfig} from "@/api/business/store"; +import { listStore, changeReturnVisitStatus, getMtUrl, changeSelfDeliveryStatus, getStoreConfig, updateStoreConfig, refresh} from "@/api/business/store"; import { listSaleA} from "@/api/business/sale"; export default { @@ -557,6 +566,11 @@ export default { // this.open = true; // this.title = "添加角色"; }, + async handleRefresh(){ + await refresh().then(response => { + this.handleQuery(); + }) + }, /** 修改按钮操作 */ handleUpdate(row) { this.reset(); diff --git a/ruoyi-ui/src/views/system/user/index.vue b/ruoyi-ui/src/views/system/user/index.vue index 26c05d5..af43851 100644 --- a/ruoyi-ui/src/views/system/user/index.vue +++ b/ruoyi-ui/src/views/system/user/index.vue @@ -141,7 +141,7 @@ - +