Commit 9eb767e8 by 陶光胜

门店品牌变更

parent eb1c1023
package com.gic.store.service.impl;
import com.alibaba.fastjson.JSON;
import com.gic.commons.util.GlobalInfo;
import com.gic.store.dao.mapper.TabStoreBrandMapper;
import com.gic.store.dao.mapper.TabStoreBrandRefMapper;
......@@ -11,6 +12,8 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -26,7 +29,7 @@ import java.util.stream.Collectors;
*/
@Service
public class StoreBrandServiceImpl implements StoreBrandService {
private static final Logger log = LogManager.getLogger(StoreBrandServiceImpl.class);
@Autowired
private TabStoreBrandMapper tabStoreBrandMapper;
@Autowired
......@@ -148,10 +151,10 @@ public class StoreBrandServiceImpl implements StoreBrandService {
}
private void swapSort(TabStoreBrandRef tabStoreBrandRef, TabStoreBrand prevStoreBrand) {
log.info("品牌排序:{},{}", JSON.toJSONString(tabStoreBrandRef), JSON.toJSONString(prevStoreBrand));
if (prevStoreBrand != null) {
Double temp = tabStoreBrandRef.getSort();
tabStoreBrandRefMapper.updateSort(tabStoreBrandRef.getEnterpriseId(), tabStoreBrandRef.getStoreBrandId(), prevStoreBrand.getSort());
tabStoreBrandRefMapper.updateSort(prevStoreBrand.getEnterpriseId(), prevStoreBrand.getStoreBrandId(), temp);
tabStoreBrandRefMapper.updateSort(prevStoreBrand.getEnterpriseId(), prevStoreBrand.getStoreBrandId(), tabStoreBrandRef.getSort());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment