修改桩停用,小程序登录

This commit is contained in:
yuyang 2022-03-10 15:49:07 +08:00
parent 8ddd229539
commit caa9ffb67f
7 changed files with 30 additions and 14 deletions

View File

@ -52,7 +52,12 @@ public class XhpcTerminalController extends BaseController {
@Log(title = "终端-停用", businessType = BusinessType.UPDATE)
@PostMapping(value = "/updateStatus")
public AjaxResult updateStatus(@RequestBody XhpcTerminal xhpcTerminal) {
if(null==xhpcTerminal.getTerminalId()){
return AjaxResult.error("桩数据为空");
}
if(null==xhpcTerminal.getStatus()){
return AjaxResult.error("桩数据状态为空");
}
return xhpcTerminalService.updateStatus(xhpcTerminal.getTerminalId(), xhpcTerminal.getStatus());
}

View File

@ -63,7 +63,8 @@ public class XhpcTerminalServiceImpl extends BaseService implements IXhpcTermina
@Override
public AjaxResult updateStatus(Long terminalId, Integer Status) {
XhpcTerminal xhpcTerminal = xhpcTerminalMapper.selectXhpcTerminalById(terminalId);
XhpcTerminal xhpcTerminal = new XhpcTerminal();
xhpcTerminal.setTerminalId(terminalId);
xhpcTerminal.setStatus(Status);
xhpcTerminalMapper.updateXhpcTerminal(xhpcTerminal);
return AjaxResult.success();

View File

@ -396,6 +396,7 @@
where te.charging_station_id = #{chargingStationId}
and te.status = 0
and te.del_flag = 0
order by te.serial_number desc
</select>
<insert id="insertXhpcRateModel" parameterType="com.xhpc.common.domain.XhpcRateModel" useGeneratedKeys="true"

View File

@ -29,7 +29,7 @@ public class XhpcServiceDataUpdateServiceImpl implements IXhpcServiceDataUpdateS
list.put("SOC",cacheSOC);
list.put("version",cacheVersion);
list.put("phone", cachePhone);
list.put("aliyunMessageCount", cacheAliyunMessageCount);
//list.put("aliyunMessageCount", cacheAliyunMessageCount);
return list;
}
@ -48,14 +48,14 @@ public class XhpcServiceDataUpdateServiceImpl implements IXhpcServiceDataUpdateS
return AjaxResult.error("号码格式错误");
}
}
if (aliyunMessageCount == null && "".equals(aliyunMessageCount)) {
return AjaxResult.error("短信条数为空");
}
// if (aliyunMessageCount == null && "".equals(aliyunMessageCount)) {
// return AjaxResult.error("短信条数为空");
// }
redisService.setCacheObject("global:SOC", SOC);
redisService.setCacheObject("global:version", version);
redisService.setCacheObject("global:phone", phone);
redisService.setCacheObject("global:AliyunMessageCount", aliyunMessageCount);
// redisService.setCacheObject("global:AliyunMessageCount", aliyunMessageCount);
return AjaxResult.success();

View File

@ -484,7 +484,6 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe
Map<String, Object> operatorMessage = xhpcChargeOrderService.getOperatorMessage(xhpcChargeOrder.getChargingStationId());
if(operatorMessage !=null){
if(operatorMessage.get("operatorIdEvcs")!=null){
if(operatorMessage.get("operatorIdEvcs") !=null && !"".equals(operatorMessage.get("operatorIdEvcs").toString())){
String stw = operatorMessage.get("operatorIdEvcs").toString();
if(stw.length()>9){

View File

@ -924,4 +924,9 @@
<select id="getStatisticsStationHistoryOrderId" resultType="int">
select count(statistics_station_id) from xhpc_statistics_station where history_order_id=#{historyOrderId} and type=#{type}
</select>
<select id="getTodayNUmber" resultType="map">
</select>
</mapper>

View File

@ -133,6 +133,9 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
String type = StringUtils.valueOf(map.get("type"));
String openid = StringUtils.valueOf(map.get("openid"));
String tenantId = StringUtils.valueOf(map.get("tenantId"));
logger.info("<<<<<<<<<<openid>>>>>>>>>>>>");
logger.info("<<<<<<<<<<注册openid>>>>>>>>>>>>"+openid);
logger.info("<<<<<<<<<<openid>>>>>>>>>>>>");
if (StringUtils.isEmpty(openid)) {
return R.fail(HttpStatus.NOT_NULL, "openid不能为空");
}
@ -201,6 +204,9 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
return R.fail(HttpStatus.NOT_NULL, "验证码不能为空");
}
String openid = StringUtils.valueOf(map.get("openid"));
logger.info("<<<<<<<<<<openid>>>>>>>>>>>>");
logger.info("<<<<<<<<<<登录openid>>>>>>>>>>>>"+openid);
logger.info("<<<<<<<<<<openid>>>>>>>>>>>>");
if (StringUtils.isEmpty(openid)) {
return R.fail(HttpStatus.NOT_NULL, "openid不能为空");
}
@ -323,14 +329,10 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
return R.fail(HttpStatus.DATA_ERROR, "对不起,您的账号:" + username + " 已停用");
}
if (StatusConstants.OPERATION_WX_TYPE.equals(type)) {
if (StringUtils.isEmpty(user.getWeixinOpenId())) {
user.setWeixinOpenId(openid);
}
user.setWeixinOpenId(openid);
user.setWeixinLogin(UserConstants.LOGIN);
} else {
if (StringUtils.isEmpty(user.getAlipayOpenId())) {
user.setAlipayOpenId(openid);
}
user.setAlipayOpenId(openid);
user.setAlipayLogin(UserConstants.LOGIN);
}
xhpcAppUserMapper.update(user);
@ -409,6 +411,9 @@ public class XhpcAppUserServiceImpl extends BaseService implements IXhpcAppUserU
String type = StringUtils.valueOf(map.get("type"));
String openid = StringUtils.valueOf(map.get("openid"));
String tenantId = StringUtils.valueOf(map.get("tenantId"));
logger.info("<<<<<<<<<<openid>>>>>>>>>>>>");
logger.info("<<<<<<<<<<自动登录openid>>>>>>>>>>>>"+openid);
logger.info("<<<<<<<<<<openid>>>>>>>>>>>>");
Map<String, Object> userLoginTime = xhpcAppUserMapper.getUserLoginTime(Integer.valueOf(type), openid,tenantId);
if(userLoginTime ==null){
return R.fail(HttpStatus.USER_LOGIN, "请重新登录");