Commit afbddd05 by 陶光胜

门店状态变更

parent 27fe082e
......@@ -73,7 +73,7 @@ public enum StoreESFieldsEnum {
*/
STOREBRANDS("storeBrands", "店招品牌"),
/**
* 门店启用状态
* 门店状态
*/
STATUS("status", "门店启用状态"),
/**
......@@ -91,7 +91,7 @@ public enum StoreESFieldsEnum {
/**
* 门店状态
*/
ERPSTATUS("erpStatus", "门店状态"),
REALSTATUS("realStatus", "门店状态"),
/**
* 门店地区
*/
......
......@@ -9,13 +9,21 @@ package com.gic.store.constant;
*/
public enum StoreStatusEnum {
/**
* 启用
* 上线
*/
ONLINE(1, "启用"),
ONLINE(1, "上线"),
/**
* 不启用
* 未上线
*/
INONLINE(2, "不启用");
INONLINE(2, "未上线"),
/**
* 停业整顿
*/
STOPDOING(3, "停业整顿"),
/**
* 闭店
*/
CLOSE(4, "闭店");
private int code;
private String message;
......
......@@ -30,7 +30,7 @@ public class StoreEsDTO implements Serializable {
private Integer completeStatus;
private Integer createType;
private Integer storeType;
private Integer erpStatus;
private Integer realStatus;
private List<String> areaIds;
private String id;
private Integer ownType;
......@@ -195,12 +195,12 @@ public class StoreEsDTO implements Serializable {
this.storeType = storeType;
}
public Integer getErpStatus() {
return erpStatus;
public Integer getRealStatus() {
return realStatus;
}
public void setErpStatus(Integer erpStatus) {
this.erpStatus = erpStatus;
public void setRealStatus(Integer realStatus) {
this.realStatus = realStatus;
}
public List<String> getAreaIds() {
......@@ -322,7 +322,7 @@ public class StoreEsDTO implements Serializable {
", completeStatus=" + completeStatus +
", createType=" + createType +
", storeType=" + storeType +
", erpStatus=" + erpStatus +
", realStatus=" + realStatus +
", areaIds=" + areaIds +
", id='" + id + '\'' +
", ownType=" + ownType +
......
......@@ -88,16 +88,16 @@ public class StoreInfoDTO implements Serializable {
private Integer overflowStatus;
/**
* 门店启用状态;1启用 2不启用
* 门店状态;
*/
private Integer status;
private Integer completeStatus;
/**
* erp门店状态
* 门店状态,业务使用
*/
private Integer erpStatus;
private Integer realStatus;
/**
* 门店类型
......@@ -223,12 +223,12 @@ public class StoreInfoDTO implements Serializable {
this.status = status;
}
public Integer getErpStatus() {
return erpStatus;
public Integer getRealStatus() {
return realStatus;
}
public void setErpStatus(Integer erpStatus) {
this.erpStatus = erpStatus;
public void setRealStatus(Integer realStatus) {
this.realStatus = realStatus;
}
public Integer getStoreType() {
......@@ -514,7 +514,7 @@ public class StoreInfoDTO implements Serializable {
", overflowStatus=" + overflowStatus +
", status=" + status +
", completeStatus=" + completeStatus +
", erpStatus=" + erpStatus +
", realStatus=" + realStatus +
", storeType=" + storeType +
", createTime=" + createTime +
", updateTime=" + updateTime +
......
......@@ -36,12 +36,12 @@ public class StoreSearchDTO implements Serializable {
private Integer storeTagId;
private Integer completeStatus;
private List<Integer> storeResourceList;
private Integer erpStatus;
private Integer realStatus;
private String storeGroupIds;
private String regionIds;
private String storeTypes;
private String storeStatuss;
private String erpStatuss;
private String realStatuss;
private String storeTags;
public Integer getStoreGroupId() {
......@@ -238,13 +238,12 @@ public class StoreSearchDTO implements Serializable {
this.storeResourceList = storeResourceList;
}
public Integer getErpStatus() {
return erpStatus;
public Integer getRealStatus() {
return realStatus;
}
public StoreSearchDTO setErpStatus(Integer erpStatus) {
this.erpStatus = erpStatus;
return this;
public void setRealStatus(Integer realStatus) {
this.realStatus = realStatus;
}
public String getStoreGroupIds() {
......@@ -279,12 +278,12 @@ public class StoreSearchDTO implements Serializable {
this.storeStatuss = storeStatuss;
}
public String getErpStatuss() {
return erpStatuss;
public String getRealStatuss() {
return realStatuss;
}
public void setErpStatuss(String erpStatuss) {
this.erpStatuss = erpStatuss;
public void setRealStatuss(String realStatuss) {
this.realStatuss = realStatuss;
}
public String getStoreTags() {
......@@ -330,12 +329,12 @@ public class StoreSearchDTO implements Serializable {
", storeTagId=" + storeTagId +
", completeStatus=" + completeStatus +
", storeResourceList=" + storeResourceList +
", erpStatus=" + erpStatus +
", realStatus=" + realStatus +
", storeGroupIds='" + storeGroupIds + '\'' +
", regionIds='" + regionIds + '\'' +
", storeTypes='" + storeTypes + '\'' +
", storeStatuss='" + storeStatuss + '\'' +
", erpStatuss='" + erpStatuss + '\'' +
", realStatuss='" + realStatuss + '\'' +
", storeTags='" + storeTags + '\'' +
'}';
}
......
......@@ -32,7 +32,7 @@ public class StoreSearchDbDTO implements Serializable {
private List<Integer> storeIdList;
private List<Integer> storeInfoIdList;
private List<Integer> statusList;
private List<Integer> erpStatusList;
private List<Integer> realStatusList;
private Integer currentPage=1;
private Integer pageSize=20;
......@@ -188,12 +188,12 @@ public class StoreSearchDbDTO implements Serializable {
this.statusList = statusList;
}
public List<Integer> getErpStatusList() {
return erpStatusList;
public List<Integer> getRealStatusList() {
return realStatusList;
}
public void setErpStatusList(List<Integer> erpStatusList) {
this.erpStatusList = erpStatusList;
public void setRealStatusList(List<Integer> realStatusList) {
this.realStatusList = realStatusList;
}
public Integer getStoreBrandId() {
......@@ -252,7 +252,7 @@ public class StoreSearchDbDTO implements Serializable {
", storeIdList=" + storeIdList +
", storeInfoIdList=" + storeInfoIdList +
", statusList=" + statusList +
", erpStatusList=" + erpStatusList +
", realStatusList=" + realStatusList +
", currentPage=" + currentPage +
", pageSize=" + pageSize +
'}';
......
......@@ -426,4 +426,6 @@ public interface ClerkApiService {
* @throws
*/
ServiceResponse<List<ClerkDTO>> listHaobanClerk(Integer enterpriseId, Integer positionId);
ServiceResponse<Void> checkStoreRealStatus(String params);
}
......@@ -250,4 +250,6 @@ public interface TabStoreInfoMapper {
* @throws
*/
Integer hasUnCompleteStatusStore(@Param("enterpriseId") Integer enterpriseId);
int updateStoreRealStatus(@Param("storeInfoId") Integer storeInfoId, @Param("status") int status);
}
\ No newline at end of file
......@@ -96,7 +96,7 @@ public class TabStoreInfo {
/**
* erp门店状态
*/
private Integer erpStatus;
private Integer realStatus;
/**
* 门店类型
......@@ -253,12 +253,12 @@ public class TabStoreInfo {
this.status = status;
}
public Integer getErpStatus() {
return erpStatus;
public Integer getRealStatus() {
return realStatus;
}
public void setErpStatus(Integer erpStatus) {
this.erpStatus = erpStatus;
public void setRealStatus(Integer realStatus) {
this.realStatus = realStatus;
}
public Integer getStoreType() {
......
......@@ -124,7 +124,20 @@ public interface ClerkService {
* @throws
*/
List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, List<Integer> storeInfoIds, String search, Integer clerkType);
/**
* listClerkByStoreInfoId
* @Title: listClerkByStoreInfoId
* @Description:
* @author taogs
* @param enterpriseId
* @param storeInfoIds
* @param status
* @param search
* @return java.util.List<com.gic.store.entity.TabClerk>
* @throws
*/
List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, List<Integer> storeInfoIds, Integer status, String search);
/**
* getTotalClerk
* @Title: getTotalClerk
......
......@@ -503,4 +503,16 @@ public interface StoreService {
* @throws
*/
boolean hasUnCompleteStatusStore(Integer enterpriseId);
/**
* 导购变更,更新门店状态
* @Title: 导购变更,更新门店状态
* @Description:
* @author taogs
* @param storeInfoId
* @param status
* @return void
* @throws
*/
void updateStoreRealStatus(Integer storeInfoId, int status);
}
......@@ -7,6 +7,7 @@ import com.gic.store.dto.ClerkDTO;
import com.gic.store.dto.ClerkSearchDTO;
import com.gic.store.entity.TabClerk;
import com.gic.store.service.ClerkService;
import com.gic.store.service.StoreService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -24,6 +25,8 @@ public class ClerkServiceImpl implements ClerkService {
@Autowired
private TabClerkMapper tabClerkMapper;
@Autowired
private StoreService storeService;
@Override
public boolean isRepeatByClerkCode(Integer storeInfoId, String clerkCode, Integer clerkId) {
......@@ -72,6 +75,7 @@ public class ClerkServiceImpl implements ClerkService {
tabClerk.setCreateTime(new Date());
tabClerk.setStatus(StoreEnableOrDisAbleEnum.ENABLE.getCode());
tabClerkMapper.insertSelective(tabClerk);
this.storeService.updateStoreRealStatus(copy.getStoreInfoId(), StoreEnableOrDisAbleEnum.ENABLE.getCode());
return tabClerk.getClerkId();
}
......@@ -110,6 +114,11 @@ public class ClerkServiceImpl implements ClerkService {
}
@Override
public List<TabClerk> listClerkByStoreInfoId(Integer enterpriseId, List<Integer> storeInfoIds, Integer status, String search) {
return tabClerkMapper.listClerkByStoreInfoId(enterpriseId, storeInfoIds, null, search, null, status);
}
@Override
public Integer getTotalClerk(Integer enterpriseId, List<Integer> storeInfoIds, ClerkSearchDTO search) {
return tabClerkMapper.getTotalClerk(enterpriseId, storeInfoIds, search.getSearch(), search.getStatus());
}
......
......@@ -77,7 +77,7 @@ public class StoreServiceImpl implements StoreService {
tabStoreInfo.setOverflowStatus(0);
}
tabStoreInfo.setStatus(copy.getStatus());
tabStoreInfo.setErpStatus(copy.getErpStatus());
tabStoreInfo.setRealStatus(copy.getRealStatus());
tabStoreInfo.setStoreType(copy.getStoreType());
tabStoreInfo.setCreateType(copy.getCreateType());
tabStoreInfo.setCreateTime(new Date());
......@@ -115,7 +115,7 @@ public class StoreServiceImpl implements StoreService {
tabStoreInfo.setLongitude(copy.getLongitude());
tabStoreInfo.setLatitude(copy.getLatitude());
tabStoreInfo.setStatus(copy.getStatus());
tabStoreInfo.setErpStatus(copy.getErpStatus());
tabStoreInfo.setRealStatus(copy.getRealStatus());
tabStoreInfo.setStoreType(copy.getStoreType());
tabStoreInfo.setCompleteStatus(copy.getCompleteStatus());
tabStoreInfo.setIndexId(copy.getIndexId());
......@@ -211,7 +211,6 @@ public class StoreServiceImpl implements StoreService {
StringUtils.isNotBlank(storeDTO.getStoreCode()) &&
CollectionUtils.isNotEmpty(storeDTO.getPhotoList()) &&
storeDTO.getStoreType() != null &&
storeDTO.getErpStatus() != null &&
StringUtils.isNotBlank(storeDTO.getConactsPhone()) &&
CollectionUtils.isNotEmpty(storeDTO.getBusinessTimeList()) &&
StringUtils.isNotBlank(storeDTO.getBusinessTimeList().get(0).getWeekday()) &&
......@@ -577,4 +576,10 @@ public class StoreServiceImpl implements StoreService {
public boolean hasUnCompleteStatusStore(Integer enterpriseId) {
return tabStoreInfoMapper.hasUnCompleteStatusStore(enterpriseId) != null;
}
@Override
public void updateStoreRealStatus(Integer storeInfoId, int status) {
int i = this.tabStoreInfoMapper.updateStoreRealStatus(storeInfoId, status);
logger.info("更新门店状态记录数:{}", i);
}
}
\ No newline at end of file
......@@ -22,11 +22,10 @@ import com.gic.store.dto.clerk.OrderAddClerkDTO;
import com.gic.store.dto.clerk.PosAddClerkDTO;
import com.gic.store.dto.clerk.ProcessBatchClerkDTO;
import com.gic.store.entity.TabClerk;
import com.gic.store.entity.TabStoreRegion;
import com.gic.store.service.*;
import com.gic.store.utils.valid.ValidUtil;
import com.gic.weimob.api.dto.WeimobGuiderSynDTO;
import com.gic.weimob.api.service.WeimobStoreSiteService;
import com.gic.weimob.api.service.WeimobStoreSiteApiService;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -66,7 +65,7 @@ public class ClerkApiServiceImpl implements ClerkApiService {
@Autowired
private EnterpriseApiService enterpriseApiService;
@Autowired
private WeimobStoreSiteService weimobStoreSiteService;
private WeimobStoreSiteApiService weimobStoreSiteApiService;
@Autowired
private WmStoreSyncLogApiService wmStoreSyncLogApiService;
@Autowired
......@@ -133,6 +132,9 @@ public class ClerkApiServiceImpl implements ClerkApiService {
if (StringUtils.isNotBlank(clerkDTO.getPhoneNumber())) {
String nationcode = clerkDTO.getNationcode();
if (StringUtils.isBlank(nationcode)) {
if(clerkDTO.getPhoneNumber().length() != 11){
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "手机号国际码不能为空");
}
nationcode = Constants.NATION_CODE;
}
//默认加上+
......@@ -159,7 +161,6 @@ public class ClerkApiServiceImpl implements ClerkApiService {
clerkLogService.saveClerkLogBySaveClerk(clerkDTO.getEnterpriseId(), id, clerkDTO.getReason(),
clerkDTO.getRemark(), clerkDTO.getOperatorId(), clerkDTO.getOperatorName());
storeLogByAddClerk(clerkDTO);
synClerkInfoToWeimobMq(clerkDTO);
} else {
TabClerk oldClerk = this.clerkService.getById(clerkDTO.getClerkId());
......@@ -501,6 +502,12 @@ public class ClerkApiServiceImpl implements ClerkApiService {
Integer i = clerkService.updateClerkStatus(enterpriseId, clerkIdList, status);
for (Integer clerkId : clerkIdList) {
sparkJobApiService.updateClerkStatus(enterpriseId, clerkId.longValue(), 1 == status ? 0 : 1);
/**判断门店下是否还有启用导购**/
try {
GICMQClientUtil.getClientInstance().sendCommonMessage("commonRouter", clerkId+","+enterpriseId, "com.gic.store.service.ClerkApiService","checkStoreRealStatus");
} catch (Exception e) {
logger.warn("异常", e);
}
}
}
}
......@@ -808,7 +815,7 @@ public class ClerkApiServiceImpl implements ClerkApiService {
String wmGuiderDtoStr = (String) jsonObject.get("wmGuiderDTO");
WeimobGuiderSynDTO wmGuiderDTO = JSONObject.parseObject(wmGuiderDtoStr, WeimobGuiderSynDTO.class);
logger.info("异步导购微盟放入参数:{}", JSONObject.toJSONString(wmGuiderDTO));
ServiceResponse<Void> result = weimobStoreSiteService.addWeimobGuider(Integer.parseInt(wmMallStoreId),
ServiceResponse<Void> result = weimobStoreSiteApiService.addWeimobGuider(Integer.parseInt(wmMallStoreId),
Integer.parseInt(enterpriseId), wmGuiderDTO);
logger.info("异步导购结果:code:{}, message:{}", result.getCode(), result.getMessage());
return ServiceResponse.success();
......@@ -874,17 +881,17 @@ public class ClerkApiServiceImpl implements ClerkApiService {
List<WmStoreSyncLogDTO> wmStoreLog = wmStoreListResult.getResult();
wmStoreLog.forEach(storeLog -> {
ServiceResponse<Boolean> isExitClerkResult = weimobStoreSiteService
ServiceResponse<Boolean> isExitClerkResult = weimobStoreSiteApiService
.isExitClerk(storeLog.getWmMallStoreId(), clerkDTO.getPhoneNumber());
if (isExitClerkResult.isSuccess()) {
ServiceResponse<Void> weimobResult;
if (isExitClerkResult.getResult()) {
//如果存在了,则是更新操作
weimobResult = weimobStoreSiteService
weimobResult = weimobStoreSiteApiService
.updateWeimobGuider(storeLog.getWmMallStoreId(), storeLog.getEnterpriseId(), weimobGuiderSynDTO);
} else {
//新增操作
weimobResult = weimobStoreSiteService
weimobResult = weimobStoreSiteApiService
.addWeimobGuider(storeLog.getWmMallStoreId(), storeLog.getEnterpriseId(), weimobGuiderSynDTO);
}
logger.warn("导购增改微盟返回结果:{}", JSONObject.toJSONString(weimobResult));
......@@ -913,6 +920,28 @@ public class ClerkApiServiceImpl implements ClerkApiService {
return haobanClerk(clerkList);
}
@Override
public ServiceResponse<Void> checkStoreRealStatus(String params) {
String[] arr = params.split(",");
Integer clerkId = Integer.valueOf(arr[0]);
Integer enterpriseId = Integer.valueOf(arr[1]);
TabClerk tabClerk = this.clerkService.getById(clerkId);
if(tabClerk != null){
ArrayList<Integer> storeInfoIdList = new ArrayList<>();
storeInfoIdList.add(tabClerk.getStoreInfoId());
List<TabClerk> list = this.clerkService.listClerkByStoreInfoId(enterpriseId, storeInfoIdList, 1, null);
if(CollectionUtils.isEmpty(list)){
this.storeService.updateStoreRealStatus(tabClerk.getStoreInfoId(), 0);
}else {
ServiceResponse<StoreDTO> response = this.storeApiService.getStoreByStoreInfoId(enterpriseId, tabClerk.getStoreInfoId());
if(response.isSuccess() && response.getResult()!= null && response.getResult().getRealStatus() == 0){
this.storeService.updateStoreRealStatus(tabClerk.getStoreInfoId(), 1);
}
}
}
return ServiceResponse.success();
}
private ServiceResponse<List<ClerkDTO>> haobanClerk(List<TabClerk> clerkList) {
List<ClerkDTO> clerkDTOS = EntityUtil.changeEntityListByJSON(ClerkDTO.class, clerkList);
if (CollectionUtils.isNotEmpty(clerkDTOS)) {
......
......@@ -34,7 +34,7 @@ import com.gic.store.utils.field.*;
import com.gic.store.utils.valid.ValidUtil;
import com.gic.weimob.api.dto.WeimobPhysicalStoreDTO;
import com.gic.weimob.api.dto.WeimobStoreAccountDTO;
import com.gic.weimob.api.service.WeimobStoreSiteService;
import com.gic.weimob.api.service.WeimobStoreSiteApiService;
import com.google.common.base.Joiner;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -115,7 +115,7 @@ public class StoreApiServiceImpl implements StoreApiService {
@Autowired
private StoreTagService storeTagService;
@Autowired
private WeimobStoreSiteService weimobStoreSiteService;
private WeimobStoreSiteApiService weimobStoreSiteApiService;
@Autowired
private WmStoreSyncLogApiService wmStoreSyncLogApiService;
@Autowired
......@@ -478,13 +478,13 @@ public class StoreApiServiceImpl implements StoreApiService {
ServiceResponse<StoreDictDTO> newStoreType = this.storeDictApiService.getStoreDict("storeType", newStore.getStoreType().toString());
sb.append("变更为【").append(newStoreType.getResult().getKey()).append("】");
}
if (newStore.getErpStatus() != null && !newStore.getErpStatus().equals(oldStore.getErpStatus())) {
if (newStore.getRealStatus() != null && !newStore.getRealStatus().equals(oldStore.getRealStatus())) {
sb.append("门店状态");
if (oldStore.getErpStatus() != null) {
ServiceResponse<StoreDictDTO> oldStoreStatus = this.storeDictApiService.getStoreDict("storeStatus", oldStore.getErpStatus().toString());
if (oldStore.getRealStatus() != null) {
ServiceResponse<StoreDictDTO> oldStoreStatus = this.storeDictApiService.getStoreDict("storeStatus", oldStore.getRealStatus().toString());
sb.append("【").append(oldStoreStatus.getResult().getKey()).append("】");
}
ServiceResponse<StoreDictDTO> newStoreStatus = this.storeDictApiService.getStoreDict("storeStatus", newStore.getErpStatus().toString());
ServiceResponse<StoreDictDTO> newStoreStatus = this.storeDictApiService.getStoreDict("storeStatus", newStore.getRealStatus().toString());
sb.append("变更为【").append(newStoreStatus.getResult().getKey()).append("】");
}
if (StringUtils.isNotBlank(newStore.getConactsPhone()) && !StringUtils.equals(newStore.getConactsPhone(), oldStore.getConactsPhone())) {
......@@ -1511,7 +1511,7 @@ public class StoreApiServiceImpl implements StoreApiService {
esDTO.setCountyId(dto.getAreaId());
esDTO.setCreateType(dto.getCreateType());
esDTO.setEnterpriseId(enterpriseId);
esDTO.setErpStatus(dto.getErpStatus());
esDTO.setRealStatus(dto.getRealStatus());
esDTO.setId(enterpriseId + "_" + storeId);
esDTO.setProvinceId(dto.getProvinceId());
esDTO.setProvinces(dto.getProvinces());
......@@ -1709,8 +1709,8 @@ public class StoreApiServiceImpl implements StoreApiService {
json = QueryConditionAssemblyUtil.createSimpleQueryNode(StoreESFieldsEnum.STATUS.getField(), OperateEnum.OPERATE_ARR_CONTAIN, storeSearchDTO.getStoreStatuss());
jsonObjectList.add(json);
}
if(StringUtils.isNotBlank(storeSearchDTO.getErpStatuss())){
json = QueryConditionAssemblyUtil.createSimpleQueryNode(StoreESFieldsEnum.ERPSTATUS.getField(), OperateEnum.OPERATE_ARR_CONTAIN, storeSearchDTO.getErpStatuss());
if(StringUtils.isNotBlank(storeSearchDTO.getRealStatuss())){
json = QueryConditionAssemblyUtil.createSimpleQueryNode(StoreESFieldsEnum.REALSTATUS.getField(), OperateEnum.OPERATE_ARR_CONTAIN, storeSearchDTO.getRealStatuss());
jsonObjectList.add(json);
}
return json;
......@@ -1750,9 +1750,9 @@ public class StoreApiServiceImpl implements StoreApiService {
json = QueryConditionAssemblyUtil.createSimpleQueryNode(StoreESFieldsEnum.STATUS.getField(), OperateEnum.OPERATE_EQ, storeSearchDTO.getStatus());
jsonObjectList.add(json);
}
//门店状态
if (storeSearchDTO.getErpStatus() != null) {
json = QueryConditionAssemblyUtil.createSimpleQueryNode(StoreESFieldsEnum.ERPSTATUS.getField(), OperateEnum.OPERATE_EQ, storeSearchDTO.getErpStatus());
//门店真正的上线状态
if (storeSearchDTO.getRealStatus() != null) {
json = QueryConditionAssemblyUtil.createSimpleQueryNode(StoreESFieldsEnum.REALSTATUS.getField(), OperateEnum.OPERATE_EQ, storeSearchDTO.getRealStatus());
jsonObjectList.add(json);
}
if (storeSearchDTO.getCompleteStatus() != null) {
......@@ -1811,7 +1811,7 @@ public class StoreApiServiceImpl implements StoreApiService {
if (wmStoreListResult.isSuccess()) {
List<WmStoreSyncLogDTO> wmStoreList = wmStoreListResult.getResult();
wmStoreList.forEach(wmStore -> {
ServiceResponse<Void> weimobResult = this.weimobStoreSiteService
ServiceResponse<Void> weimobResult = this.weimobStoreSiteApiService
.updateWeimobPhysicalStore(wmStore.getWmMallStoreId(), storeDTO.getEnterpriseId(), weimobPhysicalStoreDTO);
logger.info("门店修改同步到微盟结果:{},店铺ID:{}", JSON.toJSONString(weimobResult), wmStore.getWmMallStoreId());
});
......
......@@ -134,7 +134,7 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
parseArea(t, storeDTO);
// todo 判断溢出
storeDTO.setOverflowStatus(0);
praseErpStatusAndStoreType(t, storeDTO);
praseStatusAndStoreType(t, storeDTO);
if (StringUtils.isNotBlank(t.getStoreGroupName())) {
storeDTO.setIsEditStoreGroup(1);
TabStoreGroup group = storeGroupService.getStoreGroupByName(t.getStoreGroupName(), t.getEnterpriseId());
......@@ -162,6 +162,7 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
storeDTO.setRemark("批量导入");
storeDTO.setOperatorId(t.getOperatorId());
storeDTO.setOperatorName(t.getOperatorName());
ServiceResponse<StoreDTO> serviceResponse = storeApiService.saveOrUpdate(storeDTO);
String msg;
if (serviceResponse.isSuccess()) {
......@@ -173,13 +174,13 @@ public class StoreTaskServiceImpl extends AbstractTaskAllocationOperation implem
storeImportService.updateData(t);
}
private void praseErpStatusAndStoreType(StoreTmpDTO t, StoreDTO storeDTO) {
private void praseStatusAndStoreType(StoreTmpDTO t, StoreDTO storeDTO) {
if (StringUtils.isNotBlank(t.getErpStatus())) {
ServiceResponse<List<StoreDictDTO>> erpStatusResponse = storeDictApiService.listStoreStatus(t.getEnterpriseId());
List<StoreDictDTO> erpList = erpStatusResponse.getResult();
final String erpStatusTmp = t.getErpStatus().replace("\\s+", "");
Optional<StoreDictDTO> erpStatusDTO = erpList.stream().filter(e -> e.getKey().equals(erpStatusTmp)).findFirst();
storeDTO.setErpStatus(Integer.parseInt(erpStatusDTO.get().getValue()));
ServiceResponse<List<StoreDictDTO>> statusResponse = storeDictApiService.listStoreStatus(t.getEnterpriseId());
List<StoreDictDTO> statusList = statusResponse.getResult();
final String statusTmp = t.getErpStatus().replace("\\s+", "");
Optional<StoreDictDTO> statusDTO = statusList.stream().filter(e -> e.getKey().equals(statusTmp)).findFirst();
storeDTO.setStatus(Integer.parseInt(statusDTO.get().getValue()));
}
if (StringUtils.isNotBlank(t.getStoreType())) {
ServiceResponse<List<StoreDictDTO>> storeTypeResponse = storeDictApiService.listStoreType(t.getEnterpriseId());
......
......@@ -66,7 +66,7 @@
<dubbo:service interface="com.gic.store.service.DictApiService" ref="dictApiService" timeout="6000" />
<dubbo:service interface="com.gic.store.service.StoreTransferApiService" ref="storeTransferApiService" timeout="6000" />
<dubbo:reference interface="com.gic.weimob.api.service.WeimobStoreSiteService" id="weimobStoreSiteService" timeout="6000"/>
<dubbo:reference interface="com.gic.weimob.api.service.WeimobStoreSiteApiService" id="weimobStoreSiteApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.enterprise.service.WmStoreSyncLogApiService" id="wmStoreSyncLogApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.spark.api.service.SparkJobApiService" id="sparkJobApiService" timeout="6000"/>
<dubbo:reference interface="com.gic.member.config.api.service.CardAscriptionConfigService" id="cardAscriptionConfigService" timeout="6000"/>
......
......@@ -18,7 +18,7 @@
<result column="overflow_status" jdbcType="INTEGER" property="overflowStatus" />
<result column="complete_status" jdbcType="INTEGER" property="completeStatus" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="erp_status" jdbcType="INTEGER" property="erpStatus" />
<result column="real_status" jdbcType="INTEGER" property="realStatus" />
<result column="store_type" jdbcType="INTEGER" property="storeType" />
<result column="create_type" jdbcType="INTEGER" property="createType" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
......@@ -37,7 +37,7 @@
<sql id="Base_Column_List">
${alias}.store_info_id, ${alias}.store_name, ${alias}.store_code, ${alias}.region_id, ${alias}.conacts_phone, ${alias}.address,
${alias}.brand_ids, ${alias}.province_id, ${alias}.city_id, ${alias}.area_id, ${alias}.provinces, ${alias}.longitude, ${alias}.latitude, ${alias}.overflow_status,
${alias}.complete_status, ${alias}.status, ${alias}.erp_status, ${alias}.store_type,${alias}.create_type, ${alias}.create_time, ${alias}.update_time, ${alias}.index_id
${alias}.complete_status, ${alias}.status, ${alias}.real_status, ${alias}.store_type,${alias}.create_type, ${alias}.create_time, ${alias}.update_time, ${alias}.index_id
</sql>
<sql id="Base_Column_List2">
${alias}.store_id, ${alias}.enterprise_id, ${alias}.store_group_id, ${alias}.own_type, ${alias}.is_edit_store_group,${alias}.from_enterprise_id
......@@ -50,17 +50,14 @@
from tab_store_info t
where t.store_info_id = #{storeInfoId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_store_info
where store_info_id = #{storeInfoId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.store.entity.TabStoreInfo">
insert into tab_store_info (store_info_id, store_name,
store_code, region_id, conacts_phone,
address, brand_ids, province_id,
city_id, area_id, provinces,
longitude, latitude, overflow_status,
complete_status, status, erp_status,
complete_status, status, real_status,
store_type,create_type, create_time, update_time,enterprise_id
)
values (#{storeInfoId,jdbcType=INTEGER}, #{storeName,jdbcType=VARCHAR},
......@@ -68,7 +65,7 @@
#{address,jdbcType=VARCHAR}, #{brandIds,jdbcType=VARCHAR}, #{provinceId,jdbcType=VARCHAR},
#{cityId,jdbcType=VARCHAR}, #{areaId,jdbcType=VARCHAR}, #{provinces,jdbcType=VARCHAR},
#{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, #{overflowStatus,jdbcType=INTEGER},
#{completeStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{erpStatus,jdbcType=INTEGER},
#{completeStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{realStatus,jdbcType=INTEGER},
#{storeType,jdbcType=INTEGER}, #{createType,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},#{enterpriseId,jdbcType=INTEGER}
)
......@@ -127,8 +124,8 @@
<if test="status != null">
status,
</if>
<if test="erpStatus != null">
erp_status,
<if test="realStatus != null">
real_status,
</if>
<if test="storeType != null">
store_type,
......@@ -195,8 +192,8 @@
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="erpStatus != null">
#{erpStatus,jdbcType=INTEGER},
<if test="realStatus != null">
#{realStatus,jdbcType=INTEGER},
</if>
<if test="storeType != null">
#{storeType,jdbcType=INTEGER},
......@@ -264,8 +261,8 @@
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="erpStatus != null">
erp_status = #{erpStatus,jdbcType=INTEGER},
<if test="realStatus != null">
real_status = #{realStatus,jdbcType=INTEGER},
</if>
<if test="storeType != null">
store_type = #{storeType,jdbcType=INTEGER},
......@@ -302,7 +299,7 @@
overflow_status = #{overflowStatus,jdbcType=INTEGER},
complete_status = #{completeStatus,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
erp_status = #{erpStatus,jdbcType=INTEGER},
real_status = #{realStatus,jdbcType=INTEGER},
store_type = #{storeType,jdbcType=INTEGER},
create_type = #{createType,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
......@@ -367,8 +364,8 @@
<if test="store.status != null">
and t1.status = #{store.status}
</if>
<if test="store.erpStatus != null ">
and t1.erp_status = #{store.erpStatus}
<if test="store.realStatus != null ">
and t1.real_status = #{store.realStatus}
</if>
<if test="store.regionId != null">
and t1.region_id = #{store.regionId}
......@@ -421,9 +418,9 @@
#{id}
</foreach>
</if>
<if test="store.erpStatusList != null and store.erpStatusList.size()>0">
and t1.erp_status in
<foreach collection="store.erpStatusList" index="index" item="id" open="(" separator="," close=")">
<if test="store.realStatusList != null and store.realStatusList.size()>0">
and t1.real_status in
<foreach collection="store.realStatusList" index="index" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
......@@ -566,4 +563,8 @@
and t1.complete_status = 0
limit 1
</select>
<update id="updateStoreRealStatus">
update tab_store_info set real_status=#{status} where store_info_id=#{storeInfoId} and delete_flag = 0
</update>
</mapper>
\ No newline at end of file
......@@ -147,7 +147,7 @@ public class StoreController extends DownloadUtils {
// 保存店长
ClerkDTO saveClerk = getSaveClerk(clerkQO);
storeDTO.setClerkLeader(saveClerk);
storeDTO.setRealStatus(1);
ServiceResponse<StoreDTO> serviceResponse = storeApiService.saveOrUpdate(storeDTO);
if (serviceResponse.isSuccess()) {
LogUtils.createLog((storeQO.getStoreId() == null ? "新增" : "编辑") + "门店", storeQO.getStoreName());
......@@ -517,17 +517,10 @@ public class StoreController extends DownloadUtils {
int statusIndex = fieldCodeList.indexOf("status");
if (statusIndex != -1) {
fieldCodeList.set(statusIndex, "statusName");
for (StoreDTO e : list) {
e.setStatusName(e.getStatus() == null ? "未知" : (e.getStatus() == 1 ? "已启用" : "未启用"));
}
}
int erpStatusIndex = fieldCodeList.indexOf("erpStatus");
if (erpStatusIndex != -1) {
fieldCodeList.set(erpStatusIndex, "erpStatusName");
Map<Integer, String> erpStatusMap = storeDictApiService.listAllStoreStatus(list.get(0).getEnterpriseId())
Map<Integer, String> statusMap = storeDictApiService.listAllStoreStatus(list.get(0).getEnterpriseId())
.getResult().stream().collect(Collectors.toMap(e -> Integer.valueOf(e.getValue()), StoreDictDTO::getKey));
for (StoreDTO e : list) {
e.setErpStatusName(erpStatusMap.get(e.getErpStatus()));
e.setStatusName(statusMap.get(e.getStatus()));
}
}
int storeTypeIndex = fieldCodeList.indexOf("storeType");
......@@ -735,7 +728,6 @@ public class StoreController extends DownloadUtils {
list.add(new StoreListSourceVO(StoreESFieldsEnum.COMPLETESTATUS.getField(), StoreESFieldsEnum.COMPLETESTATUS.getDesc()));
list.add(new StoreListSourceVO(StoreESFieldsEnum.STATUS.getField(), StoreESFieldsEnum.STATUS.getDesc()));
list.add(new StoreListSourceVO(StoreESFieldsEnum.REGIONNAME.getField(), StoreESFieldsEnum.REGIONNAME.getDesc()));
list.add(new StoreListSourceVO(StoreESFieldsEnum.ERPSTATUS.getField(), StoreESFieldsEnum.ERPSTATUS.getDesc()));
list.add(new StoreListSourceVO(StoreESFieldsEnum.STORETYPE.getField(), StoreESFieldsEnum.STORETYPE.getDesc()));
list.add(new StoreListSourceVO(StoreESFieldsEnum.STOREID.getField(), StoreESFieldsEnum.STOREID.getDesc(),1));
return list;
......
......@@ -83,11 +83,6 @@ public class StoreQO implements Serializable {
private Integer status;
/**
* erp门店状态
*/
private Integer erpStatus;
/**
* 门店类型
*/
private Integer storeType;
......@@ -223,14 +218,6 @@ public class StoreQO implements Serializable {
this.status = status;
}
public Integer getErpStatus() {
return erpStatus;
}
public void setErpStatus(Integer erpStatus) {
this.erpStatus = erpStatus;
}
public Integer getStoreType() {
return storeType;
}
......
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