Commit 7ea37991 authored by 刘凡's avatar 刘凡

修改:修改气瓶同步消息

parent 727a8d68
...@@ -114,6 +114,7 @@ public class CylinderController { ...@@ -114,6 +114,7 @@ public class CylinderController {
try { try {
validateResult = cylinderFillingDataValidationService.validateFilling(jsonobject); validateResult = cylinderFillingDataValidationService.validateFilling(jsonobject);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
logger.error("液化气体气瓶充装信息上报,数据校验失败"); logger.error("液化气体气瓶充装信息上报,数据校验失败");
cylinderFillingMessage.setMessage(e.getMessage()); cylinderFillingMessage.setMessage(e.getMessage());
} }
...@@ -131,7 +132,7 @@ public class CylinderController { ...@@ -131,7 +132,7 @@ public class CylinderController {
if (!ObjectUtils.isEmpty(validateResult.getRecordErrorData())) { if (!ObjectUtils.isEmpty(validateResult.getRecordErrorData())) {
errorNumber += validateResult.getRecordErrorData().size(); errorNumber += validateResult.getRecordErrorData().size();
error.put("充装填充错误数据:", validateResult.getRecordErrorData()); error.put("填充错误数据:", validateResult.getRecordErrorData());
message.add("充装记录数据异常气瓶数:" + validateResult.getRecordErrorCylinderNumber()); message.add("充装记录数据异常气瓶数:" + validateResult.getRecordErrorCylinderNumber());
} }
...@@ -151,6 +152,8 @@ public class CylinderController { ...@@ -151,6 +152,8 @@ public class CylinderController {
throw new BadRequest(error.toString()); throw new BadRequest(error.toString());
} }
} else {
throw new BadRequest("数据校验失败!!!");
} }
// Map<String, Class> classMap = new HashMap<>(); // Map<String, Class> classMap = new HashMap<>();
......
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.api.openapi.face.orm.dao.MidEquipRegistrationInfoMapper; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.api.openapi.face.orm.dao.MidEquipRegistrationInfoMapper;
import com.yeejoin.amos.api.openapi.face.orm.entity.MidEquipRegistrationInfo; import com.yeejoin.amos.api.openapi.face.orm.entity.MidEquipRegistrationInfo;
import com.yeejoin.amos.boot.module.cylinder.api.dto.TzBaseEnterpriseInfoDto; import com.yeejoin.amos.boot.module.cylinder.api.dto.TzBaseEnterpriseInfoDto;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import net.sf.json.JSONNull;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -375,7 +376,7 @@ public class CylinderFillingDataValidationService { ...@@ -375,7 +376,7 @@ public class CylinderFillingDataValidationService {
for (int i = 0; i < jsonArray.size(); i++) { for (int i = 0; i < jsonArray.size(); i++) {
JSONObject row = jsonArray.getJSONObject(i); JSONObject row = jsonArray.getJSONObject(i);
for (String key : keys) { for (String key : keys) {
if (!row.containsKey(key) || ObjectUtils.isEmpty(row.get(key) )) { if (!row.containsKey(key) || ObjectUtils.isEmpty(row.get(key)) || row.get(key).equals(JSONNull.getInstance())) {
errorList.add(row.toString()); errorList.add(row.toString());
} }
} }
......
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