| | |
| | | import com.whyc.util.ThreadLocalUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import sun.applet.Main; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | |
| | | //对结果进行处理 |
| | | if(response.getCode() == 1){ //请求成功,data有正常数据 |
| | | String dataStr = (String) response.getData(); |
| | | //截取dataStr中"data:"后的字符串 |
| | | /*//截取dataStr中"data:"后的字符串 |
| | | int index = dataStr.indexOf("data"); |
| | | dataStr = dataStr.substring(index+6, dataStr.length()-3); |
| | | //WmsLocationDto wmsLocationDto = JsonUtil.getGson().fromJson(dataStr, WmsLocationDto.class); |
| | | List<WmsLocationDto> wmsLocationDtoList = JsonUtil.getGson().fromJson(dataStr, new TypeToken<List<WmsLocationDto>>(){}.getType()); |
| | | //WmsLocationDto wmsLocationDto = JsonUtil.getGson().fromJson(dataStr, WmsLocationDto.class);*/ |
| | | WmsResponse<List<WmsLocationDto>> wmsResponse = JsonUtil.getGson().fromJson(dataStr, new TypeToken<WmsResponse<List<WmsLocationDto>>>(){}.getType()); |
| | | List<WmsLocationDto> wmsLocationDtoList = wmsResponse.getData(); |
| | | response.set(1,wmsLocationDtoList); |
| | | } |
| | | return response; |
| | |
| | | //对结果进行处理 |
| | | if(response.getCode() == 1){ //请求成功,data有正常数据 |
| | | String dataStr = (String) response.getData(); |
| | | /* |
| | | //截取dataStr中"data:"后的字符串 |
| | | int index = dataStr.indexOf("data"); |
| | | dataStr = dataStr.substring(index+6, dataStr.length()-3); |
| | | //WmsLocationDto wmsLocationDto = JsonUtil.getGson().fromJson(dataStr, WmsLocationDto.class); |
| | | List<WmsPallet> wmsPalletList = JsonUtil.getGson().fromJson(dataStr, new TypeToken<List<WmsPallet>>(){}.getType()); |
| | | List<WmsPallet> wmsPalletList = JsonUtil.getGson().fromJson(dataStr, new TypeToken<List<WmsPallet>>(){}.getType());*/ |
| | | WmsResponse<List<WmsPallet>> wmsResponse = JsonUtil.getGson().fromJson(dataStr, new TypeToken<WmsResponse<List<WmsPallet>>>(){}.getType()); |
| | | List<WmsPallet> wmsPalletList = wmsResponse.getData(); |
| | | response.set(1,wmsPalletList); |
| | | } |
| | | return response; |