Bläddra i källkod

app首页弹出-边民订单确认

linbl 1 år sedan
förälder
incheckning
b253b61ab7

+ 0 - 35
sp-service/level-one-server/src/main/java/com/pj/tb_order/MethodOrderService.java

@@ -102,39 +102,4 @@ public class MethodOrderService {
         }
     }
 
-    public OrderVo setOrderVoProperties(TbOrder tbOrder,OrderVo orderVo){
-        //获取商家手机号
-        TbEnterprise enterprise = tbEnterpriseMapper.selectById(tbOrder.getEnterpriseId());
-        if(enterprise == null)throw new ServiceException("商家信息异常!");
-        orderVo.setConcat(enterprise.getOwnerTel());
-        //获取过审商品名称 计价单位 净重 毛重 商品发布时间
-        TbGoodsTransit goodsTransit = tbGoodsTransitMapper.selectById(tbOrder.getGoodsId());
-        if(goodsTransit == null)
-            throw new ServiceException("过审商品信息异常!");
-        orderVo.setOrderId(tbOrder.getId());
-        orderVo.setGoodsTransitName(goodsTransit.getGoodsName());
-        orderVo.setGoodsUnit(goodsTransit.getGoodsUnits());
-        orderVo.setNetWeight(goodsTransit.getNetWeight());
-        orderVo.setGrossWeight(goodsTransit.getGrossWeight());
-        orderVo.setGoodsTransitCreateTime(goodsTransit.getCreateTime());
-        //相关的所有边民
-//        List<TbOrderPeopleConfirm> peopleList = tbOrderPeopleConfirmMapper.selectList
-//                (new LambdaQueryWrapper<TbOrderPeopleConfirm>().eq(TbOrderPeopleConfirm::getGroupId, tbOrder.getGroupId()).eq(TbOrderPeopleConfirm::getOrderId, tbOrder.getId()));
-//        orderVo.setPeopleList(peopleList);
-        //订单创建时间
-        orderVo.setOrderCreateTime(tbOrder.getCreateTime());
-        //购买的互市组名称
-        orderVo.setGroupName(tbGroupMapper.selectById(tbOrder.getGroupId()).getOrgName());
-        //商户确认时间
-        orderVo.setEnterpriseConfirmTime(tbOrder.getCreateTime());
-        //todo: orderVo进境时间
-        orderVo.setEntrantTime(new Date());
-        //todo: orderVo进口时间
-        orderVo.setImportTime(new Date());
-        //todo: orderVo出互市区时间
-        orderVo.setOutFrontierTradeTime(new Date());
-
-        return orderVo;
-    }
-
 }

+ 19 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrder.java

@@ -251,6 +251,15 @@ public class TbOrder extends Model<TbOrder> implements Serializable {
 	private Date peopleConfirmTime;
 
 	/**
+	 * 互助委托申报确认状态
+	 */
+	private String cooperEntrustStatus;
+	/**
+	 * 互助委托申报确认时间
+	 */
+	private String cooperEntrustTime;
+
+	/**
 	 * 边民进口申报确认状态(0=待确认,1=是)
 	 */
 	private Integer applyConfirmStatus;
@@ -360,4 +369,14 @@ public class TbOrder extends Model<TbOrder> implements Serializable {
 	 */
 	private String goodsUnit;
 
+	/**
+	 * 车牌号
+	 */
+	private String veNo;
+
+	/**
+	 * 车航次(班)号
+	 */
+	private String voyageNo;
+
 }

+ 26 - 6
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderAppController.java

@@ -4,7 +4,6 @@ import com.pj.api.dto.OrderDto;
 import com.pj.project4sp.SP;
 import com.pj.tb_order.vo.OrderVo;
 import com.pj.tb_order.vo.PeopleConfirmVo;
-import com.pj.tb_people.TbPeople;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -100,8 +99,8 @@ public class TbOrderAppController {
 	 * @param orderId
 	 * @return
 	 */
-	@GetMapping("orderDetail")
-	public AjaxJson orderDetail(Long orderId){
+	@RequestMapping("orderDetail")
+	public AjaxJson orderDetail(@RequestParam("orderId")Long orderId){
 		return AjaxJson.getSuccessData(tbOrderService.orderDetail(orderId));
 	}
 
@@ -122,15 +121,36 @@ public class TbOrderAppController {
 		return AjaxJson.getPageData(Long.valueOf(list.size()), list);
 	}
 
-	@RequestMapping("confirmOrder")
-	public AjaxJson confirmOrder(@RequestParam("orderId")Long orderId, @RequestParam("confirmType")Integer confirmType) {
-		return AjaxJson.toAjax(tbOrderService.confirmOrder(orderId, confirmType));
+
+
+	/** app首页获取边民未确认订单 */
+	@RequestMapping("getNoConfirmOrder")
+	public AjaxJson getNoConfirmOrder() {
+		return AjaxJson.getSuccessData(tbOrderService.getNoConfirmOrder());
+	}
+
+	/** 获取一级市场边民订单的所有确认状态 */
+	@RequestMapping("getConfirmStatus")
+	public AjaxJson getConfirmStatus(@RequestParam("orderId")Long orderId) {
+		return AjaxJson.getSuccessData(tbOrderService.getConfirmStatus(orderId));
 	}
 
+	/** 边民订单确认 */
+	@RequestMapping("confirmOrder")
+	public AjaxJson confirmOrder(@RequestParam("orderId")Long orderId) {
+		return AjaxJson.toAjax(tbOrderService.confirmOrder(orderId));
+	}
+	/** 边民进口申报确认 */
 	@RequestMapping("applyOrder")
 	public AjaxJson applyOrder(@RequestParam("orderId")Long orderId) {
 		return AjaxJson.toAjax(tbOrderService.applyOrder(orderId));
 	}
+	/** 互助委托申报确认 */
+	@RequestMapping("cooperOrder")
+	public AjaxJson cooperOrder(@RequestParam("orderId")Long orderId) {
+		return AjaxJson.toAjax(tbOrderService.cooperOrder(orderId));
+	}
+
 
 	/*-----           正常业务逻辑👆👆    rpc远程调用👇👇 -----*/
 

+ 5 - 3
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderMapper.java

@@ -2,6 +2,7 @@ package com.pj.tb_order;
 
 import java.util.List;
 
+import com.pj.tb_order.vo.ConfirmVo;
 import org.apache.ibatis.annotations.Mapper;
 
 import com.pj.utils.so.*;
@@ -10,7 +11,7 @@ import org.springframework.stereotype.Repository;
 
 /**
  * Mapper: tb_order -- 订单表
- * @author loovi 
+ * @author loovi
  */
 
 @Mapper
@@ -21,10 +22,11 @@ public interface TbOrderMapper extends BaseMapper <TbOrder> {
 
 	/**
 	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
-	 * @param so 参数集合 
-	 * @return 数据列表 
+	 * @param so 参数集合
+	 * @return 数据列表
 	 */
 	List<TbOrder> getList(SoMap so);
 
+	ConfirmVo getConfirmStatus(Long orderId);
 
 }

+ 5 - 7
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderMapper.xml

@@ -86,6 +86,7 @@
 			<if test=' this.has("peopleConfirmType") '> and people_confirm_type = #{peopleConfirmType} </if>
 			<if test=' this.has("collageOrdersId") '> and collage_orders_id = #{collageOrdersId} </if>
 			<if test=' this.has("applyConfirmStatus") '> and apply_confirm_status = #{applyConfirmStatus} </if>
+			<if test=' this.has("cooperEntrustStatus") '> and cooper_entrust_status = #{cooperEntrustStatus} </if>
 		</where>
 		order by
 		<choose>
@@ -143,13 +144,10 @@
 		</choose>
 	</select>
 
-
-
-
-
-
-
-
+	<select id="getConfirmStatus" resultMap="com.pj.tb_order.vo.ConfirmVo">
+		select id orderId,people_confirm_status,cooper_entrust_status,apply_confirm_status from tb_order
+		where id = #{orderId}
+	</select>
 
 
 </mapper>

+ 90 - 35
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderService.java

@@ -20,6 +20,7 @@ import com.pj.tb_enterprise.TbEnterpriseMapper;
 import com.pj.tb_goods_transit.TbGoodsTransit;
 import com.pj.tb_goods_transit.TbGoodsTransitMapper;
 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.PeopleConfirmVo;
 import com.pj.tb_order_people_confirm.TbOrderPeopleConfirm;
@@ -227,8 +228,6 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 		OrderVo orderVo = new OrderVo();
 		//数据拷贝
 		BeanUtils.copyProperties(order,orderVo);
-		//设置基本属性
-		orderVo = methodOrderService.setOrderVoProperties(order,orderVo);
 		return orderVo;
 	}
 
@@ -285,32 +284,6 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 		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
 	 */
-	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 边民发起支付申请,调用银行接口:验证边民支付信息,将货款先存入银行第三方账户,并给出回执
 		// 银行返回支付回执为"交易成功"时,方法往下执行
 
@@ -350,7 +356,6 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 		// TODO: 2023/8/29 更新状态保存交易记录
 		LambdaUpdateWrapper<TbOrder> wrapper = new LambdaUpdateWrapper<>();
 		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::getUpdateBy, appLoginInfo.getLoginId());
 		wrapper.set(TbOrder::getUpdateName, appLoginInfo.getLoginName());
@@ -358,8 +363,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 		wrapper.eq(TbOrder::getId, orderId);
 		boolean result = update(wrapper);
 
-		// TODO: 2023/8/29 同步交易信息(由于目前未知航通传过来的订单数据形式,暂未做)
-		// TODO: 2023/8/29 监听航通传过来的大订单里的所有边民订单,当所有边民都进行订单确认后,调用航通接口发送信息
+		// TODO: 2023/8/29 调用航通008接口,发送信息
 		OrderDto tbOrderDto = new OrderDto();
 		BeanUtils.copyProperties(tbOrderMapper.selectById(orderId),tbOrderDto);
 		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);
 		boolean result = update(wrapper);
 
-		// TODO: 2023/8/29 发送信息(由于目前未知航通传过来的订单数据形式,暂未做)
-		// TODO: 2023/8/29 监听航通传过来的大订单里的所有边民订单,当所有边民都进行进口申报确认后,调用航通接口发送信息
+		// TODO: 2023/8/29 调用航通008接口,发送信息
 		OrderDto tbOrderDto = new OrderDto();
 		BeanUtils.copyProperties(tbOrderMapper.selectById(orderId),tbOrderDto);
 		asyncServerInterface.sendLevelOneOrderDto(tbOrderDto,DataType.DATA_TYPE_TWO.getCode());
@@ -395,6 +398,28 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 		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 系统接收到航通接口信息:车辆已出一级市场
 	public void orderFinish(Long[] ids){
 		//1、todo: 调用银行接口发起划扣:将边民划扣至银行第三方账户的货款,支付至外籍商户的账户
@@ -433,6 +458,36 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 		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){
 		TbOrder byId = super.getById(id);

+ 47 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order/vo/ConfirmVo.java

@@ -0,0 +1,47 @@
+package com.pj.tb_order.vo;
+
+import lombok.Data;
+
+import java.util.Date;
+
+
+/**
+ * @Author lbl
+ **/
+@Data
+public class ConfirmVo {
+
+
+    /**
+     * 订单ID
+     */
+    private Long orderId;
+
+    /**
+     * 一级市场边民确认状态(0=待确认,1=是)
+     */
+    private Integer peopleConfirmStatus;
+    /**
+     * 一级市场边民确认时间
+     */
+    private Date peopleConfirmTime;
+
+    /**
+     * 互助委托申报确认状态
+     */
+    private String cooperEntrustStatus;
+    /**
+     * 互助委托申报确认时间
+     */
+    private String cooperEntrustTime;
+
+    /**
+     * 边民进口申报确认状态(0=待确认,1=是)
+     */
+    private Integer applyConfirmStatus;
+    /**
+     * 边民进口申报确认时间
+     */
+    private Date applyConfirmTime;
+
+}

+ 111 - 27
sp-service/level-one-server/src/main/java/com/pj/tb_order/vo/OrderVo.java

@@ -15,7 +15,7 @@ import java.util.List;
 public class OrderVo {
 
 
-    private Long orderId;
+    private Long id;
 
     /**
      * 订单编号
@@ -33,16 +33,6 @@ public class OrderVo {
      */
     private String enterpriseName;
 
-    /**
-     * 商家联系号码
-     */
-    private String concat;
-
-
-    /**
-     * 过审商品名称
-     */
-    private String goodsTransitName;
 
     /**
      * 计价单位
@@ -64,50 +54,144 @@ public class OrderVo {
      */
     private Double totalPrice;
 
+
     /**
-     * 边民
+     * 订单创建时间
      */
-//    private List<TbOrderPeopleConfirm> peopleList;
+    private Date orderCreateTime;
 
     /**
-     * 商品发布时间
+     * 购买的互市组名称
      */
-    private Date goodsTransitCreateTime;
+    private String groupName;
+
 
     /**
-     * 订单创建时间
+     * 买家ID
      */
-    private Date orderCreateTime;
+    private Long buyUserId;
 
     /**
-     * 购买的互市组名称
+     * 买家
      */
-    private String groupName;
+    private String buyUserName;
+
+    /**
+     * 购买用户类型(3=边民,2=组长)
+     */
+    private String buyUserType;
+
+    /**
+     * 商家ID
+     */
+    private Long enterpriseId;
+
+
+    /**
+     * 总重量
+     */
+    private Double totalWeight;
+
+
+    /**
+     * 交易时间
+     */
+    private Date tradeTime;
+
+    /**
+     * 交易状态(0=未支付,1=已支付)
+     */
+    private Integer tradeStatus;
+
+    /**
+     * 支付方式(0=金融互助,1=现金刷卡)
+     */
+    private Integer payType;
 
+    /**
+     * 结算时间
+     */
+    private String settleTime;
 
     /**
-     * 商户确认订单时间
+     * 当前结算金额
      */
-    private Date enterpriseConfirmTime;
+    private Double realPrice;
 
+    /**
+     * 应结金额
+     */
+    private Double shouldPrice;
+
+    /**
+     * 商品名称字符串
+     */
+    private String goodsNames;
+
+    /**
+     * 是否申报
+     */
+    private Integer apply;
+
+    /**
+     * 申报时间
+     */
+    private Date applyTime;
+
+    /**
+     * 申报结果
+     */
+    private String applyResult;
 
     /**
-     * 进境时间
+     *
      */
-    private Date entrantTime;
+    private String applyFailReason;
 
+    /**
+     * 一级市场边民确认状态(0=待确认,1=是)
+     */
+    private Integer peopleConfirmStatus;
+    /**
+     * 一级市场边民确认时间
+     */
+    private Date peopleConfirmTime;
 
     /**
-     * 进口时间
+     * 互助委托申报确认状态
      */
-    private Date importTime;
+    private String cooperEntrustStatus;
+    /**
+     * 互助委托申报确认时间
+     */
+    private String cooperEntrustTime;
 
+    /**
+     * 边民进口申报确认状态(0=待确认,1=是)
+     */
+    private Integer applyConfirmStatus;
+    /**
+     * 边民进口申报确认时间
+     */
+    private Date applyConfirmTime;
 
     /**
-     * 出互市区时间
+     *
      */
-    private Date outFrontierTradeTime;
+    private Long shopId;
 
+    /**
+     *
+     */
+    private String shopName;
 
+    /**
+     * 车牌号
+     */
+    private String veNo;
 
+    /**
+     * 车航次(班)号
+     */
+    private String voyageNo;
 }