收藏减少必填字段
This commit is contained in:
+3
@@ -53,6 +53,7 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
|
|||||||
@ApiOperation(value="标准收藏-国内收藏", notes="标准收藏-国内收藏")
|
@ApiOperation(value="标准收藏-国内收藏", notes="标准收藏-国内收藏")
|
||||||
@PostMapping(value = "/domestic/add")
|
@PostMapping(value = "/domestic/add")
|
||||||
public Result<T> domesticAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
|
public Result<T> domesticAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
|
||||||
|
lawsStandardCollection.setSource("1");
|
||||||
lawsStandardCollectionService.add(lawsStandardCollection);
|
lawsStandardCollectionService.add(lawsStandardCollection);
|
||||||
return Result.OK("操作成功!");
|
return Result.OK("操作成功!");
|
||||||
}
|
}
|
||||||
@@ -78,6 +79,7 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
|
|||||||
@ApiOperation(value="标准收藏-海外收藏", notes="标准收藏-海外收藏")
|
@ApiOperation(value="标准收藏-海外收藏", notes="标准收藏-海外收藏")
|
||||||
@PostMapping(value = "/overseas/add")
|
@PostMapping(value = "/overseas/add")
|
||||||
public Result<T> overseasAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
|
public Result<T> overseasAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
|
||||||
|
lawsStandardCollection.setSource("2");
|
||||||
lawsStandardCollectionService.add(lawsStandardCollection);
|
lawsStandardCollectionService.add(lawsStandardCollection);
|
||||||
return Result.OK("操作成功!");
|
return Result.OK("操作成功!");
|
||||||
}
|
}
|
||||||
@@ -103,6 +105,7 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
|
|||||||
@ApiOperation(value="标准收藏-企标收藏", notes="标准收藏-企标收藏")
|
@ApiOperation(value="标准收藏-企标收藏", notes="标准收藏-企标收藏")
|
||||||
@PostMapping(value = "/enterprise/add")
|
@PostMapping(value = "/enterprise/add")
|
||||||
public Result<T> enterpriseAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
|
public Result<T> enterpriseAdd(@Validated @RequestBody LawsStandardCollection lawsStandardCollection) {
|
||||||
|
lawsStandardCollection.setSource("3");
|
||||||
lawsStandardCollectionService.add(lawsStandardCollection);
|
lawsStandardCollectionService.add(lawsStandardCollection);
|
||||||
return Result.OK("操作成功!");
|
return Result.OK("操作成功!");
|
||||||
}
|
}
|
||||||
|
|||||||
+4
@@ -14,6 +14,8 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 标准收藏
|
* @Description: 标准收藏
|
||||||
@@ -44,6 +46,7 @@ public class LawsStandardCollection implements Serializable {
|
|||||||
|
|
||||||
/**标准ID*/
|
/**标准ID*/
|
||||||
@ApiModelProperty(value = "标准ID")
|
@ApiModelProperty(value = "标准ID")
|
||||||
|
@NotBlank(message = "standardId not null")
|
||||||
private String standardId;
|
private String standardId;
|
||||||
|
|
||||||
/**标准类别(GB、GB/T)*/
|
/**标准类别(GB、GB/T)*/
|
||||||
@@ -52,6 +55,7 @@ public class LawsStandardCollection implements Serializable {
|
|||||||
|
|
||||||
/**标准编号*/
|
/**标准编号*/
|
||||||
@ApiModelProperty(value = "标准编号")
|
@ApiModelProperty(value = "标准编号")
|
||||||
|
@NotBlank(message = "standardNumber not null")
|
||||||
private String standardNumber;
|
private String standardNumber;
|
||||||
|
|
||||||
/**标准名称*/
|
/**标准名称*/
|
||||||
|
|||||||
+4
-22
@@ -5,6 +5,7 @@ import com.jero.common.system.vo.LoginUser;
|
|||||||
import com.jero.modules.laws.common.service.ILawsCommonService;
|
import com.jero.modules.laws.common.service.ILawsCommonService;
|
||||||
import com.jero.modules.laws.enterprise.entity.EnterpriseStandard;
|
import com.jero.modules.laws.enterprise.entity.EnterpriseStandard;
|
||||||
import com.jero.modules.laws.enterprise.service.EnterpriseStandardService;
|
import com.jero.modules.laws.enterprise.service.EnterpriseStandardService;
|
||||||
|
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
||||||
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
||||||
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
|
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
|
||||||
import com.jero.modules.personal.entity.LawsStandardCollection;
|
import com.jero.modules.personal.entity.LawsStandardCollection;
|
||||||
@@ -94,28 +95,9 @@ public class LawsStandardCollectionServiceImpl extends ServiceImpl<LawsStandardC
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void add(LawsStandardCollection lawsStandardCollection) {
|
public void add(LawsStandardCollection lawsStandardCollection) {
|
||||||
//下面这些判断是给前端联调时给前端看的
|
LawsDomesticStandard standard = lawsDomesticStandardService.queryById(lawsStandardCollection.getStandardId());
|
||||||
String standardClass = lawsStandardCollection.getStandardClass();
|
lawsStandardCollection.setStandardClass(standard.getStandardClass());
|
||||||
if (StringUtils.isBlank(standardClass)){
|
lawsStandardCollection.setStandardName(standard.getStandardName());
|
||||||
throw new JeroBootException("standardClass标准类别参数不能为空");
|
|
||||||
}
|
|
||||||
String standardNumber = lawsStandardCollection.getStandardNumber();
|
|
||||||
if (StringUtils.isBlank(standardNumber)){
|
|
||||||
throw new JeroBootException("standardNumber标准编号参数不能为空");
|
|
||||||
}
|
|
||||||
String standardName = lawsStandardCollection.getStandardName();
|
|
||||||
if (StringUtils.isBlank(standardName)){
|
|
||||||
throw new JeroBootException("standardName标准名称参数不能为空");
|
|
||||||
}
|
|
||||||
String source1 = lawsStandardCollection.getSource();
|
|
||||||
if (StringUtils.isBlank(source1)){
|
|
||||||
throw new JeroBootException("source1收藏标准来源(1国内、2海外、3企标)参数不能为空");
|
|
||||||
}
|
|
||||||
String collectionStandardId = lawsStandardCollection.getStandardId();
|
|
||||||
if (StringUtils.isBlank(collectionStandardId)){
|
|
||||||
throw new JeroBootException("standardId标准ID(参数不能为空");
|
|
||||||
}
|
|
||||||
|
|
||||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
lawsStandardCollection.setCollectorId(sysUser.getId());
|
lawsStandardCollection.setCollectorId(sysUser.getId());
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
|
|||||||
Reference in New Issue
Block a user