| | |
| | | package com.ruoyi.management.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.management.domain.*; |
| | | import com.ruoyi.management.domain.dto.SupplierVolumeProductionRkglQuery; |
| | |
| | | import com.ruoyi.system.api.domain.getVolumeProductionRkQuery; |
| | | import com.ruoyi.system.api.feignClient.LogClient; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | v.setReason(byId.getReasonsRefusal()); |
| | | return v; |
| | | } |
| | | |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | @Override |
| | | public PageDTO<SupplierVolumeProductionRkglVO> getslVolumeProductionRkglList(getVolumeProductionRkQuery getVolumeProductionRkQuery) { |
| | | Page<SlVolumeProductionRkgl> page = new Page<>(getVolumeProductionRkQuery.getPageCurr(), getVolumeProductionRkQuery.getPageSize()); |
| | | |
| | | List<SysUser> data1 = sysUserClient.getUserSupplierList(getVolumeProductionRkQuery).getData(); |
| | | Set<Long> goodsSkuIdList = null; |
| | | List<Long> managementIds = new ArrayList<>(); |
| | | goodsSkuIdList = data1.stream().map(SysUser::getUserId) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser data2 = sysUserClient.getSysUser(userid).getData(); |
| | | LambdaQueryWrapper< SlVolumeProductionRkgl> wrapper1= Wrappers.lambdaQuery(); |
| | | QueryWrapper<SlStoreManagement> storeManagementGrade = new QueryWrapper<SlStoreManagement>() |
| | | .eq("del_flag", "0"); |
| | | if (data2!=null){ |
| | | if (!data2.getUserType().equals("00")){ |
| | | // 仓库管理员 根据仓库管理员的等级查询对应的仓库 |
| | | switch (data2.getRoleType()){ |
| | | case 3: |
| | | storeManagementGrade.ge("store_management_grade",3); |
| | | managementIds = slStoreManagementMapper.selectList(storeManagementGrade).stream() |
| | | .map(SlStoreManagement::getId).collect(Collectors.toList()); |
| | | break; |
| | | case 4: |
| | | storeManagementGrade.ge("store_management_grade",4); |
| | | managementIds = slStoreManagementMapper.selectList(storeManagementGrade).stream() |
| | | .map(SlStoreManagement::getId).collect(Collectors.toList()); |
| | | break; |
| | | case 5: |
| | | storeManagementGrade.ge("store_management_grade",5); |
| | | managementIds = slStoreManagementMapper.selectList(storeManagementGrade).stream() |
| | | .map(SlStoreManagement::getId).collect(Collectors.toList()); |
| | | break; |
| | | case 6: |
| | | storeManagementGrade.eq("store_management_grade",6); |
| | | managementIds = slStoreManagementMapper.selectList(storeManagementGrade).stream() |
| | | .map(SlStoreManagement::getId).collect(Collectors.toList()); |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | if (!managementIds.isEmpty()){ |
| | | wrapper1.in(SlVolumeProductionRkgl::getManagementId,managementIds); |
| | | } |
| | | if (getVolumeProductionRkQuery.getPresentState()!=null && getVolumeProductionRkQuery.getPresentState()!=0){ |
| | | wrapper1.eq(SlVolumeProductionRkgl::getPresentState,getVolumeProductionRkQuery.getPresentState()); |
| | | } |
| | |
| | | slVolumeProductionRkgl.setPresentState(3); |
| | | } |
| | | if (list3.contains(userid.toString())){ |
| | | slVolumeProductionRkgl.setAuditStatus(1); |
| | | slVolumeProductionRkgl.setAuditStatus(3); |
| | | slVolumeProductionRkgl.setPresentState(4); |
| | | } |
| | | |
| | | this.save(slVolumeProductionRkgl); |
| | | }else{ |
| | | slVolumeProductionRkgl = this.getById(volumeProductionRkglDTO.getId()); |
| | |
| | | slVolumeProductionRkgl.setPresentState(3); |
| | | } |
| | | if (list3.contains(userid.toString())){ |
| | | slVolumeProductionRkgl.setAuditStatus(1); |
| | | slVolumeProductionRkgl.setAuditStatus(3); |
| | | slVolumeProductionRkgl.setPresentState(4); |
| | | } |
| | | this.updateById(slVolumeProductionRkgl); |