| | |
| | | |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.module.model.mpk.common.MdkConstant; |
| | | import com.iailab.module.model.mpk.dao.MethodSettingDao; |
| | | import com.iailab.module.model.mpk.dto.MethodSettingDTO; |
| | | import com.iailab.module.model.mpk.entity.MethodSettingEntity; |
| | |
| | | @Override |
| | | public void insertList(List<MethodSettingDTO> list, String MethodId) { |
| | | List<MethodSettingEntity> entityList = ConvertUtils.sourceToTarget(list, MethodSettingEntity.class); |
| | | // pyFile排第一 |
| | | entityList.sort((e1,e2) -> e1.getSettingKey().equals(MdkConstant.PY_FILE_KEY) ? -1 : e2.getSettingKey().equals(MdkConstant.PY_FILE_KEY) ? 1 : 0); |
| | | for(int i = 0; i < entityList.size(); i++){ |
| | | MethodSettingEntity entity = entityList.get(i); |
| | | if (StringUtils.isNotBlank(entity.getValue())){ |
| | | // 去掉空格 |
| | | entity.setValue(entity.getValue().trim().replace("\\s+", "")); |
| | | entity.setValue(entity.getValue().trim().replaceAll("\\s+", "")); |
| | | } |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | entity.setMethodId(MethodId); |