规范--反转equals使用

上级 26f423de
...@@ -189,7 +189,7 @@ public class HttpsRequestUtil { ...@@ -189,7 +189,7 @@ public class HttpsRequestUtil {
String ret = ""; String ret = "";
while (ret != null) { while (ret != null) {
ret = br.readLine(); ret = br.readLine();
if (ret != null && !ret.trim().equals("")) { if (ret != null && !"".equals(ret.trim())) {
str_return = str_return + new String(ret.getBytes("ISO-8859-1"), "utf-8"); str_return = str_return + new String(ret.getBytes("ISO-8859-1"), "utf-8");
} }
} }
......
...@@ -98,6 +98,7 @@ public class BCryptPasswordEncoder implements PasswordEncoder { ...@@ -98,6 +98,7 @@ public class BCryptPasswordEncoder implements PasswordEncoder {
return BCrypt.hashpw(rawPassword.toString(), salt); return BCrypt.hashpw(rawPassword.toString(), salt);
} }
public boolean matches(CharSequence rawPassword, String encodedPassword) { public boolean matches(CharSequence rawPassword, String encodedPassword) {
if (rawPassword == null) { if (rawPassword == null) {
throw new IllegalArgumentException("rawPassword cannot be null"); throw new IllegalArgumentException("rawPassword cannot be null");
......
...@@ -59,7 +59,7 @@ public class UserReportServiceImpl implements UserReportService { ...@@ -59,7 +59,7 @@ public class UserReportServiceImpl implements UserReportService {
@Override @Override
public Integer getUserActiveCount() { public Integer getUserActiveCount() {
ResultBody resultBody = wxService.getUserPortrait(); ResultBody resultBody = wxService.getUserPortrait();
if (resultBody != null && resultBody.getCode().equals("200")) { if (resultBody != null && "200".equals(resultBody.getCode())) {
JSONObject result = JSONObject.parseObject(resultBody.getResult().toString()); JSONObject result = JSONObject.parseObject(resultBody.getResult().toString());
JSONArray jsonArray; JSONArray jsonArray;
//当去微信拿不到日活量时会报空指针就返回null代表没拿到数据,要重新请求 //当去微信拿不到日活量时会报空指针就返回null代表没拿到数据,要重新请求
......
...@@ -53,7 +53,7 @@ public class SealManageServiceImpl implements SealManageService { ...@@ -53,7 +53,7 @@ public class SealManageServiceImpl implements SealManageService {
@Override @Override
public ResultBody uploadSeal(SealVO sealVO, LoginSuccessDTO loginSuccessDTO) { public ResultBody uploadSeal(SealVO sealVO, LoginSuccessDTO loginSuccessDTO) {
ResultBody resultBody = this.checkAuthStatus(sealVO.getPort(), loginSuccessDTO); ResultBody resultBody = this.checkAuthStatus(sealVO.getPort(), loginSuccessDTO);
if (!resultBody.getCode().equals("200")) { if (!"200".equals(resultBody.getCode())) {
return resultBody; return resultBody;
} }
UserFddDO userFddInfo = (UserFddDO) resultBody.getResult(); UserFddDO userFddInfo = (UserFddDO) resultBody.getResult();
...@@ -122,7 +122,7 @@ public class SealManageServiceImpl implements SealManageService { ...@@ -122,7 +122,7 @@ public class SealManageServiceImpl implements SealManageService {
@Override @Override
public ResultBody removeSeal(String signatureId, Integer port, LoginSuccessDTO loginSuccessDTO) { public ResultBody removeSeal(String signatureId, Integer port, LoginSuccessDTO loginSuccessDTO) {
ResultBody resultBody = checkAuthStatus(port, loginSuccessDTO); ResultBody resultBody = checkAuthStatus(port, loginSuccessDTO);
if (!resultBody.getCode().equals("200")) { if (!"200".equals(resultBody.getCode())) {
return resultBody; return resultBody;
} }
UserFddDO userFddInfo = (UserFddDO) resultBody.getResult(); UserFddDO userFddInfo = (UserFddDO) resultBody.getResult();
...@@ -184,7 +184,7 @@ public class SealManageServiceImpl implements SealManageService { ...@@ -184,7 +184,7 @@ public class SealManageServiceImpl implements SealManageService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ResultBody defaultSeal(String signatureId, Integer port, LoginSuccessDTO loginSuccessDTO) { public ResultBody defaultSeal(String signatureId, Integer port, LoginSuccessDTO loginSuccessDTO) {
ResultBody resultBody = checkAuthStatus(port, loginSuccessDTO); ResultBody resultBody = checkAuthStatus(port, loginSuccessDTO);
if (!resultBody.getCode().equals("200")) { if (!"200".equals(resultBody.getCode())) {
return resultBody; return resultBody;
} }
UserFddDO userFddInfo = (UserFddDO) resultBody.getResult(); UserFddDO userFddInfo = (UserFddDO) resultBody.getResult();
...@@ -207,7 +207,7 @@ public class SealManageServiceImpl implements SealManageService { ...@@ -207,7 +207,7 @@ public class SealManageServiceImpl implements SealManageService {
@Override @Override
public ResultBody getSealInfo(String signatureId, Integer port, LoginSuccessDTO loginSuccessDTO) { public ResultBody getSealInfo(String signatureId, Integer port, LoginSuccessDTO loginSuccessDTO) {
ResultBody resultBody = checkAuthStatus(port, loginSuccessDTO); ResultBody resultBody = checkAuthStatus(port, loginSuccessDTO);
if (!resultBody.getCode().equals("200")) { if (!"200".equals(resultBody.getCode())) {
return resultBody; return resultBody;
} }
UserFddDO userFddInfo = (UserFddDO) resultBody.getResult(); UserFddDO userFddInfo = (UserFddDO) resultBody.getResult();
......
...@@ -200,13 +200,13 @@ public class UserFddAuthServiceImpl implements UserFddAuthService { ...@@ -200,13 +200,13 @@ public class UserFddAuthServiceImpl implements UserFddAuthService {
return ResultBody.error(ResultEnum.NOT_FOUND); return ResultBody.error(ResultEnum.NOT_FOUND);
} }
//修改认证状态 //修改认证状态
if (authenticationType.equals("2")) { if ("2".equals(authenticationType)) {
userFddAuthDao.updateCompanyCertStatus(customerId, status); userFddAuthDao.updateCompanyCertStatus(customerId, status);
} else { } else {
userFddAuthDao.updatePersonCertStatus(customerId, status); userFddAuthDao.updatePersonCertStatus(customerId, status);
} }
//通过需要申请证书 //通过需要申请证书
if (("2".equals(authenticationType) && status.equals("4")) || (authenticationType.equals("1") && status.equals("2"))) { if (("2".equals(authenticationType) && "4".equals(status)) || ("1".equals(authenticationType) && "2".equals(status))) {
fddService.getApplyCert(verifyInfoDO.getCustomerId(), verifyInfoDO.getTransactionNo()); fddService.getApplyCert(verifyInfoDO.getCustomerId(), verifyInfoDO.getTransactionNo());
} }
return ResultBody.success(); return ResultBody.success();
......
...@@ -347,7 +347,7 @@ public class MessageServiceImpl implements MessageService { ...@@ -347,7 +347,7 @@ public class MessageServiceImpl implements MessageService {
MessageTimeVO messageTimeVO1 = messageDao.selectUserMessageTimeType(id); MessageTimeVO messageTimeVO1 = messageDao.selectUserMessageTimeType(id);
// 增加聊天时长 // 增加聊天时长
String timeValue = redisTemplate.opsForValue().get("Message" + userAccountId); String timeValue = redisTemplate.opsForValue().get("Message" + userAccountId);
if (timeValue == null || timeValue.equals("")) { if (timeValue == null || "".equals(timeValue)) {
redisTemplate.setValueSerializer(RedisSerializer.json()); redisTemplate.setValueSerializer(RedisSerializer.json());
redisTemplate.opsForValue().set("Message" + userAccountId, userAccountId.toString(), messageTimeVO1.getChatDuration() * 24 * 60 * 60, TimeUnit.SECONDS); redisTemplate.opsForValue().set("Message" + userAccountId, userAccountId.toString(), messageTimeVO1.getChatDuration() * 24 * 60 * 60, TimeUnit.SECONDS);
return ResultBody.success("成功购买"+messageTimeVO1.getChatDuration()+"天聊天功能"); return ResultBody.success("成功购买"+messageTimeVO1.getChatDuration()+"天聊天功能");
...@@ -375,7 +375,7 @@ public class MessageServiceImpl implements MessageService { ...@@ -375,7 +375,7 @@ public class MessageServiceImpl implements MessageService {
} }
// 增加聊天时长 // 增加聊天时长
String timeValue = redisTemplate.opsForValue().get("Message" + userAccountId); String timeValue = redisTemplate.opsForValue().get("Message" + userAccountId);
if (timeValue == null || timeValue.equals("")) { if (timeValue == null || "".equals(timeValue)) {
redisTemplate.setValueSerializer(RedisSerializer.json()); redisTemplate.setValueSerializer(RedisSerializer.json());
redisTemplate.opsForValue().set("Message" + userAccountId, userAccountId.toString(), messageTimeVO1.getChatDuration() * 24 * 60 * 60, TimeUnit.SECONDS); redisTemplate.opsForValue().set("Message" + userAccountId, userAccountId.toString(), messageTimeVO1.getChatDuration() * 24 * 60 * 60, TimeUnit.SECONDS);
return ResultBody.success("成功购买"+messageTimeVO1.getChatDuration()+"天聊天功能"); return ResultBody.success("成功购买"+messageTimeVO1.getChatDuration()+"天聊天功能");
......
...@@ -73,7 +73,7 @@ public class RealNameAuthServiceImpl implements RealNameAuthService { ...@@ -73,7 +73,7 @@ public class RealNameAuthServiceImpl implements RealNameAuthService {
String faceMsg = JSONObject.parseObject(faceResult.toString()).getString("code"); String faceMsg = JSONObject.parseObject(faceResult.toString()).getString("code");
String backMsg = JSONObject.parseObject(backResult.toString()).getString("code"); String backMsg = JSONObject.parseObject(backResult.toString()).getString("code");
// 都解析通过 // 都解析通过
if (faceMsg.equals("200") && backMsg.equals("200")) { if ("200".equals(faceMsg) && "200".equals(backMsg)) {
// 处理正面 // 处理正面
JSONObject faceResultJson = JSONObject.parseObject( JSONObject faceResultJson = JSONObject.parseObject(
JSONObject.parseObject(faceResult.toString()).getString("result")); JSONObject.parseObject(faceResult.toString()).getString("result"));
...@@ -96,9 +96,9 @@ public class RealNameAuthServiceImpl implements RealNameAuthService { ...@@ -96,9 +96,9 @@ public class RealNameAuthServiceImpl implements RealNameAuthService {
realNameAuthDO.setIssue(backResultJson.getString("issue")); realNameAuthDO.setIssue(backResultJson.getString("issue"));
realNameAuthDO.setUnionId(realNameAuthVO.getUnionId()); realNameAuthDO.setUnionId(realNameAuthVO.getUnionId());
if (faceResultJson.getString("sex").equals("男")) { if ("男".equals(faceResultJson.getString("sex"))) {
realNameAuthDO.setSex(1); realNameAuthDO.setSex(1);
} else if (faceResultJson.getString("sex").equals("女")) { } else if ("女".equals(faceResultJson.getString("sex"))) {
realNameAuthDO.setSex(2); realNameAuthDO.setSex(2);
} else { } else {
realNameAuthDO.setSex(0); realNameAuthDO.setSex(0);
...@@ -116,7 +116,7 @@ public class RealNameAuthServiceImpl implements RealNameAuthService { ...@@ -116,7 +116,7 @@ public class RealNameAuthServiceImpl implements RealNameAuthService {
realNameAuthDO.setBirthday(this.getDate(faceResultJson.getString("birth"), "yyyyMMdd")); realNameAuthDO.setBirthday(this.getDate(faceResultJson.getString("birth"), "yyyyMMdd"));
realNameAuthDO.setStartDate(this.getDate(backResultJson.getString("start_date"), "yyyyMMdd")); realNameAuthDO.setStartDate(this.getDate(backResultJson.getString("start_date"), "yyyyMMdd"));
if (backResultJson.getString("end_date").equals("长期")) { if ("长期".equals(backResultJson.getString("end_date"))) {
realNameAuthDO.setEndDate(null); realNameAuthDO.setEndDate(null);
} else { } else {
realNameAuthDO.setEndDate(this.getDate(backResultJson.getString("end_date"), "yyyyMMdd")); realNameAuthDO.setEndDate(this.getDate(backResultJson.getString("end_date"), "yyyyMMdd"));
...@@ -168,7 +168,7 @@ public class RealNameAuthServiceImpl implements RealNameAuthService { ...@@ -168,7 +168,7 @@ public class RealNameAuthServiceImpl implements RealNameAuthService {
RealNameAuthDO realNameAuthDO = realNameAuthDao.getRealNameAuthById(id); RealNameAuthDO realNameAuthDO = realNameAuthDao.getRealNameAuthById(id);
if (realNameAuthDO != null) { if (realNameAuthDO != null) {
UserAccountDO userAccountById = userServiceDao.getUserAccountById(realNameAuthDO.getUserAccountId()); UserAccountDO userAccountById = userServiceDao.getUserAccountById(realNameAuthDO.getUserAccountId());
if(realNameAuthDO.getUnionId() == null || realNameAuthDO.getUnionId().equals("")){ if(realNameAuthDO.getUnionId() == null || "".equals(realNameAuthDO.getUnionId())){
realNameAuthDO.setUnionId(userAccountById.getUnionId()); realNameAuthDO.setUnionId(userAccountById.getUnionId());
realNameAuthDao.updateRealNameAuth(realNameAuthDO); realNameAuthDao.updateRealNameAuth(realNameAuthDO);
} }
...@@ -197,7 +197,7 @@ public class RealNameAuthServiceImpl implements RealNameAuthService { ...@@ -197,7 +197,7 @@ public class RealNameAuthServiceImpl implements RealNameAuthService {
RealNameAuthDO realNameAuthDO = realNameAuthDao.userDetail(userAccountId); RealNameAuthDO realNameAuthDO = realNameAuthDao.userDetail(userAccountId);
if (realNameAuthDO != null) { if (realNameAuthDO != null) {
UserAccountDO userAccountById = userServiceDao.getUserAccountById(realNameAuthDO.getUserAccountId()); UserAccountDO userAccountById = userServiceDao.getUserAccountById(realNameAuthDO.getUserAccountId());
if(realNameAuthDO.getUnionId() == null || realNameAuthDO.getUnionId().equals("")){ if(realNameAuthDO.getUnionId() == null || "".equals(realNameAuthDO.getUnionId())){
realNameAuthDO.setUnionId(userAccountById.getUnionId()); realNameAuthDO.setUnionId(userAccountById.getUnionId());
realNameAuthDao.updateRealNameAuth(realNameAuthDO); realNameAuthDao.updateRealNameAuth(realNameAuthDO);
} }
......
...@@ -329,7 +329,7 @@ public class WxServiceImpl implements WxService { ...@@ -329,7 +329,7 @@ public class WxServiceImpl implements WxService {
String url = "https://api.weixin.qq.com/wxa/generate_urllink?access_token=" + accessToken; String url = "https://api.weixin.qq.com/wxa/generate_urllink?access_token=" + accessToken;
String res = HttpHelper.httpPost(url, param.toString()); String res = HttpHelper.httpPost(url, param.toString());
JSONObject result = JSONObject.parseObject(res); JSONObject result = JSONObject.parseObject(res);
if (result.getString("errcode").equals("0")) { if ("0".equals(result.getString("errcode"))) {
return result.getString("url_link"); return result.getString("url_link");
} }
return res; return res;
...@@ -350,7 +350,7 @@ public class WxServiceImpl implements WxService { ...@@ -350,7 +350,7 @@ public class WxServiceImpl implements WxService {
JSONObject result = JSONObject.parseObject(res); JSONObject result = JSONObject.parseObject(res);
log.info("param: id:{},code:{}", id, code); log.info("param: id:{},code:{}", id, code);
log.info("getUserPhoneNumber: " + result.toString()); log.info("getUserPhoneNumber: " + result.toString());
if (result.getString("errcode").equals("0")) { if ("0".equals(result.getString("errcode"))) {
String phone_info = result.getString("phone_info"); String phone_info = result.getString("phone_info");
JSONObject phoneInfoObject = JSONObject.parseObject(phone_info); JSONObject phoneInfoObject = JSONObject.parseObject(phone_info);
return phoneInfoObject.getString("purePhoneNumber"); return phoneInfoObject.getString("purePhoneNumber");
......
...@@ -134,7 +134,7 @@ public class XzServiceImpl implements XzService { ...@@ -134,7 +134,7 @@ public class XzServiceImpl implements XzService {
if (jsonObject1.get("data") != null) { if (jsonObject1.get("data") != null) {
// 添加认证签约结果 // 添加认证签约结果
JSONObject signedResult = this.getSignedResult(xzAuthVO); JSONObject signedResult = this.getSignedResult(xzAuthVO);
if (signedResult.get("msg").equals("success")) { if ("success".equals(signedResult.get("msg"))) {
// log.info("Signed result: {}", signedResult); // log.info("Signed result: {}", signedResult);
List<JSONObject> jsonObjects = JSONArray.parseArray(signedResult.get("data").toString(), JSONObject.class); List<JSONObject> jsonObjects = JSONArray.parseArray(signedResult.get("data").toString(), JSONObject.class);
// log.info("jsonObjects : {}", com.alibaba.fastjson2.JSONObject.toJSONString(jsonObjects)); // log.info("jsonObjects : {}", com.alibaba.fastjson2.JSONObject.toJSONString(jsonObjects));
...@@ -185,7 +185,7 @@ public class XzServiceImpl implements XzService { ...@@ -185,7 +185,7 @@ public class XzServiceImpl implements XzService {
public String xzAuthNotify(JSONObject notify) { public String xzAuthNotify(JSONObject notify) {
log.info("xzAuthNotify获取到的推送结果:{}", notify.toString()); log.info("xzAuthNotify获取到的推送结果:{}", notify.toString());
// 认证成功,修改认证状态 // 认证成功,修改认证状态
if (notify.get("code").toString().equals("0")) { if ("0".equals(notify.get("code").toString())) {
XzAuthDO authDO = notify.get("data", XzAuthDO.class); XzAuthDO authDO = notify.get("data", XzAuthDO.class);
Integer userAccountId = (Integer) com.alibaba.fastjson2.JSONObject.parseObject(authDO.getCustomParams()).get("userAccountId"); Integer userAccountId = (Integer) com.alibaba.fastjson2.JSONObject.parseObject(authDO.getCustomParams()).get("userAccountId");
if (userAccountId != null) { if (userAccountId != null) {
...@@ -301,7 +301,7 @@ public class XzServiceImpl implements XzService { ...@@ -301,7 +301,7 @@ public class XzServiceImpl implements XzService {
.frontLogNo(frontLogNo) .frontLogNo(frontLogNo)
.build()); .build());
System.out.println(jsonObject.toString()); System.out.println(jsonObject.toString());
if (jsonObject.get("isSuccess").toString().equals("T")) { if ("T".equals(jsonObject.get("isSuccess").toString())) {
return ResultBody.success(jsonObject.get("data")); return ResultBody.success(jsonObject.get("data"));
} else { } else {
return ResultBody.error(jsonObject.get("errorMessage").toString()); return ResultBody.error(jsonObject.get("errorMessage").toString());
......
...@@ -108,7 +108,7 @@ public class QccEntAuthUtil { ...@@ -108,7 +108,7 @@ public class QccEntAuthUtil {
String response = HttpsRequestUtil.httpsRequest(url, method, headers, bodys); String response = HttpsRequestUtil.httpsRequest(url, method, headers, bodys);
log.info("response11111111111111: " + response); log.info("response11111111111111: " + response);
//获取response的body //获取response的body
if(response.equals("Invalid Result - invalid business license")){ if("Invalid Result - invalid business license".equals(response)){
return null; return null;
} }
return response; return response;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论