Browse Source

Merge branch 'master' of http://175.178.51.79:3000/Augcl/pet-admin

# Conflicts:
#	ruoyi-admin/src/main/resources/application.yml
master
CYF 2 months ago
parent
commit
002a3cc30d
51 changed files with 1337 additions and 447 deletions
  1. +3
    -2
      CatmDogd-Mall-Front-test/.env.development
  2. +1
    -1
      CatmDogd-Mall-Front-test/.env.production
  3. +85
    -73
      CatmDogd-Mall-Front-test/src/views/model/AppUsers/index.vue
  4. +4
    -2
      CatmDogd-Mall-Front-test/src/views/oms/order/index.vue
  5. +11
    -0
      ruoyi-admin/pom.xml
  6. +46
    -0
      ruoyi-admin/src/main/resources/application-druid.yml
  7. +2
    -2
      ruoyi-admin/src/main/resources/application.yml
  8. +11
    -0
      ruoyi-catdog/pom.xml
  9. +91
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiAppletHhrWorkInController.java
  10. +70
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiAppletHhrWorkOutController.java
  11. +28
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiAppletInfoController.java
  12. +53
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiAppletLoginController.java
  13. +59
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiAppletWalletController.java
  14. +29
    -29
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/AppletBannerController.java
  15. +0
    -43
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/AppletIndexIconController.java
  16. +25
    -30
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/AppletIndexPartnerConfigController.java
  17. +0
    -39
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/AppletLoginController.java
  18. +0
    -59
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/AppletWalletController.java
  19. +27
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/applet/pojo/dto/ApiAppletLoginDTO.java
  20. +14
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/applet/pojo/dto/ApiQueryIIdDTO.java
  21. +21
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/applet/pojo/dto/ApiQueryIIdMyUserDTO.java
  22. +15
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/applet/utils/conf/AppletUtil.java
  23. +33
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/applet/utils/wechat/WechatHttpConf.java
  24. +163
    -140
      ruoyi-catdog/src/main/java/com/ruoyi/model/domain/AppUsers.java
  25. +2
    -2
      ruoyi-catdog/src/main/java/com/ruoyi/model/domain/TransactionDetails.java
  26. +16
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/model/mapper/AppUsersMapper.java
  27. +1
    -2
      ruoyi-catdog/src/main/java/com/ruoyi/model/mapper/IndexconfigIconMapper.java
  28. +1
    -1
      ruoyi-catdog/src/main/java/com/ruoyi/model/mapper/IndexconfigMapper.java
  29. +1
    -1
      ruoyi-catdog/src/main/java/com/ruoyi/model/mapper/TransactionDetailsMapper.java
  30. +25
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/IAApiAppletHhrWorkOutService.java
  31. +23
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/IAApiAppletLoginService.java
  32. +4
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/IApiAppletInfoService.java
  33. +13
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/IAppUsersService.java
  34. +1
    -2
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/IIndexconfigIconService.java
  35. +1
    -1
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/IIndexconfigService.java
  36. +1
    -1
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/ITransactionDetailsService.java
  37. +135
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/AApiAppletHhrWorkOutServiceImpl.java
  38. +203
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/AApiAppletLoginServiceImpl.java
  39. +8
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/ApiAppletInfoServiceImpl.java
  40. +12
    -0
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/AppUsersServiceImpl.java
  41. +2
    -2
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/IndexconfigIconServiceImpl.java
  42. +2
    -2
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/IndexconfigServiceImpl.java
  43. +2
    -2
      ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/TransactionDetailsServiceImpl.java
  44. +11
    -0
      ruoyi-catdog/src/main/resources/mapper/model/AppUsersMapper.xml
  45. +2
    -5
      ruoyi-catdog/src/main/resources/mapper/model/IndexconfigIconMapper.xml
  46. +2
    -2
      ruoyi-catdog/src/main/resources/mapper/model/IndexconfigMapper.xml
  47. +1
    -0
      ruoyi-catdog/src/main/resources/mapper/model/TransactionDetailsMapper.xml
  48. +2
    -0
      ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
  49. +20
    -0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginApplet.java
  50. +4
    -4
      ruoyi-framework/pom.xml
  51. +51
    -0
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java

+ 3
- 2
CatmDogd-Mall-Front-test/.env.development View File

@ -4,8 +4,9 @@ VUE_APP_TITLE = 猫妈狗爸商城管理平台
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'
# 若依管理系统/开发环境 https://api-test.catmdogd.com/test-api
VUE_APP_BASE_API = 'http://localhost:8081'
# 若依管理系统/开发环境 https://pet-admin.hhlm1688.com/api
#VUE_APP_BASE_API = 'https://pet-admin.hhlm1688.com/api/prod-api'
VUE_APP_BASE_API = 'http://localhost:8081/prod-api'
# 路由懒加载 # 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true VUE_CLI_BABEL_TRANSPILE_MODULES = true


+ 1
- 1
CatmDogd-Mall-Front-test/.env.production View File

@ -5,5 +5,5 @@ VUE_APP_TITLE = 猫妈狗爸商城管理平台测试环境
ENV = 'production' ENV = 'production'
# 若依管理系统/生产环境 # 若依管理系统/生产环境
VUE_APP_BASE_API = '/test-api'
VUE_APP_BASE_API = '/api/prod-api'
VUE_APP_JUDGE_STAR = 0 VUE_APP_JUDGE_STAR = 0

+ 85
- 73
CatmDogd-Mall-Front-test/src/views/model/AppUsers/index.vue View File

@ -75,11 +75,30 @@
placeholder="选择过期时间"> placeholder="选择过期时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item class="flex_one tr">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-form-item label="是否合伙人" prop="userHh">
<el-input
v-model="queryParams.userHh"
placeholder="请输入是否合伙人"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否伴宠师" prop="userBcs">
<el-input
v-model="queryParams.userBcs"
placeholder="请输入是否伴宠师"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item> </el-form-item>
</template> </template>
<el-form-item class="flex_one tr">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button :icon="showMoreCondition ? 'el-icon-arrow-up' : 'el-icon-arrow-down'" size="mini" @click="showMoreCondition = !showMoreCondition">{{showMoreCondition ? '收起条件' : '展开条件'}}</el-button>
</el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
@ -90,7 +109,7 @@
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['model:AppUsers:add']"
v-hasPermi="['model:appUsers:add']"
>新增</el-button> >新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -101,7 +120,7 @@
size="mini" size="mini"
:disabled="single" :disabled="single"
@click="handleUpdate" @click="handleUpdate"
v-hasPermi="['model:AppUsers:edit']"
v-hasPermi="['model:appUsers:edit']"
>修改</el-button> >修改</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -112,7 +131,7 @@
size="mini" size="mini"
:disabled="multiple" :disabled="multiple"
@click="handleDelete" @click="handleDelete"
v-hasPermi="['model:AppUsers:remove']"
v-hasPermi="['model:appUsers:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
@ -123,13 +142,13 @@
size="mini" size="mini"
:loading="exportLoading" :loading="exportLoading"
@click="handleExport" @click="handleExport"
v-hasPermi="['model:AppUsers:export']"
v-hasPermi="['model:appUsers:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="AppUsersList" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="appUsersList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户编号" align="center" prop="userId" /> <el-table-column label="用户编号" align="center" prop="userId" />
<el-table-column label="备注" align="center" prop="remark" v-if="columns[0].visible"/> <el-table-column label="备注" align="center" prop="remark" v-if="columns[0].visible"/>
@ -145,9 +164,11 @@
<el-table-column label="刷新token" align="center" prop="refreshToken" v-if="columns[10].visible"/> <el-table-column label="刷新token" align="center" prop="refreshToken" v-if="columns[10].visible"/>
<el-table-column label="过期时间" align="center" prop="expireTime" width="180" v-if="columns[11].visible"> <el-table-column label="过期时间" align="center" prop="expireTime" width="180" v-if="columns[11].visible">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.expireTime, '')}}</span>
<span>{{ parseTime(scope.row.expireTime, '')}}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="是否合伙人" align="center" prop="userHh" v-if="columns[12].visible"/>
<el-table-column label="是否伴宠师" align="center" prop="userBcs" v-if="columns[13].visible"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -155,14 +176,14 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['model:AppUsers:edit']"
v-hasPermi="['model:appUsers:edit']"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['model:AppUsers:remove']"
v-hasPermi="['model:appUsers:remove']"
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -176,7 +197,7 @@
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改用户对话框 -->
<!-- 添加或修改用户对话框 -->
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body> <el-dialog :title="title" :visible.sync="open" width="50%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two"> <el-form ref="form" :model="form" :rules="rules" label-width="108px" inline class="dialog-form-two">
<el-form-item label="逻辑删除" prop="delFlag"> <el-form-item label="逻辑删除" prop="delFlag">
@ -217,12 +238,18 @@
</el-form-item> </el-form-item>
<el-form-item label="过期时间" prop="expireTime"> <el-form-item label="过期时间" prop="expireTime">
<el-date-picker clearable size="small" <el-date-picker clearable size="small"
v-model="form.expireTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择过期时间">
v-model="form.expireTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择过期时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="是否合伙人" prop="userHh">
<el-input v-model="form.userHh" placeholder="请输入是否合伙人" />
</el-form-item>
<el-form-item label="是否伴宠师" prop="userBcs">
<el-input v-model="form.userBcs" placeholder="请输入是否伴宠师" />
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -233,8 +260,14 @@
</template> </template>
<script> <script>
import { listAppUsers, getAppUsers, delAppUsers, addAppUsers, updateAppUsers, exportAppUsers } from "@/api/model/AppUsers";
import {parseTime} from "../../../utils/ruoyi";
import {
listAppUsers,
getAppUsers,
delAppUsers,
addAppUsers,
updateAppUsers,
exportAppUsers
} from "@/api/model/AppUsers";
export default { export default {
name: "AppUsers", name: "AppUsers",
@ -254,8 +287,8 @@ export default {
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
//
AppUsersList: [],
//
appUsersList: [],
// //
title: "", title: "",
// //
@ -265,63 +298,55 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
updatorBy: null, updatorBy: null,
userImage: null, userImage: null,
userName: null, userName: null,
userState: null, userState: null,
userTelephone: null, userTelephone: null,
unionid: null, unionid: null,
openid: null, openid: null,
accessToken: null, accessToken: null,
expiresIn: null, expiresIn: null,
refreshToken: null, refreshToken: null,
expireTime: null, expireTime: null,
userHh: null,
userBcs: null
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
userName: [ userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" }
{required: true, message: "用户名称不能为空", trigger: "blur"}
], ],
}, },
columns: [ columns: [
{ key: 4, label: "备注", visible: true },
{ key: 6, label: "修改人", visible: true },
{ key: 7, label: "用户头像", visible: false },
{ key: 8, label: "用户名称", visible: true },
{ key: 9, label: "用户状态, 0==为注册, 1==已注册为认证", visible: true },
{ key: 10, label: "用户电话", visible: false },
{ key: 11, label: "只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段", visible: false },
{ key: 12, label: "用户的标识,对当前公众号唯一", visible: false },
{ key: 13, label: "token", visible: false },
{ key: 14, label: "过期时间", visible: false },
{ key: 15, label: "刷新token", visible: false },
{ key: 16, label: "过期时间", visible: false },
],
{key: 4, label: "备注", visible: true},
{key: 6, label: "修改人", visible: true},
{key: 7, label: "用户头像", visible: false},
{key: 8, label: "用户名称", visible: true},
{key: 9, label: "用户状态, 0==为注册, 1==已注册为认证", visible: true},
{key: 10, label: "用户电话", visible: false},
{key: 11, label: "只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段", visible: false},
{key: 12, label: "用户的标识,对当前公众号唯一", visible: false},
{key: 13, label: "token", visible: false},
{key: 14, label: "过期时间", visible: false},
{key: 15, label: "刷新token", visible: false},
{key: 16, label: "过期时间", visible: false},
{key: 17, label: "是否合伙人", visible: false},
{key: 18, label: "是否伴宠师", visible: false},
],
showMoreCondition: false
}; };
}, },
created() { created() {
this.getList(); this.getList();
}, },
methods: { methods: {
parseTime,
/** 查询用户列表 */
/** 查询用户表列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listAppUsers(this.queryParams).then(response => { listAppUsers(this.queryParams).then(response => {
this.AppUsersList = response.rows;
this.appUsersList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
@ -335,39 +360,24 @@ export default {
reset() { reset() {
this.form = { this.form = {
userId: null, userId: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
delFlag: null, delFlag: null,
remark: null, remark: null,
updateTime: null, updateTime: null,
updatorBy: null, updatorBy: null,
userImage: null, userImage: null,
userName: null, userName: null,
userState: null, userState: null,
userTelephone: null, userTelephone: null,
unionid: null, unionid: null,
openid: null, openid: null,
accessToken: null, accessToken: null,
expiresIn: null, expiresIn: null,
refreshToken: null, refreshToken: null,
expireTime: null, expireTime: null,
userHh: null,
userBcs: null
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -384,14 +394,14 @@ export default {
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map(item => item.userId) this.ids = selection.map(item => item.userId)
this.single = selection.length!==1
this.single = selection.length !== 1
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加用户";
this.title = "添加用户";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
@ -400,7 +410,7 @@ export default {
getAppUsers(userId).then(response => { getAppUsers(userId).then(response => {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改用户";
this.title = "修改用户";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
@ -426,23 +436,25 @@ export default {
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const userIds = row.userId || this.ids; const userIds = row.userId || this.ids;
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() {
this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function () {
return delAppUsers(userIds); return delAppUsers(userIds);
}).then(() => { }).then(() => {
this.getList(); this.getList();
this.$modal.msgSuccess("删除成功"); this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}).catch(() => {
});
}, },
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
const queryParams = this.queryParams; const queryParams = this.queryParams;
this.$modal.confirm('是否确认导出所有用户数据项?').then(() => {
this.$modal.confirm('是否确认导出所有用户数据项?').then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportAppUsers(queryParams); return exportAppUsers(queryParams);
}).then(response => { }).then(response => {
this.download(response.msg); this.download(response.msg);
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {});
}).catch(() => {
});
} }
} }
}; };


+ 4
- 2
CatmDogd-Mall-Front-test/src/views/oms/order/index.vue View File

@ -145,7 +145,7 @@
<div v-if="scope.row.merchantNote">{{ scope.row.merchantNote }}</div> <div v-if="scope.row.merchantNote">{{ scope.row.merchantNote }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单状态" prop="status" width="160" align="center" > <el-table-column label="订单状态" prop="status" width="160" align="center" >
<template v-slot="scope"> <template v-slot="scope">
<div> <div>
@ -277,7 +277,9 @@
<!-- 日志 --> <!-- 日志 -->
<el-dialog :title="logObj.title" :visible.sync="logObj.open" width="500px" append-to-body> <el-dialog :title="logObj.title" :visible.sync="logObj.open" width="500px" append-to-body>
<el-timeline> <el-timeline>
<el-timeline-item v-for="item in logObj.logList" placement="top" :timestamp="parseTime(item.createTime, '')">
<el-timeline-item v-for="item in logObj.logList" placement="top"
:key="item.id"
:timestamp="parseTime(item.createTime, '')">
<el-card> <el-card>
<h4>{{ getLogEvent(item.orderStatus) }}</h4> <h4>{{ getLogEvent(item.orderStatus) }}</h4>
<br> <br>


+ 11
- 0
ruoyi-admin/pom.xml View File

@ -69,6 +69,17 @@
<artifactId>ruoyi-mall</artifactId> <artifactId>ruoyi-mall</artifactId>
<version>${ruoyi.version}</version> <version>${ruoyi.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-catdog</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.junit.vintage</groupId> <groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId> <artifactId>junit-vintage-engine</artifactId>


+ 46
- 0
ruoyi-admin/src/main/resources/application-druid.yml View File

@ -101,3 +101,49 @@ aes:
key: 1111111111123456 key: 1111111111123456
# 伴宠师-相关配置信息
wechat-admin:
enabled: true
appId: wx01f0f43759922fda
secret: b0a5617e6e4c387262a32af2b355c8b6
merchantId: 1665639691
privateKeyPath: ruoyi-admin/src/main/resources/apiclient_cert.p12
#privateKeyPath: /Users/daixiande/Work/杂七杂八/1665639691_20240111_cert/apiclient_key.pem
merchantSerialNumber: 6050244FC18200362585F1F9FD6557A1B291E8C0
apiV3key: 19971022197001121966060120240731
apiV2key: 19961022196901121965060120230731
notifyUrl: https://api.catmdogd.com/prod-api/no-auth/wechat/notify
notifyUrlForBCHSH: https://api.catmdogd.com/prod-api/no-auth/wechat/notifyForBCHSH
miniProgramAppId: wxd1a6ba7b5e17a5b6
miniProgramSecret: 06e946a2c9010f8eb9e306018a779a7f
staffAppId: wx01f0f43759922fda
staffSecret: b0a5617e6e4c387262a32af2b355c8b6
pay:
v3:
# 租户id
miniapp:
# 应用appId 服务商模式下为服务商的appid 必填
app-id: wxd1a6ba7b5e17a5b6
# v2 api 密钥 1.0.5版本以后如果用到V2的接口时必填
app-secret: 06e946a2c9010f8eb9e306018a779a7f
# api v3 密钥 必填
app-v3-secret: 19971022197001121966060120240731
# 微信支付商户号 服务商模式下为服务商的mchid 必填
mch-id: 1665639691
# 商户服务器域名 用于回调 需要放开回调接口的安全策略 必填
domain: https://api-test.catmdogd.com
# 商户 api 证书路径 必填 填写classpath路径 位于 maven项目的resources文件下
cert-path: apiclient_cert.p12
#cert-path: /data/software/app/key/apiclient_cert.p12

+ 2
- 2
ruoyi-admin/src/main/resources/application.yml View File

@ -17,13 +17,13 @@ ruoyi:
# 前端请求的 跟踪 header name # 前端请求的 跟踪 header name
traceIdName: x-web-trace-id traceIdName: x-web-trace-id
# 开发环境配置
# 开发环境配置.0
server: server:
# 服务器的HTTP端口,默认为8080 # 服务器的HTTP端口,默认为8080
port: 8081 port: 8081
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: /prod-api/
context-path: /prod-api
tomcat: tomcat:
# tomcat的URI编码 # tomcat的URI编码
uri-encoding: UTF-8 uri-encoding: UTF-8


+ 11
- 0
ruoyi-catdog/pom.xml View File

@ -68,6 +68,17 @@
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId> <artifactId>ruoyi-common</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
<version>0.0.20131108.vaadin1</version>
<scope>compile</scope>
</dependency>
</dependencies> </dependencies>
<properties> <properties>


+ 91
- 0
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiAppletHhrWorkInController.java View File

@ -0,0 +1,91 @@
package com.ruoyi.applet.contoller;
import com.ruoyi.applet.pojo.dto.ApiQueryIIdDTO;
import com.ruoyi.applet.utils.conf.AppletUtil;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.model.domain.*;
import com.ruoyi.model.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(description = "伴宠师-工作台外部")
@RestController
@RequestMapping("/applet/workIn")
public class ApiAppletHhrWorkInController extends BaseController {
@Autowired
private IIndexconfigIconService indexconfigIconService;
@Autowired
private IIndexconfigService indexConfigService;
@Autowired
private IAppUsersService appUsersService;
@Autowired
private IIndexPartnerConfigService iIndexPartnerConfigService;
//1.查询轮播图接口
@Autowired
private IAppBannerService iAppBannerService;
@ApiOperation("轮播图列表")
@GetMapping("/bannerList")
public AjaxResult bannerList(){
List<AppBanner> bannerList = iAppBannerService.getBannerList();
return AjaxResult.success("轮播图列表",bannerList);
}
@ApiOperation("未加入的工作台图标配置查询")
@GetMapping("/indexConfigIco")
public AjaxResult getIndexConfigIcon(){
List<IndexconfigIcon> indexconfigIconByIdentity = indexconfigIconService.getIndexconfigIconByIdentity();
return AjaxResult.success(indexconfigIconByIdentity);
}
@ApiOperation("已加入的工作台图标配置查询")
@GetMapping("/indexConfig")
public TableDataInfo getIndexConfig(){
return getDataTable(indexConfigService.getIndexconfigList());
}
@ApiOperation("查询加入合伙人提示配置列表")
@GetMapping("/list")
public TableDataInfo list(){
List<IndexPartnerConfig> indexPartnerConfigList = iIndexPartnerConfigService.getIndexPartnerConfigList();
return getDataTable(indexPartnerConfigList);
}
@ApiOperation("申请加入合伙人-需要token")
@PostMapping("/joinHh")
public AjaxResult joinHh(@RequestBody ApiQueryIIdDTO dto){
// AppUsers localAppletUser = AppletUtil.getLocalAppletUser();
AppUsers localAppletUser = new AppUsers();
localAppletUser.setUserId(dto.getAppUserId());
localAppletUser.setUserHh(1);
appUsersService.updateAppUsers(localAppletUser);
return AjaxResult.success("申请成功合伙人");
}
@ApiOperation("申请加入伴宠师-需要token")
@PostMapping("/joiBcs")
public AjaxResult joiBcs(@RequestBody ApiQueryIIdDTO dto){
// AppUsers localAppletUser = AppletUtil.getLocalAppletUser();
AppUsers localAppletUser = new AppUsers();
localAppletUser.setUserId(dto.getAppUserId());
localAppletUser.setUserBcs(1);
appUsersService.updateAppUsers(localAppletUser);
return AjaxResult.success("申请成功伴宠师");
}
}

+ 70
- 0
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiAppletHhrWorkOutController.java View File

@ -0,0 +1,70 @@
package com.ruoyi.applet.contoller;
import com.ruoyi.applet.pojo.dto.ApiQueryIIdDTO;
import com.ruoyi.applet.pojo.dto.ApiQueryIIdMyUserDTO;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.model.service.IAApiAppletHhrWorkOutService;
import com.ruoyi.model.service.IAApiAppletLoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@Api(description = "伴宠师-合伙人工作台内部流程")
@RestController
@RequestMapping("/applet/workOut")
public class ApiAppletHhrWorkOutController {
//伴宠师-登录相关问题
@Resource
private IAApiAppletHhrWorkOutService apiAppletHhrWorkOutService;
//合伙人工作台 - 绑定用户基础信息
@ApiOperation("合伙人工作台 - 绑定用户基础信息")
@GetMapping("/hhrInfo/{appUserId}")
public AjaxResult HhrInfo(@PathVariable("appUserId") Long appUserId){
return apiAppletHhrWorkOutService.HhrInfo(appUserId);
}
//合伙人工作台 - 绑定二维码
@ApiOperation("合伙人工作台 - 绑定二维码")
@GetMapping("/hhrCode/{appUserId}")
public AjaxResult HhrCode(@PathVariable("appUserId") Long appUserId){
return apiAppletHhrWorkOutService.HhrCode(appUserId);
}
//合伙人工作台 - 我的用户列表 0 未下单 1已下单
@ApiOperation("合伙人工作台 - 我的用户列表 0 未下单 1已下单")
@PostMapping("/hhrMyUserList")
public AjaxResult HhrMyUserList(@RequestBody ApiQueryIIdMyUserDTO dto, Pageable page){
return apiAppletHhrWorkOutService.HhrMyUserList(dto.getAppUserId(),dto.getState(),page);
}
//合伙人工作台 - 根据用户标识查询用户下单详细信息
@ApiOperation("合伙人工作台 - 根据用户标识查询用户下单详细信息")
@GetMapping("/hhrMyUserGetById/{appUserId}")
public AjaxResult HhrMyUserGetById(@PathVariable("appUserId") Long appUserId){
return apiAppletHhrWorkOutService.HhrMyUserGetById(appUserId);
}
}

+ 28
- 0
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiAppletInfoController.java View File

@ -0,0 +1,28 @@
package com.ruoyi.applet.contoller;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(description = "伴宠师-我的流程")
@RestController
@RequestMapping("/applet/info")
public class ApiAppletInfoController {
}

+ 53
- 0
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiAppletLoginController.java View File

@ -0,0 +1,53 @@
package com.ruoyi.applet.contoller;
import com.ruoyi.applet.pojo.dto.ApiAppletLoginDTO;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.model.service.IAApiAppletLoginService;
import com.ruoyi.model.service.IAddValueServiceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(description = "伴宠师-登录流程")
@RestController
@RequestMapping("/applet/login")
public class ApiAppletLoginController {
//伴宠师-登录相关问题
@Autowired
private IAApiAppletLoginService apiAppletLoginService;
//伴宠师-微信授权登录
@ApiOperation("伴宠师-微信授权登录")
@PostMapping("/wechatLogin")
public AjaxResult wechatLogin(@RequestBody ApiAppletLoginDTO params){
return apiAppletLoginService.wechatLogin(params);
}
//伴宠师-获取手机号码
@ApiOperation("伴宠师-获取手机号码")
@PostMapping("/bindPhone")
public AjaxResult bindPhone(@RequestBody ApiAppletLoginDTO params){
return apiAppletLoginService.bindPhone(params);
}
//伴宠师-登录页基础信息
@ApiOperation("伴宠师-登录页基础信息")
@GetMapping("/loginConf")
public AjaxResult loginConf(){
return apiAppletLoginService.loginConf();
}
//伴宠师-获取用户基本能信息
@ApiOperation("伴宠师-获取用户基本能信息")
@GetMapping("/getAppletUserInfo/{appUserId}")
public AjaxResult getAppletUserInfo(@PathVariable("appUserId") Long appUserId){
return apiAppletLoginService.getAppletUserInfo(appUserId);
}
}

+ 59
- 0
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiAppletWalletController.java View File

@ -0,0 +1,59 @@
package com.ruoyi.applet.contoller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.model.domain.AppTransactionDetails;
import com.ruoyi.model.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
@Api(description = "伴宠师-钱包相关接口")
@RestController
@RequestMapping("/applet/wallet")
public class ApiAppletWalletController extends BaseController {
//钱包
@Autowired
private IAppWalletService appWalletService;
//钱包提现配置
@Autowired
private IAppWithdrawalConfigService appWithdrawalConfigService;
@Autowired
private IAppTransactionDetailsService appTransactionDetailsService;
@Autowired
private ITransactionDetailsService transactionDetailsService;
@ApiOperation("交易明细记录列表-这里还要改成带分页的")
@GetMapping("/getTransactionDetailsList/{transactionType}")
public TableDataInfo getTransactionDetailsList(@PathVariable Long transactionType){
return getDataTable(transactionDetailsService.getTransactionDetailsList(transactionType));
}
@ApiOperation("交易明细记录")
@GetMapping("/getTransactionDetails/{id}")
public TableDataInfo getAppTransactionDetailsByWid(@PathVariable Long id){
return getDataTable(appTransactionDetailsService.getAppTransactionDetailsByWid(id));
}
//伴宠师-用户提现
@ApiOperation("伴宠师-用户提现")
@PostMapping("/saveMoney")
public AjaxResult saveMoney(@PathVariable BigDecimal money){
AppTransactionDetails appTransactionDetails = new AppTransactionDetails();
appTransactionDetails.setDetailsName("提现测试");
appTransactionDetails.setDetailsPrice(100L);
appTransactionDetailsService.insertAppTransactionDetails(appTransactionDetails);
return AjaxResult.success("提现成功");
}
}

+ 29
- 29
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/AppletBannerController.java View File

@ -1,29 +1,29 @@
package com.ruoyi.applet.contoller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.model.domain.AppBanner;
import com.ruoyi.model.service.IAppBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(description = "轮播图")
@RestController
@RequestMapping("/applet/banner")
public class AppletBannerController extends BaseController {
//1.查询轮播图接口
@Autowired
private IAppBannerService iAppBannerService;
@ApiOperation("轮播图列表")
@GetMapping("/list")
public TableDataInfo list(){
return getDataTable(iAppBannerService.getBannerList());
}
}
//package com.ruoyi.applet.contoller;
//
//import com.ruoyi.common.core.controller.BaseController;
//import com.ruoyi.common.core.page.TableDataInfo;
//import com.ruoyi.model.domain.AppBanner;
//import com.ruoyi.model.service.IAppBannerService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
//@Api(description = "伴宠师-轮播图")
//@RestController
//@RequestMapping("/applet/banner")
//public class AppletBannerController extends BaseController {
//// //1.查询轮播图接口
//// @Autowired
//// private IAppBannerService iAppBannerService;
////
//// @ApiOperation("轮播图列表")
//// @GetMapping("/list")
//// public TableDataInfo list(){
//// return getDataTable(iAppBannerService.getBannerList());
//// }
//}

+ 0
- 43
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/AppletIndexIconController.java View File

@ -1,43 +0,0 @@
package com.ruoyi.applet.contoller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.model.domain.Indexconfig;
import com.ruoyi.model.domain.IndexconfigIcon;
import com.ruoyi.model.service.IIndexconfigIconService;
import com.ruoyi.model.service.IIndexconfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(description = "工作台图标")
@RestController
@RequestMapping("/applet/indexIcon")
public class AppletIndexIconController extends BaseController {
@Autowired
private IIndexconfigIconService indexconfigIconService;
@Autowired
private IIndexconfigService indexConfigService;
@ApiOperation("未加入的工作台图标配置查询")
@GetMapping("/indexConfigIcon/{identity}")
public AjaxResult getIndexConfigIcon(@PathVariable Long identity){
IndexconfigIcon indexconfigIconByIdentity = indexconfigIconService.getIndexconfigIconByIdentity(identity);
return AjaxResult.success(indexconfigIconByIdentity);
}
@ApiOperation("已加入的工作台图标配置查询")
@GetMapping("/indexConfig/{indexType}")
public TableDataInfo getIndexConfig(@PathVariable Long indexType){
return getDataTable(indexConfigService.getIndexconfigList(indexType));
}
}

+ 25
- 30
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/AppletIndexPartnerConfigController.java View File

@ -1,30 +1,25 @@
package com.ruoyi.applet.contoller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.model.domain.IndexPartnerConfig;
import com.ruoyi.model.service.IIndexPartnerConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(description = "加入合伙人提示配置")
@RestController
@RequestMapping("/applet/indexPartnerConfig")
public class AppletIndexPartnerConfigController extends BaseController {
@Autowired
private IIndexPartnerConfigService iIndexPartnerConfigService;
@ApiOperation("查询加入合伙人提示配置列表")
@GetMapping("/list")
public TableDataInfo list(){
List<IndexPartnerConfig> indexPartnerConfigList = iIndexPartnerConfigService.getIndexPartnerConfigList();
return getDataTable(indexPartnerConfigList);
}
}
//package com.ruoyi.applet.contoller;
//
//import com.ruoyi.common.core.controller.BaseController;
//import com.ruoyi.common.core.page.TableDataInfo;
//import com.ruoyi.model.domain.IndexPartnerConfig;
//import com.ruoyi.model.service.IIndexPartnerConfigService;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//
//@Api(description = "伴宠师-合伙人已绑定工作台")
//@RestController
//@RequestMapping("/applet/hhr")
//public class AppletIndexPartnerConfigController extends BaseController {
//
//
//
//
//
//}

+ 0
- 39
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/AppletLoginController.java View File

@ -1,39 +0,0 @@
package com.ruoyi.applet.contoller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Api(description = "伴宠师登录")
@RestController
@RequestMapping("/applet/login")
public class AppletLoginController {
// @Autowired
//1.微信授权登录接口
//2.获取微信手机号接口
//3.获取用户协议和隐私政策用一个config拉取
// @Aonymous
// @ApiOperation("登录接口")
// @PostMapping("/login")
// public ResponseEntity login(@RequestBody AppletLoginRequest appletLoginRequest){
// Map<String,Object> hashMap = new HashMap();
// hashMap.put("userInfo",appletLoginRequest);
// hashMap.put("token",123);
// return ResponseEntity.ok(hashMap);
// }
}

+ 0
- 59
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/AppletWalletController.java View File

@ -1,59 +0,0 @@
package com.ruoyi.applet.contoller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.model.service.IAppTransactionDetailsService;
import com.ruoyi.model.service.IAppWalletService;
import com.ruoyi.model.service.IAppWithdrawalConfigService;
import com.ruoyi.model.service.ITransactionDetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(description = "钱包")
@RestController
@RequestMapping("/applet/wallet")
public class AppletWalletController extends BaseController {
//钱包
@Autowired
private IAppWalletService appWalletService;
//钱包提现配置
@Autowired
private IAppWithdrawalConfigService appWithdrawalConfigService;
@Autowired
private IAppTransactionDetailsService appTransactionDetailsService;
@ApiOperation("钱包列表")
@GetMapping("/getWalletList/{userId}")
public TableDataInfo getAppWalletByUserId(@PathVariable Long userId){
return getDataTable(appWalletService.getAppWalletByUserId(userId));
}
@Autowired
private ITransactionDetailsService transactionDetailsService;
@ApiOperation("交易明细记录列表")
@GetMapping("/getTransactionDetailsList")
public TableDataInfo getTransactionDetailsList(){
return getDataTable(transactionDetailsService.getTransactionDetailsList());
}
@ApiOperation("钱包提现规则")
@GetMapping("/getAppWithdrawal")
public AjaxResult getAppWithdrawalConfig(){
return AjaxResult.success(appWithdrawalConfigService.getAppWithdrawalConfig());
}
@ApiOperation("交易明细记录")
@GetMapping("/getTransactionDetails/{wid}")
public TableDataInfo getAppTransactionDetailsByWid(@PathVariable Long wid){
return getDataTable(appTransactionDetailsService.getAppTransactionDetailsByWid(wid));
}
}

+ 27
- 0
ruoyi-catdog/src/main/java/com/ruoyi/applet/pojo/dto/ApiAppletLoginDTO.java View File

@ -0,0 +1,27 @@
package com.ruoyi.applet.pojo.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ApiAppletLoginDTO {
/**
* 参数信息
*/
@ApiModelProperty(value = "参数信息")
private String code;
/**
* 用户唯一标识
*/
@ApiModelProperty(value = "用户唯一标识")
private String openid;
/**
* 邀请者标识
*/
@ApiModelProperty(value = "邀请者销售标识")
private String shareId;
}

+ 14
- 0
ruoyi-catdog/src/main/java/com/ruoyi/applet/pojo/dto/ApiQueryIIdDTO.java View File

@ -0,0 +1,14 @@
package com.ruoyi.applet.pojo.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ApiQueryIIdDTO {
/**
* 用户标识
*/
@ApiModelProperty(value = "用户标识")
private Long appUserId;
}

+ 21
- 0
ruoyi-catdog/src/main/java/com/ruoyi/applet/pojo/dto/ApiQueryIIdMyUserDTO.java View File

@ -0,0 +1,21 @@
package com.ruoyi.applet.pojo.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ApiQueryIIdMyUserDTO {
/**
* 用户标识
*/
@ApiModelProperty(value = "用户标识")
private Long appUserId;
/**
* 状态0未下单1已下单
*/
@ApiModelProperty(value = "状态0未下单1已下单")
private Integer state;
}

+ 15
- 0
ruoyi-catdog/src/main/java/com/ruoyi/applet/utils/conf/AppletUtil.java View File

@ -0,0 +1,15 @@
package com.ruoyi.applet.utils.conf;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.framework.config.LocalDataUtil;
import com.ruoyi.model.domain.AppUsers;
import org.springframework.stereotype.Service;
@Service
public class AppletUtil {
public static AppUsers getLocalAppletUser() {
AppUsers user = (AppUsers) LocalDataUtil.getVar(Constants.LOGIN_APPLET_TOKEN_KEY);
return user;
}
}

+ 33
- 0
ruoyi-catdog/src/main/java/com/ruoyi/applet/utils/wechat/WechatHttpConf.java View File

@ -0,0 +1,33 @@
package com.ruoyi.applet.utils.wechat;
import com.alibaba.fastjson.JSONObject;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Component;
@Component
public class WechatHttpConf {
public JSONObject getJSONObject(String url){
String jsonObjectStr = null;
try {
CloseableHttpClient client = null;
CloseableHttpResponse response = null;
HttpGet httpGet = new HttpGet(url);
client = HttpClients.createDefault();
response = client.execute(httpGet);
HttpEntity entity = response.getEntity();
jsonObjectStr = EntityUtils.toString(entity);
} catch (Exception e) {
throw new RuntimeException("服务繁忙,稍后再试");
}
JSONObject jsonObject = JSONObject.parseObject(jsonObjectStr);
return jsonObject;
}
}

+ 163
- 140
ruoyi-catdog/src/main/java/com/ruoyi/model/domain/AppUsers.java View File

@ -1,7 +1,11 @@
package com.ruoyi.model.domain; package com.ruoyi.model.domain;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
@ -13,6 +17,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* @author ruoyi * @author ruoyi
* @date 2025-03-08 * @date 2025-03-08
*/ */
@Data
public class AppUsers extends BaseEntity public class AppUsers extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -68,144 +73,162 @@ public class AppUsers extends BaseEntity
@Excel(name = "过期时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "过期时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date expireTime; private Date expireTime;
public void setUserId(Long userId)
{
this.userId = userId;
}
public Long getUserId()
{
return userId;
}
public void setDelFlag(Integer delFlag)
{
this.delFlag = delFlag;
}
public Integer getDelFlag()
{
return delFlag;
}
public void setUpdatorBy(String updatorBy)
{
this.updatorBy = updatorBy;
}
public String getUpdatorBy()
{
return updatorBy;
}
public void setUserImage(String userImage)
{
this.userImage = userImage;
}
public String getUserImage()
{
return userImage;
}
public void setUserName(String userName)
{
this.userName = userName;
}
public String getUserName()
{
return userName;
}
public void setUserState(Long userState)
{
this.userState = userState;
}
public Long getUserState()
{
return userState;
}
public void setUserTelephone(String userTelephone)
{
this.userTelephone = userTelephone;
}
public String getUserTelephone()
{
return userTelephone;
}
public void setUnionid(String unionid)
{
this.unionid = unionid;
}
public String getUnionid()
{
return unionid;
}
public void setOpenid(String openid)
{
this.openid = openid;
}
public String getOpenid()
{
return openid;
}
public void setAccessToken(String accessToken)
{
this.accessToken = accessToken;
}
public String getAccessToken()
{
return accessToken;
}
public void setExpiresIn(Long expiresIn)
{
this.expiresIn = expiresIn;
}
public Long getExpiresIn()
{
return expiresIn;
}
public void setRefreshToken(String refreshToken)
{
this.refreshToken = refreshToken;
}
public String getRefreshToken()
{
return refreshToken;
}
public void setExpireTime(Date expireTime)
{
this.expireTime = expireTime;
}
public Date getExpireTime()
{
return expireTime;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("userId", getUserId())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("delFlag", getDelFlag())
.append("remark", getRemark())
.append("updateTime", getUpdateTime())
.append("updatorBy", getUpdatorBy())
.append("userImage", getUserImage())
.append("userName", getUserName())
.append("userState", getUserState())
.append("userTelephone", getUserTelephone())
.append("unionid", getUnionid())
.append("openid", getOpenid())
.append("accessToken", getAccessToken())
.append("expiresIn", getExpiresIn())
.append("refreshToken", getRefreshToken())
.append("expireTime", getExpireTime())
.toString();
}
/** 是否合伙人 */
@Excel(name = "是否合伙人")
private Integer userHh;
/** 是否伴宠师 */
@Excel(name = "是否伴宠师")
private Integer userBcs;
@TableField(exist = false)
private Date recentlyPayTime;
@TableField(exist = false)
private BigDecimal accumulate_money = new BigDecimal(100) ;
@TableField(exist = false)
private BigDecimal reward_money = new BigDecimal(99) ;
// public void setUserId(Long userId)
// {
// this.userId = userId;
// }
//
// public Long getUserId()
// {
// return userId;
// }
// public void setDelFlag(Integer delFlag)
// {
// this.delFlag = delFlag;
// }
//
// public Integer getDelFlag()
// {
// return delFlag;
// }
// public void setUpdatorBy(String updatorBy)
// {
// this.updatorBy = updatorBy;
// }
//
// public String getUpdatorBy()
// {
// return updatorBy;
// }
// public void setUserImage(String userImage)
// {
// this.userImage = userImage;
// }
//
// public String getUserImage()
// {
// return userImage;
// }
// public void setUserName(String userName)
// {
// this.userName = userName;
// }
//
// public String getUserName()
// {
// return userName;
// }
// public void setUserState(Long userState)
// {
// this.userState = userState;
// }
//
// public Long getUserState()
// {
// return userState;
// }
// public void setUserTelephone(String userTelephone)
// {
// this.userTelephone = userTelephone;
// }
//
// public String getUserTelephone()
// {
// return userTelephone;
// }
// public void setUnionid(String unionid)
// {
// this.unionid = unionid;
// }
//
// public String getUnionid()
// {
// return unionid;
// }
// public void setOpenid(String openid)
// {
// this.openid = openid;
// }
//
// public String getOpenid()
// {
// return openid;
// }
// public void setAccessToken(String accessToken)
// {
// this.accessToken = accessToken;
// }
//
// public String getAccessToken()
// {
// return accessToken;
// }
// public void setExpiresIn(Long expiresIn)
// {
// this.expiresIn = expiresIn;
// }
//
// public Long getExpiresIn()
// {
// return expiresIn;
// }
// public void setRefreshToken(String refreshToken)
// {
// this.refreshToken = refreshToken;
// }
//
// public String getRefreshToken()
// {
// return refreshToken;
// }
// public void setExpireTime(Date expireTime)
// {
// this.expireTime = expireTime;
// }
//
// public Date getExpireTime()
// {
// return expireTime;
// }
//
// @Override
// public String toString() {
// return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
// .append("userId", getUserId())
// .append("createBy", getCreateBy())
// .append("createTime", getCreateTime())
// .append("delFlag", getDelFlag())
// .append("remark", getRemark())
// .append("updateTime", getUpdateTime())
// .append("updatorBy", getUpdatorBy())
// .append("userImage", getUserImage())
// .append("userName", getUserName())
// .append("userState", getUserState())
// .append("userTelephone", getUserTelephone())
// .append("unionid", getUnionid())
// .append("openid", getOpenid())
// .append("accessToken", getAccessToken())
// .append("expiresIn", getExpiresIn())
// .append("refreshToken", getRefreshToken())
// .append("expireTime", getExpireTime())
// .toString();
// }
} }

+ 2
- 2
ruoyi-catdog/src/main/java/com/ruoyi/model/domain/TransactionDetails.java View File

@ -26,8 +26,8 @@ public class TransactionDetails extends BaseEntity
@Excel(name = "金额") @Excel(name = "金额")
private Long detailsPrice; private Long detailsPrice;
/** 交易类型: 1为收入明细,2为支出明细 */
@Excel(name = "交易类型: 1为收入明细,2为支出明细")
/** 交易类型: 0为收入明细,1为支出明细 */
@Excel(name = "交易类型: 0为收入明细,1为支出明细")
private Long transactionType; private Long transactionType;
public void setId(Long id) public void setId(Long id)


+ 16
- 0
ruoyi-catdog/src/main/java/com/ruoyi/model/mapper/AppUsersMapper.java View File

@ -58,4 +58,20 @@ public interface AppUsersMapper
* @return 结果 * @return 结果
*/ */
public int deleteAppUsersByUserIds(Long[] userIds); public int deleteAppUsersByUserIds(Long[] userIds);
/**
* 根据微信标识查询用户信息
* @param openid
* @return
*/
public AppUsers selectAppUsersByOpenId(String openid);
} }

+ 1
- 2
ruoyi-catdog/src/main/java/com/ruoyi/model/mapper/IndexconfigIconMapper.java View File

@ -61,8 +61,7 @@ public interface IndexconfigIconMapper
/** /**
* 根据identity查询图标信息 * 根据identity查询图标信息
* @param identity
* @return * @return
*/ */
IndexconfigIcon getIndexconfigIconByIdentity(Long identity);
public List<IndexconfigIcon> getIndexconfigIconByIdentity();
} }

+ 1
- 1
ruoyi-catdog/src/main/java/com/ruoyi/model/mapper/IndexconfigMapper.java View File

@ -64,5 +64,5 @@ public interface IndexconfigMapper
* *
* @return 主页工作台配置集合 * @return 主页工作台配置集合
*/ */
public List<Indexconfig> getIndexconfigList(Long indexType);
public List<Indexconfig> getIndexconfigList();
} }

+ 1
- 1
ruoyi-catdog/src/main/java/com/ruoyi/model/mapper/TransactionDetailsMapper.java View File

@ -64,5 +64,5 @@ public interface TransactionDetailsMapper
* *
* @return 交易明细记录集合 * @return 交易明细记录集合
*/ */
public List<TransactionDetails> getTransactionDetailsList();
public List<TransactionDetails> getTransactionDetailsList(Long transactionType);
} }

+ 25
- 0
ruoyi-catdog/src/main/java/com/ruoyi/model/service/IAApiAppletHhrWorkOutService.java View File

@ -0,0 +1,25 @@
package com.ruoyi.model.service;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.data.domain.Pageable;
public interface IAApiAppletHhrWorkOutService {
//合伙人工作台 - 绑定用户基础信息
AjaxResult HhrInfo(Long appUserId);
//合伙人工作台 - 绑定二维码
AjaxResult HhrCode(Long appUserId);
//合伙人工作台 - 我的用户列表 0 未下单 1已下单
AjaxResult HhrMyUserList(Long appUserId,Integer state, Pageable page);
//合伙人工作台 - 根据用户标识查询用户下单详细信息
AjaxResult HhrMyUserGetById(Long appUserId);
}

+ 23
- 0
ruoyi-catdog/src/main/java/com/ruoyi/model/service/IAApiAppletLoginService.java View File

@ -0,0 +1,23 @@
package com.ruoyi.model.service;
import com.ruoyi.applet.pojo.dto.ApiAppletLoginDTO;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
public interface IAApiAppletLoginService {
//伴宠师-微信授权登录
AjaxResult wechatLogin(ApiAppletLoginDTO params);
//伴宠师-获取手机号码
AjaxResult bindPhone(ApiAppletLoginDTO params);
//伴宠师-登录页基础信息
AjaxResult loginConf();
//伴宠师-获取用户基本能信息
AjaxResult getAppletUserInfo(Long appUserId);
}

+ 4
- 0
ruoyi-catdog/src/main/java/com/ruoyi/model/service/IApiAppletInfoService.java View File

@ -0,0 +1,4 @@
package com.ruoyi.model.service;
public interface IApiAppletInfoService {
}

+ 13
- 0
ruoyi-catdog/src/main/java/com/ruoyi/model/service/IAppUsersService.java View File

@ -58,4 +58,17 @@ public interface IAppUsersService
* @return 结果 * @return 结果
*/ */
public int deleteAppUsersByUserId(Long userId); public int deleteAppUsersByUserId(Long userId);
/**
* 根据微信标识查询用户信息
* @param openid
* @return
*/
public AppUsers selectAppUsersByOpenId(String openid);
// public int updateAppUsersByOpenId(AppUsers appUsers);
} }

+ 1
- 2
ruoyi-catdog/src/main/java/com/ruoyi/model/service/IIndexconfigIconService.java View File

@ -62,8 +62,7 @@ public interface IIndexconfigIconService
/** /**
* 查询工作台图标 * 查询工作台图标
* *
* @param identity 工作台图标身份
* @return 工作台图标 * @return 工作台图标
*/ */
public IndexconfigIcon getIndexconfigIconByIdentity(Long identity);
public List<IndexconfigIcon> getIndexconfigIconByIdentity();
} }

+ 1
- 1
ruoyi-catdog/src/main/java/com/ruoyi/model/service/IIndexconfigService.java View File

@ -64,5 +64,5 @@ public interface IIndexconfigService
* *
* @return 主页工作台配置集合 * @return 主页工作台配置集合
*/ */
public List<Indexconfig> getIndexconfigList(Long indexType);
public List<Indexconfig> getIndexconfigList();
} }

+ 1
- 1
ruoyi-catdog/src/main/java/com/ruoyi/model/service/ITransactionDetailsService.java View File

@ -64,5 +64,5 @@ public interface ITransactionDetailsService
* *
* @return 交易明细记录集合 * @return 交易明细记录集合
*/ */
public List<TransactionDetails> getTransactionDetailsList();
public List<TransactionDetails> getTransactionDetailsList(Long transactionType);
} }

+ 135
- 0
ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/AApiAppletHhrWorkOutServiceImpl.java View File

@ -0,0 +1,135 @@
package com.ruoyi.model.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.applet.utils.conf.AppletUtil;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.model.domain.AppUsers;
import com.ruoyi.model.service.IAApiAppletHhrWorkOutService;
import com.ruoyi.model.service.IAppUsersService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j
@Service
public class AApiAppletHhrWorkOutServiceImpl implements IAApiAppletHhrWorkOutService {
@Resource
private IAppUsersService appUsersService;
@Resource
private TokenService tokenService;
//合伙人工作台 - 绑定用户基础信息
@Override
public AjaxResult HhrInfo(Long appUserId){
// AppUsers localAppletUser = AppletUtil.getLocalAppletUser();
AppUsers localAppletUser = new AppUsers();
localAppletUser.setUserId(appUserId);
AppUsers appUsers = appUsersService.selectAppUsersByUserId(localAppletUser.getUserId());
Map<String,Object> map = new HashMap<>();
map.put("info",appUsers); //用户信息
map.put("partner_level","初级合伙人"); //合伙人等级
map.put("partner_day","138天"); //合伙人加入天数
map.put("partner_new_num","25"); //合伙人当前合伙人比例
map.put("partner_upgrade_num","30"); //合伙人晋级之后的合伙人比例
map.put("user_code","jsk66623"); //邀请码
map.put("user_code_bj","https://image.hhlm1688.com/img/work/log/indexInfo/11.png"); //邀请码背景图
map.put("user_code_fx","https://image.hhlm1688.com/img/work/log/indexInfo/11.png"); //分享海报背景图
map.put("user_code_url","https://image.hhlm1688.com/img/work/log/indexInfo/11.png"); //分销链接背景图
map.put("register_users","100"); //当月注册用户
map.put("order_users","200"); //当月下单用户
map.put("use_users","200"); //当月有效用户
map.put("order_users_money","288.98"); //本月订单金额
map.put("use_users_money","288.98"); //本月有效订单金额
map.put("register_users_sum","999"); //累积注册用户
map.put("order_users_sum","998"); //累积下单用户
map.put("use_users_sum","999"); //累积有效用户
map.put("order_users_sum_money","288.98"); //累积订单金额
map.put("use_users_sum_money","288.98"); //累积有效订单金额
map.put("money","998.98"); //钱包金额
map.put("new_money","288.98"); //本月分成
map.put("old_money","288.98"); //累积分成
map.put("upgrade_register_num","5"); //距离下一个等级需要注册多少人
map.put("upgrade_order_num","20"); //距离下一个等级需要下单人数
map.put("upgrade_image","https://image.hhlm1688.com/img/work/log/indexInfo/11.png"); //背景图
map.put("upgrade_details","合伙人权益说明:富文本"); //合伙人权益说明富文本
map.put("user_details","*累计报酬:当该用户订单完成时,才会纳入报酬计算:这是一个富文本"); //我的用户说明
map.put("level_details","累积数据:即注册至今的累计数据:这是一个富文本"); //我的等级说明
map.put("withdrawal_details","提现说明:这是一个富文本提现说明:这是一个富文本提现说明:这是一个富文本提现说明:这是一个富文本"); //提现说明
return AjaxResult.success(map);
}
//合伙人工作台 - 绑定二维码
@Override
public AjaxResult HhrCode(Long appUserId){
AppUsers localAppletUser = new AppUsers();
localAppletUser.setUserId(appUserId);
AppUsers appUsers = appUsersService.selectAppUsersByUserId(localAppletUser.getUserId());
Map<String,Object> map = new HashMap<>();
map.put("code","666666");//邀请码
map.put("url","https://image.hhlm1688.com/img/work/log/headImage.png");//二维码地址
map.put("bj_url","https://image.hhlm1688.com/img/work/log/headImage.png");//海报背景图
map.put("title","欢迎来到宠物小程序二维码部分");//说明
return AjaxResult.success(map);
}
//合伙人工作台 - 我的用户列表 0 未下单 1已下单
@Override
public AjaxResult HhrMyUserList(Long appUserId,Integer state, Pageable page){
AppUsers localAppletUser = new AppUsers();
localAppletUser.setUserId(appUserId);
List<AppUsers> pageRes = appUsersService.selectAppUsersList(new AppUsers());
// PageImpl<AppUsers> appUsers = new PageImpl<>(pageRes, page, ((Page) pageRes).getTotal());
return AjaxResult.success("查询分页成功",pageRes);
}
//合伙人工作台 - 根据用户标识查询用户下单详细信息
@Override
public AjaxResult HhrMyUserGetById(Long appUserId){
Map<String,Object> map = new HashMap<>();
map.put("createTime",new Date());//注册时间
map.put("recently_pay_time",new Date());//最近下单时间
map.put("accumulate_money","9999.99");//海报背景图
map.put("reward_money","100");//累积报酬
return AjaxResult.success("用户下单详细信息成功",map);
}
}

+ 203
- 0
ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/AApiAppletLoginServiceImpl.java View File

@ -0,0 +1,203 @@
package com.ruoyi.model.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.applet.pojo.dto.ApiAppletLoginDTO;
import com.ruoyi.applet.utils.wechat.WechatHttpConf;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginApplet;
import com.ruoyi.common.core.domain.model.LoginMember;
import com.ruoyi.model.domain.AppUsers;
import com.ruoyi.model.service.IAApiAppletLoginService;
import com.ruoyi.model.service.IAppUsersService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import com.ruoyi.framework.web.service.TokenService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.time.LocalDateTime;
import java.util.*;
import static org.bouncycastle.asn1.x500.style.RFC4519Style.member;
@Slf4j
@Service
public class AApiAppletLoginServiceImpl implements IAApiAppletLoginService {
@Value("${wechat-admin.appId}")
private String appId;
@Value("${wechat-admin.secret}")
private String secret;
private static final String TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s";
private static final String API_URL = "https://api.weixin.qq.com/wxa/business/getuserphonenumber";
@Resource
private WechatHttpConf wechatHttpConf;
@Resource
private IAppUsersService appUsersService;
@Resource
private TokenService tokenService;
//伴宠师-微信授权登录
@Transactional(rollbackFor = {Exception.class})
@Override
public AjaxResult wechatLogin(ApiAppletLoginDTO params){
if(StringUtils.isEmpty(params.getCode())){
throw new RuntimeException("参数错误");
}
String loginUrl = "https://api.weixin.qq.com/sns/jscode2session?appid="
+ appId + "&secret="
+ secret+ "&js_code="
+ params.getCode()
+ "&grant_type=authorization_code";
JSONObject wx_json = wechatHttpConf.getJSONObject(loginUrl);
String wxOpenid = wx_json.getString("openid");
if (StringUtils.isBlank(wxOpenid)) {
throw new RuntimeException("服务繁忙,稍后再试");
}
AppUsers appUsers = appUsersService.selectAppUsersByOpenId(wxOpenid);
if (appUsers == null) {
//用户信息为空的情况下说明是新的用户
appUsers = new AppUsers();
long appletId = System.currentTimeMillis();
appUsers.setUserId(appletId);
appUsers.setOpenid(wxOpenid);
appUsers.setUserName("伴宠师"+System.currentTimeMillis());//lzx需要修改到conf中的配置获取
appUsers.setUserImage("https://image.hhlm1688.com/img/work/log/headImage.png"); //lzx需要修改到conf中的配置获取
appUsers.setCreateTime(LocalDateTime.now());
appUsersService.insertAppUsers(appUsers);
LoginApplet loginApplet = new LoginApplet();
loginApplet.setAppletId(appletId);
String appletToken = tokenService.createAppletToken(loginApplet);
Map<String,Object> map = new HashMap();
map.put("token",appletToken);
map.put("userInfo",appUsers);
return AjaxResult.success("登录成功",map);
}else{
LoginApplet loginApplet = new LoginApplet();
loginApplet.setAppletId(appUsers.getUserId());
String appletToken = tokenService.createAppletToken(loginApplet);
Map<String,Object> map = new HashMap();
map.put("token",appletToken);
map.put("userInfo",appUsers);
return AjaxResult.success("登录成功",map);
}
}
//伴宠师-获取手机号码
@Override
public AjaxResult bindPhone(ApiAppletLoginDTO params){
try {
String phoneNumber = this.getPhoneNumber(params.getCode());
AppUsers appUsers = appUsersService.selectAppUsersByOpenId(params.getOpenid());
//如果对象存在
if (appUsers!=null){
appUsers.setUserTelephone(phoneNumber);
appUsersService.updateAppUsers(appUsers);
}
return AjaxResult.success(phoneNumber);
}catch (Exception e){
return AjaxResult.error(e.getMessage());
}
}
//伴宠师-登录页基础信息
@Override
public AjaxResult loginConf(){
Map map = new HashMap();
map.put("appletName","伴宠师");
map.put("appletLogoImg","https://image.hhlm1688.com/img/Group%20213084%402x.png");
map.put("user_xy","用户协议富文本");
map.put("user_zc","隐私政策富文本");
return AjaxResult.success("查询成功",map);
}
//伴宠师-获取用户基本能信息
@Override
public AjaxResult getAppletUserInfo(Long appUserId){
AppUsers appUsers = appUsersService.selectAppUsersByUserId(appUserId);
return AjaxResult.success("用户信息",appUsers);
}
public String getAccessToken() throws Exception {
String requestUrl = String.format(TOKEN_URL, appId, secret);
URL url = new URL(requestUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
try (BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), "UTF-8"))) {
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
org.json.JSONObject jsonResponse = new org.json.JSONObject(response.toString());
return jsonResponse.getString("access_token");
}
}
public String getPhoneNumber(String code) throws Exception {
URL url = new URL(API_URL + "?access_token=" + this.getAccessToken());
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/json; utf-8");
conn.setRequestProperty("Accept", "application/json");
conn.setDoOutput(true);
JSONObject jsonInput = new JSONObject();
jsonInput.put("code", code);
try (DataOutputStream os = new DataOutputStream(conn.getOutputStream())) {
byte[] input = jsonInput.toString().getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
try (BufferedReader br = new BufferedReader(
new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) {
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
//获取手机号码
return response.toString();
}
}
}

+ 8
- 0
ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/ApiAppletInfoServiceImpl.java View File

@ -0,0 +1,8 @@
package com.ruoyi.model.service.impl;
import com.ruoyi.model.service.IApiAppletInfoService;
import org.springframework.stereotype.Service;
@Service
public class ApiAppletInfoServiceImpl implements IApiAppletInfoService {
}

+ 12
- 0
ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/AppUsersServiceImpl.java View File

@ -93,4 +93,16 @@ public class AppUsersServiceImpl implements IAppUsersService
{ {
return appUsersMapper.deleteAppUsersByUserId(userId); return appUsersMapper.deleteAppUsersByUserId(userId);
} }
/**
* 根据微信标识查询用户信息
* @param openid
* @return
*/
@Override
public AppUsers selectAppUsersByOpenId(String openid){
return appUsersMapper.selectAppUsersByOpenId(openid);
}
} }

+ 2
- 2
ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/IndexconfigIconServiceImpl.java View File

@ -92,7 +92,7 @@ public class IndexconfigIconServiceImpl implements IIndexconfigIconService
} }
@Override @Override
public IndexconfigIcon getIndexconfigIconByIdentity(Long identity) {
return indexconfigIconMapper.getIndexconfigIconByIdentity(identity);
public List<IndexconfigIcon> getIndexconfigIconByIdentity() {
return indexconfigIconMapper.getIndexconfigIconByIdentity();
} }
} }

+ 2
- 2
ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/IndexconfigServiceImpl.java View File

@ -95,8 +95,8 @@ public class IndexconfigServiceImpl implements IIndexconfigService
} }
@Override @Override
public List<Indexconfig> getIndexconfigList(Long indexType){
return indexconfigMapper.getIndexconfigList(indexType);
public List<Indexconfig> getIndexconfigList(){
return indexconfigMapper.getIndexconfigList();
} }


+ 2
- 2
ruoyi-catdog/src/main/java/com/ruoyi/model/service/impl/TransactionDetailsServiceImpl.java View File

@ -99,7 +99,7 @@ public class TransactionDetailsServiceImpl implements ITransactionDetailsService
* @return 交易明细记录集合 * @return 交易明细记录集合
*/ */
@Override @Override
public List<TransactionDetails> getTransactionDetailsList() {
return transactionDetailsMapper.getTransactionDetailsList();
public List<TransactionDetails> getTransactionDetailsList(Long transactionType) {
return transactionDetailsMapper.getTransactionDetailsList(transactionType);
} }
} }

+ 11
- 0
ruoyi-catdog/src/main/resources/mapper/model/AppUsersMapper.xml View File

@ -50,6 +50,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where user_id = #{userId} where user_id = #{userId}
</select> </select>
<select id="selectAppUsersByOpenId" parameterType="String" resultMap="AppUsersResult">
<include refid="selectAppUsersVo"/>
where openid = #{openid}
</select>
<insert id="insertAppUsers" parameterType="AppUsers"> <insert id="insertAppUsers" parameterType="AppUsers">
insert into app_users insert into app_users
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">


+ 2
- 5
ruoyi-catdog/src/main/resources/mapper/model/IndexconfigIconMapper.xml View File

@ -28,11 +28,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectIndexconfigIconVo"/> <include refid="selectIndexconfigIconVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="getIndexconfigIconByIdentity" resultType="com.ruoyi.model.domain.IndexconfigIcon">
<include refid="selectIndexconfigIconVo"/>
<where>
<if test="identity != null ">identity = #{identity}</if>
</where>
<select id="getIndexconfigIconByIdentity" parameterType="IndexconfigIcon" resultMap="IndexconfigIconResult">
select id, icon, icon_name, identity from indexconfig_icon
</select> </select>
<insert id="insertIndexconfigIcon" parameterType="IndexconfigIcon"> <insert id="insertIndexconfigIcon" parameterType="IndexconfigIcon">


+ 2
- 2
ruoyi-catdog/src/main/resources/mapper/model/IndexconfigMapper.xml View File

@ -36,8 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectIndexconfigVo"/> <include refid="selectIndexconfigVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="getIndexconfigList" resultType="com.ruoyi.model.domain.Indexconfig">
<include refid="selectIndexconfigVo"/> where indexType = #{indexType} and del_flag=0
<select id="getIndexconfigList" parameterType="Indexconfig" resultMap="IndexconfigResult">
<include refid="selectIndexconfigVo"/>
</select> </select>
<insert id="insertIndexconfig" parameterType="Indexconfig"> <insert id="insertIndexconfig" parameterType="Indexconfig">


+ 1
- 0
ruoyi-catdog/src/main/resources/mapper/model/TransactionDetailsMapper.xml View File

@ -31,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="getTransactionDetailsList" resultType="com.ruoyi.model.domain.TransactionDetails"> <select id="getTransactionDetailsList" resultType="com.ruoyi.model.domain.TransactionDetails">
<include refid="selectTransactionDetailsVo"/> <include refid="selectTransactionDetailsVo"/>
where transaction_type = #{transactionType}
</select> </select>
<insert id="insertTransactionDetails" parameterType="TransactionDetails"> <insert id="insertTransactionDetails" parameterType="TransactionDetails">


+ 2
- 0
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java View File

@ -69,6 +69,7 @@ public class Constants
*/ */
public static final String LOGIN_TOKEN_KEY = "login_tokens:"; public static final String LOGIN_TOKEN_KEY = "login_tokens:";
public static final String LOGIN_MEMBER_TOKEN_KEY = "login_member_tokens:"; public static final String LOGIN_MEMBER_TOKEN_KEY = "login_member_tokens:";
public static final String LOGIN_APPLET_TOKEN_KEY = "login_applet_tokens:"; //伴宠师-小程序登录
public static final String MEMBER_INFO = "member_info"; public static final String MEMBER_INFO = "member_info";
public static final String STAFF_INFO = "staff_info"; public static final String STAFF_INFO = "staff_info";
@ -102,6 +103,7 @@ public class Constants
*/ */
public static final String LOGIN_USER_KEY = "login_user_key"; public static final String LOGIN_USER_KEY = "login_user_key";
public static final String LOGIN_MEMBER_KEY = "login_member_key"; public static final String LOGIN_MEMBER_KEY = "login_member_key";
public static final String LOGIN_APPLET_KEY = "login_applet_key";
/** /**
* 用户ID * 用户ID


+ 20
- 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/model/LoginApplet.java View File

@ -0,0 +1,20 @@
package com.ruoyi.common.core.domain.model;
import lombok.Data;
/**
* 伴宠师-小程序登录
*/
@Data
public class LoginApplet {
private Long appletId;
private String token;
private Long loginTime;
private Long expireTime;
/**
* 登录类型1伴宠师端
*/
private Integer sourceType;
}

+ 4
- 4
ruoyi-framework/pom.xml View File

@ -69,9 +69,9 @@
<artifactId>ruoyi-system</artifactId> <artifactId>ruoyi-system</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-catdog</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.ruoyi</groupId>-->
<!-- <artifactId>ruoyi-catdog</artifactId>-->
<!-- </dependency>-->
</dependencies> </dependencies>
</project> </project>

+ 51
- 0
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/TokenService.java View File

@ -5,6 +5,7 @@ import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import com.ruoyi.common.core.domain.model.LoginApplet;
import com.ruoyi.common.core.domain.model.LoginMember; import com.ruoyi.common.core.domain.model.LoginMember;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -98,6 +99,24 @@ public class TokenService
return null; return null;
} }
public LoginMember getLoginAppletUser(HttpServletRequest request) {
// 获取请求携带的令牌
String token = getToken(request);
if (StringUtils.isNotEmpty(token)) {
try {
Claims claims = parseToken(token);
// 解析对应的权限以及用户信息
String uuid = (String) claims.get(Constants.LOGIN_APPLET_KEY);
String userKey = Constants.LOGIN_APPLET_KEY + uuid;
return redisCache.getCacheObject(userKey);
} catch (Exception e) {
}
}
return null;
}
/** /**
* 设置用户身份信息 * 设置用户身份信息
*/ */
@ -148,6 +167,21 @@ public class TokenService
return createToken(claims); return createToken(claims);
} }
/**
* 伴宠师-小程序登录
* @param loginApplet
* @return
*/
public String createAppletToken(LoginApplet loginApplet){
String token = IdUtils.fastUUID();
loginApplet.setToken(token);
refreshAppletToken(loginApplet);
Map<String, Object> claims = new HashMap<>();
claims.put(Constants.LOGIN_APPLET_KEY, token);
return createToken(claims);
}
/** /**
* 验证令牌有效期相差不足20分钟自动刷新缓存 * 验证令牌有效期相差不足20分钟自动刷新缓存
* *
@ -194,6 +228,23 @@ public class TokenService
redisCache.setCacheObject(userKey, loginUser, memberExpireTime, TimeUnit.DAYS); redisCache.setCacheObject(userKey, loginUser, memberExpireTime, TimeUnit.DAYS);
} }
/**
* 伴宠师-小程序登录
* @param loginApplet
*/
public void refreshAppletToken(LoginApplet loginApplet) {
loginApplet.setLoginTime(System.currentTimeMillis());
loginApplet.setExpireTime(loginApplet.getLoginTime() + memberExpireTime * 24 * 60 * MILLIS_MINUTE);
// 根据uuid将loginUser缓存
String userKey = Constants.LOGIN_APPLET_TOKEN_KEY + loginApplet.getToken();
redisCache.setCacheObject(userKey, loginApplet, memberExpireTime, TimeUnit.DAYS);
}
/** /**
* 设置用户代理信息 * 设置用户代理信息
* *


Loading…
Cancel
Save