Commit 3beff1e3 by 徐高华

Merge remote-tracking branch 'origin/master-xgh-好办停用' into developer

Conflicts:
	haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/StoreController.java
parents c18fed54 4e2e729d
...@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.alibaba.dubbo.common.utils.CollectionUtils; import com.alibaba.dubbo.common.utils.CollectionUtils;
import com.alibaba.fastjson.JSON;
import com.gic.clerk.api.dto.ClerkDTO; import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService; import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
...@@ -110,43 +111,35 @@ public class StoreController extends WebBaseController { ...@@ -110,43 +111,35 @@ public class StoreController extends WebBaseController {
logger.info("没有关联任何商户:{}", wxEnterpriseId); logger.info("没有关联任何商户:{}", wxEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
List<String> enterpriseIdList = enterpriseList.stream().filter(dto->{
String enterprsieId = dto.getEnterpriseId() ;
Integer code = this.enterpriseUseForbidService.selectPermissionStatus(enterprsieId, EnterpriseServiceEnum.HAO_BAN.getRightMenuCode()) ;
logger.info("是否停用={},{}",enterprsieId,code);
if(code ==0 || code==1) {
return true ;
}
return false ;
}).map(EnterpriseDetailDTO::getEnterpriseId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(enterpriseIdList)) {
logger.info("没有关联任何商户或商户都已停用:{}", wxEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_1);
}
Map<String, EnterpriseDetailDTO> enterpriseTypeMap = enterpriseList.stream().collect(Collectors.toMap(dto -> dto.getEnterpriseId(), dto -> dto)); Map<String, EnterpriseDetailDTO> enterpriseTypeMap = enterpriseList.stream().collect(Collectors.toMap(dto -> dto.getEnterpriseId(), dto -> dto));
List<String> enterpriseIdList = enterpriseList.stream().map(EnterpriseDetailDTO::getEnterpriseId).collect(Collectors.toList());
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCodeByStaffId(enterpriseIdList, staffId); List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCodeByStaffId(enterpriseIdList, staffId);
if (CollectionUtils.isEmpty(bindRelationList)) { if (CollectionUtils.isEmpty(bindRelationList)) {
logger.info("没有关联任何商户导购:{}", wxEnterpriseId); logger.info("没有关联任何商户导购:{}", wxEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
Map<String,Boolean> map = new HashMap<>(); logger.info("成员绑定导购数据={}",JSON.toJSONString(bindRelationList));
for (StaffClerkRelationDTO staffClerkRelationDTO : bindRelationList) { for (StaffClerkRelationDTO staffClerkRelationDTO : bindRelationList) {
String storeId = staffClerkRelationDTO.getStoreId() ; String storeId = staffClerkRelationDTO.getStoreId() ;
StoreDTO store = storeService.getStore(storeId); StoreDTO store = storeService.getStore(storeId);
if (store == null) { if (store == null) {
continue; continue;
} }
String enterprsieId = store.getEnterpriseId() ; String enterpriseId = store.getEnterpriseId();
if(StringUtils.isNotBlank(gicEnterpriseId) && !gicEnterpriseId.equals(enterprsieId)) { ClerkDTO clerk = clerkService.getClerkByClerkCode(enterpriseId, staffClerkRelationDTO.getClerkCode());
logger.info("非当前商户,跳过={},{}",gicEnterpriseId,enterprsieId);
continue ;
}
if(null != map.get(enterprsieId)) {
if(Boolean.FALSE.equals(map.get(enterprsieId))) {
logger.info("该企业过期,{}", enterprsieId);
continue ;
}
}else {
Integer code = this.enterpriseUseForbidService.selectPermissionStatus(enterprsieId, EnterpriseServiceEnum.HAO_BAN.getRightMenuCode()) ;
logger.info("是否停用={},{}",enterprsieId,code);
// 不能用
if(!(code ==0 || code==1)) {
logger.info("该企业过期,{}", staffId, enterprsieId);
map.put(enterprsieId, false) ;
continue;
}
}
map.put(enterprsieId, true) ;
ClerkDTO clerk = clerkService.getClerkByClerkCode(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getClerkCode());
if (clerk == null) { if (clerk == null) {
continue; continue;
} }
...@@ -158,7 +151,6 @@ public class StoreController extends WebBaseController { ...@@ -158,7 +151,6 @@ public class StoreController extends WebBaseController {
if (wxEnterpriseDTO == null) { if (wxEnterpriseDTO == null) {
continue; continue;
} }
String enterpriseId = clerk.getEnterpriseId();
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(enterpriseId); EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(enterpriseId);
if (enterpriseDTO == null) { if (enterpriseDTO == null) {
continue; continue;
......
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