Commit fae0c8f5 by guojuxing

can not cast StoreDTO to JSONObject修改

parent e6d32c36
......@@ -6,6 +6,7 @@ import com.gic.api.base.commons.ServiceResponse;
import com.gic.plug.web.strategy.ScreenBackStrategy;
import com.gic.plug.web.utils.ComputeBackUtil;
import com.gic.store.constant.StoreESFieldsEnum;
import com.gic.store.dto.StoreDTO;
import com.gic.store.dto.StoreSearchDTO;
import com.gic.store.service.StoreApiService;
import org.apache.commons.collections.CollectionUtils;
......@@ -27,12 +28,12 @@ public class StoreBackImpl implements ScreenBackStrategy {
StoreSearchDTO storeSearchDTO = new StoreSearchDTO();
storeSearchDTO.setEnterpriseId(enterpriseId);
storeSearchDTO.setStoreIds(value);
ServiceResponse response = this.storeApiService.listStore(storeSearchDTO, 1, 50, StoreESFieldsEnum.STORENAME.getField());
ServiceResponse<Page<StoreDTO>> response = this.storeApiService.listStore(storeSearchDTO, 1, 50, StoreESFieldsEnum.STORENAME.getField());
if(response.isSuccess()){
List<JSONObject> list = ((Page)response.getResult()).getResult();
List<StoreDTO> list = ((Page)response.getResult()).getResult();
if(CollectionUtils.isNotEmpty(list)){
for (int i = 0,length = list.size(); i < length; i ++) {
JSONObject jsonObject = list.get(i);
for (StoreDTO storeDTO : list) {
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(storeDTO);
stringBuilder.append("【").append(jsonObject.getString(StoreESFieldsEnum.STORENAME.getField())).append("】").append(" ");
}
}
......
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