no message
This commit is contained in:
@ -36,11 +36,11 @@ public class ReceiveBatteryController {
|
|||||||
@ApiOperation(value = "接收租电数据接口")
|
@ApiOperation(value = "接收租电数据接口")
|
||||||
@PostMapping("/batterymeal")
|
@PostMapping("/batterymeal")
|
||||||
public Result batteryMeal(@RequestBody String receiveMealReq){
|
public Result batteryMeal(@RequestBody String receiveMealReq){
|
||||||
Boolean bool = receiveService.recceiveMeals(receiveMealReq);
|
String code = receiveService.recceiveMeals(receiveMealReq);
|
||||||
if (!bool.booleanValue()){
|
if (code.equals(NOT_PERMISSION.getCode())){
|
||||||
return Result.fail(NOT_PERMISSION);
|
return Result.fail(NOT_PERMISSION);
|
||||||
}
|
}
|
||||||
return Result.ok();
|
return Result.ok("200","操作成功","操作成功","Cid",code);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "接收用户数据接口")
|
@ApiOperation(value = "接收用户数据接口")
|
||||||
|
|||||||
@ -2,7 +2,7 @@ package com.sczx.sync.service;
|
|||||||
|
|
||||||
|
|
||||||
public interface ReceiveService {
|
public interface ReceiveService {
|
||||||
boolean recceiveMeals(String request);
|
String recceiveMeals(String request);
|
||||||
|
|
||||||
String recceiveUserInfo(String request);
|
String recceiveUserInfo(String request);
|
||||||
|
|
||||||
|
|||||||
@ -45,14 +45,14 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
private String accessToken;
|
private String accessToken;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean recceiveMeals(String request) {
|
public String recceiveMeals(String request) {
|
||||||
|
|
||||||
SyncRequest<BatteryRule> syncRequest = JSON.parseObject(request, SyncRequest.class);
|
SyncRequest<BatteryRule> syncRequest = JSON.parseObject(request, SyncRequest.class);
|
||||||
|
|
||||||
if(!syncRequest.getAppid().equals(appId)||!syncRequest.getAccessToken().equals(accessToken)){
|
if(!syncRequest.getAppid().equals(appId)||!syncRequest.getAccessToken().equals(accessToken)){
|
||||||
return false;
|
return NOT_PERMISSION.getCode();
|
||||||
}
|
}
|
||||||
BatteryRule batteryRule = syncRequest.getData();
|
BatteryRule batteryRule = JSON.parseObject(String.valueOf(syncRequest.getData()), BatteryRule.class);
|
||||||
batteryRule.setSyncTime(LocalDateTime.now());
|
batteryRule.setSyncTime(LocalDateTime.now());
|
||||||
QueryWrapper<BatteryRule> syncDataInfoQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<BatteryRule> syncDataInfoQueryWrapper = new QueryWrapper<>();
|
||||||
QueryWrapper<BatteryRule> eq = syncDataInfoQueryWrapper.eq("meal_id", batteryRule.getMealId());
|
QueryWrapper<BatteryRule> eq = syncDataInfoQueryWrapper.eq("meal_id", batteryRule.getMealId());
|
||||||
@ -63,7 +63,7 @@ public class ReceiveServiceImpl implements ReceiveService {
|
|||||||
batteryMealMapper.insertZcRentBatteyRule(batteryRule);
|
batteryMealMapper.insertZcRentBatteyRule(batteryRule);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return batteryRule.getId() + "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -39,6 +39,12 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateBatteryRule" parameterType="BatteryRule">
|
<update id="updateBatteryRule" parameterType="BatteryRule">
|
||||||
|
<selectKey keyProperty='id' resultType='java.lang.Long' order='AFTER'>
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
from zc_rent_battey_rule
|
||||||
|
where meal_id = #{mealId}
|
||||||
|
</selectKey>
|
||||||
update zc_rent_battey_rule
|
update zc_rent_battey_rule
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="title != null and title != ''">title = #{title},</if>
|
<if test="title != null and title != ''">title = #{title},</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user