|
|
@@ -11,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import com.goafanti.achievement.bo.InputAchievementOrder;
|
|
|
import com.goafanti.achievement.service.AchievementOrderLogService;
|
|
|
import com.goafanti.achievement.service.AchievementOrderService;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
@@ -20,6 +21,7 @@ import com.goafanti.common.enums.AchievementOrderFields;
|
|
|
import com.goafanti.common.enums.AchievementOrderStatus;
|
|
|
import com.goafanti.common.enums.DemandOrderStatus;
|
|
|
import com.goafanti.common.model.AchievementOrder;
|
|
|
+import com.goafanti.common.model.AchievementOrderLog;
|
|
|
import com.goafanti.common.model.DemandOrder;
|
|
|
import com.goafanti.common.model.DemandOrderLog;
|
|
|
import com.goafanti.demand.bo.InputDemandOrder;
|
|
|
@@ -39,6 +41,47 @@ public class AdminOrderApiController extends CertifyApiController {
|
|
|
private AchievementOrderLogService achievementOrderLogService;
|
|
|
|
|
|
/**
|
|
|
+ * 科技成果线索单/意向单修改
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/updateAchievementOrder", method = RequestMethod.POST)
|
|
|
+ public Result updateAchievementOrder(@Valid InputAchievementOrder order, BindingResult bindingResult,
|
|
|
+ String recordTimeFormattedDate, Boolean flag) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (bindingResult.hasErrors()) {
|
|
|
+ res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
|
|
|
+ AchievementOrderFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(order.getId())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技成果线索单/意向单ID", "科技成果线索单/意向单ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(order.getAchievementId())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技成果ID", "科技成果ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (null == order.getStatus()) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技成果线索单/意向单状态", "科技成果线索单/意向单状态"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (flag && StringUtils.isBlank(recordTimeFormattedDate)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技需求记录修改时间", "科技需求记录修改时间"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ AchievementOrder achievementOrder = new AchievementOrder();
|
|
|
+ AchievementOrderLog aol = new AchievementOrderLog();
|
|
|
+ BeanUtils.copyProperties(order, achievementOrder);
|
|
|
+ BeanUtils.copyProperties(order, aol);
|
|
|
+ achievementOrderService.updateAchievementOrder(achievementOrder, aol, recordTimeFormattedDate);
|
|
|
+
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 关闭科技成果线索单/意向单
|
|
|
*/
|
|
|
@RequestMapping(value = "/achievementShutdown", method = RequestMethod.POST)
|
|
|
@@ -179,10 +222,17 @@ public class AdminOrderApiController extends CertifyApiController {
|
|
|
AchievementOrderFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ if (StringUtils.isBlank(inputDemandOrder.getId())) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技需求线索单/意向单ID", "科技需求线索单/意向单ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
if (StringUtils.isBlank(inputDemandOrder.getDemandId())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技需求ID", "科技需求ID"));
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
if (null == inputDemandOrder.getStatus()) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到科技需求状态", "科技需求状态"));
|
|
|
return res;
|