no message

This commit is contained in:
2025-08-27 01:44:25 +08:00
parent 2fc96102a6
commit 9ff8038104
4 changed files with 14 additions and 8 deletions

View File

@ -36,11 +36,11 @@ public class ReceiveBatteryController {
@ApiOperation(value = "接收租电数据接口")
@PostMapping("/batterymeal")
public Result batteryMeal(@RequestBody String receiveMealReq){
Boolean bool = receiveService.recceiveMeals(receiveMealReq);
if (!bool.booleanValue()){
String code = receiveService.recceiveMeals(receiveMealReq);
if (code.equals(NOT_PERMISSION.getCode())){
return Result.fail(NOT_PERMISSION);
}
return Result.ok();
return Result.ok("200","操作成功","操作成功","Cid",code);
}
@ApiOperation(value = "接收用户数据接口")

View File

@ -2,7 +2,7 @@ package com.sczx.sync.service;
public interface ReceiveService {
boolean recceiveMeals(String request);
String recceiveMeals(String request);
String recceiveUserInfo(String request);

View File

@ -45,14 +45,14 @@ public class ReceiveServiceImpl implements ReceiveService {
private String accessToken;
@Override
public boolean recceiveMeals(String request) {
public String recceiveMeals(String request) {
SyncRequest<BatteryRule> syncRequest = JSON.parseObject(request, SyncRequest.class);
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());
QueryWrapper<BatteryRule> syncDataInfoQueryWrapper = new QueryWrapper<>();
QueryWrapper<BatteryRule> eq = syncDataInfoQueryWrapper.eq("meal_id", batteryRule.getMealId());
@ -63,7 +63,7 @@ public class ReceiveServiceImpl implements ReceiveService {
batteryMealMapper.insertZcRentBatteyRule(batteryRule);
}
return true;
return batteryRule.getId() + "";
}
@Override

View File

@ -39,6 +39,12 @@
</insert>
<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
<trim prefix="SET" suffixOverrides=",">
<if test="title != null and title != ''">title = #{title},</if>