Showing
1 changed file
with
9 additions
and
6 deletions
@@ -4,12 +4,12 @@ import com.alibaba.fastjson.JSONObject; | @@ -4,12 +4,12 @@ import com.alibaba.fastjson.JSONObject; | ||
4 | import com.yoho.core.common.utils.DateUtil; | 4 | import com.yoho.core.common.utils.DateUtil; |
5 | import com.yoho.ufo.dal.BrandMapper; | 5 | import com.yoho.ufo.dal.BrandMapper; |
6 | import com.yoho.ufo.model.brand.Brand; | 6 | import com.yoho.ufo.model.brand.Brand; |
7 | +import com.yoho.ufo.service.IBrandService; | ||
8 | +import com.yoho.ufo.util.OrikaUtils; | ||
7 | import com.yohobuy.ufo.model.common.PageModel; | 9 | import com.yohobuy.ufo.model.common.PageModel; |
8 | import com.yohobuy.ufo.model.common.PageResponseBO; | 10 | import com.yohobuy.ufo.model.common.PageResponseBO; |
9 | import com.yohobuy.ufo.model.request.brand.BrandRequestBo; | 11 | import com.yohobuy.ufo.model.request.brand.BrandRequestBo; |
10 | import com.yohobuy.ufo.model.request.brand.BrandResponseBo; | 12 | import com.yohobuy.ufo.model.request.brand.BrandResponseBo; |
11 | -import com.yoho.ufo.service.IBrandService; | ||
12 | -import com.yoho.ufo.util.OrikaUtils; | ||
13 | import org.slf4j.Logger; | 13 | import org.slf4j.Logger; |
14 | import org.slf4j.LoggerFactory; | 14 | import org.slf4j.LoggerFactory; |
15 | import org.springframework.stereotype.Service; | 15 | import org.springframework.stereotype.Service; |
@@ -35,8 +35,7 @@ public class BrandServiceImpl implements IBrandService { | @@ -35,8 +35,7 @@ public class BrandServiceImpl implements IBrandService { | ||
35 | LOGGER.info("insertOrUpdateBrand param = {}", brandRequestBo); | 35 | LOGGER.info("insertOrUpdateBrand param = {}", brandRequestBo); |
36 | Brand brand = OrikaUtils.map(brandRequestBo, Brand.class); | 36 | Brand brand = OrikaUtils.map(brandRequestBo, Brand.class); |
37 | brand.setEditTime(DateUtil.currentTimeSeconds()); | 37 | brand.setEditTime(DateUtil.currentTimeSeconds()); |
38 | - // TODO | ||
39 | - brand.setEditPid(10086); | 38 | + brand.setEditPid(getUserId()); |
40 | if (brand.getId() == null || brand.getId() == 0) { | 39 | if (brand.getId() == null || brand.getId() == 0) { |
41 | // 默认开启状态 | 40 | // 默认开启状态 |
42 | brand.setStatus(1); | 41 | brand.setStatus(1); |
@@ -85,11 +84,15 @@ public class BrandServiceImpl implements IBrandService { | @@ -85,11 +84,15 @@ public class BrandServiceImpl implements IBrandService { | ||
85 | LOGGER.info("updateBrandStatus param = {}", requestBo); | 84 | LOGGER.info("updateBrandStatus param = {}", requestBo); |
86 | Brand brand = OrikaUtils.map(requestBo, Brand.class); | 85 | Brand brand = OrikaUtils.map(requestBo, Brand.class); |
87 | brand.setEditTime(DateUtil.currentTimeSeconds()); | 86 | brand.setEditTime(DateUtil.currentTimeSeconds()); |
88 | - // TODO | ||
89 | - brand.setEditPid(1111111); | 87 | + brand.setEditPid(getUserId()); |
90 | return brandMapper.updateBrandStatus(brand); | 88 | return brandMapper.updateBrandStatus(brand); |
91 | } | 89 | } |
92 | 90 | ||
91 | + private Integer getUserId() { | ||
92 | + Integer userId = (new UserHelper()).getUserId(); | ||
93 | + return userId == null ? 0 : userId; | ||
94 | + } | ||
95 | + | ||
93 | @Override | 96 | @Override |
94 | public List<JSONObject> getBrandIdAndName() { | 97 | public List<JSONObject> getBrandIdAndName() { |
95 | // TODO 可以添加缓存 | 98 | // TODO 可以添加缓存 |
-
Please register or login to post a comment