| | |
| | | package com.ruoyi.production.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | if(CollectionUtils.isEmpty(productProcessList)){ |
| | | return AjaxResult.warn("模板错误或导入数据为空"); |
| | | } |
| | | productProcessList.forEach(productProcess -> { |
| | | if (ObjectUtils.isEmpty(productProcess)) { |
| | | throw new RuntimeException("使用模板进行导入"); |
| | | } |
| | | if (ObjectUtils.isEmpty(productProcess.getName())) { |
| | | throw new RuntimeException("工序名称不能为空"); |
| | | } |
| | | }); |
| | | this.saveOrUpdateBatch(productProcessList); |
| | | return AjaxResult.success(true); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return AjaxResult.error("导入失败"); |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | productProcessMapper.deleteBatchIds(ids); |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductProcess> productProcessList(Integer dateType) { |
| | | return baseMapper.selectList(new LambdaQueryWrapper<ProductProcess>() |
| | | .eq(dateType != null, ProductProcess::getStatus, 1)); |
| | | } |
| | | } |