Переглянути джерело

一级市场删除一些不用的方法;二级市场订单表加车牌号

linbl 1 рік тому
батько
коміт
5fd8bb1eeb

+ 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;
 	}
 

+ 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;
 
 	/**
 	 * 收货人名称

+ 1 - 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>