|
|
@@ -35,6 +35,7 @@ import com.goafanti.common.enums.AchievementFields;
|
|
|
import com.goafanti.common.enums.AchievementImportFields;
|
|
|
import com.goafanti.common.enums.AchievementOrderStatus;
|
|
|
import com.goafanti.common.enums.AchievementReleaseStatus;
|
|
|
+import com.goafanti.common.enums.AchievementSwitchSign;
|
|
|
import com.goafanti.common.enums.AttachmentType;
|
|
|
import com.goafanti.common.enums.DeleteStatus;
|
|
|
import com.goafanti.common.model.Achievement;
|
|
|
@@ -188,7 +189,7 @@ public class AdminAchievementApiController extends CertifyApiController {
|
|
|
* 修改成果
|
|
|
*/
|
|
|
@RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
|
- public Result update(@Valid InputAchievement ia, BindingResult bindingResult,
|
|
|
+ public Result update(@Valid InputAchievement ia, BindingResult bindingResult, Integer switchSign,
|
|
|
@RequestParam(name = "keywords[]", required = false) String[] keywords) {
|
|
|
Result res = new Result();
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
@@ -197,6 +198,17 @@ public class AdminAchievementApiController extends CertifyApiController {
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
+ if (null == switchSign) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到开关标记", "开关标记"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!AchievementSwitchSign.CLOSE.getCode().equals(switchSign)
|
|
|
+ && !AchievementSwitchSign.OPEN.getCode().equals(switchSign)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "开关标记"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (StringUtils.isBlank(ia.getId())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
|
|
|
return res;
|
|
|
@@ -221,7 +233,7 @@ public class AdminAchievementApiController extends CertifyApiController {
|
|
|
|
|
|
Achievement a = new Achievement();
|
|
|
BeanUtils.copyProperties(ia, a);
|
|
|
- achievementService.updateAchievement(a, keywords);
|
|
|
+ achievementService.updateAchievement(a, keywords, switchSign);
|
|
|
return res;
|
|
|
}
|
|
|
|