Commit 99037a74 by fudahua

主门单配置

parent 30f4ec9a
package com.gic.haoban.manage.service.service.out.impl;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -11,8 +12,11 @@ import com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService;
import java.util.Date;
import static org.slf4j.LoggerFactory.getLogger;
@Service
public class ClerkMainStoreRelatedApiServiceImpl implements ClerkMainStoreRelatedApiService {
private static final Logger logger = getLogger(ClerkMainStoreRelatedApiServiceImpl.class);
@Autowired
ClerkMainStoreRelatedService clerkMainStoreRelatedService;
......@@ -20,12 +24,16 @@ public class ClerkMainStoreRelatedApiServiceImpl implements ClerkMainStoreRelate
@Override
public void setMainStore(String staffId, String storeId, String wxEnterpriseId) {
TabHaobanClerkMainStoreRelated related = clerkMainStoreRelatedService.selectByWxEnterpriseIdAndStoreId(staffId, wxEnterpriseId);
if (null != related && (!related.getStoreId().equals(storeId))) {
if (related == null) {
clerkMainStoreRelatedService.setMainStore(staffId, storeId, wxEnterpriseId);
} else if (null != related && (!related.getStoreId().equals(storeId))) {
related.setStatusFlag(0);
related.setUpdateTime(new Date());
clerkMainStoreRelatedService.update(related);
}
clerkMainStoreRelatedService.setMainStore(staffId, storeId, wxEnterpriseId);
} else {
logger.info("已经设置过主门店:{}", staffId);
}
}
@Override
......
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