Commit 9d2b3e81 by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents 6e4c0b54 4a918ff1
......@@ -153,12 +153,24 @@ public interface ClerkApiService {
* 如果存在返回 门店下 同导购code 的 clerkId ,如果不存在,新建导购,返回新建的导购i
* @author zhiwj
* @param clerkId
* @param storeId
* @param storeInfoId
* @param enterpriseId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Integer> addClerkToOtherStore(Integer clerkId, Integer storeInfoId, Integer enterpriseId);
/**
* @Title: ensureClerkInStore
* @Description:
* @author zhiwj
* @param clerkId
* @param storeInfoId
* @param enterpriseId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Integer> addClerkToOtherStore(Integer clerkId, Integer storeId, Integer enterpriseId);
ServiceResponse<Boolean> ensureClerkInStore(Integer clerkId, Integer storeInfoId, Integer enterpriseId);
/**
* @Title: listClerkByStoreBrand
......
......@@ -576,13 +576,13 @@ public class ClerkApiServiceImpl implements ClerkApiService {
}
@Override
public ServiceResponse<Integer> addClerkToOtherStore(Integer clerkId, Integer storeId, Integer enterpriseId) {
logger.info("clerkId:{}, storeId:{}, enterpriseId:{}", clerkId, storeId, enterpriseId);
public ServiceResponse<Integer> addClerkToOtherStore(Integer clerkId, Integer storeInfoId, Integer enterpriseId) {
logger.info("clerkId:{}, storeInfoId:{}, enterpriseId:{}", clerkId, storeInfoId, enterpriseId);
TabClerk clerk = this.clerkService.getById(clerkId);
if (clerk == null) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS.getCode(), "导购不存在");
}
StoreDTO store = this.storeApiService.getStoreById(enterpriseId, storeId).getResult();
StoreDTO store = this.storeApiService.getStoreByStoreInfoId(enterpriseId, storeInfoId).getResult();
if (store == null) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS.getCode(), "门店不存在");
}
......@@ -604,6 +604,26 @@ public class ClerkApiServiceImpl implements ClerkApiService {
}
@Override
public ServiceResponse<Boolean> ensureClerkInStore(Integer clerkId, Integer storeInfoId, Integer enterpriseId) {
logger.info("clerkId:{}, storeInfoId:{}, enterpriseId:{}", clerkId, storeInfoId, enterpriseId);
TabClerk clerk = this.clerkService.getById(clerkId);
if (clerk == null) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS.getCode(), "导购不存在", Boolean.FALSE);
}
StoreDTO store = this.storeApiService.getStoreById(enterpriseId, storeInfoId).getResult();
if (store == null) {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS.getCode(), "门店不存在", Boolean.FALSE);
}
if (clerk.getStoreInfoId().equals(store.getStoreInfoId())) {
logger.info("导购[clerkId:{}]已存在门店[storeId:{}, storeInfoId:{}]下", clerkId, store.getStoreId(), store.getStoreInfoId());
return EnterpriseServiceResponse.success(Boolean.TRUE);
} else {
logger.info("导购[clerkId:{}]不存在门店[storeId:{}, storeInfoId:{}]下", clerkId, store.getStoreId(), store.getStoreInfoId());
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS.getCode(), "导购不存在该门店下", Boolean.FALSE);
}
}
@Override
public ServiceResponse<List<ClerkDTO>> listClerkByStoreBrand(Integer enterpriseId, Integer storeBrandId, String clerkName) {
StoreSearchDBDTO storeSearchDBDTO = new StoreSearchDBDTO();
storeSearchDBDTO.setEnterpriseId(enterpriseId);
......
......@@ -48,6 +48,9 @@
)
</insert>
<insert id="insertSelective" parameterType="com.gic.store.entity.TabClerk">
<selectKey keyProperty="clerkId" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into tab_clerk
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clerkId != null">
......
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