| | |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.constant.FillRuleConstant; |
| | | import org.jeecg.common.system.vo.DictModel; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.FillRuleUtil; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.system.entity.*; |
| | |
| | | @Override |
| | | public List<MdcProductionTreeModel> queryTreeListByConfig(){ |
| | | SysParams sysParams = sysParamsService.getSysPramBySettingKey("dnc_production"); |
| | | LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | LambdaQueryWrapper<MdcProduction> query = new LambdaQueryWrapper<MdcProduction>(); |
| | | if (sysParams == null) { |
| | | return null; |
| | | }else { |
| | | List<String> productionIds = new ArrayList<>(); |
| | | if (!("admin").equals(loginUser.getUsername())) { |
| | | //不是超级管理员,获取用户拥有的产线 |
| | | if (loginUser.getProductionIds() != null) { |
| | | if (loginUser.getProductionIds().contains(",")) { |
| | | productionIds = Arrays.asList(loginUser.getProductionIds().split(",")); |
| | | } else { |
| | | productionIds = Collections.singletonList(loginUser.getProductionIds()); |
| | | } |
| | | } |
| | | } |
| | | if (("0").equals(sysParams.getSettingValue())){ |
| | | query.eq(MdcProduction::getOrgType,"2"); |
| | | query.in(!productionIds.isEmpty(), MdcProduction::getId, productionIds); |
| | | query.eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString()); |
| | | query.orderByAsc(MdcProduction::getProductionOrder); |
| | | List<MdcProduction> list = this.list(query); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<MdcProduction> findMdcPros(String userId, String productionId) { |
| | | return this.baseMapper.loadProductionOptions(userId, productionId); |
| | | } |
| | | |
| | | @Override |
| | | public List<MdcProOptionsVo> loadTeamOptions(String userId, String productionId) { |
| | | List<MdcProOptionsVo> result = new ArrayList<>(); |
| | | List<String> productionList = this.findChildren(Arrays.asList(productionId.split(","))); |
| | |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> findProIdsByUId(String userId, List<String> allProductionIds) { |
| | | return this.baseMapper.findProIdsByUId(userId, allProductionIds); |
| | | } |
| | | |
| | | /** |
| | |
| | | super.update(updateWrapper); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<String> findChildByProId(String productionId) { |
| | | return this.baseMapper.findChildByProId(productionId); |
| | | } |
| | | |
| | | @Override |
| | | public String findProName(String equipmentId) { |
| | | return this.baseMapper.findProName(equipmentId); |
| | | } |
| | | } |