Commit cf15d099 by 徐高华

参数校验

parent 19915fb0
......@@ -15,6 +15,7 @@ import com.gic.marketing.pro.api.dto.offline.OfflinePreInfoDTO;
import com.gic.marketing.pro.api.qdto.offline.PageOfflinePreQDTO;
import com.gic.marketing.pro.api.qdto.offline.WriteOffOfflinePreQDTO;
import com.gic.marketing.pro.api.service.offline.OfflinePreApiService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -90,11 +91,11 @@ public class OfflinePreController {
*/
@RequestMapping("/check-offline-pre-write-off")
@ResponseBody
public RestResponse<Void> checkOfflinePreWriteOff(Object offlinePreId, String storeId){
if(null == offlinePreId || !NumberUtil.isNumber(offlinePreId.toString())) {
public RestResponse<Void> checkOfflinePreWriteOff(String offlinePreId, String storeId){
if(StringUtils.isBlank(offlinePreId) || !NumberUtil.isNumber(offlinePreId.trim())) {
return RestResponse.failure("9999","参数错误") ;
}
ServiceResponse<Void> countOfflinePre = offlinePreApiService.checkOfflinePreWriteOff(Long.valueOf(offlinePreId.toString()), storeId);
ServiceResponse<Void> countOfflinePre = offlinePreApiService.checkOfflinePreWriteOff(Long.valueOf(offlinePreId.trim()), storeId);
return JSONObject.parseObject(JSONObject.toJSONString(countOfflinePre, SerializerFeature.WriteMapNullValue), RestResponse.class);
}
}
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