| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.fzzy.igds.constant.Constant; |
| | | import com.fzzy.igds.constant.RedisConst; |
| | | import com.fzzy.igds.domain.Depot; |
| | | import com.fzzy.igds.domain.DepotConf; |
| | | import com.fzzy.igds.mapper.DepotConfMapper; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | |
| | | |
| | | @Resource |
| | | private DepotConfMapper depotConfMapper; |
| | | @Resource |
| | | private DepotService depotService; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | |
| | |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | |
| | | QueryWrapper<DepotConf> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("company_id", user.getCompanyId()); |
| | | |
| | | |
| | | //监管用户-默认查看所有信息不增加条件 |
| | | if (Constant.USER_TYPE_10.equals(user.getUserType())) { |
| | | queryWrapper.eq("company_id", user.getCompanyId()); |
| | | //不增加条件 |
| | | } |
| | | |
| | | //库区用户,如果是公司用户可以查看公司下属所有库区,如果为当前库区只查询当前库区 |
| | | if (Constant.USER_TYPE_30.equals(user.getUserType())) { |
| | | queryWrapper.eq("company_id", user.getCompanyId()); |
| | | |
| | | if (ContextUtil.isDepotUser(user.getDeptId() + "")) { |
| | | queryWrapper.eq("dept_id", user.getDeptId() + ""); |
| | | } else { |
| | | queryWrapper.likeRight("dept_id", user.getDeptId() + ""); |
| | | } |
| | | } |
| | | |
| | | //银行用户,根据合同查询银行下所有库区 |
| | | if (Constant.USER_TYPE_20.equals(user.getUserType())) { |
| | | |
| | | return this.getDeptByContract(user.getUserData()); |
| | | if(StringUtils.isBlank(user.getUserData())) return null; |
| | | |
| | | queryWrapper.eq("d.company_id", user.getCompanyId()); |
| | | queryWrapper.eq("c.pledge_bank", user.getUserData()); |
| | | return depotConfMapper.selectByBank(queryWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | return null; |
| | | } |
| | | |
| | | private List<DepotConf> getDeptByContract(String userData) { |
| | | |
| | | //TODO |
| | | return null; |
| | | return depotConfMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | /** |