|
@@ -20,6 +20,7 @@ import com.pj.tb_enterprise.TbEnterpriseMapper;
|
|
import com.pj.tb_goods_transit.TbGoodsTransit;
|
|
import com.pj.tb_goods_transit.TbGoodsTransit;
|
|
import com.pj.tb_goods_transit.TbGoodsTransitMapper;
|
|
import com.pj.tb_goods_transit.TbGoodsTransitMapper;
|
|
import com.pj.tb_goods_transit.TbGoodsTransitService;
|
|
import com.pj.tb_goods_transit.TbGoodsTransitService;
|
|
|
|
+import com.pj.tb_order.vo.ConfirmVo;
|
|
import com.pj.tb_order.vo.OrderVo;
|
|
import com.pj.tb_order.vo.OrderVo;
|
|
import com.pj.tb_order.vo.PeopleConfirmVo;
|
|
import com.pj.tb_order.vo.PeopleConfirmVo;
|
|
import com.pj.tb_order_people_confirm.TbOrderPeopleConfirm;
|
|
import com.pj.tb_order_people_confirm.TbOrderPeopleConfirm;
|
|
@@ -227,8 +228,6 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
OrderVo orderVo = new OrderVo();
|
|
OrderVo orderVo = new OrderVo();
|
|
//数据拷贝
|
|
//数据拷贝
|
|
BeanUtils.copyProperties(order,orderVo);
|
|
BeanUtils.copyProperties(order,orderVo);
|
|
- //设置基本属性
|
|
|
|
- orderVo = methodOrderService.setOrderVoProperties(order,orderVo);
|
|
|
|
return orderVo;
|
|
return orderVo;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -285,32 +284,6 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
return peopleConfirmList;
|
|
return peopleConfirmList;
|
|
}
|
|
}
|
|
|
|
|
|
- /** 远程调用:根据时间和登陆人查询订单 */
|
|
|
|
- public List<OrderDto> selectOrderList( Long appUserId){
|
|
|
|
- //判断当前是否已接单
|
|
|
|
- LambdaQueryWrapper<TbOrder> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
- //根据当天时间查询
|
|
|
|
-// queryWrapper.eq(TbOrder::getCreateTime,sdf.format(currDay));
|
|
|
|
- queryWrapper.eq(TbOrder::getCreateBy,appUserId);
|
|
|
|
- //todo:届时放开该注释
|
|
|
|
-// queryWrapper.eq(TbOrder::getApply,ApplyStatus.APPLY_STATUS_ONE.getCode()); //申报通过
|
|
|
|
- queryWrapper.eq(TbOrder::getDeleteStatus,DeleteStatus.DELETE_STATUS_ON.getCode());
|
|
|
|
- queryWrapper.apply("DATE(create_time) = DATE({0})", new Date()); // 匹配当天的数据
|
|
|
|
- List<TbOrder> tbOrderList = tbOrderMapper.selectList(queryWrapper);
|
|
|
|
- //创建返回值集合
|
|
|
|
- List<OrderDto> result = new ArrayList<>();
|
|
|
|
- //执行数据封装
|
|
|
|
- if(tbOrderList.size() == 1){
|
|
|
|
- tbOrderList.forEach(item -> {
|
|
|
|
- OrderDto orderDto = new OrderDto();
|
|
|
|
- BeanUtils.copyProperties(item,orderDto);
|
|
|
|
- result.add(orderDto);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- //返回
|
|
|
|
- return result;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 接收订单推送消息,
|
|
* 接收订单推送消息,
|
|
* 边民进行交易确认,
|
|
* 边民进行交易确认,
|
|
@@ -336,11 +309,44 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
- * 边民确认订单
|
|
|
|
|
|
+ * app首页获取边民未确认订单
|
|
|
|
+ */
|
|
|
|
+ public OrderVo getNoConfirmOrder() {
|
|
|
|
+ //获取登录人
|
|
|
|
+ APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
|
+
|
|
|
|
+ LambdaQueryWrapper<TbOrder> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ wrapper.eq(TbOrder::getBuyUserId, appLoginInfo.getFk());
|
|
|
|
+ wrapper.eq(TbOrder::getPeopleConfirmStatus, ConfirmStatus.CONFIRM_STATUS_ZERO.getCode());//订单未确认
|
|
|
|
+ wrapper.orderByDesc(TbOrder::getCreateTime);
|
|
|
|
+ wrapper.orderByDesc(TbOrder::getUpdateTime);
|
|
|
|
+
|
|
|
|
+ List<TbOrder> tbOrders = tbOrderMapper.selectList(wrapper);
|
|
|
|
+ if(tbOrders.size() > 0) {
|
|
|
|
+ TbOrder order = tbOrders.get(0);
|
|
|
|
+
|
|
|
|
+ OrderVo orderVo = new OrderVo();
|
|
|
|
+ BeanUtils.copyProperties(order,orderVo);
|
|
|
|
+ return orderVo;
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取一级市场边民订单的所有确认状态
|
|
* @param orderId 一级市场订单表ID
|
|
* @param orderId 一级市场订单表ID
|
|
*/
|
|
*/
|
|
- public boolean confirmOrder(Long orderId, Integer confirmType){
|
|
|
|
|
|
+ public ConfirmVo getConfirmStatus(Long orderId) {
|
|
|
|
+ return tbOrderMapper.getConfirmStatus(orderId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 边民订单确认
|
|
|
|
+ * @param orderId 一级市场订单表ID
|
|
|
|
+ */
|
|
|
|
+ public boolean confirmOrder(Long orderId){
|
|
// TODO: 2023/8/28 边民发起支付申请,调用银行接口:验证边民支付信息,将货款先存入银行第三方账户,并给出回执
|
|
// TODO: 2023/8/28 边民发起支付申请,调用银行接口:验证边民支付信息,将货款先存入银行第三方账户,并给出回执
|
|
// 银行返回支付回执为"交易成功"时,方法往下执行
|
|
// 银行返回支付回执为"交易成功"时,方法往下执行
|
|
|
|
|
|
@@ -350,7 +356,6 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
// TODO: 2023/8/29 更新状态保存交易记录
|
|
// TODO: 2023/8/29 更新状态保存交易记录
|
|
LambdaUpdateWrapper<TbOrder> wrapper = new LambdaUpdateWrapper<>();
|
|
LambdaUpdateWrapper<TbOrder> wrapper = new LambdaUpdateWrapper<>();
|
|
wrapper.set(TbOrder::getPeopleConfirmStatus, ConfirmStatus.CONFIRM_STATUS_ONE.getCode());//边民确认:1=确认
|
|
wrapper.set(TbOrder::getPeopleConfirmStatus, ConfirmStatus.CONFIRM_STATUS_ONE.getCode());//边民确认:1=确认
|
|
- wrapper.set(TbOrder::getPeopleConfirmType, confirmType);//边民确认类型[1=刷脸,2=指纹]
|
|
|
|
wrapper.set(TbOrder::getPeopleConfirmTime, new Date());
|
|
wrapper.set(TbOrder::getPeopleConfirmTime, new Date());
|
|
wrapper.set(TbOrder::getUpdateBy, appLoginInfo.getLoginId());
|
|
wrapper.set(TbOrder::getUpdateBy, appLoginInfo.getLoginId());
|
|
wrapper.set(TbOrder::getUpdateName, appLoginInfo.getLoginName());
|
|
wrapper.set(TbOrder::getUpdateName, appLoginInfo.getLoginName());
|
|
@@ -358,8 +363,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
wrapper.eq(TbOrder::getId, orderId);
|
|
wrapper.eq(TbOrder::getId, orderId);
|
|
boolean result = update(wrapper);
|
|
boolean result = update(wrapper);
|
|
|
|
|
|
- // TODO: 2023/8/29 同步交易信息(由于目前未知航通传过来的订单数据形式,暂未做)
|
|
|
|
- // TODO: 2023/8/29 监听航通传过来的大订单里的所有边民订单,当所有边民都进行订单确认后,调用航通接口发送信息
|
|
|
|
|
|
+ // TODO: 2023/8/29 调用航通008接口,发送信息
|
|
OrderDto tbOrderDto = new OrderDto();
|
|
OrderDto tbOrderDto = new OrderDto();
|
|
BeanUtils.copyProperties(tbOrderMapper.selectById(orderId),tbOrderDto);
|
|
BeanUtils.copyProperties(tbOrderMapper.selectById(orderId),tbOrderDto);
|
|
asyncServerInterface.sendLevelOneOrderDto(tbOrderDto,DataType.DATA_TYPE_ONE.getCode()); // 发送至航通
|
|
asyncServerInterface.sendLevelOneOrderDto(tbOrderDto,DataType.DATA_TYPE_ONE.getCode()); // 发送至航通
|
|
@@ -386,8 +390,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
wrapper.eq(TbOrder::getId, orderId);
|
|
wrapper.eq(TbOrder::getId, orderId);
|
|
boolean result = update(wrapper);
|
|
boolean result = update(wrapper);
|
|
|
|
|
|
- // TODO: 2023/8/29 发送信息(由于目前未知航通传过来的订单数据形式,暂未做)
|
|
|
|
- // TODO: 2023/8/29 监听航通传过来的大订单里的所有边民订单,当所有边民都进行进口申报确认后,调用航通接口发送信息
|
|
|
|
|
|
+ // TODO: 2023/8/29 调用航通008接口,发送信息
|
|
OrderDto tbOrderDto = new OrderDto();
|
|
OrderDto tbOrderDto = new OrderDto();
|
|
BeanUtils.copyProperties(tbOrderMapper.selectById(orderId),tbOrderDto);
|
|
BeanUtils.copyProperties(tbOrderMapper.selectById(orderId),tbOrderDto);
|
|
asyncServerInterface.sendLevelOneOrderDto(tbOrderDto,DataType.DATA_TYPE_TWO.getCode());
|
|
asyncServerInterface.sendLevelOneOrderDto(tbOrderDto,DataType.DATA_TYPE_TWO.getCode());
|
|
@@ -395,6 +398,28 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 互助委托申报确认
|
|
|
|
+ * @param orderId 一级市场订单表ID
|
|
|
|
+ */
|
|
|
|
+ public boolean cooperOrder(Long orderId){
|
|
|
|
+ //获取登录人
|
|
|
|
+ APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
|
|
|
|
+
|
|
|
|
+ LambdaUpdateWrapper<TbOrder> wrapper = new LambdaUpdateWrapper<>();
|
|
|
|
+ wrapper.set(TbOrder::getCooperEntrustStatus, ConfirmStatus.CONFIRM_STATUS_ONE.getCode());//互助委托申报确认:1=确认
|
|
|
|
+ wrapper.set(TbOrder::getCooperEntrustTime, new Date());
|
|
|
|
+
|
|
|
|
+ wrapper.set(TbOrder::getUpdateBy, appLoginInfo.getLoginId());
|
|
|
|
+ wrapper.set(TbOrder::getUpdateName, appLoginInfo.getLoginName());
|
|
|
|
+ wrapper.set(TbOrder::getUpdateTime, new Date());
|
|
|
|
+
|
|
|
|
+ wrapper.eq(TbOrder::getId, orderId);
|
|
|
|
+ boolean result = update(wrapper);
|
|
|
|
+
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
// TODO: 2023/8/28 系统接收到航通接口信息:车辆已出一级市场
|
|
// TODO: 2023/8/28 系统接收到航通接口信息:车辆已出一级市场
|
|
public void orderFinish(Long[] ids){
|
|
public void orderFinish(Long[] ids){
|
|
//1、todo: 调用银行接口发起划扣:将边民划扣至银行第三方账户的货款,支付至外籍商户的账户
|
|
//1、todo: 调用银行接口发起划扣:将边民划扣至银行第三方账户的货款,支付至外籍商户的账户
|
|
@@ -433,6 +458,36 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
|
|
asyncServerInterface.sendLevelOneOrderDto(tbOrderDto,DataType.DATA_TYPE_THREE.getCode());
|
|
asyncServerInterface.sendLevelOneOrderDto(tbOrderDto,DataType.DATA_TYPE_THREE.getCode());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /*----- 正常业务逻辑👆👆 rpc远程调用👇👇 -----*/
|
|
|
|
+
|
|
|
|
+ /** 远程调用:根据时间和登陆人查询订单 */
|
|
|
|
+ public List<OrderDto> selectOrderList( Long appUserId){
|
|
|
|
+ //判断当前是否已接单
|
|
|
|
+ LambdaQueryWrapper<TbOrder> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
+ //根据当天时间查询
|
|
|
|
+// queryWrapper.eq(TbOrder::getCreateTime,sdf.format(currDay));
|
|
|
|
+ queryWrapper.eq(TbOrder::getCreateBy,appUserId);
|
|
|
|
+ //todo:届时放开该注释
|
|
|
|
+// queryWrapper.eq(TbOrder::getApply,ApplyStatus.APPLY_STATUS_ONE.getCode()); //申报通过
|
|
|
|
+ queryWrapper.eq(TbOrder::getDeleteStatus,DeleteStatus.DELETE_STATUS_ON.getCode());
|
|
|
|
+ queryWrapper.apply("DATE(create_time) = DATE({0})", new Date()); // 匹配当天的数据
|
|
|
|
+ List<TbOrder> tbOrderList = tbOrderMapper.selectList(queryWrapper);
|
|
|
|
+ //创建返回值集合
|
|
|
|
+ List<OrderDto> result = new ArrayList<>();
|
|
|
|
+ //执行数据封装
|
|
|
|
+ if(tbOrderList.size() == 1){
|
|
|
|
+ tbOrderList.forEach(item -> {
|
|
|
|
+ OrderDto orderDto = new OrderDto();
|
|
|
|
+ BeanUtils.copyProperties(item,orderDto);
|
|
|
|
+ result.add(orderDto);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ //返回
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
/** 远程调用 查订单 */
|
|
/** 远程调用 查订单 */
|
|
OrderDto getOrderDtoById(Long id){
|
|
OrderDto getOrderDtoById(Long id){
|
|
TbOrder byId = super.getById(id);
|
|
TbOrder byId = super.getById(id);
|