|
|
@@ -4,57 +4,57 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
-import org.jeecg.modules.smscheck.entity.FileStaticUrl;
|
|
|
-import org.jeecg.modules.smscheck.entity.MyCustomAnnotation;
|
|
|
-import org.jeecg.modules.smscheck.entity.SmsCheckCustomerData;
|
|
|
-import org.jeecg.modules.smscheck.entity.UrlData;
|
|
|
-
|
|
|
+import io.swagger.models.auth.In;
|
|
|
+import org.jeecg.modules.smscheck.entity.*;
|
|
|
+import org.jeecg.modules.smscheck.service.ISmsCheckCustomerInfoService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.lang.reflect.Array;
|
|
|
import java.lang.reflect.Field;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+
|
|
|
public class ObjectComparator {
|
|
|
- public static Map<String, Object> compareObjects(Object obj1, Object obj2) throws IllegalAccessException {
|
|
|
+
|
|
|
+
|
|
|
+ public static Map<String, Object> compareObjects(Object obj1, Object obj2, Integer type) throws IllegalAccessException {
|
|
|
Map<String, Object> diffProperties = new HashMap<>();
|
|
|
|
|
|
Class<?> clazz = obj1.getClass();
|
|
|
Field[] fields = clazz.getDeclaredFields();
|
|
|
-
|
|
|
+ int i=-1;
|
|
|
for (Field field : fields) {
|
|
|
-
|
|
|
+ i++;
|
|
|
field.setAccessible(true);
|
|
|
Object value1 = field.get(obj1);
|
|
|
Object value2 = field.get(obj2);
|
|
|
if (value1!=null && value2!=null && field!=null && field.getAnnotation(ApiModelProperty.class)!=null ){
|
|
|
+ System.out.println(field.getAnnotation(ApiModelProperty.class).value());
|
|
|
if (!value1.equals(value2)) {
|
|
|
- if (!field.getAnnotation(ApiModelProperty.class).value().contains("上传资料") && !field.getAnnotation(ApiModelProperty.class).value().contains("稽核结果")){
|
|
|
- if (field.getAnnotation(ApiModelProperty.class).value().contains("是否")){
|
|
|
- if (value1.equals("1")){
|
|
|
- value1="是";
|
|
|
- }else {
|
|
|
- value1="否";
|
|
|
- }
|
|
|
- if (value2.equals("1")){
|
|
|
- value2="是";
|
|
|
- }else {
|
|
|
- value2="否";
|
|
|
+ if (!field.getAnnotation(ApiModelProperty.class).value().contains("上传资料") && !field.getAnnotation(ApiModelProperty.class).value().contains("稽核结果")){
|
|
|
+ // if (!field.getAnnotation(ApiModelProperty.class).value().contains("上传资料")){
|
|
|
+ if (!field.getAnnotation(ApiModelProperty.class).value().contains("稽核结果") && type!=2){
|
|
|
+ if (field.getAnnotation(ApiModelProperty.class).value().contains("是否")){
|
|
|
+ if (value1.equals("1")){
|
|
|
+ value1="是";
|
|
|
+ }else {
|
|
|
+ value1="否";
|
|
|
+ }
|
|
|
+ if (value2.equals("1")){
|
|
|
+ value2="是";
|
|
|
+ }else {
|
|
|
+ value2="否";
|
|
|
+ }
|
|
|
}
|
|
|
+ diffProperties.put(field.getAnnotation(ApiModelProperty.class).value(), "原值:"+value2+" -> 现值:"+value1);
|
|
|
}
|
|
|
-// if (field.getAnnotation(ApiModelProperty.class).value().contains("稽核结果")){
|
|
|
-// if (value1.equals("1")){
|
|
|
-// value1="是";
|
|
|
-// }else {
|
|
|
-// value1="否";
|
|
|
-// }
|
|
|
-// if (value2.equals("1")){
|
|
|
-// value2="是";
|
|
|
-// }else {
|
|
|
-// value2="否";
|
|
|
-// }
|
|
|
-// }
|
|
|
- diffProperties.put(field.getAnnotation(ApiModelProperty.class).value(), "原值:"+value2+" -> 现值:"+value1);
|
|
|
}
|
|
|
-
|
|
|
+ if (field.getAnnotation(ApiModelProperty.class).value().contains("稽核结果") && type==2){
|
|
|
+ diffProperties.put(field.getAnnotation(ApiModelProperty.class).value(), "原值:"+value2+" -> 现值:"+value1);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|