Explorar o código

Merge remote-tracking branch 'origin/feature/asyncOrder' into feature/asyncOrder

Mechrevo hai 1 ano
pai
achega
ee0c1a47d0

+ 12 - 11
sp-core/sp-api/src/main/java/com/pj/api/dto/OrdersDto.java

@@ -68,9 +68,9 @@ public class OrdersDto implements Serializable {
     private Long carId;
 
     /**
-     * 车型名称
+     * 车牌号
      */
-    private String carType;
+    private String veNo;
 
     /**
      * 收货人名称
@@ -300,13 +300,6 @@ public class OrdersDto implements Serializable {
         this.carId = carId;
     }
 
-    public String getCarType() {
-        return carType;
-    }
-
-    public void setCarType(String carType) {
-        this.carType = carType;
-    }
 
     public String getConsigneeName() {
         return consigneeName;
@@ -516,7 +509,15 @@ public class OrdersDto implements Serializable {
         this.payTaxTime = payTaxTime;
     }
 
-    public OrdersDto(Long id, Long levelOneOrderId, String orderNo, Long goodsId, String goodsName, String goodsFrom, String shipperPhone, String shipperName, Long driverId, String driverName, String driverPhone, Long carId, String carType, String consigneeName, String consigneePhone, String declarationNumber, Integer orderFinish, String loadingAddress, String unloadingAddress, String comment, Date updateTime, Long updateBy, String updateName, Integer deleteStatus, Date createTime, Long createBy, String createName, Long tradeAreaId, String tradeAreaName, Long purchaserId, String purchaserName, Long leaderId, Long fkGoodsDemandId, Integer isDelivery, Double resalePrice, Integer isPay, Date payTime, Integer payTax, Date payTaxTime) {
+    public String getVeNo() {
+        return veNo;
+    }
+
+    public void setVeNo(String veNo) {
+        this.veNo = veNo;
+    }
+
+    public OrdersDto(Long id, Long levelOneOrderId, String orderNo, Long goodsId, String goodsName, String goodsFrom, String shipperPhone, String shipperName, Long driverId, String driverName, String driverPhone, Long carId, String veNo, String consigneeName, String consigneePhone, String declarationNumber, Integer orderFinish, String loadingAddress, String unloadingAddress, String comment, Date updateTime, Long updateBy, String updateName, Integer deleteStatus, Date createTime, Long createBy, String createName, Long tradeAreaId, String tradeAreaName, Long purchaserId, String purchaserName, Long leaderId, Long fkGoodsDemandId, Integer isDelivery, Double resalePrice, Integer isPay, Date payTime, Integer payTax, Date payTaxTime) {
         this.id = id;
         this.levelOneOrderId = levelOneOrderId;
         this.orderNo = orderNo;
@@ -529,7 +530,7 @@ public class OrdersDto implements Serializable {
         this.driverName = driverName;
         this.driverPhone = driverPhone;
         this.carId = carId;
-        this.carType = carType;
+        this.veNo = veNo;
         this.consigneeName = consigneeName;
         this.consigneePhone = consigneePhone;
         this.declarationNumber = declarationNumber;

+ 0 - 52
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/MethodEnterpriseService.java

@@ -53,58 +53,6 @@ public class MethodEnterpriseService {
     private TbEnterpriseMapper tbEnterpriseMapper;
 
     /**
-     * 方法抽取:将List<TbOrder> tbOrderList 转成 List<OrderVo> vo
-     * @param tbOrderList
-     * @return
-     */
-    public List<OrdersVo> orderListChangeVo(APPLoginUserInfo appLoginInfo,List<TbOrder> tbOrderList){
-        //判空
-        if(tbOrderList.size() == 0)return new ArrayList<>();
-        //创建返回值集合
-        List<OrdersVo> result = new ArrayList<>();
-        //循环遍历
-        tbOrderList.forEach(item -> {
-            //初始化Vo信息
-            Long orderId = null,groupId = null;
-            String goodsName = null,goodsImg = null,groupName = null,tradeNum = null;
-            Integer orderStatus = null;
-            Double price = null; Date orderTime = null;
-            //开始处理
-            //orderId
-            orderId = item.getId();
-            //groupId,groupName
-            Long fkId = appLoginInfo.getFk();
-            TbPeople tbPeople = tbPeopleMapper.selectById(fkId);
-            if(tbPeople != null && tbPeople.getId() != null){
-                groupId = tbPeople.getGroupId();
-                groupName = tbPeople.getGroupName();
-            }
-            //tradeNum
-            tradeNum = item.getTradeNo();
-            Long goodsId = item.getGoodsId();
-            TbGoodsTransit tbGoods = tbGoodsTransitMapper.selectById(goodsId);
-            if(tbGoods != null){
-                //goodsName,goodsImg
-                goodsName = tbGoods.getGoodsName();
-                goodsImg = tbGoods.getGoodsImg();
-            }
-            //price
-            price = item.getTotalPrice();
-            //orderTime
-            orderTime = item.getCreateTime();
-            //orderStatus
-            orderStatus = item.getFinishStatus();
-            //物流对象
-            TbLogisticsDto tbLogisticsDto = transportInterface.selectByOrderId(orderId);
-            //数据封装
-            result.add(new OrdersVo(orderId,tradeNum,orderTime,goodsName,goodsImg,price,groupId,groupName,orderStatus,tbLogisticsDto));
-        });
-
-        //返回前端
-        return result;
-    }
-
-    /**
      * 验证重复提交
      * @param loginUserFK 登录用户的ID
      */

+ 1 - 9
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseAppController.java

@@ -56,15 +56,7 @@ public class TbEnterpriseAppController {
         return AjaxJson.getSuccess("商家认证信息已提交,管理员审核中,请耐心等待!");
     }
 
-    /**
-     * 管理一级市场的贸易订单
-     */
-    @RequestMapping("manageLevelOneOrders")
-    public AjaxJson manageLevelOneOrders(@RequestParam(value = "keyword", required = false) String keyword) {
-        SoMap so = SoMap.getRequestSoMap();
-        List<OrdersVo> ordersVos = tbEnterpriseService.manageLevelOneOrders(so.startPage(), keyword);
-        return AjaxJson.getSuccessData(ordersVos);
-    }
+
 
     /*------            正常业务👆👆    rpc远程调用👇👇                         -----------*/
 

+ 0 - 25
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseService.java

@@ -172,31 +172,6 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
 
 
     /**
-     * 管理一级市场的贸易订单。
-     * 列表(主要展示字段:订单号、下单时间、商品名称、图片、价格、购买的边民组、订单状态、物流信息)、
-     * 确认退货/退款;
-     * 物流状态  SoMap soMap
-     */
-    public List<OrdersVo> manageLevelOneOrders(SoMap so, String keyword) {
-
-        //获取当前登录用户
-        APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
-        if (appLoginInfo == null || appLoginInfo.getLoginId() == null)
-            throw new RuntimeException("当前登陆用户信息已失效!");
-        Long fk = appLoginInfo.getFk();
-        //仅能查询自己的订单
-        so.put("buyUserId", fk);
-        so.put("deleteStatus", DeleteStatus.DELETE_STATUS_ON.getCode());
-        so.put("keyword", keyword);
-
-        List<TbOrder> tbOrders = tbOrderMapper.getList(so);
-        //执行数据封装
-        List<OrdersVo> ordersVos = methodEnterpriseService.orderListChangeVo(appLoginInfo, tbOrders);
-        return ordersVos;
-    }
-
-
-    /**
      * 导入
      *
      * @param file excel文件

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

@@ -64,16 +64,14 @@ public class MethodOrderService {
             case 5: // 一级市场商家
                 so.put("enterpriseId",fk);
                 break;
-            case 6: // 合作社
+            case 6: // 合作社(暂未加条件过滤,可看所有边民订单)
                 break;
             default:
                 throw new ServiceException("服务器繁忙~");
         }
         so.put("deleteStatus",DeleteStatus.DELETE_STATUS_ON.getCode());
-        so.put("sortType",44);
         List<TbOrder> tbOrderList = tbOrderMapper.getList(so);
         return tbOrderList;
-
     }
 
     /**

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

@@ -27,15 +27,6 @@ public class TbOrderAppController {
 	TbOrderService tbOrderService;
 
 
-	/** 增 */
-	@RequestMapping("appAdd")
-//	@SaCheckPermission(TbOrder.PERMISSION_CODE_ADD)
-	public AjaxJson add(TbOrder t){
-		tbOrderService.appAdd(t);
-		t = tbOrderService.getById(SP.publicMapper.getPrimarykey());
-		return AjaxJson.getSuccessData(t);
-	}
-
 	/** 删 - 根据id列表 */
 	@RequestMapping("deleteByIds")
 	public AjaxJson deleteByIds(){
@@ -67,19 +58,16 @@ public class TbOrderAppController {
 
 	/**
 	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
-	 * @param orderStatus  订单状态,非必填  不传查询所有 , 0=待确认,1=申报中,2=已完成,3=已取消
 	 * @return
 	 */
 	@RequestMapping("getList")
-	public AjaxJson getList(@RequestParam(value = "orderStatus",required = false) Integer orderStatus) {
+	public AjaxJson getList() {
 		SoMap so = SoMap.getRequestSoMap();
-		List<TbOrder> list = tbOrderService.getAPPList(so.startPage(),orderStatus);
+		List<TbOrder> list = tbOrderService.getAPPList(so.startPage());
 		if(list.size() == 0)return AjaxJson.getSuccess("暂无更多的订单消息!");
 		return AjaxJson.getPageData(so.getDataCount(), list);
 	}
 
-
-
 	/** 查 转售列表:边民查看已完结订单,包括已转售/未转售 */
 	@RequestMapping("getResaleOrders")
 	public AjaxJson getResaleOrders() {
@@ -87,7 +75,6 @@ public class TbOrderAppController {
 		return AjaxJson.getPageData(Long.valueOf(resaleOrders.size()), resaleOrders);
 	}
 
-
 	/**
 	 * 组长或者边民取消订单
 	 * @param orderId  一级市场订单ID
@@ -117,6 +104,7 @@ public class TbOrderAppController {
 	public AjaxJson orderDetail(Long orderId){
 		return AjaxJson.getSuccessData(tbOrderService.orderDetail(orderId));
 	}
+
 	/**
 	 * 根据ID获取订单详情
 	 * @param orderId
@@ -166,7 +154,6 @@ public class TbOrderAppController {
 		return b;
 	}
 
-
 	/** 改 转售状态:根据订单Id把订单改为已转售 */
 	@RequestMapping("rpc/updateResaleStatus")
 	public boolean updateResaleStatus(@RequestParam("id")Long orderId) {

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

@@ -71,52 +71,6 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 	@Autowired
 	private AdminInterface adminInterface;
 
-	/**  app端: 生成一级市场订单 */
-	void appAdd(TbOrder t){
-		//获取当前登陆人
-		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
-		if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
-			throw new RuntimeException("当前登录账号信息已失效!");
-		//判断当前是否已接单
-		LambdaQueryWrapper<TbOrder> queryWrapper = new LambdaQueryWrapper<>();
-		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-		queryWrapper.eq(TbOrder::getCreateTime,sdf.format(new Date()));
-		queryWrapper.eq(TbOrder::getDeleteStatus,DeleteStatus.DELETE_STATUS_ON.getCode());
-		List<TbOrder> tbOrderList = tbOrderMapper.selectList(queryWrapper);
-		if(tbOrderList.size() != 0)throw new ServiceException("你 " + tbOrderList.get(0).getCreateTime() + " 已完成下单,请勿继续操作!");
-
-
-		//判断基本状态
-		Integer enterpriseConfirm = t.getEnterpriseConfirm(); //一级市场商户确认(0=待确认,1=是,2=否)
-		String buyUserType = t.getBuyUserType(); //购买用户类型只能是2
-		Integer peopleConfirm = t.getPeopleConfirmStatus();//边民确认[0=待确认,1=全部确认,2=部分边民确认]
-		String pick = t.getPick(); //是否接单[0=待接单,1=已接单]
-
-		if(enterpriseConfirm != 1)throw new ServiceException("商户确认状态异常!");
-		if(!buyUserType.equals(UserType.USER_TYPE_GROUP_LEADER.getCode() + ""))throw new ServiceException("登录用户身份异常!");
-		if(peopleConfirm != 1)throw new ServiceException("边民确认状态异常");
-		if(!pick.equals("1"))throw new ServiceException("接单状态状态异常");
-
-		//设置购买的互市组信息
-		Long fk = appLoginInfo.getFk();
-		TbPeople tbPeople = tbPeopleMapper.selectById(fk);
-		if(tbPeople == null)throw new ServiceException("边民信息异常!");
-		t.setGroupId(tbPeople.getGroupId());
-
-		//设置基本属性
-		t.setApply(ApplyStatus.APPLY_STATUS_ZERO.getCode()); // 申报状态
-		t.setTradeStatus(TradeStatus.TRADE_STATUS_ZERO.getCode()); //支付状态
-		t.setPickTime(new Date()); // 接单时间
-		t.setSend(0); // 发货状态 默认 0=未发货
-		t.setFinishStatus(0); // 完成状态 默认 0=未完成
-		//设置公共属性
-		t.setCreateBy(appLoginInfo.getLoginId());
-		t.setCreateName(appLoginInfo.getLoginName());
-		t.setCreateTime(new Date());
-		t.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
-		save(t);
-	}
-
 	/** 删 */
 	void delete(Long id){
 		removeById(id);
@@ -184,35 +138,15 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 	/**
 	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
 	 * APP专用 与该订单相关的任何人员能看
-	 * @param orderStatus  订单状态,非必填  不传查询所有 , 0=待商家确认,1=申报中,2=已完成,3=已取消
 	 * @param so
 	 * @return
 	 */
-	List<TbOrder> getAPPList(SoMap so,Integer orderStatus) {
+	List<TbOrder> getAPPList(SoMap so) {
 		//获取登录用户,登录的用户也许边民,互市组组长,一级市场商家
 		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
-		if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
-			throw new RuntimeException("当前登录账号信息已失效!");
-		Integer userType = appLoginInfo.getUserType();
-		//匹配case
-		if(orderStatus != null){
-			switch (orderStatus){
-				case 0:
-					so.put("enterpriseConfirm",0);
-					break;
-				case 1:
-					so.put("apply",0);
-					break;
-				case 2:
-					so.put("finishStatus",1);
-					break;
-				case 3:
-					so.put("cancelPeople",1);
-					break;
-			}
-		}
+
 		//与订单相关的人能看
-		List<TbOrder> tbOrderList = methodOrderService.checkType(userType,appLoginInfo.getFk(),so);
+		List<TbOrder> tbOrderList = methodOrderService.checkType(appLoginInfo.getUserType(),appLoginInfo.getFk(),so);
  		return tbOrderList;
 	}
 

+ 172 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order_goods/TbOrderGoods.java

@@ -0,0 +1,172 @@
+package com.pj.tb_order_goods;
+
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: tb_order_goods -- 订单商品表
+ * @author lbl
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbOrderGoods.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbOrderGoods extends Model<TbOrderGoods> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id
+	 */
+	private static final long serialVersionUID = 1L;
+	/**
+	 * 此模块对应的表名
+	 */
+	public static final String TABLE_NAME = "tb_order_goods";
+	/**
+	 * 此模块对应的权限码
+	 */
+	public static final String PERMISSION_CODE = "tb-order-goods";
+	public static final String PERMISSION_CODE_ADD = "tb-order-goods-add";
+	public static final String PERMISSION_CODE_EDIT = "tb-order-goods-edit";
+	public static final String PERMISSION_CODE_DEL = "tb-order-goods-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键
+	 */
+	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
+	private Long id;
+	/**
+	 * 预申报编号
+	 */
+	private String platSeqNo;
+
+	/**
+	 * 边民备案号
+	 */
+	private String borderPutrecNo;
+
+	/**
+	 * 身份证号
+	 */
+	private String idno;
+
+	/**
+	 * 订单ID
+	 */
+	private Long orderId;
+
+	/**
+	 * 商品ID
+	 */
+	private Long goodsId;
+
+	/**
+	 * 商品编号
+	 */
+	private String goodsCode;
+
+	/**
+	 * 商品名称
+	 */
+	private String goodsName;
+
+	/**
+	 * 商品图片
+	 */
+	private String avatar;
+
+	/**
+	 * 购买金额
+	 */
+	private Double buyAmount;
+
+	/**
+	 * 净重
+	 */
+	private Double netWt;
+
+	/**
+	 * 毛重
+	 */
+	private Double grossWt;
+
+	/**
+	 * 购买数量
+	 */
+	private Double buyQty;
+
+	/**
+	 * 第一数量
+	 */
+	private Double buyQty1;
+
+	/**
+	 * 第二数量
+	 */
+	private Double buyQty2;
+
+	/**
+	 * 计价单位,如元、万等
+	 */
+	private String buyUnit;
+
+	/**
+	 * 数量单位,如kg、吨等
+	 */
+	private String numUnit;
+
+	/**
+	 * 创建人编号
+	 */
+	private String createBy;
+
+	/**
+	 * 创建人名称
+	 */
+	private String createName;
+
+	/**
+	 * 创建时间
+	 */
+	private String createTime;
+
+	/**
+	 * 更新人编号
+	 */
+	private String updateBy;
+
+	/**
+	 * 更新人名称
+	 */
+	private String updateName;
+
+	/**
+	 * 更新时间
+	 */
+	private String updateTime;
+
+	/**
+	 * 删除状态(0=禁用,1=启用)
+	 */
+	private String deleteStatus;
+
+
+
+
+
+
+
+
+}

+ 95 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order_goods/TbOrderGoodsController.java

@@ -0,0 +1,95 @@
+package com.pj.tb_order_goods;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: tb_order_goods -- 订单商品表
+ * @author lbl
+ */
+@RestController
+@RequestMapping("/TbOrderGoods/")
+public class TbOrderGoodsController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbOrderGoodsService tbOrderGoodsService;
+
+	/** 增 */
+	@RequestMapping("add")
+	@SaCheckPermission(TbOrderGoods.PERMISSION_CODE_ADD)
+	public AjaxJson add(TbOrderGoods t){
+		tbOrderGoodsService.add(t);
+		t = tbOrderGoodsService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */
+	@RequestMapping("delete")
+	@SaCheckPermission(TbOrderGoods.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 tbOrderGoodsService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 删 - 根据id列表 */
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbOrderGoods.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+		int line = SP.publicMapper.deleteByIds(TbOrderGoods.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+
+	/** 改 */
+	@RequestMapping("update")
+	@SaCheckPermission(TbOrderGoods.PERMISSION_CODE_EDIT)
+	public AjaxJson update(TbOrderGoods t){
+		tbOrderGoodsService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */
+	@RequestMapping("getById")
+		@SaCheckPermission(TbOrderGoods.PERMISSION_CODE)
+	public AjaxJson getById(String id){
+		TbOrderGoods t = tbOrderGoodsService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	@RequestMapping("getList")
+		@SaCheckPermission(TbOrderGoods.PERMISSION_CODE)
+	public AjaxJson getList() {
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbOrderGoods> list = tbOrderGoodsService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+
+
+
+	/** 改 - 删除状态(0=禁用,1=启用) */
+	@RequestMapping("updateDeleteStatus")
+	@SaCheckPermission(TbOrderGoods.PERMISSION_CODE_EDIT)
+	public AjaxJson updateDeleteStatus(String id, String value){
+		int line = SP.publicMapper.updateColumnById(TbOrderGoods.TABLE_NAME, "delete_status", value, id);
+		return AjaxJson.getByLine(line);
+	}
+
+
+
+
+
+
+
+}

+ 30 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order_goods/TbOrderGoodsMapper.java

@@ -0,0 +1,30 @@
+package com.pj.tb_order_goods;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: tb_order_goods -- 订单商品表
+ * @author lbl 
+ */
+
+@Mapper
+@Repository
+public interface TbOrderGoodsMapper extends BaseMapper <TbOrderGoods> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<TbOrderGoods> getList(SoMap so);
+
+
+}

+ 89 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order_goods/TbOrderGoodsMapper.xml

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pj.tb_order_goods.TbOrderGoodsMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, plat_seq_no, border_putrec_no, idno, order_id, goods_id, goods_code, goods_name, avatar, buy_amount, net_wt, gross_wt, buy_qty, buy_qty1, buy_qty2, buy_unit, num_unit, create_by, create_name, create_time, update_by, update_name, update_time, delete_status from tb_order_goods  -->
+
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.tb_order_goods.TbOrderGoods"></resultMap>
+
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select *
+		from tb_order_goods
+	</sql>
+
+
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("platSeqNo") '> and plat_seq_no = #{platSeqNo} </if>
+			<if test=' this.has("borderPutrecNo") '> and border_putrec_no = #{borderPutrecNo} </if>
+			<if test=' this.has("idno") '> and idno = #{idno} </if>
+			<if test=' this.has("orderId") '> and order_id = #{orderId} </if>
+			<if test=' this.has("goodsId") '> and goods_id = #{goodsId} </if>
+			<if test=' this.has("goodsCode") '> and goods_code = #{goodsCode} </if>
+			<if test=' this.has("goodsName") '> and goods_name = #{goodsName} </if>
+			<if test=' this.has("avatar") '> and avatar = #{avatar} </if>
+			<if test=' this.has("buyAmount") '> and buy_amount = #{buyAmount} </if>
+			<if test=' this.has("netWt") '> and net_wt = #{netWt} </if>
+			<if test=' this.has("grossWt") '> and gross_wt = #{grossWt} </if>
+			<if test=' this.has("buyQty") '> and buy_qty = #{buyQty} </if>
+			<if test=' this.has("buyQty1") '> and buy_qty1 = #{buyQty1} </if>
+			<if test=' this.has("buyQty2") '> and buy_qty2 = #{buyQty2} </if>
+			<if test=' this.has("buyUnit") '> and buy_unit = #{buyUnit} </if>
+			<if test=' this.has("numUnit") '> and num_unit = #{numUnit} </if>
+			<if test=' this.has("createBy") '> and create_by = #{createBy} </if>
+			<if test=' this.has("createName") '> and create_name = #{createName} </if>
+			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
+			<if test=' this.has("updateBy") '> and update_by = #{updateBy} </if>
+			<if test=' this.has("updateName") '> and update_name = #{updateName} </if>
+			<if test=' this.has("updateTime") '> and update_time = #{updateTime} </if>
+			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> plat_seq_no desc </when>
+			<when test='sortType == 3'> border_putrec_no desc </when>
+			<when test='sortType == 4'> idno desc </when>
+			<when test='sortType == 5'> order_id desc </when>
+			<when test='sortType == 6'> goods_id desc </when>
+			<when test='sortType == 7'> goods_code desc </when>
+			<when test='sortType == 8'> goods_name desc </when>
+			<when test='sortType == 9'> avatar desc </when>
+			<when test='sortType == 10'> buy_amount desc </when>
+			<when test='sortType == 11'> net_wt desc </when>
+			<when test='sortType == 12'> gross_wt desc </when>
+			<when test='sortType == 13'> buy_qty desc </when>
+			<when test='sortType == 14'> buy_qty1 desc </when>
+			<when test='sortType == 15'> buy_qty2 desc </when>
+			<when test='sortType == 16'> buy_unit desc </when>
+			<when test='sortType == 17'> num_unit desc </when>
+			<when test='sortType == 18'> create_by desc </when>
+			<when test='sortType == 19'> create_name desc </when>
+			<when test='sortType == 20'> create_time desc </when>
+			<when test='sortType == 21'> update_by desc </when>
+			<when test='sortType == 22'> update_name desc </when>
+			<when test='sortType == 23'> update_time desc </when>
+			<when test='sortType == 24'> delete_status desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+
+
+
+
+
+
+
+
+
+
+</mapper>

+ 51 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order_goods/TbOrderGoodsService.java

@@ -0,0 +1,51 @@
+package com.pj.tb_order_goods;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+import com.pj.utils.sg.*;
+
+/**
+ * Service: tb_order_goods -- 订单商品表
+ * @author lbl 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class TbOrderGoodsService extends ServiceImpl<TbOrderGoodsMapper, TbOrderGoods> implements IService<TbOrderGoods>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbOrderGoodsMapper tbOrderGoodsMapper;
+
+	/** 增 */
+	void add(TbOrderGoods t){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(TbOrderGoods t){
+		updateById(t);
+
+	}
+
+	/** 查 */
+	TbOrderGoods getById(String id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<TbOrderGoods> getList(SoMap so) { 
+		return tbOrderGoodsMapper.getList(so);	
+	}
+	
+
+}

+ 2 - 2
sp-service/level-two-server/src/main/java/com/pj/tb_orders/TbOrders.java

@@ -103,9 +103,9 @@ public class TbOrders extends Model<TbOrders> implements Serializable {
 	private Long carId;
 
 	/**
-	 * 车型名称
+	 * 车牌号
 	 */
-	private String carType;
+	private String veNo;
 
 	/**
 	 * 收货人名称

+ 2 - 2
sp-service/level-two-server/src/main/java/com/pj/tb_orders/TbOrdersDto.java

@@ -108,9 +108,9 @@ public class TbOrdersDto {
 	private Long carId;
 
 	/**
-	 * 车型名称
+	 * 车牌号
 	 */
-	private String carType;
+	private String veNo;
 
 	/**
 	 * 收货人名称

+ 2 - 1
sp-service/level-two-server/src/main/java/com/pj/tb_orders/TbOrdersMapper.xml

@@ -35,7 +35,7 @@
 			<if test=' this.has("driverName") '> and driver_name = #{driverName} </if>
 			<if test=' this.has("driverPhone") '> and driver_phone = #{driverPhone} </if>
 			<if test=' this.has("carId") '> and car_id = #{carId} </if>
-			<if test=' this.has("carType") '> and car_type = #{carType} </if>
+			<if test=' this.has("veNo") '> and ve_no = #{veNo} </if>
 			<if test=' this.has("consigneeName") '> and consignee_name = #{consigneeName} </if>
 			<if test=' this.has("consigneePhone") '> and consignee_phone = #{consigneePhone} </if>
 			<if test=' this.has("declarationNumber") '> and declaration_number = #{declarationNumber} </if>
@@ -93,6 +93,7 @@
 
 	<select id="getLevelTwoList" resultMap="model">
 		select * from tb_orders where purchaser_id is null and (purchaser_name is null or purchaser_name='')
+		<if test=' this.has("goodsName") '>and goods_name like concat('%', #{goodsName}, '%') or ve_no like concat('%', #{goodsName}, '%')</if>
 	</select>