|
@@ -27,6 +27,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.BeanWrapper;
|
|
import org.springframework.beans.BeanWrapper;
|
|
|
import org.springframework.beans.BeanWrapperImpl;
|
|
import org.springframework.beans.BeanWrapperImpl;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.context.ApplicationEventPublisher;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
@@ -49,6 +50,7 @@ import java.util.stream.Collectors;
|
|
|
@Service
|
|
@Service
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
|
|
public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FsStoreScrmMapper fsStoreMapper;
|
|
private FsStoreScrmMapper fsStoreMapper;
|
|
|
|
|
|
|
@@ -57,11 +59,16 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FsStoreProductScrmMapper fsStoreProduct;
|
|
private FsStoreProductScrmMapper fsStoreProduct;
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ConfigUtil configUtil;
|
|
private ConfigUtil configUtil;
|
|
|
|
|
|
|
|
private static final String MERCHANT_PREFIX = "YJB";
|
|
private static final String MERCHANT_PREFIX = "YJB";
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ApplicationEventPublisher applicationEventPublisher;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询店铺管理
|
|
* 查询店铺管理
|
|
|
*
|
|
*
|
|
@@ -97,6 +104,7 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public Long insertFsStore(FsStoreScrm fsStore) {
|
|
public Long insertFsStore(FsStoreScrm fsStore) {
|
|
|
|
|
+ //检查商家填写的账号是否重复
|
|
|
if (fsStore.getAccount() != null) {
|
|
if (fsStore.getAccount() != null) {
|
|
|
FsStoreScrm fs = fsStoreMapper.selectFsStoreByAccount(fsStore.getAccount());
|
|
FsStoreScrm fs = fsStoreMapper.selectFsStoreByAccount(fsStore.getAccount());
|
|
|
if (fs != null) {
|
|
if (fs != null) {
|
|
@@ -127,6 +135,8 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
|
|
|
fsStore.setStoreSeq(sequence);
|
|
fsStore.setStoreSeq(sequence);
|
|
|
fsStore.setQualificationUpdateTime(LocalDate.now());
|
|
fsStore.setQualificationUpdateTime(LocalDate.now());
|
|
|
fsStoreMapper.insertFsStore(fsStore);
|
|
fsStoreMapper.insertFsStore(fsStore);
|
|
|
|
|
+ //信息发布
|
|
|
|
|
+ applicationEventPublisher.publishEvent(fsStore);
|
|
|
return fsStore.getStoreId();
|
|
return fsStore.getStoreId();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -230,7 +240,10 @@ public class FsStoreScrmServiceImpl implements IFsStoreScrmService {
|
|
|
log.error("获取diff出错", e);
|
|
log.error("获取diff出错", e);
|
|
|
}
|
|
}
|
|
|
fsStore.setQualificationUpdateTime(LocalDate.now());
|
|
fsStore.setQualificationUpdateTime(LocalDate.now());
|
|
|
- return fsStoreMapper.updateFsStore(fsStore);
|
|
|
|
|
|
|
+ int updateRowNum = fsStoreMapper.updateFsStore(fsStore);
|
|
|
|
|
+ //信息发布
|
|
|
|
|
+ applicationEventPublisher.publishEvent(fsStore);
|
|
|
|
|
+ return updateRowNum;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|