|
@@ -13,6 +13,7 @@ import com.diagbot.dto.VersionWrapperDTO;
|
|
|
import com.diagbot.entity.VersionDetail;
|
|
|
import com.diagbot.entity.VersionInfo;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
+import com.diagbot.enums.ProductTypeEnum;
|
|
|
import com.diagbot.enums.StatusEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
@@ -88,6 +89,8 @@ public class VersionInfoFacade extends VersionInfoServiceImpl {
|
|
|
VersionWrapperDTO versionList = new VersionWrapperDTO();
|
|
|
versionList.setId(versionInfo.getId());
|
|
|
versionList.setGmtCreate(versionInfo.getGmtCreate());
|
|
|
+ versionList.setProductType(versionInfo.getProductType());
|
|
|
+ versionList.setProductTypeName(ProductTypeEnum.getName(versionInfo.getProductType()));
|
|
|
versionList.setName(versionInfo.getName());
|
|
|
versionList.setModifierid(userNames.get(versionInfo.getModifierid()));
|
|
|
versionList.setRefreshTime(versionInfo.getRefreshTime());
|
|
@@ -127,18 +130,22 @@ public class VersionInfoFacade extends VersionInfoServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public boolean saveVersionInfoAll(VersionInfoVO versionInfoVO) {
|
|
|
- // 1.判断该版本号是否存在名字相同的数据
|
|
|
+ // 1.判断摸个产品该版本号是否存在名字相同的数据
|
|
|
QueryWrapper<VersionInfo> templateInfoFand = new QueryWrapper<>();
|
|
|
- templateInfoFand.eq("name", versionInfoVO.getName()).eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ templateInfoFand.eq("product_type", versionInfoVO.getProductType())
|
|
|
+ .eq("name", versionInfoVO.getName())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+
|
|
|
VersionInfo dataInfo = getOne(templateInfoFand);
|
|
|
if (dataInfo != null) {
|
|
|
- throw new CommonException(CommonErrorCode.NOT_EXISTS, "该版本号已存在");
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "该产品该版本号已存在");
|
|
|
}
|
|
|
|
|
|
// 增加版本数据
|
|
|
VersionInfo versionInfo = new VersionInfo();
|
|
|
versionInfo.setCreator(UserUtils.getCurrentPrincipleID());
|
|
|
versionInfo.setGmtCreate(DateUtil.now());
|
|
|
+ versionInfo.setProductType(versionInfo.getProductType());
|
|
|
versionInfo.setName(versionInfoVO.getName());
|
|
|
versionInfo.setGmtModified(DateUtil.now());
|
|
|
versionInfo.setModifier(UserUtils.getCurrentPrincipleID());
|
|
@@ -188,14 +195,18 @@ public class VersionInfoFacade extends VersionInfoServiceImpl {
|
|
|
checkExist(versionInfoVO.getId());
|
|
|
// 2.判断该版本号是否存在名字相同的数据
|
|
|
QueryWrapper<VersionInfo> templateInfoFand = new QueryWrapper<>();
|
|
|
- templateInfoFand.eq("name", versionInfoVO.getName()).eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ templateInfoFand.eq("product_type", versionInfoVO.getProductType())
|
|
|
+ .eq("name", versionInfoVO.getName())
|
|
|
+ .eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+
|
|
|
VersionInfo dataInfo = getOne(templateInfoFand);
|
|
|
if (dataInfo != null && !dataInfo.getId().equals(versionInfoVO.getId())) {
|
|
|
- throw new CommonException(CommonErrorCode.NOT_EXISTS, "该版本号已存在");
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS, "该产品该版本号已存在");
|
|
|
}
|
|
|
// 3.修改版本信息
|
|
|
VersionInfo versionInfo = new VersionInfo();
|
|
|
versionInfo.setId(versionInfoVO.getId());// 模板id
|
|
|
+ versionInfo.setProductType(versionInfoVO.getProductType());
|
|
|
versionInfo.setName(versionInfoVO.getName());// 模板名称
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
if (versionInfoVO.getRefreshTime() != null) {
|