Merge remote-tracking branch 'origin/master'

This commit is contained in:
HH 2022-07-20 15:10:12 +08:00
commit 9a97ad4aad
9 changed files with 188 additions and 3 deletions

View File

@ -32,6 +32,8 @@ import com.ghy.payment.service.FinancialDetailService;
import com.ghy.payment.service.FinancialMasterService; import com.ghy.payment.service.FinancialMasterService;
import com.ghy.web.pojo.vo.*; import com.ghy.web.pojo.vo.*;
import com.ghy.worker.domain.Worker; import com.ghy.worker.domain.Worker;
import com.ghy.worker.domain.WorkerCertification;
import com.ghy.worker.service.IWorkerCertificationService;
import com.ghy.worker.service.WorkerService; import com.ghy.worker.service.WorkerService;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -69,6 +71,8 @@ public class OrderMasterController extends BaseController {
@Autowired @Autowired
private WorkerService workerService; private WorkerService workerService;
@Autowired @Autowired
private IWorkerCertificationService workerCertificationService;
@Autowired
private OrderDetailService orderDetailService; private OrderDetailService orderDetailService;
@Autowired @Autowired
private OrderGoodsService orderGoodsService; private OrderGoodsService orderGoodsService;
@ -186,6 +190,8 @@ public class OrderMasterController extends BaseController {
List<OrderStandard> standardList = new ArrayList<>(); List<OrderStandard> standardList = new ArrayList<>();
// 子单施工师傅信息 // 子单施工师傅信息
Worker detailWorker = workerService.selectById(orderDetail.getWorkerId()); Worker detailWorker = workerService.selectById(orderDetail.getWorkerId());
// 师傅实名信息
WorkerCertification detailWorkerRealInfo = workerCertificationService.selectByWorkerId(orderDetail.getWorkerId());
// 子单商品规格及信息 // 子单商品规格及信息
List<OrderGoods> orderStandardList = orderGoodsService.selectByOrderDetailId(orderDetail.getId()); List<OrderGoods> orderStandardList = orderGoodsService.selectByOrderDetailId(orderDetail.getId());
@ -203,7 +209,7 @@ public class OrderMasterController extends BaseController {
orderStandardDetail.setOrderDetailCode(orderDetail.getCode()); orderStandardDetail.setOrderDetailCode(orderDetail.getCode());
orderStandardDetail.setWorkBeginTime(orderDetail.getWorkBeginTime()); orderStandardDetail.setWorkBeginTime(orderDetail.getWorkBeginTime());
orderStandardDetail.setWorkFinishTime(orderDetail.getWorkFinishTime()); orderStandardDetail.setWorkFinishTime(orderDetail.getWorkFinishTime());
orderStandardDetail.setWorkerName(detailWorker.getName()); orderStandardDetail.setWorkerName(detailWorkerRealInfo.getName());
orderStandardDetail.setWorkerPhone(detailWorker.getPhone()); orderStandardDetail.setWorkerPhone(detailWorker.getPhone());
orderStandardDetail.setRevTime(orderDetail.getRevTime()); orderStandardDetail.setRevTime(orderDetail.getRevTime());
orderStandardDetail.setExpectTimeStart(orderDetail.getExpectTimeStart()); orderStandardDetail.setExpectTimeStart(orderDetail.getExpectTimeStart());
@ -220,6 +226,9 @@ public class OrderMasterController extends BaseController {
// 师傅信息 // 师傅信息
Worker worker = workerService.selectById(orderMaster.getWorkerId()); Worker worker = workerService.selectById(orderMaster.getWorkerId());
// 师傅实名信息
WorkerCertification workerRealInfo = workerCertificationService.selectByWorkerId(orderMaster.getWorkerId());
// 消费者信息 // 消费者信息
Customer customer = customerService.selectByCustomerId(orderMaster.getCustomerId()); Customer customer = customerService.selectByCustomerId(orderMaster.getCustomerId());
@ -254,7 +263,7 @@ public class OrderMasterController extends BaseController {
orderListResponse.setDiscountMoney(financialMaster.getDiscountMoney()); orderListResponse.setDiscountMoney(financialMaster.getDiscountMoney());
orderListResponse.setTotalMoney(financialMaster.getTotalMoney()); orderListResponse.setTotalMoney(financialMaster.getTotalMoney());
orderListResponse.setPayMoney(financialMaster.getPayMoney()); orderListResponse.setPayMoney(financialMaster.getPayMoney());
orderListResponse.setWorkerName(worker == null ? "" : worker.getName()); orderListResponse.setWorkerName(workerRealInfo == null ? "" : workerRealInfo.getName());
orderListResponse.setWorkerPhone(worker == null ? "" : worker.getPhone()); orderListResponse.setWorkerPhone(worker == null ? "" : worker.getPhone());
orderListResponse.setCustomerName(customer.getName()); orderListResponse.setCustomerName(customer.getName());
orderListResponse.setCustomerPhone(customer.getPhone()); orderListResponse.setCustomerPhone(customer.getPhone());

View File

@ -0,0 +1,43 @@
package com.ghy.web.controller.tool;
import com.alibaba.fastjson.JSONObject;
import com.ghy.common.config.BaiduConfig;
import com.ghy.common.core.controller.BaseController;
import com.ghy.common.core.domain.AjaxResult;
import com.ghy.common.utils.ExceptionUtil;
import com.ghy.common.utils.http.HttpUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.ResponseBody;
/**
* 百度地图逆解析
* @author clunt
*/
@Controller
@RequestMapping("/tool/baidu")
public class BaiduController extends BaseController {
@Autowired
private BaiduConfig baiduConfig;
@PostMapping("/getLocation")
@ResponseBody
public AjaxResult getLocationByLot(@RequestBody JSONObject jsonObject){
try {
String location = jsonObject.getString("location");
String url = baiduConfig.getUrl().replace("#AK#", baiduConfig.getAk()) + location;
String result = HttpUtils.sendGet(url);
return AjaxResult.success(result);
}catch (Exception e){
e.printStackTrace();
logger.error(e.getMessage());
return AjaxResult.error(ExceptionUtil.getExceptionMessage(e));
}
}
}

View File

@ -125,3 +125,8 @@ jim:
appKey: '' appKey: ''
masterSecret: '' masterSecret: ''
maxRetryTimes: '' maxRetryTimes: ''
# 百度地图应用api
baidu:
ak: 'ZQTgMW7W0GTuE7Ripb0HDp5TqRaOI6PZ'
url: 'https://api.map.baidu.com/reverse_geocoding/v3/?ak=#AK#&output=json&coordtype=wgs84ll&location='

View File

@ -0,0 +1,32 @@
package com.ghy.common.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* 百度地图应用ak配置
* @author clunt
*/
@Component
@ConfigurationProperties(prefix = "baidu")
public class BaiduConfig {
private String ak;
private String url;
public String getAk() {
return ak;
}
public void setAk(String ak) {
this.ak = ak;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}

View File

@ -82,7 +82,7 @@
<if test="countryId != null and countryId != 0">#{countryId},</if> <if test="countryId != null and countryId != 0">#{countryId},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="address != null and address != ''">#{address},</if> <if test="address != null and address != ''">#{address},</if>
<if test="isDefault != null and isDefault != 0">#{isDefault},</if> <if test="isDefault != null">#{isDefault},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
sysdate() sysdate()

View File

@ -35,6 +35,16 @@
<artifactId>ghy-common</artifactId> <artifactId>ghy-common</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.ghy</groupId>
<artifactId>ghy-order</artifactId>
</dependency>
<dependency>
<groupId>com.ghy</groupId>
<artifactId>ghy-payment</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -0,0 +1,11 @@
package com.ghy.quartz.service;
public interface OrderService {
// 更新超时环境订单
void overTimeOrder(String orderStatus);
// 自动完成和分账
void finishOrder();
}

View File

@ -0,0 +1,35 @@
package com.ghy.quartz.service.impl;
import com.ghy.order.service.OrderMasterService;
import com.ghy.payment.service.FinancialMasterService;
import com.ghy.quartz.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class OrderServiceImpl implements OrderService {
@Autowired
private OrderMasterService orderMasterService;
@Autowired
private FinancialMasterService financialMasterService;
@Override
public void overTimeOrder(String orderStatus) {
// 查询符合超时的单
// 更新对应单的状态
// 生成对应的扣款明细
}
@Override
public void finishOrder() {
// 查询符合自动确认的订单
// 更新符合自动确认订单的状态
// 调用分账动作
}
}

View File

@ -0,0 +1,40 @@
package com.ghy.quartz.task;
import com.ghy.common.utils.ExceptionUtil;
import com.ghy.quartz.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Slf4j
@Component("orderTask")
public class OrderTask {
@Autowired
private OrderService orderService;
/**
* 超时状态刷新
* */
public void overTimeOrder(String orderStatus){
try {
orderService.overTimeOrder(orderStatus);
}catch (Exception e){
log.error("over time order task error is {}", ExceptionUtil.getExceptionMessage(e));
e.printStackTrace();
}
}
/**
* 自动确认完成订单
* */
public void finishOrder(){
try {
orderService.finishOrder();
}catch (Exception e){
log.error("auto finish order task error is {}", ExceptionUtil.getExceptionMessage(e));
e.printStackTrace();
}
}
}