Commit d0d34b15 by 陶光胜

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-store into developer

parents 5cd9a0c9 997d7174
......@@ -35,6 +35,8 @@ public interface ClerkApiService {
*/
ServiceResponse<Integer> saveClerkForOrder(String clerkName, String clerkCode, Integer storeId, Integer enterpriseId, String orderNum);
ServiceResponse<Integer> saveClerkByStoreInfoIdForOrder(String clerkName, String clerkCode, Integer storeInfoId, Integer enterpriseId, String orderNum);
/** @Description: 通过导购code查询导购
* @author taogs
......@@ -43,10 +45,22 @@ public interface ClerkApiService {
* @return
*/
ServiceResponse<ClerkDTO> getClerkByCode(Integer enterpriseId, String clerkCode, Integer storeId);
/**
* @Title: getClerkByCodeAndStoreInfoId
* @Description:
* @author zhiwj
* @param enterpriseId
* @param clerkCode
* @param storeInfoId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.store.dto.ClerkDTO>
* @throws
*/
ServiceResponse<ClerkDTO> getClerkByCodeAndStoreInfoId(Integer enterpriseId, String clerkCode, Integer storeInfoId);
/**
* @Title: listClerk
* @Description: 导购列表
* @author zhiwj
* @author zhiwj
* @param enterpriseId 企业id
* @param clerkSearchDTO
* @param pageNum
......
......@@ -125,23 +125,46 @@ public class ClerkApiServiceImpl implements ClerkApiService {
}
@Override
public ServiceResponse<Integer> saveClerkByStoreInfoIdForOrder(String clerkName, String clerkCode, Integer storeInfoId, Integer enterpriseId, String orderNum) {
Integer storeId = this.storeService.getStoreIdByStoreInfoId(enterpriseId, storeInfoId);
if (storeId != null) {
ClerkDTO clerkDTO = new ClerkDTO();
clerkDTO.setClerkName(clerkName);
clerkDTO.setClerkCode(clerkCode);
clerkDTO.setEnterpriseId(enterpriseId);
clerkDTO.setStoreInfoId(storeInfoId);
clerkDTO.setReason(ClerkLogReasonEnum.ORDER.getCode());
clerkDTO.setRemark("订单号:" + orderNum);
ServiceResponse serviceResponse = this.saveOrUpdate(clerkDTO);
return serviceResponse;
} else {
logger.warn("门店不存在 enterpriseId:{}, storeInfoId:{}", enterpriseId, storeInfoId);
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS.getCode(), "门店不存在");
}
}
@Override
public ServiceResponse<ClerkDTO> getClerkByCode(Integer enterpriseId, String clerkCode, Integer storeId) {
ServiceResponse<StoreDTO> storeResponse = storeApiService.getStoreById(enterpriseId, storeId);
if (storeResponse.getResult() != null) {
StoreDTO store = storeResponse.getResult();
TabClerk clerk = this.clerkService.getClerkByCode(enterpriseId, clerkCode, store.getStoreInfoId());
if (clerk != null) {
return EnterpriseServiceResponse.success(EntityUtil.changeEntityByJSON(ClerkDTO.class, clerk));
} else {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS);
}
return getClerkByCodeAndStoreInfoId(enterpriseId, clerkCode, storeId);
} else {
logger.warn("门店不存在 enterpriseId:{}, storeId:{}", enterpriseId, storeId);
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS.getCode(), "门店不存在");
}
}
@Override
public ServiceResponse<ClerkDTO> getClerkByCodeAndStoreInfoId(Integer enterpriseId, String clerkCode, Integer storeInfoId) {
TabClerk clerk = this.clerkService.getClerkByCode(enterpriseId, clerkCode, storeInfoId);
if (clerk != null) {
return EnterpriseServiceResponse.success(EntityUtil.changeEntityByJSON(ClerkDTO.class, clerk));
} else {
return EnterpriseServiceResponse.failure(ErrorCode.NOTEXISTS);
}
}
private void storeLogByAddClerk(ClerkDTO clerkDTO) {
StoreLogDTO storeLogDTO = new StoreLogDTO();
storeLogDTO.setEnterpriseId(clerkDTO.getEnterpriseId());
......
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