|
|
@@ -19,6 +19,7 @@ import com.goafanti.common.enums.AttachmentType;
|
|
|
import com.goafanti.common.enums.DeleteStatus;
|
|
|
import com.goafanti.common.enums.DemandAuditStatus;
|
|
|
import com.goafanti.common.enums.DemandOrderFields;
|
|
|
+import com.goafanti.common.enums.DemandOrderStatus;
|
|
|
import com.goafanti.common.enums.DemandReleaseStatus;
|
|
|
import com.goafanti.common.model.Demand;
|
|
|
import com.goafanti.common.model.DemandOrder;
|
|
|
@@ -38,13 +39,12 @@ public class PortalOrderApiController extends CertifyApiController {
|
|
|
private DemandService demandService;
|
|
|
@Resource
|
|
|
private DemandOrderLogService demandOrderLogService;
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 科技成果购买
|
|
|
*/
|
|
|
@RequestMapping(value = "/orderAchievement", method = RequestMethod.POST)
|
|
|
- public Result orderAchievement(){
|
|
|
+ public Result orderAchievement() {
|
|
|
Result res = new Result();
|
|
|
return res;
|
|
|
}
|
|
|
@@ -136,7 +136,7 @@ public class PortalOrderApiController extends CertifyApiController {
|
|
|
DemandOrderFields.getFieldDesc(bindingResult.getFieldError().getField())));
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (StringUtils.isBlank(inputDemandOrder.getDemandId())) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
return res;
|
|
|
@@ -165,7 +165,7 @@ public class PortalOrderApiController extends CertifyApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 关闭订单
|
|
|
+ * 关闭科技需求订单
|
|
|
*/
|
|
|
@RequestMapping(value = "/demandShutdown", method = RequestMethod.POST)
|
|
|
public Result shutdown(String id) {
|
|
|
@@ -180,6 +180,13 @@ public class PortalOrderApiController extends CertifyApiController {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "订单ID"));
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ if (!DemandOrderStatus.CREATE.getCode().equals(order.getStatus())) {
|
|
|
+ res.getError().add(buildError("", "当前状态无法撤销!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ res.setData(demandOrderService.updateShutdownByUser(order));
|
|
|
return res;
|
|
|
}
|
|
|
|