wang-hao-jie
2022-01-05 6901d54eeb093a4b94f0630ae88bda7936f16919
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/wx/IndexController.java
@@ -10,6 +10,7 @@
import cn.exrick.xboot.your.util.HttpUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -29,7 +30,7 @@
 */
@Slf4j
@RestController
@Api(tags = "订单接口")
@Api(tags = "小程序接口")
@RequestMapping("/xboot/wx")
@Transactional
public class IndexController {
@@ -57,7 +58,8 @@
    //2.微信登陆
    @RequestMapping("/login")
    @RequestMapping(value = "/login", method = RequestMethod.POST)
    @ApiOperation(value = "微信登陆")
    public Object doLogin(String code){
        JSONObject SessionKeyOpenId = getSessionKeyOrOpenId( code );
@@ -89,7 +91,8 @@
    //3.微信绑定零售许可证
    //licence:零售许可证号
    //openId:微信id
    @RequestMapping("/bindWx")
    @RequestMapping(value = "/bindWx", method = RequestMethod.POST)
    @ApiOperation(value = "微信绑定零售许可证")
    public Object bindWx(String licence,String openId){
        QueryWrapper<Customer> wrapper = new QueryWrapper<>();
        wrapper.eq("licence",licence);
@@ -104,7 +107,8 @@
    }
    //4.获取今日配送订单
    @RequestMapping("/getTodayOrder")
    @RequestMapping(value = "/getTodayOrder", method = RequestMethod.POST)
    @ApiOperation(value = "获取今日配送订单")
    public Object getTodayOrder(String customerId){
        OrderTask orderTask = getOrder(customerId);
        if(orderTask==null){
@@ -127,7 +131,8 @@
    }
    //5.获取车辆位置
    @RequestMapping("/getCarInfo")
    @RequestMapping(value = "/getCarInfo",method = RequestMethod.POST)
    @ApiOperation(value = "获取车辆位置")
    public Object getCarInfo(String customerId){
        QueryWrapper<OrderTask> wrapper2 = new QueryWrapper<OrderTask>();
        String format = DateUtil.format(new Date(), "yyyy-MM-dd");
@@ -141,7 +146,8 @@
        String latestGps = haiKangPost.findLatestGps(carids);
        JSONObject jsonObject = JSONUtil.parseObj(latestGps);
        String data = jsonObject.getStr("data");
        JSONObject jsonObject2 = JSONUtil.parseObj(data);
        JSONArray objects = JSONUtil.parseArray(data);
        JSONObject jsonObject2 = objects.getJSONObject(0);
        Integer lng = jsonObject2.getInt("longitude");
        Integer lat = jsonObject2.getInt("latitude");
@@ -154,7 +160,8 @@
    }
    //6.加油助力
    @RequestMapping("/likes")
    @RequestMapping(value = "/likes", method = RequestMethod.POST)
    @ApiOperation(value = "加油助力")
    public Object likes(String customerId){
        OrderTask order = getOrder(customerId);
        order.setLikes(1);
@@ -163,7 +170,8 @@
    }
    //7.获取订单列表
    @RequestMapping("/getOrderList")
    @RequestMapping(value = "/getOrderList", method = RequestMethod.POST)
    @ApiOperation(value = "获取订单列表")
    public Object getOrderList(String customerId, String startTime, String endTime, PageVo page){
        page.setSort("sendDate");
        page.setOrder("desc");
@@ -180,7 +188,8 @@
    }
    //8.获取订单详情列表
    @RequestMapping("/getOrderDetail")
    @RequestMapping(value = "/getOrderDetail", method = RequestMethod.POST)
    @ApiOperation(value = "获取订单详情列表")
    public Object getOrderDetail(String orderId){
        QueryWrapper<OrderDetail> wrapper = new QueryWrapper<>();
        wrapper.eq("order_id",orderId);
@@ -189,7 +198,8 @@
    }
    //9.评价
    @RequestMapping("/remark")
    @RequestMapping(value = "/remark", method = RequestMethod.POST)
    @ApiOperation(value = "评价")
    public Object remark(int level,String orderId){
        OrderTask byId = iOrderTaskService.getById(orderId);
        byId.setLevel(level);
@@ -200,6 +210,7 @@
    //10.获取意见建议列表
    @RequestMapping(value = "/getSuggestByPage", method = RequestMethod.GET)
    @ApiOperation(value = "获取意见建议列表")
    public Result<IPage<Suggest>> getByPage(String customerId,PageVo page) {
        QueryWrapper<Suggest> wrapper = new QueryWrapper<>();
        wrapper.eq("customer_id",customerId);
@@ -209,6 +220,7 @@
    //12.新增意见建议
    @RequestMapping(value = "/insertSuggest", method = RequestMethod.POST)
    @ApiOperation(value = "新增意见建议")
    public Result<Suggest> insertSuggest(String customerId,String content) {
        Suggest suggest = new Suggest();
        suggest.setContent(content);
@@ -221,6 +233,7 @@
    //13.新增签收人
    @RequestMapping(value = "/insertReceive", method = RequestMethod.POST)
    @ApiOperation(value = "新增签收人")
    public Result<CustomerReceive> insertReceive(String customerId,String name,String phone) {
        CustomerReceive customerReceive = new CustomerReceive();
        customerReceive.setCustomerId(customerId);