cy
2023-12-08 25b639f34bd7e80a69cdb5b46b2d082c1590d033
consum-base/src/main/java/com/consum/base/service/impl/BaseWarehouseManagerServiceImpl.java
@@ -10,12 +10,13 @@
import com.iplatform.model.po.S_role;
import com.walker.infrastructure.utils.CollectionUtils;
import com.walker.jdbc.service.BaseServiceImpl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @Description 物品分类
@@ -85,11 +86,17 @@
                baseWarehouseManager.setManagerName(managerName);
                this.insert(baseWarehouseManager);
                FinSysTenantUser finSysTenantUser = finSysTenantUserService.queryOneById(String.valueOf(managerId));
                FinSysTenantUser finSysTenantUser = finSysTenantUserService.queryOneBySysId(String.valueOf(managerId));
                if (finSysTenantUser == null) {
                    throw new Exception("用户不存在");
                }
                Long sysUserId = finSysTenantUser.getSysUserId();
                // 先判断是否拥有该角色
                String isHasRole = "select count(1) from s_role_user where org_id=0 and role_id=" + roleId + " and user_id=" + sysUserId;
                List<Map<String, Object>> isHasRoleList = this.select(isHasRole, new HashMap<>());
                if (!CollectionUtils.isEmpty(isHasRoleList)) {
                    continue;
                }
                String saveUserRole = "insert into s_role_user(user_id, role_id, org_id) values(:managerId,:roleId,0)";
                Map<String, Object> userRoleParam = new HashMap<>();
                userRoleParam.put("managerId", sysUserId);
@@ -112,7 +119,7 @@
    @Override
    public List<BaseWarehouseManager> selectManagerList(Long warehouseId, Long agencyId) {
        StringBuilder sql = new StringBuilder("select * from base_warehouse_manager bwm left join base_warehouse bw on bwm.base_warehouse_id = bw.id "
            + "where 1=1 ");
                + "where 1=1 ");
        Map<String, Object> param = new HashMap<>();
        if (warehouseId != null) {
            param.put("warehouseId", warehouseId);