gongzuming
2024-09-11 433f3631e70c86714ec7f0ce7a740050a51e6944
质检是否有总仓权限
已修改3个文件
12 ■■■■■ 文件已修改
src/main/java/com/mzl/flower/dto/response/current/CurrentUserDTO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/supplier/StationService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/system/UserService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/dto/response/current/CurrentUserDTO.java
@@ -53,4 +53,7 @@
    @ApiModelProperty(value = "当前积分")
    private Integer currentPoint;
    @ApiModelProperty(value = "是否总仓权限")
    private Boolean mainWarehouse;
}
src/main/java/com/mzl/flower/service/supplier/StationService.java
@@ -96,4 +96,8 @@
        List<StationDTO> list = stationMapper.queryList( name);
        return list;
    }
    public Boolean getMainWarehouse(String userId) {
        return stationMapper.selectCount(new LambdaQueryWrapper<Station>().like(Station::getUserIds, userId))>0;
    }
}
src/main/java/com/mzl/flower/service/system/UserService.java
@@ -21,6 +21,7 @@
import com.mzl.flower.service.customer.CustomerService;
import com.mzl.flower.service.partner.PartnerService;
import com.mzl.flower.service.point.CustomerPointService;
import com.mzl.flower.service.supplier.StationService;
import com.mzl.flower.service.supplier.SupplierService;
import com.mzl.flower.utils.TreeBuilderUtil;
import com.mzl.flower.utils.UUIDGenerator;
@@ -79,6 +80,8 @@
    @Autowired
    private CustomerPointMapper customerPointMapper;
    @Autowired
    private StationService stationService;
    public User findUserByOpenId(String openId, String sessionKey, String unionId
@@ -208,6 +211,8 @@
            result.setSupplierDTO(supplierService.getCurrentSupplier());
        }else if(Constants.USER_TYPE.partner.name().equals(user.getType())){
            result.setPartnerDTO(partnerService.getCurrentPartner());
        }else if (Constants.USER_TYPE.admin.name().equals(user.getType())){
            result.setMainWarehouse(stationService.getMainWarehouse(user.getId()));
        }
        result.setBindWechat(wechatMapper.selectCount(new LambdaQueryWrapper<UserWechat>()
                .eq(UserWechat::getUserId, userId)) > 0);