Commit adcca63e by 陶光胜

门店批量导入修改

parent 791c534f
......@@ -454,11 +454,10 @@ public class ClerkApiServiceImpl implements ClerkApiService {
String[] split = clerkIds.split(GlobalInfo.FLAG_COMMA);
clerkIdList = Stream.of(split).map(Integer::parseInt).collect(Collectors.toList());
}
List<Integer> clerkIdListNew = new ArrayList<>();
if(StoreStatusEnum.INONLINE.getCode() == status){
List<UserOwnerDefaultDTO> result = this.cardAscriptionConfigService.getDefaultUserOwner(enterpriseId).getResult();
if(CollectionUtils.isNotEmpty(result)){
clerkIdListNew = clerkIdList.stream().filter(clerkId -> {
clerkIdList = clerkIdList.stream().filter(clerkId -> {
for(UserOwnerDefaultDTO dto : result){
if(clerkId.intValue() == dto.getClerkId().intValue()){
return false;
......@@ -468,9 +467,11 @@ public class ClerkApiServiceImpl implements ClerkApiService {
}).collect(Collectors.toList());
}
}
Integer i = clerkService.updateClerkStatus(enterpriseId, CollectionUtils.isEmpty(clerkIdListNew) ? clerkIdList : clerkIdListNew, status);
for (Integer clerkId : clerkIdList) {
sparkJobApiService.updateClerkStatus(enterpriseId, clerkId.longValue(), 1 == status ? 0 : 1);
if(CollectionUtils.isNotEmpty(clerkIdList)){
Integer i = clerkService.updateClerkStatus(enterpriseId, clerkIdList, status);
for (Integer clerkId : clerkIdList) {
sparkJobApiService.updateClerkStatus(enterpriseId, clerkId.longValue(), 1 == status ? 0 : 1);
}
}
}
......
......@@ -30,7 +30,6 @@ public class StoreStatusStrategyImpl implements BulkUpdateStoreStrtegy {
@Override
public int bulkUpdateStore(String storeInfoIds, Integer enterpriseId, String value, StoreService storeService, Integer operatorId, String operatorName) {
List<Integer> storeInfoIdList = new ArrayList<>();
List<Integer> storeInfoIdListNew = new ArrayList<>();
List<UserOwnerDefaultDTO> result = this.cardAscriptionConfigService.getDefaultUserOwner(enterpriseId).getResult();
if ("all".equals(storeInfoIds)) {
storeInfoIdList = storeService.listAllStoreInfoId(enterpriseId);
......@@ -42,7 +41,7 @@ public class StoreStatusStrategyImpl implements BulkUpdateStoreStrtegy {
}
}
if(CollectionUtils.isNotEmpty(result) && StoreStatusEnum.INONLINE.getCode() == Integer.valueOf(value)){
storeInfoIdListNew = storeInfoIdList.stream().filter(storeInfoId -> {
storeInfoIdList = storeInfoIdList.stream().filter(storeInfoId -> {
for(UserOwnerDefaultDTO dto : result){
if(storeInfoId.intValue() == dto.getStoreInfoId().intValue()){
return false;
......@@ -51,17 +50,20 @@ public class StoreStatusStrategyImpl implements BulkUpdateStoreStrtegy {
return true;
}).collect(Collectors.toList());
}
String storeInfoIdsNew = StringUtils.join(CollectionUtils.isNotEmpty(storeInfoIdListNew) ? storeInfoIdListNew : storeInfoIdList, ",");
int i = storeService.bulkUpdateStoreStatus(storeInfoIdsNew, enterpriseId, value);
if (i > 0) {
int valueCode = Integer.parseInt(value);
storeLogService.saveBulkStoreStatusLog(storeInfoIdList, enterpriseId, operatorId, operatorName, "门店状态变更为【" + StoreStatusEnum.parseCode(valueCode) + "】");
for (Integer storeInfoId : storeInfoIdList) {
// 启用禁用的值和会员组取的不一致 需要转换下
sparkJobApiService.updateStoreStatus(enterpriseId, storeInfoId, StoreStatusEnum.ONLINE.getCode() == valueCode ? 0 : 1);
if(CollectionUtils.isNotEmpty(storeInfoIdList)){
String storeInfoIdsNew = StringUtils.join(storeInfoIdList, ",");
int i = storeService.bulkUpdateStoreStatus(storeInfoIdsNew, enterpriseId, value);
if (i > 0) {
int valueCode = Integer.parseInt(value);
storeLogService.saveBulkStoreStatusLog(storeInfoIdList, enterpriseId, operatorId, operatorName, "门店状态变更为【" + StoreStatusEnum.parseCode(valueCode) + "】");
for (Integer storeInfoId : storeInfoIdList) {
// 启用禁用的值和会员组取的不一致 需要转换下
sparkJobApiService.updateStoreStatus(enterpriseId, storeInfoId, StoreStatusEnum.ONLINE.getCode() == valueCode ? 0 : 1);
}
}
return i;
}
return i;
return 0;
}
}
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