|
|
@@ -1,7 +1,11 @@
|
|
|
package com.uas.platform.b2c.prod.product.kind.controller;
|
|
|
|
|
|
+import com.uas.platform.b2c.common.account.model.User;
|
|
|
+import com.uas.platform.b2c.core.support.SystemSession;
|
|
|
+import com.uas.platform.b2c.fa.payment.utils.StringUtils;
|
|
|
import com.uas.platform.b2c.prod.product.kind.model.KindConcern;
|
|
|
import com.uas.platform.b2c.prod.product.kind.service.KindConcernService;
|
|
|
+import com.uas.platform.core.exception.IllegalOperatorException;
|
|
|
import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.model.PageParams;
|
|
|
import com.uas.sso.support.Page;
|
|
|
@@ -57,6 +61,7 @@ public class KindConcernController {
|
|
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
|
public Page<KindConcern> getConcernKindByPage(PageParams pageParams, String keyword, Long enUU, String type) {
|
|
|
if (HAS_CONCERN.equals(type)) {
|
|
|
+ return kindConcernService.getConcernKindByPage(pageParams, keyword, enUU);
|
|
|
} else if (NOT_CONCERN.equals(type)) {
|
|
|
return kindConcernService.getNotConcernKindByPage(pageParams, keyword, enUU);
|
|
|
}
|
|
|
@@ -82,16 +87,16 @@ public class KindConcernController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/modify", method = RequestMethod.POST)
|
|
|
public ModelMap addKindConcern(@RequestBody KindConcern kindConcern) {
|
|
|
- // status 为0,说明是未关注类目
|
|
|
- if (Constant.NO == kindConcern.getStatus()) {
|
|
|
- return kindConcernService.addKindConcern(kindConcern);
|
|
|
- } else if (Constant.YES == kindConcern.getStatus()) {
|
|
|
+ if (kindConcern != null && kindConcern.getId() != null) {
|
|
|
return kindConcernService.deleteKindConcern(kindConcern);
|
|
|
}
|
|
|
- ModelMap map = new ModelMap();
|
|
|
- map.put("success", false);
|
|
|
- map.put("message", "参数错误");
|
|
|
- return map;
|
|
|
+ User user = SystemSession.getUser();
|
|
|
+ if (user != null && user.getEnterprise() != null) {
|
|
|
+ kindConcern.setEnUU(user.getEnterprise().getUu());
|
|
|
+ } else {
|
|
|
+ throw new IllegalOperatorException("用户信息错误");
|
|
|
+ }
|
|
|
+ return kindConcernService.addKindConcern(kindConcern);
|
|
|
}
|
|
|
|
|
|
/**
|