| | |
| | | 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.LoginUser; |
| | | import org.jeecg.common.util.FillRuleUtil; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.system.entity.*; |
| | | import org.jeecg.modules.system.mapper.*; |
| | | import org.jeecg.modules.system.mapper.MdcProductionEquipmentMapper; |
| | | import org.jeecg.modules.system.mapper.MdcProductionMapper; |
| | | import org.jeecg.modules.system.mapper.MdcUserProductionMapper; |
| | | import org.jeecg.modules.system.mapper.SysUserMapper; |
| | | import org.jeecg.modules.system.model.MdcProductionTreeModel; |
| | | import org.jeecg.modules.system.model.ProductionIdModel; |
| | | import org.jeecg.modules.system.service.IMdcProductionService; |
| | | import org.jeecg.modules.system.service.ISysParamsService; |
| | | import org.jeecg.modules.system.util.FindsProductionsChildrenUtil; |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Resource |
| | | private MdcProductionEquipmentMapper productionEquipmentMapper; |
| | | |
| | | @Resource |
| | | private ISysParamsService sysParamsService; |
| | | /** |
| | | * queryTreeList 对应 queryTreeList 查询所有的产线数据,以树结构形式响应给前端 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 查询所有产线信息,并分节点进行显示(添加系统配置) |
| | | */ |
| | | @Override |
| | | public List<MdcProductionTreeModel> queryTreeListByConfig(){ |
| | | SysParams sysParams = sysParamsService.getSysPramBySettingKey("dnc_production"); |
| | | LambdaQueryWrapper<MdcProduction> query = new LambdaQueryWrapper<MdcProduction>(); |
| | | if (sysParams == null) { |
| | | return null; |
| | | }else { |
| | | if (("0").equals(sysParams.getSettingValue())){ |
| | | query.eq(MdcProduction::getOrgType,"2"); |
| | | query.eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString()); |
| | | query.orderByAsc(MdcProduction::getProductionOrder); |
| | | List<MdcProduction> list = this.list(query); |
| | | //设置用户id,让前台显示 |
| | | this.setUserIdsByProList(list); |
| | | //封装一级树 |
| | | List<MdcProductionTreeModel> listResult = new ArrayList<>(); |
| | | for (MdcProduction production : list) { |
| | | if (production.getDescription().isEmpty()){ |
| | | production.setDescription(""); |
| | | } |
| | | listResult.add(new MdcProductionTreeModel(production)); |
| | | } |
| | | //调用wrapTreeDataToTreeList方法生成树状数据 |
| | | return listResult; |
| | | }else { |
| | | query.eq(MdcProduction::getDelFlag, CommonConstant.DEL_FLAG_0.toString()); |
| | | query.orderByAsc(MdcProduction::getProductionOrder); |
| | | List<MdcProduction> list = this.list(query); |
| | | //设置用户id,让前台显示 |
| | | this.setUserIdsByProList(list); |
| | | //调用wrapTreeDataToTreeList方法生成树状数据 |
| | | return FindsProductionsChildrenUtil.wrapTreeDataToTreeList(list); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * queryTreeList 根据产线id查询,前端回显调用 |
| | | */ |
| | | @Override |