Commit 90896028 by zhiwj

bug

parent 6cb718f0
......@@ -296,13 +296,29 @@ public class StoreController extends DownloadUtils {
}
@RequestMapping("bulk-update-store")
public RestResponse bulkUpdateStatus(String storeIds, String value, int type, String toStoreId) {
public RestResponse bulkUpdateStatus(String storeIds, String value, int type, Integer toStoreId) {
Integer enterpriseId = UserDetailUtils.getUserDetail().getEnterpriseId();
if (StringUtils.isBlank(storeIds) || StringUtils.isBlank(value)) {
return EnterpriseRestResponse.failure(ErrorCode.MISS_PARAMETER);
}
ServiceResponse response = this.storeApiService.bulkUpdateStore(storeIds, value, enterpriseId, type, UserDetailUtils.getUserDetail().getUserId(), UserDetailUtils.getUserDetail().getUserInfo().getUserName());
if (response.isSuccess()) {
if (type == 1 && toStoreId != null) {
// 如果是批量修改状态 要转移门店
StoreSearchDTO storeSearchDTO = new StoreSearchDTO();
storeSearchDTO.setStoreIds(storeIds.replace(',', ' '));
List<String> list = this.storeApiService.listStore(storeSearchDTO, 1, 1000, "storeInfoId").getResult().getResult()
.stream().map(e -> e.getStoreInfoId().toString()).collect(Collectors.toList());
Integer storeInfoId = storeApiService.getStoreById(UserDetailUtils.getUserDetail().getEnterpriseId(), toStoreId).getResult().getStoreInfoId();
StoreBatchUpdateDTO storeBatchUpdateDTO = new StoreBatchUpdateDTO();
storeBatchUpdateDTO.setEnterpriseId(UserDetailUtils.getUserDetail().getEnterpriseId());
storeBatchUpdateDTO.setSourceStoreInfoIdList(list);
storeBatchUpdateDTO.setTargetStoreInfoId(storeInfoId + "");
storeBatchUpdateDTO.setUserId(UserDetailUtils.getUserDetail().getUserId());
logger.info("transfer-store-member:{}", JSON.toJSONString(storeBatchUpdateDTO));
this.storeUpdateApiService.storeBatchUpdate(storeBatchUpdateDTO);
}
// 写日志
String[] storeArr = storeIds.split(",");
StoreSearchDTO storeSearchDTO = new StoreSearchDTO();
storeSearchDTO.setEnterpriseId(enterpriseId);
......
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