BUGFIX: 回显;
This commit is contained in:
@@ -29,6 +29,8 @@ public class LibraryModelPointDTO implements Serializable {
|
||||
|
||||
private String modelType;
|
||||
|
||||
private String modelSex;
|
||||
|
||||
@ApiModelProperty("templateId")
|
||||
private Long templateId;
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ public interface LibraryService extends IService<Library> {
|
||||
*/
|
||||
LibraryUpdateVo upload(LibraryUploadDTO libraryUploadDTO);
|
||||
|
||||
void checkModel(String value, List<Long> modelIds, Integer deleteModelConfirm);
|
||||
|
||||
/**
|
||||
* 编辑library 文件名
|
||||
*
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.ai.da.mapper.entity.*;
|
||||
import com.ai.da.model.dto.LibraryModelPointDTO;
|
||||
import com.ai.da.model.dto.ModelsDotDTO;
|
||||
import com.ai.da.model.enums.ModelType;
|
||||
import com.ai.da.model.enums.Sex;
|
||||
import com.ai.da.model.vo.LibraryModelPointVO;
|
||||
import com.ai.da.python.PythonService;
|
||||
import com.ai.da.python.vo.DesignPythonObjects;
|
||||
@@ -21,11 +22,13 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -60,6 +63,18 @@ public class LibraryModelPointServiceImpl extends ServiceImpl<LibraryModelPointM
|
||||
libraryModelPointVO.setTemplateId(libraryModelPoint.getId());
|
||||
} else {
|
||||
//编辑
|
||||
if (!StringUtils.isEmpty(libraryModelPointDTO.getModelSex())) {
|
||||
Library byId = libraryService.getById(libraryModelPointDTO.getLibraryId());
|
||||
if (!byId.getLevel2Type().equals(libraryModelPointDTO.getModelSex())) {
|
||||
if (byId.getLevel2Type().equals(Sex.FEMALE.getValue())) {
|
||||
libraryService.checkModel(Sex.FEMALE.getValue(), Collections.singletonList(byId.getId()), 1);
|
||||
}else {
|
||||
libraryService.checkModel(Sex.MALE.getValue(), Collections.singletonList(byId.getId()), 1);
|
||||
}
|
||||
byId.setLevel2Type(libraryModelPointDTO.getModelSex());
|
||||
libraryService.updateById(byId);
|
||||
}
|
||||
}
|
||||
LibraryModelPoint modelPoint = getById(libraryModelPointDTO.getTemplateId());
|
||||
if (Objects.isNull(modelPoint)) {
|
||||
throw new BusinessException("modelPoint.not.found");
|
||||
|
||||
@@ -458,7 +458,9 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
|
||||
libraryMapper.delete(qw);
|
||||
}
|
||||
|
||||
private void checkModel(String value, List<Long> modelIds, Integer deleteModelConfirm) {
|
||||
|
||||
@Override
|
||||
public void checkModel(String value, List<Long> modelIds, Integer deleteModelConfirm) {
|
||||
AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder();
|
||||
QueryWrapper<Workspace> qw = new QueryWrapper<>();
|
||||
qw.lambda().eq(Workspace::getUserName, authPrincipalVo.getUsername());
|
||||
|
||||
Reference in New Issue
Block a user