企业列表出来了

master
法外狂徒张三 2024-09-08 11:50:04 +08:00
parent 42d0f186be
commit 89a6836a82
1 changed files with 8 additions and 7 deletions

View File

@ -133,13 +133,6 @@ public class MyApiController extends BaseController
Long userId = SecurityUtils.getUserId();
myApi.setUserId(userId);
MyApi myApi1 = myApiService.selectMyApiByUserIdAndApiId(userId, myApi.getApiId());
if (myApi1!=null) {
myApi.setMyNum(myApi1.getMyNum()+myApi.getMyNum());
if(myApi1.getMyStates().equals("N")){
myApi.setMyStates("Y");
}
return toAjax(myApiService.updateById(myApi));
}
// 获取当前时间(没有时区)
LocalDateTime now = LocalDateTime.now();
@ -155,6 +148,14 @@ public class MyApiController extends BaseController
// 将Instant转换为Date
Date date = Date.from(instant);
myApi.setMyTime(date);
if (myApi1!=null) {
myApi.setMyNum(myApi1.getMyNum()+myApi.getMyNum());
if(myApi1.getMyStates().equals("N")){
myApi.setMyStates("Y");
}
return toAjax(myApiService.updateById(myApi));
}
myApi.setMyStates("Y");
return toAjax(myApiService.save(myApi));
}