|
|
@@ -1,9 +1,11 @@
|
|
|
package com.jjt.dye.service.impl;
|
|
|
|
|
|
import com.jjt.common.utils.StringUtils;
|
|
|
+import com.jjt.dye.domain.DyeEnergy;
|
|
|
import com.jjt.dye.domain.DyeType;
|
|
|
import com.jjt.dye.domain.DyeTypePara;
|
|
|
import com.jjt.dye.mapper.DyeTypeMapper;
|
|
|
+import com.jjt.dye.service.IDyeEnergyService;
|
|
|
import com.jjt.dye.service.IDyeTypeService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -22,6 +24,8 @@ import java.util.List;
|
|
|
public class DyeTypeServiceImpl implements IDyeTypeService {
|
|
|
@Resource
|
|
|
private DyeTypeMapper dyeTypeMapper;
|
|
|
+ @Resource
|
|
|
+ private IDyeEnergyService dyeEnergyService;
|
|
|
|
|
|
/**
|
|
|
* 查询染整线设备类型管理
|
|
|
@@ -42,7 +46,25 @@ public class DyeTypeServiceImpl implements IDyeTypeService {
|
|
|
*/
|
|
|
@Override
|
|
|
public List<DyeType> selectDyeTypeList(DyeType dyeType) {
|
|
|
- return dyeTypeMapper.selectDyeTypeList(dyeType);
|
|
|
+ List<DyeType> list = dyeTypeMapper.selectDyeTypeList(dyeType);
|
|
|
+ List<DyeEnergy> energyList = dyeEnergyService.selectDyeEnergyList(new DyeEnergy());
|
|
|
+ List<DyeTypePara> paras = new ArrayList<>();
|
|
|
+ energyList.forEach(energy -> {
|
|
|
+ DyeTypePara para = new DyeTypePara();
|
|
|
+ para.setParaCode(energy.getEngCode());
|
|
|
+ para.setParaName(energy.getEngName());
|
|
|
+ paras.add(para);
|
|
|
+ });
|
|
|
+ list.forEach(type -> {
|
|
|
+ DyeType tp = selectDyeTypeByTypeId(type.getTypeId());
|
|
|
+ List<DyeTypePara> paraList = tp.getDyeTypeParaList();
|
|
|
+ if (paraList == null) {
|
|
|
+ paraList = new ArrayList<>();
|
|
|
+ }
|
|
|
+ paraList.addAll(paras);
|
|
|
+ type.setDyeTypeParaList(paraList);
|
|
|
+ });
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
/**
|