| | |
| | | package com.iailab.module.model.mpk.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.iailab.framework.common.service.impl.BaseServiceImpl; |
| | | import com.iailab.framework.common.service.impl.CrudServiceImpl; |
| | | import com.iailab.framework.common.util.object.ConvertUtils; |
| | | import com.iailab.module.model.mpk.dao.ProjectModelDao; |
| | | import com.iailab.module.model.mpk.dto.MpkFileDTO; |
| | | import com.iailab.module.model.mpk.dto.ProjectModelDTO; |
| | | import com.iailab.module.model.mpk.entity.ProjectModelEntity; |
| | | import com.iailab.module.model.mpk.service.ProjectModelService; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @description: |
| | |
| | | * @date: 2024/8/22 14:41 |
| | | **/ |
| | | @Service |
| | | public class ProjectModelServiceImpl extends CrudServiceImpl<ProjectModelDao, ProjectModelEntity, ProjectModelDTO> implements ProjectModelService { |
| | | public class ProjectModelServiceImpl extends BaseServiceImpl<ProjectModelDao, ProjectModelEntity> implements ProjectModelService { |
| | | @Override |
| | | public List<ProjectModelDTO> list(Map<String, Object> params) { |
| | | List<ProjectModelEntity> entityList = baseDao.selectList(getWrapper(params)); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void create(List<MpkFileDTO> models, String projectId) { |
| | | List<ProjectModelEntity> list = new ArrayList<>(models.size()); |
| | | for (MpkFileDTO model : models) { |
| | | ProjectModelEntity projectModel = new ProjectModelEntity(); |
| | | projectModel.setId(UUID.randomUUID().toString()); |
| | | projectModel.setProjectId(projectId); |
| | | projectModel.setModelId(model.getId()); |
| | | list.add(projectModel); |
| | | } |
| | | baseDao.insert(list); |
| | | } |
| | | |
| | | public QueryWrapper<ProjectModelEntity> getWrapper(Map<String, Object> params){ |
| | | String id = (String)params.get("id"); |
| | | String projectId = (String)params.get("projectId"); |