Browse Source

修复代码提交

master
主管理员 2 weeks ago
parent
commit
70a55f543d
11 changed files with 337 additions and 47 deletions
  1. +2
    -2
      CatmDogd-Mall-Front-test/.env.development
  2. +1
    -0
      CatmDogd-Mall-Front-test/src/views/model/AppletAnswer/index.vue
  3. +44
    -7
      CatmDogd-Mall-Front-test/src/views/model/AppletQuestion/index.vue
  4. +7
    -7
      ruoyi-admin/src/main/resources/application-druid.yml
  5. +1
    -1
      ruoyi-admin/src/main/resources/application.yml
  6. +68
    -18
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiAppletExaminationController.java
  7. +1
    -1
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiMallOrderController.java
  8. +196
    -7
      ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiMallUserTeacherController.java
  9. +4
    -1
      ruoyi-catdog/src/main/java/com/ruoyi/applet/mallpojo/TeacherListRequest.java
  10. +12
    -2
      ruoyi-catdog/src/main/java/com/ruoyi/model/domain/AppUsers.java
  11. +1
    -1
      ruoyi-mall/src/main/java/com/cyl/h5/service/H5OrderService.java

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

@ -5,8 +5,8 @@ VUE_APP_TITLE = 下单伴宠师综合管理平台
ENV = 'development'
# 若依管理系统/开发环境 https://pet-admin.hhlm1688.com/api
VUE_APP_BASE_API = 'https://api.catmdogd.com'
# VUE_APP_BASE_API = 'http://localhost:8001'
# VUE_APP_BASE_API = 'https://api.catmdogd.com'
VUE_APP_BASE_API = 'http://localhost:8002'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true


+ 1
- 0
CatmDogd-Mall-Front-test/src/views/model/AppletAnswer/index.vue View File

@ -28,6 +28,7 @@
@keyup.enter.native="handleQuery"
/>
</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>


+ 44
- 7
CatmDogd-Mall-Front-test/src/views/model/AppletQuestion/index.vue View File

@ -72,19 +72,30 @@
<!-- @click="handleExport"-->
<!-- v-hasPermi="['model:AppletQuestion:export']"-->
<!-- >导出</el-button>-->
</el-col>
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="AppletQuestionList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="唯一标识" align="center" prop="id" />
<!-- <el-table-column label="唯一标识" align="center" prop="id" />-->
<el-table-column label="创建时间" align="center" prop="createTime" />
<el-table-column label="题目标题" align="center" prop="title" />
<el-table-column label="题目类型" align="center" prop="type"/>
<el-table-column label="题目类型" align="center" prop="type" v-if="columns[1].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.tm_type" :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column label="排序编号" align="center" prop="orderNo"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
@click="goOrder(scope.row.id)"
>设置答案</el-button>
<el-button
size="mini"
type="text"
@ -113,15 +124,26 @@
<!-- 添加或修改考核题库对话框 -->
<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" >
<el-form-item label="题目标题" prop="title">
<el-input v-model="form.title" placeholder="请输入题目标题" />
<el-input
type="textarea"
v-model="form.title"
placeholder="请输入题目标题"
:rows="4"
/>
</el-form-item>
<el-form-item label="排序编号" prop="orderNo">
<el-input v-model="form.orderNo" placeholder="请输入排序编号" />
</el-form-item>
<el-form-item label="考核类型" prop="type">
<el-input v-model="form.type" placeholder="请输入考核类型" />
<el-form-item label="题目类型" prop="type">
<el-select v-model="form.type" placeholder="请选择题目类型">
<el-option
v-for="dict in dict.type.tm_type"
:key="dict.value"
:label="dict.label"
:value="dict.value" ></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="删除标识" prop="delFlag">-->
<!-- <el-input v-model="form.delFlag" placeholder="请输入删除标识" />-->
@ -137,9 +159,11 @@
<script>
import { listAppletQuestion, getAppletQuestion, delAppletQuestion, addAppletQuestion, updateAppletQuestion, exportAppletQuestion } from "@/api/model/AppletQuestion";
import {decryptedPhone} from "@/api/ums/member";
export default {
name: "AppletQuestion",
dicts: ['tm_type'],
data() {
return {
//
@ -205,6 +229,7 @@ export default {
this.getList();
},
methods: {
/** 查询考核题库列表 */
getList() {
this.loading = true;
@ -275,6 +300,18 @@ export default {
this.title = "修改考核题库";
});
},
goOrder(questionId){
decryptedPhone(questionId).then(res => {
this.$router.push({
path: '/examine/AppletAnswer',
query: {
questionId: res
}
})
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {


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

@ -31,7 +31,7 @@ spring:
# 密码
password: Qweruiop@123
redisson:
address: "redis://47.97.158.59"
address: "47.97.158.59"
password: "Qweruiop@123" # 如果有密码的话
connectionPoolSize: 10
idleConnectionTimeout: 10000
@ -55,19 +55,19 @@ wechat:
appId: wxd1a6ba7b5e17a5b6
secret: 你的微信服务号密钥
merchantId: 1665639691
privateKeyPath: /data/software/app/key/apiclient_key.pem
# privateKeyPath: /data/software/app/key/apiclient_key.pem
# privateKeyPath: /root/pem/apiclient_key.pem
# privateKeyPath: F:\\java_work\\team_work_java\\pet-admin-25-01-25\\pet-admin\\ruoyi-admin\\src\\main\\resources\\apiclient_key.pem
privateKeyPath: F:\\java_work\\team_work_java\\pet-admin-25-01-25\\pet-admin\\ruoyi-admin\\src\\main\\resources\\apiclient_key.pem
#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
# notifyUrl: https://api.catmdogd.com/prod-api/no-auth/wechat/notify
# notifyUrlForBCHSH: https://api.catmdogd.com/prod-api/no-auth/wechat/notifyForBCHSH
# notifyUrl: https://pet-admin.hhlm1688.com/api/no-auth/wechat/notify
# notifyUrlForBCHSH: https://pet-admin.hhlm1688.com/api/no-auth/wechat/notifyForBCHSH
# notifyUrl: http://h5.xzaiyp.top/no-auth/wechat/notify
# notifyUrlForBCHSH: http://h5.xzaiyp.top/no-auth/wechat/notifyForBCHSH
notifyUrl: http://h5.xzaiyp.top/no-auth/wechat/notify
notifyUrlForBCHSH: http://h5.xzaiyp.top/no-auth/wechat/notifyForBCHSH
miniProgramAppId: wxd1a6ba7b5e17a5b6
miniProgramSecret: 06e946a2c9010f8eb9e306018a779a7f
staffAppId: wx01f0f43759922fda


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

@ -20,7 +20,7 @@ ruoyi:
# 开发环境配置.0
server:
# 服务器的HTTP端口,默认为8080
port: 8080
port: 8002
servlet:
# 应用的访问路径
context-path: /


+ 68
- 18
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiAppletExaminationController.java View File

@ -75,12 +75,34 @@ public class ApiAppletExaminationController {
return AjaxResult.success("专业执照列表数据",licenseList);
}
// @ApiOperation("伴宠师工作台-查询用户基本考核答案列表")
// @PostMapping("/answerBaseList")
// public AjaxResult answerBaseList(@RequestBody AppletAnswerBase answerBase){
// List<AppletAnswerBase> answerBaseList = appletAnswerBaseService.selectAppletAnswerBaseList(answerBase);
// return AjaxResult.success("用户基本考核答案列表数据",answerBaseList);
// }
@ApiOperation("伴宠师工作台-查询用户基本考核答案列表")
@PostMapping("/answerBaseList")
public AjaxResult answerBaseList(@RequestBody AppletAnswerBase answerBase){
List<AppletAnswerBase> answerBaseList = appletAnswerBaseService.selectAppletAnswerBaseList(answerBase);
return AjaxResult.success("用户基本考核答案列表数据",answerBaseList);
}
//查询基本考核是否完成
@ApiOperation("伴宠师工作台-查询用户基本考核是否完成")
@GetMapping("/answeBaseIsFinish")
public AjaxResult answeBaseIsFinish(Long userId){
AppletAnswerBase answerBase = new AppletAnswerBase();
answerBase.setUserId(userId);
List<AppletAnswerBase> answerBaseList = appletAnswerBaseService.selectAppletAnswerBaseList(answerBase);
if(answerBaseList.size() > 0){
return AjaxResult.success("用户基本考核已完成");
}
return AjaxResult.error("用户基本考核未完成");
}
@ApiOperation("伴宠师工作台-根据题目id查询基本考核答案")
@GetMapping("/answeBaseByQuestionId")
@ -107,18 +129,46 @@ public class ApiAppletExaminationController {
return toAjax(appletAnswerBaseService.insertAppletAnswerBase(answerBase));
}
// @ApiOperation("伴宠师工作台-查询用户培训考核答案列表")
// @PostMapping("/answeTrainList")
// public AjaxResult answeTrainList(@RequestBody AppletAnswerTrain answerTrain){
// List<AppletAnswerTrain> answerTrainList = appletAnswerTrainService.selectAppletAnswerTrainList(answerTrain);
//
// for (AppletAnswerTrain appletAnswerTrain : answerTrainList) {
// AppletQuestion question = appletQuestionService.selectAppletQuestionById(appletAnswerTrain.getQuestionId());
// appletAnswerTrain.setQuestion(question);
// }
//
// return AjaxResult.success("用户培训考核答案列表数据",answerTrainList);
// }
@ApiOperation("伴宠师工作台-查询用户培训考核答案列表")
@PostMapping("/answeTrainList")
public AjaxResult answeTrainList(@RequestBody AppletAnswerTrain answerTrain){
List<AppletAnswerTrain> answerTrainList = appletAnswerTrainService.selectAppletAnswerTrainList(answerTrain);
for (AppletAnswerTrain appletAnswerTrain : answerTrainList) {
AppletQuestion question = appletQuestionService.selectAppletQuestionById(appletAnswerTrain.getQuestionId());
appletAnswerTrain.setQuestion(question);
}
return AjaxResult.success("用户培训考核答案列表数据",answerTrainList);
}
//查询培训考核是否完成
@ApiOperation("伴宠师工作台-查询用户培训考核是否完成")
@GetMapping("/answeTrainIsFinish")
public AjaxResult answeTrainIsFinish(Long userId){
AppletAnswerTrain answerTrain = new AppletAnswerTrain();
answerTrain.setUserId(userId);
List<AppletAnswerTrain> answerTrainList = appletAnswerTrainService.selectAppletAnswerTrainList(answerTrain);
if(answerTrainList.size() > 0){
return AjaxResult.success("用户培训考核已完成");
}
return AjaxResult.error("用户培训考核未完成");
}
@ApiOperation("伴宠师工作台-根据题目id查询培训考核答案")
@GetMapping("/answeTrainByQuestionId")


+ 1
- 1
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiMallOrderController.java View File

@ -136,7 +136,7 @@ public class ApiMallOrderController extends BaseController {
//查询-再来一单的历史伴宠师
@ApiOperation("mall-查询-再来一单的历史伴宠师接口")
@GetMapping("/getTeacherList")
@GetMapping("")
public TableDataInfo getTeacherList(TeacherListRequest request) {
startPage();
AppUsers appUsers = new AppUsers();


+ 196
- 7
ruoyi-catdog/src/main/java/com/ruoyi/applet/contoller/ApiMallUserTeacherController.java View File

@ -5,10 +5,7 @@ import com.cyl.manager.staff.domain.vo.StaffVO;
import com.ruoyi.applet.mallpojo.TeacherListRequest;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.model.domain.AppUsers;
import com.ruoyi.model.domain.AppletAddress;
import com.ruoyi.model.domain.AppletConfig;
import com.ruoyi.model.domain.AppletUsersTeacher;
import com.ruoyi.model.domain.*;
import com.ruoyi.model.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -19,6 +16,9 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Slf4j
@ -35,6 +35,8 @@ public class ApiMallUserTeacherController extends BaseController {
private IAppletConfigService appletConfigService;
@Autowired
private IAppletAddressService appletAddressService;
@Autowired
private IAppletOutDateService appletOutDateService;
//mall-首页周边伴宠师
@ApiOperation("mall-首页周边伴宠师接口")
@ -71,20 +73,207 @@ public class ApiMallUserTeacherController extends BaseController {
if (request.getTeacherLevels() != null) {
appUsers.setUserBcsRole(request.getTeacherLevels());
}
//如果传入staffName
if (request.getStaffName() != null) {
appUsers.setUserName(request.getStaffName());
}
String petType =request.getPetTypes();
List<AppUsers> appUsersList = appUsersService.selectAppUsersList(appUsers);
List<AppUsers> appUsersListNew = new ArrayList<>();
for (AppUsers appUsers1 : appUsersList){
AppletUsersTeacher appletUsersTeacher = appletUsersTeacherService.selectAppletUsersTeacherByUserId(appUsers1.getUserId());
appUsers1.setAppletUsersTeacher(appletUsersTeacher);
AppletAddress appletAddress = new AppletAddress();
appletAddress.setUserId(appUsers.getUserId());
appletAddress.setUserId(appUsers1.getUserId());
List<AppletAddress> appletAddresses = appletAddressService.selectAppletAddressList(appletAddress);
appUsers.setAppletAddresseList(appletAddresses);
appUsers1.setAppletAddresseList(appletAddresses);
//如果经纬度不为空
if (request.getLatitude() != null && request.getLongitude() != null) {
//查询该经纬度下3-15公里内的接单地址
for (AppletAddress address : appletAddresses) {
if (address.getLatitude() != null && address.getLongitude() != null) {
//计算距离
Double distance = getDistance(
Double.parseDouble(request.getLatitude()),
Double.parseDouble(request.getLongitude()),
Double.parseDouble(address.getLatitude()),
Double.parseDouble(address.getLongitude())
);
//如果距离在3-15公里内
if (distance >= 3 && distance <= 100) {
// 检查appUsers1是否已经存在于appUsersListNew中
if (!appUsersListNew.contains(appUsers1)) {
appUsers1.setDistance(distance);
//如果性别不为空
if (request.getSex() != null) {
//判断性别跟查出来的性别相同
if (request.getSex().equals(appletUsersTeacher.getSex())) {
if (!appUsersListNew.contains(appUsers1)) {
appUsersListNew.add(appUsers1);
}
}
}else{
if (!appUsersListNew.contains(appUsers1)) {
appUsersListNew.add(appUsers1);
}
}
// 如果写入了接单日期
if (request.getSelectedDate() != null) {
// 创建一个AppletOutDate对象
AppletOutDate appletOutDate = new AppletOutDate();
appletOutDate.setAddressId(address.getId());
// 获取不接单日期列表
List<AppletOutDate> appletOutDates = appletOutDateService.selectAppletOutDateList(appletOutDate);
// 创建一个SimpleDateFormat对象用于格式化日期
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
// 提取不接单日期字符串列表
List<String> outDates = new ArrayList<>();
for (AppletOutDate outDate : appletOutDates) {
Date date = outDate.getDate(); // 假设AppletOutDate有一个getDate()方法
if (date != null) {
outDates.add(dateFormat.format(date)); // 将Date格式化为字符串
}
}
// 分割request.getSelectedDate()为多个日期
String[] selectedDates = request.getSelectedDate().split(",");
// 初始化一个标志用于判断是否所有日期都不在不接单日期列表中
boolean allDatesValid = true;
// 检查每个日期是否不在不接单日期列表中
for (String selectedDate : selectedDates) {
if (outDates.contains(selectedDate.trim())) {
allDatesValid = false;
break;
}
}
// 如果所有日期都不在不接单日期列表中并且appUsers1不在列表中则添加
if (allDatesValid) {
if (!appUsersListNew.contains(appUsers1)) {
appUsersListNew.add(appUsers1);
}
} else {
// 如果至少有一个日期在不接单日期列表中检查并删除appUsers1
if (appUsersListNew.contains(appUsers1)) {
appUsersListNew.remove(appUsers1);
}
}
}
// 假设 petType 是一个字符串格式为 "3,4,5"
if (petType != null && appletUsersTeacher != null && appletUsersTeacher.getPetType() != null) {
// petType 分割为字符串数组
String[] petTypes = petType.split(",");
// 遍历分割后的数组检查是否包含 appletUsersTeacher.getPetType()
boolean containsPetType = false;
for (String type : petTypes) {
if (type.trim().equals(appletUsersTeacher.getPetType())) {
containsPetType = true;
break;
}
}
if (containsPetType) {
// 如果包含检查是否已存在于列表中不存在则添加
if (!appUsersListNew.contains(appUsers1)) {
appUsersListNew.add(appUsers1);
}
} else {
// 如果不包含检查是否存在并删除
if (appUsersListNew.contains(appUsers1)) {
appUsersListNew.remove(appUsers1);
}
}
} else {
// 如果 petType 为空或者 appletUsersTeacher 或其 getPetType() 为空则检查并添加 appUsers1
if (!appUsersListNew.contains(appUsers1)) {
appUsersListNew.add(appUsers1);
}
}
}
}
}
}
}
}
return getDataTable(appUsersList);
return getDataTable(appUsersListNew);
}
/**
* 计算两个经纬度之间的距离单位公里
* @param lat1 第一个点的纬度
* @param lon1 第一个点的经度
* @param lat2 第二个点的纬度
* @param lon2 第二个点的经度
* @return 两点之间的距离公里
*/
public static double getDistance(double lat1, double lon1, double lat2, double lon2) {
// 地球半径公里
final int EARTH_RADIUS = 6371;
// 将经纬度转换为弧度
double lat1Rad = Math.toRadians(lat1);
double lon1Rad = Math.toRadians(lon1);
double lat2Rad = Math.toRadians(lat2);
double lon2Rad = Math.toRadians(lon2);
// 计算纬度差和经度差
double latDiff = lat2Rad - lat1Rad;
double lonDiff = lon2Rad - lon1Rad;
// Haversine公式计算
double a = Math.pow(Math.sin(latDiff / 2), 2) +
Math.cos(lat1Rad) * Math.cos(lat2Rad) *
Math.pow(Math.sin(lonDiff / 2), 2);
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
// 计算距离
double distance = EARTH_RADIUS * c;
// 保留两位小数
return Math.round(distance * 100) / 100.0;
}
//mall端-查询指定伴宠师详情
@ApiOperation("mall端-查询指定伴宠师详情接口")
@GetMapping("/getTeacherDetail")


+ 4
- 1
ruoyi-catdog/src/main/java/com/ruoyi/applet/mallpojo/TeacherListRequest.java View File

@ -12,6 +12,9 @@ public class TeacherListRequest extends AppletUsersTeacher {
//时间
@ApiModelProperty(value = "时间")
List<String> timeArray;
String selectedDate;
//姓名
@ApiModelProperty(value = "姓名")
String staffName;
@ -21,7 +24,7 @@ public class TeacherListRequest extends AppletUsersTeacher {
//宠物类型 1猫咪2狗狗
@ApiModelProperty(value = "宠物类型 1猫咪,2狗狗")
List<String> petTypes;
String petTypes;
//经度
@ApiModelProperty(value = "经度")
String longitude;


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

@ -127,11 +127,21 @@ public class AppUsers {
@TableField(exist = false)
List<AppletAddress> appletAddresseList;
@ApiModelProperty("评价条数)")
@ApiModelProperty("评价条数")
@TableField(exist = false)
private Integer commentNum;
@ApiModelProperty("服务小结份数)")
@ApiModelProperty("服务小结份数")
@TableField(exist = false)
private Integer serviceSummaryNum;
@ApiModelProperty("点赞次数")
@TableField(exist = false)
private Integer upNum;
@ApiModelProperty("距离")
@TableField(exist = false)
private double distance;
}

+ 1
- 1
ruoyi-mall/src/main/java/com/cyl/h5/service/H5OrderService.java View File

@ -1077,7 +1077,7 @@ public class H5OrderService {
//TODO
String payAmount = order.getPayAmount().multiply(new BigDecimal(100)).stripTrailingZeros().toPlainString();
// payAmount = "1";//支付一分钱
payAmount = "1";//支付一分钱
String prepayId = wechatPayService.jsapiPay(
String.valueOf(order.getPayId()),
orderDesc,


Loading…
Cancel
Save