Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
9a97ad4aad
|
|
@ -32,6 +32,8 @@ import com.ghy.payment.service.FinancialDetailService;
|
|||
import com.ghy.payment.service.FinancialMasterService;
|
||||
import com.ghy.web.pojo.vo.*;
|
||||
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.github.pagehelper.PageInfo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
|
@ -69,6 +71,8 @@ public class OrderMasterController extends BaseController {
|
|||
@Autowired
|
||||
private WorkerService workerService;
|
||||
@Autowired
|
||||
private IWorkerCertificationService workerCertificationService;
|
||||
@Autowired
|
||||
private OrderDetailService orderDetailService;
|
||||
@Autowired
|
||||
private OrderGoodsService orderGoodsService;
|
||||
|
|
@ -186,6 +190,8 @@ public class OrderMasterController extends BaseController {
|
|||
List<OrderStandard> standardList = new ArrayList<>();
|
||||
// 子单施工师傅信息
|
||||
Worker detailWorker = workerService.selectById(orderDetail.getWorkerId());
|
||||
// 师傅实名信息
|
||||
WorkerCertification detailWorkerRealInfo = workerCertificationService.selectByWorkerId(orderDetail.getWorkerId());
|
||||
|
||||
// 子单商品规格及信息
|
||||
List<OrderGoods> orderStandardList = orderGoodsService.selectByOrderDetailId(orderDetail.getId());
|
||||
|
|
@ -203,7 +209,7 @@ public class OrderMasterController extends BaseController {
|
|||
orderStandardDetail.setOrderDetailCode(orderDetail.getCode());
|
||||
orderStandardDetail.setWorkBeginTime(orderDetail.getWorkBeginTime());
|
||||
orderStandardDetail.setWorkFinishTime(orderDetail.getWorkFinishTime());
|
||||
orderStandardDetail.setWorkerName(detailWorker.getName());
|
||||
orderStandardDetail.setWorkerName(detailWorkerRealInfo.getName());
|
||||
orderStandardDetail.setWorkerPhone(detailWorker.getPhone());
|
||||
orderStandardDetail.setRevTime(orderDetail.getRevTime());
|
||||
orderStandardDetail.setExpectTimeStart(orderDetail.getExpectTimeStart());
|
||||
|
|
@ -220,6 +226,9 @@ public class OrderMasterController extends BaseController {
|
|||
// 师傅信息
|
||||
Worker worker = workerService.selectById(orderMaster.getWorkerId());
|
||||
|
||||
// 师傅实名信息
|
||||
WorkerCertification workerRealInfo = workerCertificationService.selectByWorkerId(orderMaster.getWorkerId());
|
||||
|
||||
// 消费者信息
|
||||
Customer customer = customerService.selectByCustomerId(orderMaster.getCustomerId());
|
||||
|
||||
|
|
@ -254,7 +263,7 @@ public class OrderMasterController extends BaseController {
|
|||
orderListResponse.setDiscountMoney(financialMaster.getDiscountMoney());
|
||||
orderListResponse.setTotalMoney(financialMaster.getTotalMoney());
|
||||
orderListResponse.setPayMoney(financialMaster.getPayMoney());
|
||||
orderListResponse.setWorkerName(worker == null ? "" : worker.getName());
|
||||
orderListResponse.setWorkerName(workerRealInfo == null ? "" : workerRealInfo.getName());
|
||||
orderListResponse.setWorkerPhone(worker == null ? "" : worker.getPhone());
|
||||
orderListResponse.setCustomerName(customer.getName());
|
||||
orderListResponse.setCustomerPhone(customer.getPhone());
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -125,3 +125,8 @@ jim:
|
|||
appKey: ''
|
||||
masterSecret: ''
|
||||
maxRetryTimes: ''
|
||||
|
||||
# 百度地图应用api
|
||||
baidu:
|
||||
ak: 'ZQTgMW7W0GTuE7Ripb0HDp5TqRaOI6PZ'
|
||||
url: 'https://api.map.baidu.com/reverse_geocoding/v3/?ak=#AK#&output=json&coordtype=wgs84ll&location='
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
<if test="countryId != null and countryId != 0">#{countryId},</if>
|
||||
<if test="status != null">#{status},</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="remark != null and remark != ''">#{remark},</if>
|
||||
sysdate()
|
||||
|
|
|
|||
|
|
@ -35,6 +35,16 @@
|
|||
<artifactId>ghy-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ghy</groupId>
|
||||
<artifactId>ghy-order</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ghy</groupId>
|
||||
<artifactId>ghy-payment</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.ghy.quartz.service;
|
||||
|
||||
public interface OrderService {
|
||||
|
||||
// 更新超时环境订单
|
||||
void overTimeOrder(String orderStatus);
|
||||
|
||||
// 自动完成和分账
|
||||
void finishOrder();
|
||||
|
||||
}
|
||||
|
|
@ -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() {
|
||||
// 查询符合自动确认的订单
|
||||
|
||||
// 更新符合自动确认订单的状态
|
||||
|
||||
// 调用分账动作
|
||||
}
|
||||
}
|
||||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue