Commit 93eaef2b authored by 李秀明's avatar 李秀明

Merge remote-tracking branch 'origin/develop_dl_bugfix' into develop_dl_bugfix

parents 2a6ae852 5a72e0c1
......@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.util.ReflectionUtils;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -131,7 +132,8 @@ public class DataDictionaryController extends BaseController {
Class<? extends DataDictionary> aClass = dataDictionary.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
// field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(dataDictionary);
if (o != null) {
Class<?> type = field.getType();
......@@ -369,7 +371,7 @@ public class DataDictionaryController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "清楚redis缓存", notes = "清楚redis缓存")
public ResponseModel<Object> cleanRedis(@RequestParam String type) throws Exception {
type = type.toLowerCase();
if ("all".equals(type)) {
if ("all".equalsIgnoreCase(type)) {
RedisConnection redisConnection = redisTemplate.getConnectionFactory().getConnection();
redisConnection.flushAll();
redisConnection.close();
......
......@@ -22,10 +22,7 @@ import java.io.OutputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
public class ExcelUtil {
......@@ -215,7 +212,7 @@ public class ExcelUtil {
if (fileName == null) {
throw new Exception("文件不存在!");
}
if (!fileName.toLowerCase().endsWith(ExcelTypeEnum.XLS.getValue()) && !fileName.toLowerCase().endsWith(ExcelTypeEnum.XLSX.getValue())) {
if (!fileName.toLowerCase(Locale.ENGLISH).endsWith(ExcelTypeEnum.XLS.getValue()) && !fileName.toLowerCase(Locale.ENGLISH).endsWith(ExcelTypeEnum.XLSX.getValue())) {
throw new Exception("文件类型异常!");
}
InputStream inputStream;
......
......@@ -24,7 +24,7 @@ public class DynamicEnumUtil {
IllegalAccessException {
// 反射访问私有变量
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
/**
* 接下来,我们将字段实例中的修饰符更改为不再是final,
......
......@@ -7,10 +7,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import javax.servlet.http.HttpServletResponse;
......@@ -282,8 +279,8 @@ public class ExcelUtil {
if (fileName == null) {
throw new Exception("文件不存在!");
}
if (!fileName.toLowerCase().endsWith(ExcelTypeEnum.XLS.getValue())
&& !fileName.toLowerCase().endsWith(ExcelTypeEnum.XLSX.getValue())) {
if (!fileName.toLowerCase(Locale.ENGLISH).endsWith(ExcelTypeEnum.XLS.getValue())
&& !fileName.toLowerCase(Locale.ENGLISH).endsWith(ExcelTypeEnum.XLSX.getValue())) {
throw new Exception("文件类型异常!");
}
InputStream inputStream;
......
package com.yeejoin.equipmanage.common.utils;
import java.math.BigDecimal;
import java.util.Locale;
import java.util.concurrent.ConcurrentHashMap;
/**
......@@ -224,7 +225,7 @@ public class BillCodeManagerUtil {
throw new IllegalArgumentException("未输入正确参数,编码前缀(prefix),编码(code)!");
}
String tmp_prefix = prefix.toUpperCase();
String tmp_prefix = prefix.toUpperCase(Locale.ENGLISH);
switch (tmp_prefix) {
case INBOUND:
return checkInboundCode(code);
......
......@@ -264,7 +264,7 @@ public class EquipmentStateUtil {
}
public static String judgeEquipState(EquipmentSpecificIndex index) {
if (TrueOrFalseEnum.real.value.toUpperCase().equals(String.valueOf(index.getValue()).toUpperCase())) {
if (TrueOrFalseEnum.real.value.equalsIgnoreCase(String.valueOf(index.getValue()))) {
return AlarmStatusEnum.BJ.getCode() == index.getIsAlarm() ? index.getEmergencyLevelColor() : "";
}
return "";
......
......@@ -9,10 +9,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.*;
public class FileUtil {
......@@ -91,7 +88,7 @@ public class FileUtil {
fileName = System.currentTimeMillis() + "_" + name;
// 获取文件的后缀名
String suffixName = fileName.substring(fileName.lastIndexOf(".")).toLowerCase();// 例如:.jpg
String suffixName = fileName.substring(fileName.lastIndexOf(".")).toLowerCase(Locale.ENGLISH);// 例如:.jpg
// 文件上传后的路径
String filePath = getFilePath(suffixName);// 1.images 2.musics 3.videos
// 4.docs
......
......@@ -201,7 +201,7 @@ public class ReflectUtil {
public static void makeAccessible(Method method) {
if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers()))
&& !method.isAccessible()) {
method.setAccessible(true);
ReflectionUtils.makeAccessible(method);
}
}
......@@ -211,7 +211,7 @@ public class ReflectUtil {
public static void makeAccessible(Field field) {
if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) || Modifier
.isFinal(field.getModifiers())) && !field.isAccessible()) {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
}
}
......
......@@ -167,7 +167,7 @@ public final class ResponseUtils {
public static Object getGetMethod(Object ob , String name)throws Exception{
Method[] m = ob.getClass().getMethods();
for(int i = 0;i < m.length;i++){
if(("get"+name).toLowerCase().equals(m[i].getName().toLowerCase())){
if(("get"+name).equalsIgnoreCase(m[i].getName())){
return m[i].invoke(ob);
}
}
......
package com.yeejoin.amos.boot.module.jcs.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
......@@ -9,7 +8,6 @@ import lombok.Getter;
* @author DELL
*/
@Getter
@AllArgsConstructor
public enum EquipTypeEnum {
/**
......@@ -34,4 +32,9 @@ public enum EquipTypeEnum {
public void setName(String name) {
this.name = name;
}
EquipTypeEnum(String key, String name) {
this.key = key;
this.name = name;
}
}
package com.yeejoin.amos.boot.module.jcs.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
......@@ -9,7 +8,6 @@ import lombok.Getter;
* @author DELL
*/
@Getter
@AllArgsConstructor
public enum FireBrigadeTypeEnum {
专职消防队("fullTime", "116", "专职消防队"),
医疗救援队("medicalTeam", "830", "医疗救援队"),
......@@ -18,4 +16,10 @@ public enum FireBrigadeTypeEnum {
private String key;
private String code;
private String name;
FireBrigadeTypeEnum(String key, String code, String name) {
this.key = key;
this.code = code;
this.name = name;
}
}
......@@ -305,7 +305,7 @@ public class ExcelParser {
}
String type = fieldTypeMap.get(fieldName).getDataType();
String cellValue = convertCellValueToString(cell);
if (type.toUpperCase().equals("ENUM")) {
if (type.toUpperCase(Locale.ENGLISH).equals("ENUM")) {
if (!enumMap.containsKey(colIndex)) {
throw new BadRequest("缺少枚举字段的配置信息:" + fieldName);
}
......
......@@ -344,7 +344,7 @@ public class ExcelParserOld {
}
String type = fieldTypeMap.get(fieldName).getDataType();
String cellValue = convertCellValueToString(cell);
if (type.toUpperCase().equals("ENUM")) {
if (type.toUpperCase(Locale.ENGLISH).equals("ENUM")) {
if (!enumMap.containsKey(colIndex)) {
throw new BadRequest("缺少枚举字段的配置信息:" + fieldName);
}
......
......@@ -583,7 +583,7 @@ public class DocxBuilder {
textStyle = new TextStyle(textStyle);
Map<String, String> spanStyleMap = styleStr2Map(style);
for (String key : spanStyleMap.keySet()) {
switch (key.trim().toLowerCase()) {
switch (key.trim().toLowerCase(Locale.ENGLISH)) {
case "text-decoration":
textStyle.setUnderscore(true);
break;
......@@ -716,7 +716,7 @@ public class DocxBuilder {
HpsMeasure measure = new HpsMeasure();
rpr.setSzCs(measure);
rpr.setSz(measure);
measure.setVal(BigInteger.valueOf((Long.parseLong(fontSize.toLowerCase().replaceAll("px", "")) - 4) * 2));
measure.setVal(BigInteger.valueOf((Long.parseLong(fontSize.toLowerCase(Locale.ENGLISH).replaceAll("px", "")) - 4) * 2));
// 加粗/斜体/下划线
if (this.bold) {
rpr.setB(new BooleanDefaultTrue());
......
......@@ -8,6 +8,7 @@ import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;
import org.springframework.util.ReflectionUtils;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
......@@ -49,7 +50,8 @@ public class EntityInsertAop {
if (annotation != null) {
//当前method就是我需要操作的method
try {
method.setAccessible(true);
// method.setAccessible(true);
ReflectionUtils.makeAccessible(method);
method.invoke(listenerBean, obj);
} catch (IllegalAccessException e) {
log.error("方法AOP前置处理权限不足");
......@@ -86,7 +88,7 @@ public class EntityInsertAop {
if (annotation != null) {
//当前method就是我需要操作的method
try {
method.setAccessible(true);
ReflectionUtils.makeAccessible(method);
method.invoke(listenerBean, obj);
} catch (IllegalAccessException e) {
log.error("方法AOP前置处理权限不足");
......
......@@ -91,7 +91,7 @@ public class AppMenuConfigController {
Class<? extends AppMenuConfig> aClass = appMenuConfig.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(appMenuConfig);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -190,7 +190,7 @@ public class ReflectUtil {
public static void makeAccessible(Method method) {
if ((!Modifier.isPublic(method.getModifiers()) || !Modifier.isPublic(method.getDeclaringClass().getModifiers()))
&& !method.isAccessible()) {
method.setAccessible(true);
ReflectionUtils.makeAccessible(method);
}
}
......@@ -200,7 +200,7 @@ public class ReflectUtil {
public static void makeAccessible(Field field) {
if ((!Modifier.isPublic(field.getModifiers()) || !Modifier.isPublic(field.getDeclaringClass().getModifiers()) || Modifier
.isFinal(field.getModifiers())) && !field.isAccessible()) {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
}
}
......
......@@ -28,7 +28,7 @@ public class TranslateUtil {
try {
Class<? extends BaseEntity> aClass = data.getClass();
Field field = aClass.getDeclaredField(keyName);
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object name = field.get(data);
if (name != null) {
String tableName = aClass.getAnnotation(TableName.class).value();
......@@ -56,7 +56,7 @@ public class TranslateUtil {
try {
Class<? extends BaseEntity> aClass = data.getClass();
Field field = aClass.getDeclaredField(keyName);
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object name = field.get(data);
if (name != null) {
String tableName = aClass.getAnnotation(TableName.class).value();
......
......@@ -123,7 +123,7 @@
// Class<? extends DataDictionary> aClass = dataDictionary.getClass();
// Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
// try {
// field.setAccessible(true);
// ReflectionUtils.makeAccessible(field);
// Object o = field.get(dataDictionary);
// if (o != null) {
// Class<?> type = field.getType();
......
......@@ -258,7 +258,7 @@ public class FireTeamController extends BaseController {
Class<? extends FireTeam> aClass = fireTeam.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(fireTeam);
if (o != null && !"serialVersionUID".equals(field)) {
Class<?> type = field.getType();
......
......@@ -107,7 +107,7 @@ public class FirefightersContactsController extends BaseController {
Class<? extends FirefightersContacts> aClass = firefightersContacts.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(firefightersContacts);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -150,7 +150,7 @@ public class FirefightersContractController extends BaseController {
Class<? extends FirefightersContract> aClass = firefightersContract.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(firefightersContract);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -107,7 +107,7 @@ public class FirefightersEducationController extends BaseController {
Class<? extends FirefightersEducation> aClass = firefightersEducation.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(firefightersEducation);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -213,7 +213,7 @@ public class FirefightersPostController extends BaseController {
Class<? extends FirefightersPost> aClass = firefightersPost.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(firefightersPost);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -166,7 +166,7 @@ public class FirefightersThoughtController extends BaseController {
Class<? extends FirefightersThought> aClass = firefightersThought.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(firefightersThought);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -107,7 +107,7 @@ public class FirefightersWorkexperienceController extends BaseController {
Class<? extends FirefightersWorkexperience> aClass = firefightersWorkexperience.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(firefightersWorkexperience);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -115,7 +115,7 @@ public class OrgDepartmentController {
Class<? extends OrgUsr> aClass = orgUsr.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(orgUsr);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -107,7 +107,7 @@ public class OrgUsrAuthController extends BaseController {
Class<? extends OrgUsrAuth> aClass = orgUsrAuth.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(orgUsrAuth);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -319,7 +319,7 @@ public class OrgUsrController extends BaseController {
Class<? extends OrgUsr> aClass = orgUsr.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(orgUsr);
if (o != null) {
Class<?> type = field.getType();
......@@ -369,7 +369,7 @@ public class OrgUsrController extends BaseController {
Class<? extends OrgUsr> aClass = orgUsr.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(orgUsr);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -251,7 +251,7 @@ public class MaintenanceCompanyServiceImpl
public List<Map<String, Object>> getAllMaintenanceList(String maintenanceType) {
List<Map<String, Object>> da=null;
String type = null;
switch (maintenanceType.toUpperCase()) {
switch (maintenanceType.toUpperCase(Locale.ENGLISH)) {
case PERSON:
type = MAINTENANCE_PERSON;
break;
......@@ -418,7 +418,7 @@ public class MaintenanceCompanyServiceImpl
}
int current = Integer.parseInt(paramsMap.get("current").toString());
int size = Integer.parseInt(paramsMap.get("size").toString());
String maintenanceType = paramsMap.get("maintenanceType").toString().toUpperCase();
String maintenanceType = paramsMap.get("maintenanceType").toString().toUpperCase(Locale.ENGLISH);
Map<String, String> filedParamsMap = Maps.newHashMap();
List<MaintenanceCompany> mainTableList;
......
......@@ -3057,7 +3057,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Field[] fields = peopleInfoDto.getFirefighters().getClass().getDeclaredFields();
for (Field field : fields) {
try{
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object value = field.get(peopleInfoDto.getFirefighters());
String name = field.getName();
map.put(name, value);
......@@ -3238,7 +3238,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Field[] fields = peopleBasicInfoDto.getClass().getDeclaredFields();
for (Field field : fields) {
try{
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
String name = field.getName();
Object value = collect.get(name);
String genericType = ((Class)field.getGenericType()).getSimpleName();
......@@ -3319,7 +3319,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Field[] fields = peopleBasicInfoDto.getClass().getDeclaredFields();
for (Field field : fields) {
try{
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
String name = field.getName();
Object value = collect.get(name);
String genericType = ((Class)field.getGenericType()).getSimpleName();
......
......@@ -98,7 +98,7 @@ public class DemoController extends BaseController {
Class<? extends Demo> aClass = demo.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(demo);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -97,7 +97,7 @@ public class AlarmController {
Class<? extends Alarm> aClass = alarm.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(alarm);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class CarConfController {
Class<? extends CarConf> aClass = carConf.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(carConf);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -518,7 +518,7 @@ public class CarController extends AbstractBaseController {
Class<? extends Car> aClass = car.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(car);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class CarInfoController {
Class<? extends CarInfo> aClass = carInfo.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(carInfo);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -97,7 +97,7 @@ public class CarPropertyController {
Class<? extends CarProperty> aClass = carProperty.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(carProperty);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class DeviceServicingController {
Class<? extends DeviceServicing> aClass = deviceServicing.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(deviceServicing);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class EquPropertyController {
Class<? extends EquProperty> aClass = equProperty.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(equProperty);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -222,7 +222,7 @@ public class EquipmentCategoryController extends AbstractBaseController {
Class<? extends EquipmentCategory> aClass = equipmentCategory.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(equipmentCategory);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -435,7 +435,7 @@ public class EquipmentDetailController extends AbstractBaseController {
Class<? extends EquipmentDetail> aClass = equipmentDetail.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(equipmentDetail);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -125,7 +125,7 @@ public class EquipmentOnCarController {
Class<? extends EquipmentOnCar> aClass = equipmentOnCar.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(equipmentOnCar);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -57,7 +57,7 @@ public class EquipmentPointController extends AbstractBaseController{
Class<? extends EquipmentPoint> aClass = equipmentPoint.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(equipmentPoint);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -97,7 +97,7 @@ public class EquipmentQrcodeController {
Class<? extends EquipmentQrcode> aClass = equipmentQrcode.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(equipmentQrcode);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class EquipmentStandardRelationsController {
Class<? extends EquipmentStandardRelations> aClass = equipmentStandardRelations.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(equipmentStandardRelations);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class EquipmentStandardWarningController {
Class<? extends EquipmentStandardWarning> aClass = equipmentStandardWarning.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(equipmentStandardWarning);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class ExtinguishantOnCarController {
Class<? extends ExtinguishantOnCar> aClass = extinguishantOnCar.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(extinguishantOnCar);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class JournalController {
Class<? extends Journal> aClass = journal.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(journal);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class LochusEquipmentController {
Class<? extends LochusEquipment> aClass = lochusEquipment.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(lochusEquipment);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class LochusStandardController {
Class<? extends LochusStandard> aClass = lochusStandard.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(lochusStandard);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -105,7 +105,7 @@ public class MaintainController extends AbstractBaseController {
Class<? extends Maintain> aClass = maintain.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(maintain);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -102,7 +102,7 @@ public class MaintainDetailController {
Class<? extends MaintainDetail> aClass = maintainDetail.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(maintainDetail);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class MaintainResultController {
Class<? extends MaintainResult> aClass = maintainResult.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(maintainResult);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class MaintainWithinSevenDaysController {
Class<? extends MaintainWithinSevenDays> aClass = maintainWithinSevenDays.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(maintainWithinSevenDays);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -148,7 +148,7 @@ public class MaintenanceResourceDataController extends AbstractBaseController {
Class<? extends MaintenanceResourceData> aClass = data.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(data);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class MaintianQueryController {
Class<? extends MaintianQuery> aClass = maintianQuery.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(maintianQuery);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -168,7 +168,7 @@ public class ManufacturerInfoController {
Class<? extends ManufacturerInfo> aClass = manufacturerInfo.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(manufacturerInfo);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class NoticeController {
Class<? extends Notice> aClass = notice.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(notice);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -103,7 +103,7 @@ public class RepairController extends AbstractBaseController {
Class<? extends Repair> aClass = repair.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(repair);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -102,7 +102,7 @@ public class RepairDetailController {
Class<? extends RepairDetail> aClass = repairDetail.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(repairDetail);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -105,7 +105,7 @@ public class ScrapController extends AbstractBaseController {
Class<? extends Scrap> aClass = scrap.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(scrap);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -99,7 +99,7 @@ public class ScrapDetailController {
Class<? extends ScrapDetail> aClass = scrapDetail.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(scrapDetail);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class StockBillDetailController {
Class<? extends StockBillDetail> aClass = stockBillDetail.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(stockBillDetail);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -102,7 +102,7 @@ public class StockController extends AbstractBaseController {
Class<? extends Stock> aClass = stock.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(stock);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -102,7 +102,7 @@ public class StockDetailController {
Class<? extends StockDetail> aClass = stockDetail.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(stockDetail);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class StockWarningRuleController {
Class<? extends StockWarningRule> aClass = stockWarningRule.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(stockWarningRule);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -111,7 +111,7 @@ public class SystemDicController {
Class<? extends SystemDic> aClass = systemDic.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(systemDic);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -155,7 +155,7 @@ public class UnitController {
Class<? extends Unit> aClass = unit.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(unit);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class UploadFileController {
Class<? extends UploadFile> aClass = uploadFile.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(uploadFile);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -638,7 +638,7 @@ public class UserController extends AbstractBaseController {
if (obj != null) {
Class<?> clazz = obj.getClass();
for (Field field : clazz.getDeclaredFields()) {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
String fieldName = field.getName();
Object value = nvl(field.get(obj));
......
......@@ -171,7 +171,7 @@ public class WarehouseController extends AbstractBaseController {
Class<? extends Warehouse> aClass = warehouse.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(warehouse);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -109,7 +109,7 @@ public class WarehouseStructureController extends AbstractBaseController {
Class<? extends WarehouseStructure> aClass = warehouseStructure.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(warehouseStructure);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class WastageBillController {
Class<? extends WastageBill> aClass = wastageBill.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(wastageBill);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -100,7 +100,7 @@ public class WastageBillDetailController {
Class<? extends WastageBillDetail> aClass = wastageBillDetail.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(wastageBillDetail);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -106,7 +106,7 @@ public class WlCarMileageController {
Class<? extends WlCarMileage> aClass = wlCarMileage.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(wlCarMileage);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -483,7 +483,7 @@ public class EquipmentDetailServiceImpl extends ServiceImpl<EquipmentDetailMappe
private String handleIndexValue(Object indexValue) {
if (!ObjectUtils.isEmpty(indexValue)) {
String val = String.valueOf(indexValue).toUpperCase();
String val = String.valueOf(indexValue).toUpperCase(Locale.ENGLISH);
switch (val) {
case "TRUE":
return "是";
......
......@@ -838,7 +838,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
map.put("color", "");
return map;
}
if (StringUtil.isNotEmpty(indexVo.getIndexValue()) && TrueOrFalseEnum.real.value.toUpperCase().equals(indexVo.getIndexValue().toUpperCase())) {
if (StringUtil.isNotEmpty(indexVo.getIndexValue()) && TrueOrFalseEnum.real.value.equalsIgnoreCase(indexVo.getIndexValue())) {
map.put("runStatus", indexVo.getIndexName());
map.put("color", indexVo.getColor());
return map;
......
......@@ -263,7 +263,7 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
continue;
}
// (此处如果不设置 无法获取对象的私有属性)
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
if ("key".equals(field.getName())) {
field.set(o, indexKey);
} else if ("value".equals(field.getName())) {
......
......@@ -20,10 +20,7 @@ import java.io.OutputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
public class ExcelUtil {
......@@ -154,7 +151,7 @@ public class ExcelUtil {
if (fileName == null) {
throw new Exception("文件不存在!");
}
if (!fileName.toLowerCase().endsWith(ExcelTypeEnum.XLS.getValue()) && !fileName.toLowerCase().endsWith(ExcelTypeEnum.XLSX.getValue())) {
if (!fileName.toLowerCase(Locale.ENGLISH).endsWith(ExcelTypeEnum.XLS.getValue()) && !fileName.toLowerCase(Locale.ENGLISH).endsWith(ExcelTypeEnum.XLSX.getValue())) {
throw new Exception("文件类型异常!");
}
InputStream inputStream;
......
......@@ -59,7 +59,7 @@ public class ReflectUtil
Method method = clazz.getDeclaredMethod(methodname, ftype); // 获取定义的方法
if (!Modifier.isPublic(method.getModifiers()))
{ // 设置非共有方法权限
method.setAccessible(true);
ReflectionUtils.makeAccessible(method);
}
method.invoke(target, fvalue); // 执行方法回调
}
......@@ -70,7 +70,7 @@ public class ReflectUtil
Field field = clazz.getDeclaredField(fname); // 获取定义的类属性
if (!Modifier.isPublic(field.getModifiers()))
{ // 设置非共有类属性权限
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
}
field.set(target, fvalue); // 设置类属性值
......@@ -115,7 +115,7 @@ public class ReflectUtil
Method method = clazz.getDeclaredMethod(methodname); // 获取定义的方法
if (!Modifier.isPublic(method.getModifiers()))
{ // 设置非共有方法权限
method.setAccessible(true);
ReflectionUtils.makeAccessible(method);
}
return method.invoke(target); // 方法回调,返回值
}
......@@ -130,7 +130,7 @@ public class ReflectUtil
Field field = clazz.getDeclaredField(fname); // 获取定义的类属性
if (!Modifier.isPublic(field.getModifiers()))
{ // 设置非共有类属性权限
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
}
return field.get(target);// 返回类属性值
}
......
......@@ -13,19 +13,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.stream.Collectors;
......@@ -1040,7 +1028,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
String filePath = "";
String fileName = "";
if(os.toLowerCase().startsWith("win")) {
if(os.toLowerCase(Locale.ENGLISH).startsWith("win")) {
filePath = this.getClass().getClassLoader().getResource("templates").getPath();
fileName = filePath + "/" + System.currentTimeMillis() + ".docx";
} else {
......@@ -1100,7 +1088,7 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
//拼接完整连接
String pa1 = "";
if(os.toLowerCase().startsWith("win")){
if(os.toLowerCase(Locale.ENGLISH).startsWith("win")){
String pa = fileName.substring(1);
document.loadFromFile(pa);
newFileName = System.currentTimeMillis()+".doc";
......
......@@ -42,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
......@@ -823,7 +824,7 @@ public class ExcelServiceImpl {
Field[] fields = orgUsrExcelDto.getClass().getDeclaredFields();
for (Field field : fields) {
try{
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object value = field.get(orgUsrExcelDto);
String name = field.getName();
// 解析注解信息
......@@ -1206,7 +1207,7 @@ private void saveuser(OrgUsrTPDlExcelDto orgUsrExcelDto,Set<String> set,String a
Field[] fields = orgUsrExcelDto.getClass().getDeclaredFields();
for (Field field : fields) {
try{
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object value = field.get(orgUsrExcelDto);
String name = field.getName();
// 解析注解信息
......@@ -2116,8 +2117,8 @@ private void saveuser(OrgUsrTPDlExcelDto orgUsrExcelDto,Set<String> set,String a
if (fileName == null) {
throw new BadRequest("文件不存在!");
}
if (!fileName.toLowerCase().endsWith(ExcelTypeEnum.XLS.getValue())
&& !fileName.toLowerCase().endsWith(ExcelTypeEnum.XLSX.getValue())) {
if (!fileName.toLowerCase(Locale.ENGLISH).endsWith(ExcelTypeEnum.XLS.getValue())
&& !fileName.toLowerCase(Locale.ENGLISH).endsWith(ExcelTypeEnum.XLSX.getValue())) {
throw new BadRequest("文件类型异常!");
}
InputStream input = multipartFile.getInputStream();
......@@ -2208,8 +2209,8 @@ private void saveuser(OrgUsrTPDlExcelDto orgUsrExcelDto,Set<String> set,String a
if (fileName == null) {
throw new BadRequest("文件不存在!");
}
if (!fileName.toLowerCase().endsWith(ExcelTypeEnum.XLS.getValue())
&& !fileName.toLowerCase().endsWith(ExcelTypeEnum.XLSX.getValue())) {
if (!fileName.toLowerCase(Locale.ENGLISH).endsWith(ExcelTypeEnum.XLS.getValue())
&& !fileName.toLowerCase(Locale.ENGLISH).endsWith(ExcelTypeEnum.XLSX.getValue())) {
throw new BadRequest("文件类型异常!");
}
List<OrgUsrSafeReportExcelDto> excelDtoList = ExcelUtil.readFirstSheetExcel(multipartFile,
......
......@@ -140,7 +140,7 @@ public class TaskController extends AbstractBaseController{
if(obj!=null){
Class<?> clazz = obj.getClass();
for (Field field : ClazzFieldUtil.getAllFields(obj)) {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
String fieldName = field.getName();
Object value = nvl(field.get(obj));
if("executorId".equals(fieldName)){
......@@ -871,7 +871,7 @@ public class TaskController extends AbstractBaseController{
Map<String, Object> map = new HashMap<String,Object>();
if(obj!=null){
for (Field field : ClazzFieldUtil.getAllFields(obj)) {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
String fieldName = field.getName();
Object value = nvl(field.get(obj));
if("userId".equals(fieldName)){
......
......@@ -270,7 +270,7 @@ public abstract class AbstractBaseController extends BaseController{
criteria.setPropertyName(query.getName());
String column = criteria.getPropertyName();
if (!(query.getValue() instanceof Collection<?>)
&& column.substring(column.length() - 2, column.length()).toUpperCase().equals("ID")) {
&& column.substring(column.length() - 2, column.length()).equalsIgnoreCase("ID")) {
criteria.setValue(Long.valueOf(query.getValue().toString()));
} else {
criteria.setValue(query.getValue());
......@@ -296,10 +296,10 @@ public abstract class AbstractBaseController extends BaseController{
}
}
if (flag) {
if (XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName.toUpperCase())
|| XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName.toUpperCase())) {
if (XJConstant.ROLE_NAME_SUPERADMIN.equalsIgnoreCase(roleTypeName)
|| XJConstant.ROLE_NAME_ADMIN.equalsIgnoreCase(roleTypeName)) {
daoCriterias = buildOrgDaoCriteriaInChildren(daoCriterias, orgCode);
} else if (XJConstant.ROLE_NAME_PERSON.equals(roleTypeName.toUpperCase())) {
} else if (XJConstant.ROLE_NAME_PERSON.equalsIgnoreCase(roleTypeName)) {
DaoCriteria compDaoCriteria = new DaoCriteria();
compDaoCriteria.setPropertyName("userId");
compDaoCriteria.setOperator(QueryOperatorEnum.EQUAL.getName());
......@@ -326,7 +326,7 @@ public abstract class AbstractBaseController extends BaseController{
// criteria.setPropertyName(query.getName());
// String column = criteria.getPropertyName();
// if (!(query.getValue() instanceof Collection<?>)
// && column.substring(column.length() - 2, column.length()).toUpperCase().equals("ID")) {
// && column.substring(column.length() - 2, column.length()).equalsIgnoreCase("ID")) {
// criteria.setValue(Long.valueOf(query.getValue().toString()));
// } else {
// criteria.setValue(query.getValue());
......@@ -357,14 +357,14 @@ public abstract class AbstractBaseController extends BaseController{
// throw new YeeException("非法请求");
// }
// String roleTypeName = param.getRole().getRoleName();
// if (XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName)
// || XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName)) {
// if (XJConstant.ROLE_NAME_SUPERADMIN.equalsIgnoreCase(roleTypeName)
// || XJConstant.ROLE_NAME_ADMIN.equalsIgnoreCase(roleTypeName)) {
// orgCode = param.getCompany().getOrgCode();
// daoCriterias = buildOrgDaoCriteriaInChildren(daoCriterias, orgCode);
// } else if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName)) {
// } else if (XJConstant.ROLE_NAME_DEPTADMIN.equalsIgnoreCase(roleTypeName)) {
// orgCode = param.getUserOrgCode();
// daoCriterias = buildOrgDaoCriteriaOutChildren(daoCriterias, orgCode);
// } else if (XJConstant.ROLE_NAME_PERSON.equals(roleTypeName)) {
// } else if (XJConstant.ROLE_NAME_PERSON.equalsIgnoreCase(roleTypeName)) {
// DaoCriteria compDaoCriteria = new DaoCriteria();
// compDaoCriteria.setPropertyName("userId");
// compDaoCriteria.setOperator(QueryOperatorEnum.EQUAL.getName());
......@@ -402,13 +402,13 @@ public abstract class AbstractBaseController extends BaseController{
*/
public HashMap<String, Object> buildMybatisDaoCriterias(String orgCode, String roleTypeName) {
HashMap<String, Object> paramMap = new HashMap<>();
if (XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName.toUpperCase()) || XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName.toUpperCase())) {
if (XJConstant.ROLE_NAME_SUPERADMIN.equalsIgnoreCase(roleTypeName) || XJConstant.ROLE_NAME_ADMIN.equalsIgnoreCase(roleTypeName)) {
paramMap.put("orgCode", orgCode + "%");
paramMap.put("roleFlag", XJConstant.ADMIN_FLAG);
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName.toUpperCase())) {
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equalsIgnoreCase(roleTypeName)) {
paramMap.put("orgCode", orgCode + "%");
paramMap.put("roleFlag", XJConstant.DEPART_FLAG);
} else if (XJConstant.ROLE_NAME_PERSON.equals(roleTypeName.toUpperCase())) {
} else if (XJConstant.ROLE_NAME_PERSON.equalsIgnoreCase(roleTypeName)) {
paramMap.put("userId", getUserId());
paramMap.put("roleFlag", XJConstant.PERSON_FLAG);
}
......@@ -423,15 +423,15 @@ public abstract class AbstractBaseController extends BaseController{
// HashMap<String, Object> paramMap = new HashMap<String, Object>();
// String roleTypeName = param.getRoleTypeName();
//
// if (XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName) || XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName)) {
// if (XJConstant.ROLE_NAME_SUPERADMIN.equalsIgnoreCase(roleTypeName) || XJConstant.ROLE_NAME_ADMIN.equalsIgnoreCase(roleTypeName)) {
// orgCode = param.getLoginOrgCode();
// paramMap.put("orgCode", orgCode + "%");
// paramMap.put("roleFlag", XJConstant.ADMIN_FLAG);
// } else if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName)) {
// } else if (XJConstant.ROLE_NAME_DEPTADMIN.equalsIgnoreCase(roleTypeName)) {
// orgCode = param.getUserOrgCode();
// paramMap.put("orgCode", orgCode + "%");
// paramMap.put("roleFlag", XJConstant.DEPART_FLAG);
// } else if (XJConstant.ROLE_NAME_PERSON.equals(roleTypeName)) {
// } else if (XJConstant.ROLE_NAME_PERSON.equalsIgnoreCase(roleTypeName)) {
// paramMap.put("userId", param.getUserId());
// paramMap.put("roleFlag", XJConstant.PERSON_FLAG);
// }
......@@ -441,13 +441,13 @@ public abstract class AbstractBaseController extends BaseController{
public HashMap<String, Object> buildMybatisCriterias(String orgCode, String roleTypeName) {
HashMap<String, Object> paramMap = new HashMap<>();
if(StringUtil.isNotEmpty(roleTypeName)){
if (XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName.toUpperCase()) || XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName.toUpperCase())) {
if (XJConstant.ROLE_NAME_SUPERADMIN.equalsIgnoreCase(roleTypeName) || XJConstant.ROLE_NAME_ADMIN.equalsIgnoreCase(roleTypeName)) {
paramMap.put("orgCode", orgCode);
paramMap.put("roleFlag", XJConstant.ADMIN_FLAG);
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName.toUpperCase())) {
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equalsIgnoreCase(roleTypeName)) {
paramMap.put("orgCode", orgCode);
paramMap.put("roleFlag", XJConstant.DEPART_FLAG);
} else if (XJConstant.ROLE_NAME_PERSON.equals(roleTypeName.toUpperCase())) {
} else if (XJConstant.ROLE_NAME_PERSON.equalsIgnoreCase(roleTypeName)) {
paramMap.put("userId", getUserId());
paramMap.put("orgCode", orgCode);
paramMap.put("roleFlag", XJConstant.PERSON_FLAG);
......
......@@ -704,10 +704,10 @@ public class CheckController extends AbstractBaseController {
req.put("orgCode", reginParams.getPersonIdentity().getCompanyBizOrgCode());
// if (XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName.toUpperCase())
// || XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName.toUpperCase())) {
// if (XJConstant.ROLE_NAME_ADMIN.equalsIgnoreCase(roleTypeName)
// || XJConstant.ROLE_NAME_SUPERADMIN.equalsIgnoreCase(roleTypeName)) {
// req.put("orgCode", loginOrgCode);
// } else if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName.toUpperCase())) {
// } else if (XJConstant.ROLE_NAME_DEPTADMIN.equalsIgnoreCase(roleTypeName)) {
// req.put("departmentId",departmentId);
// } else {
// if(StringUtil.isNotEmpty(req.get("userId"))&&req.get("userId")==null){
......@@ -805,10 +805,10 @@ public class CheckController extends AbstractBaseController {
String roleTypeName = getRoleTypeName(reginParams);
String departmentId = getDepartmentId(reginParams);
HashMap<String, Object> req = CheckPageParamUtil.fillInfo(queryRequests);
if (XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName.toUpperCase())
|| XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName.toUpperCase())) {
if (XJConstant.ROLE_NAME_ADMIN.equalsIgnoreCase(roleTypeName)
|| XJConstant.ROLE_NAME_SUPERADMIN.equalsIgnoreCase(roleTypeName)) {
req.put("orgCode", loginOrgCode);
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName.toUpperCase())) {
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equalsIgnoreCase(roleTypeName)) {
req.put("departmentId",departmentId);
} else {
if(StringUtil.isNotEmpty(req.get("userId"))&&req.get("userId")==null){
......
......@@ -415,7 +415,7 @@ public class MsgController extends AbstractBaseController {
Map<String, Object> map = new HashMap<String,Object>();
if(obj!=null){
for (Field field : ClazzFieldUtil.getAllFields(obj)) {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
String fieldName = field.getName();
Object value = nvl(field.get(obj));
if("userId".equals(fieldName)){
......
......@@ -877,7 +877,7 @@ public class PlanTaskController extends AbstractBaseController {
Map<String, Object> userResp = planTaskService.getPlanTaskStatisticsForApp(params);
resp.put("user", userResp);
params.put("userId", null);
if (XJConstant.ROLE_NAME_PERSON.equals(roleTypeName.toUpperCase())) {
if (XJConstant.ROLE_NAME_PERSON.equalsIgnoreCase(roleTypeName)) {
return CommonResponseUtil.success(resp);
}
if (!ObjectUtils.isEmpty(reginParams.getDepartment())) {
......@@ -887,7 +887,7 @@ public class PlanTaskController extends AbstractBaseController {
params.put("userDept", null);
}
if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName.toUpperCase())) {
if (XJConstant.ROLE_NAME_DEPTADMIN.equalsIgnoreCase(roleTypeName)) {
return CommonResponseUtil.success(resp);
}
params.put("orgCode", loginOrgCode);
......
......@@ -1250,9 +1250,9 @@ public class PointController extends AbstractBaseController {
String departmentId = getDepartmentId(reginParams);
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("orgCode", loginOrgCode);
if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName.toUpperCase())) {
if (XJConstant.ROLE_NAME_DEPTADMIN.equalsIgnoreCase(roleTypeName)) {
params.put("department", departmentId);
} else if (XJConstant.ROLE_NAME_PERSON.equals(roleTypeName.toUpperCase())){
} else if (XJConstant.ROLE_NAME_PERSON.equalsIgnoreCase(roleTypeName)){
params.put("userId", getUserId());
}
HashMap<String, Object> response = iPointService.queryPointPie(params);
......@@ -1269,9 +1269,9 @@ public class PointController extends AbstractBaseController {
String departmentId = getDepartmentId(reginParams);
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("orgCode", loginOrgCode);
if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName.toUpperCase())) {
if (XJConstant.ROLE_NAME_DEPTADMIN.equalsIgnoreCase(roleTypeName)) {
params.put("department", departmentId);
} else if (XJConstant.ROLE_NAME_PERSON.equals(roleTypeName.toUpperCase())){
} else if (XJConstant.ROLE_NAME_PERSON.equalsIgnoreCase(roleTypeName)){
params.put("userId", getUserId());
}
List<HashMap<String, Object>> response = iPointService.queryPointHistogram(params);
......
......@@ -140,10 +140,7 @@ public class RouteController extends AbstractBaseController {
String orgCode =reginParams.getPersonIdentity().getBizOrgCode();
//2.查询
List<Route> routeList = routeService.queryRouteListNew(orgCode);
List<Route> list = routeList.stream().filter(e -> e.getIsExist().equals("true")).collect(Collectors.toList());
List<Route> list = routeList.stream().filter(e -> e.getIsExist().equalsIgnoreCase("true")).collect(Collectors.toList());
return CommonResponseUtil.success(!Objects.isNull(isRemove) && 1 == isRemove ? (routeList!=null?ToJson.tojson(routeList):null) : (list!=null?ToJson.tojson(list):null));
} catch (Exception e) {
log.error(e.getMessage(), e);
......@@ -520,13 +517,13 @@ public class RouteController extends AbstractBaseController {
String departmentId = "";
String roleTypeName = getRoleTypeName(reginParams);
if(XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName.toUpperCase()) || XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName.toUpperCase())){
if(XJConstant.ROLE_NAME_SUPERADMIN.equalsIgnoreCase(roleTypeName) || XJConstant.ROLE_NAME_ADMIN.equalsIgnoreCase(roleTypeName)){
loginOrgCode = getOrgCode(reginParams);
}else if(XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName.toUpperCase())){
}else if(XJConstant.ROLE_NAME_DEPTADMIN.equalsIgnoreCase(roleTypeName)){
departmentId = getDepartmentId(reginParams);
loginOrgCode = getOrgCode(reginParams);
userId = userModel.getUserId();
}else if(XJConstant.ROLE_NAME_PERSON.equals(roleTypeName.toUpperCase())){
}else if(XJConstant.ROLE_NAME_PERSON.equalsIgnoreCase(roleTypeName)){
userId = userModel.getUserId();
loginOrgCode = getOrgCode(reginParams);
}
......
......@@ -864,7 +864,7 @@ public class UserController extends AbstractBaseController {
if (obj != null) {
Class<?> clazz = obj.getClass();
for (Field field : clazz.getDeclaredFields()) {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
String fieldName = field.getName();
Object value = nvl(field.get(obj));
map.put(fieldName, value);
......
......@@ -1363,15 +1363,15 @@ public class CheckServiceImpl implements ICheckService {
QueryCriteriaRespone pointQueryCriteriaRespone = new QueryCriteriaRespone();
if (XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName.toUpperCase()) || XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName.toUpperCase())) {
if (XJConstant.ROLE_NAME_SUPERADMIN.equalsIgnoreCase(roleTypeName) || XJConstant.ROLE_NAME_ADMIN.equalsIgnoreCase(roleTypeName)) {
List<DepartmentModel> departmentBos = remoteSecurityService.listDepartmentsByCompanyId(toke, product, appKey,companyId);
//查询没有部门的人员信息
CompanyModel companyModel = remoteSecurityService.listUserByCompanyId1(toke, product, appKey,companyId);
pointQueryCriteriaRespone.setDepartments(Lists.newArrayList(getDepartmentMap(departmentBos,companyModel)));//公司下部门
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName.toUpperCase())) {
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equalsIgnoreCase(roleTypeName)) {
DepartmentModel departmentBo = remoteSecurityService.getDepartmentByDeptId( toke, product, appKey,departmentId);
pointQueryCriteriaRespone.setDepartments(Lists.newArrayList(beanToMap(departmentBo)));//本公司
} else if (XJConstant.ROLE_NAME_PERSON.equals(roleTypeName.toUpperCase())) {//个人不返回
} else if (XJConstant.ROLE_NAME_PERSON.equalsIgnoreCase(roleTypeName)) {//个人不返回
return null;
}
......@@ -1703,14 +1703,14 @@ public class CheckServiceImpl implements ICheckService {
pointQueryCriteriaRespone.setTypes(catalogTreeDao.findByOrgCode(orgCode));
} else if ("departments".equals(type)) {
// pointQueryCriteriaRespone.setDepartments(iUserService.getGroupListByUser(user));
if (XJConstant.ROLE_NAME_SUPERADMIN.equals(roleTypeName.toUpperCase())
|| XJConstant.ROLE_NAME_ADMIN.equals(roleTypeName.toUpperCase())) {
if (XJConstant.ROLE_NAME_SUPERADMIN.equalsIgnoreCase(roleTypeName)
|| XJConstant.ROLE_NAME_ADMIN.equalsIgnoreCase(roleTypeName)) {
List<DepartmentModel> departmentBoList = remoteSecurityService.listDepartmentsByCompanyId(toke, product, appKey,companyId);
pointQueryCriteriaRespone.setDepartments(objectsToMaps(departmentBoList));// 公司下部门
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName.toUpperCase())) {
} else if (XJConstant.ROLE_NAME_DEPTADMIN.equalsIgnoreCase(roleTypeName)) {
DepartmentModel departmentBo = remoteSecurityService.getDepartmentByDeptId(toke, product, appKey,departmentId);
pointQueryCriteriaRespone.setDepartments(Lists.newArrayList(beanToMap(departmentBo)));// 本公司
} else if (XJConstant.ROLE_NAME_PERSON.equals(roleTypeName.toUpperCase())) {// 个人不返回
} else if (XJConstant.ROLE_NAME_PERSON.equalsIgnoreCase(roleTypeName)) {// 个人不返回
return null;
}
}
......
......@@ -67,11 +67,11 @@ public class BaseQuerySpecification<T> implements Specification<T> {
List<Order> orders = new ArrayList<>();
orderbys.keySet().forEach(key -> {
if (key.toLowerCase().equals("asc") && !orderbys.get(key).isEmpty()) {
if ("asc".equalsIgnoreCase(key) && !orderbys.get(key).isEmpty()) {
orderbys.get(key).forEach(propertyName -> {
orders.add(builder.asc(root.get(propertyName)));
});
} else if (key.toLowerCase().equals("desc") && !orderbys.get(key).isEmpty()) {
} else if ("desc".equalsIgnoreCase(key) && !orderbys.get(key).isEmpty()) {
orderbys.get(key).forEach(propertyName -> {
orders.add(builder.desc(root.get(propertyName)));
});
......
......@@ -93,7 +93,7 @@ public class CompanyDepartmentController {
Class<? extends CompanyDepartment> aClass = companyDepartment.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(companyDepartment);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -108,7 +108,7 @@ public class CompanyEvaluationLogController {
Class<? extends CompanyEvaluationLog> aClass = companyEvaluationLog.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(companyEvaluationLog);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -96,7 +96,7 @@ public class PersonContractController {
Class<? extends PersonContract> aClass = personContract.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(personContract);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -95,7 +95,7 @@ public class ProjectDeviceController {
Class<? extends ProjectDevice> aClass = projectDevice.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(projectDevice);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -95,7 +95,7 @@ public class RewardConfigController {
Class<? extends RewardConfig> aClass = rewardConfig.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(rewardConfig);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -96,7 +96,7 @@ public class RiskWorkHazadousWorkController {
Class<? extends RiskWorkHazadousWork> aClass = riskWorkHazadousWork.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(riskWorkHazadousWork);
if (o != null) {
Class<?> type = field.getType();
......
......@@ -96,7 +96,7 @@ public class RiskWorkMeasureController {
Class<? extends RiskWorkMeasure> aClass = riskWorkMeasure.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try {
field.setAccessible(true);
ReflectionUtils.makeAccessible(field);
Object o = field.get(riskWorkMeasure);
if (o != null) {
Class<?> type = field.getType();
......
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