瀏覽代碼

8.2 一级市场订单相关

Mechrevo 2 年之前
父節點
當前提交
42cbe2f0d3

+ 1 - 1
sp-core/sp-base/src/main/java/com/pj/current/dto/APPLoginUserInfo.java

@@ -11,6 +11,6 @@ import java.util.List;
 public class APPLoginUserInfo implements Serializable {
     private Long loginId;
     private String loginName;
-    private String fk;
+    private Long fk;
     private String userType;
 }

+ 22 - 0
sp-core/sp-base/src/main/java/com/pj/enummj/JudgeStatus.java

@@ -0,0 +1,22 @@
+package com.pj.enummj;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 08 02 11 18
+ **/
+@Getter
+@AllArgsConstructor
+public enum JudgeStatus {
+
+    JUDGE_STATUS_ZERO(0,"待审核"),
+    JUDGE_STATUS_ONE(1,"审核通过"),
+    JUDGE_STATUS_THREE(2,"审核不通过");
+
+    private Integer code;
+
+    private String msg;
+
+}

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

@@ -1,9 +1,12 @@
 package com.pj.tb_enterprise;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.pj.api.client.admin.AdminInterface;
 import com.pj.api.client.transport.TransportInterface;
 import com.pj.api.dto.AppUserDto;
 import com.pj.api.dto.TbLogisticsDto;
+import com.pj.common.core.exception.ServiceException;
+import com.pj.enummj.DeleteStatus;
 import com.pj.tb_enterprise.vo.OrdersVo;
 import com.pj.tb_goods.TbGoods;
 import com.pj.tb_goods.TbGoodsMapper;
@@ -45,6 +48,8 @@ public class MethodEnterpriseService {
     private TransportInterface transportInterface;
     @Autowired
     private TbGoodsTransitMapper tbGoodsTransitMapper;
+    @Autowired
+    private TbEnterpriseMapper tbEnterpriseMapper;
 
     /**
      * 方法抽取:将List<TbOrder> tbOrderList 转成 List<OrderVo> vo
@@ -90,7 +95,7 @@ public class MethodEnterpriseService {
             //orderTime
             orderTime = item.getCreateTime();
             //orderStatus
-            orderStatus = item.getConfirm();
+            orderStatus = item.getFinishStatus();
             //物流对象
             TbLogisticsDto tbLogisticsDto = transportInterface.selectByOrderId(orderId);
             //数据封装
@@ -101,6 +106,26 @@ public class MethodEnterpriseService {
         return result;
     }
 
+    /**
+     * 验证重复提交
+     * @param loginUserFK 登录用户的ID
+     */
+    void againApply(Long loginUserFK){
+        List<TbEnterprise> enterpriseList = tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getId, loginUserFK).eq(TbEnterprise::getDeleteStatus, DeleteStatus.DELETE_STATUS_ON.getCode()));
+        if(enterpriseList.size() > 0){
+            switch (enterpriseList.get(0).getJudgeStatus()){
+                case 0:
+                    throw new RuntimeException("当前账号待审核!");
+                case 1:
+                    throw new RuntimeException("当前账号已审核通过!");
+                case 2:
+                    throw new RuntimeException("当前账号审核不通过!原因是: " + enterpriseList.get(0).getJudgeContent() + " 审核时间: " + enterpriseList.get(0).getJudgeTime());
+                default:
+                    throw new ServiceException("服务器繁忙~");
+            }
+        }
+
+    }
 
     /**
      * 方法抽取  导入

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

@@ -1,9 +1,11 @@
 package com.pj.tb_enterprise;
 
+import com.pj.tb_enterprise.param.EnterpriseParam;
 import com.pj.tb_enterprise.vo.OrdersVo;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
@@ -39,8 +41,8 @@ public class TbEnterpriseAppController {
 
 	/** 商家认证 */
 	@RequestMapping("identification")
-	public AjaxJson identification(TbEnterprise t){
-		boolean identification = tbEnterpriseService.identification(t);
+	public AjaxJson identification(@Validated @RequestBody EnterpriseParam enterpriseParam){
+		boolean identification = tbEnterpriseService.identification(enterpriseParam);
 		if(!identification) return AjaxJson.getError("商家认证信息提交失败!!!");
 
 		return AjaxJson.getSuccess("商家认证信息已提交,管理员审核中,请耐心等待!");

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

@@ -84,11 +84,18 @@ public class TbEnterpriseController {
 		return AjaxJson.getSuccessData(t);
 	}
 
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	/** 查集合
+	 *  - 根据条件(参数为空时代表忽略指定条件)查看审核状态列表
+	 * @param judgeStatus 0=待审核 1=审核通过 2=审核不通过
+	 * @param keyword 模糊查询关键字,非必填,后期可进行聚合模糊查询
+	 * @return
+	 */
 	@RequestMapping("getList")
 		@SaCheckPermission(TbEnterprise.PERMISSION_CODE)
-	public AjaxJson getList() { 
+	public AjaxJson getList(Integer judgeStatus,@RequestParam(value = "keyword",required = false)String keyword) {
 		SoMap so = SoMap.getRequestSoMap();
+		so.set("judge_status",judgeStatus);
+		so.set("keyword",keyword);
 		List<TbEnterprise> list = tbEnterpriseService.getList(so.startPage());
 		return AjaxJson.getPageData(so.getDataCount(), list);
 	}

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

@@ -1,13 +1,10 @@
 package com.pj.tb_enterprise;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.fasterxml.jackson.annotation.JsonFormat;
+
 import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-import java.util.Date;
 
 @Data
 @AllArgsConstructor

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

@@ -14,11 +14,14 @@ import com.alibaba.excel.event.AnalysisEventListener;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.pj.api.client.admin.AdminInterface;
 import com.pj.api.dto.EnterpriseDto;
+import com.pj.common.core.exception.ServiceException;
 import com.pj.current.dto.APPLoginUserInfo;
 import com.pj.current.satoken.StpAPPUserUtil;
 import com.pj.current.satoken.StpUserUtil;
 import com.pj.enummj.DeleteStatus;
+import com.pj.enummj.JudgeStatus;
 import com.pj.enummj.People;
+import com.pj.tb_enterprise.param.EnterpriseParam;
 import com.pj.tb_enterprise.vo.OrdersVo;
 import com.pj.tb_order.TbOrder;
 import com.pj.tb_order.TbOrderMapper;
@@ -128,34 +131,59 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
 		return line;
 	}
 
-	/** 商家认证 */
-	boolean identification(TbEnterprise enterprise){
-		if(null == enterprise) return false;
+	/**
+	 * 商家认证
+	 * @param enterpriseParam
+	 * @return
+	 */
+	boolean identification(EnterpriseParam enterpriseParam){
 
 		//手机号去重
-		String idCard = enterprise.getIdCard();
-		if(tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getIdCard,idCard).eq(TbEnterprise::getDeleteStatus,1)).size() != 0)
+		String linkPhone = enterpriseParam.getLinkPhone();
+		if(tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getIdCard,linkPhone).eq(TbEnterprise::getDeleteStatus,DeleteStatus.DELETE_STATUS_ON.getCode())).size() != 0)
 			throw new RuntimeException("当前手机号已被认证!");
 		//身份证号去重
-		String contact = enterprise.getContact();
-		if(tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getContact,contact).eq(TbEnterprise::getDeleteStatus,1)).size() != 0)
+		String contact = enterpriseParam.getCorporateIdCard();
+		if(tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getContact,contact).eq(TbEnterprise::getDeleteStatus,DeleteStatus.DELETE_STATUS_ON.getCode())).size() != 0)
 			throw new RuntimeException("当前身份证号已被认证!");
-
-		//是否需要手机发送验证码认证?
+		//判断是否重复提交
+		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
+		if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
+			throw new RuntimeException("当前登录账号信息已失效!");
+		//重复提交验证
+		methodEnterpriseService.againApply(appLoginInfo.getFk());
+		//todo:是否需要手机发送验证码认证?
 
 		//开始保存商家信息
+		TbEnterprise tbEnterprise = new TbEnterprise();
+		//保存基本信息
+		tbEnterprise.setName(enterpriseParam.getName());
+		tbEnterprise.setNationality("China");
+		tbEnterprise.setLegalPerson(enterpriseParam.getCorporateName());
+		tbEnterprise.setIdCard(enterpriseParam.getCorporateIdCard());
+		tbEnterprise.setContact(enterpriseParam.getLinkPhone());
+		tbEnterprise.setBusinessLicense(enterpriseParam.getBusinessLicense());
+		tbEnterprise.setBankName(enterpriseParam.getBankName());
+		tbEnterprise.setBankAccount(enterpriseParam.getBankAccount());
+		tbEnterprise.setBankNo(enterpriseParam.getBankNo());
+		tbEnterprise.setDutyParagraph(enterpriseParam.getDutyParagraph());
+		//默认待审核
+		tbEnterprise.setJudgeStatus(JudgeStatus.JUDGE_STATUS_ZERO.getCode());
+
 		//注册/认证时间
-		enterprise.setRegisterTime(new Date());
+		tbEnterprise.setRegisterTime(new Date());
 		//创建时间
-		enterprise.setCreateTime(new Date());
+		tbEnterprise.setCreateTime(new Date());
 		//删除状态:启用
-		enterprise.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
+		tbEnterprise.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
 
 		// 保存商家信息
-		int insert = tbEnterpriseMapper.insert(enterprise);
+		int insert = tbEnterpriseMapper.insert(tbEnterprise);
 		return insert == 1;
 	}
 
+
+
 	/** 管理一级市场的贸易订单。
 	 * 列表(主要展示字段:订单号、下单时间、商品名称、图片、价格、购买的边民组、订单状态、物流信息)、
 	 * 确认退货/退款;

+ 51 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/param/EnterpriseParam.java

@@ -0,0 +1,51 @@
+package com.pj.tb_enterprise.param;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * 商户认证入参
+ * @Author Mechrevo
+ * @Date 2023 08 02 10 56
+ **/
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class EnterpriseParam {
+
+    @NotNull(message = "登录人ID")
+    private Long loginUserId;
+
+    @NotNull(message = "公司名称")
+    private String name;
+
+    @NotNull(message = "税号")
+    private String dutyParagraph;
+
+    @NotNull(message = "法人姓名")
+    private String corporateName;
+
+    @NotNull(message = "法人身份证")
+    private String corporateIdCard;
+
+    @NotNull(message = "联系号码")
+    private String linkPhone;
+
+    @NotNull(message = "银行编号")
+    private String bankNo;
+
+    @NotNull(message = "开户银行")
+    private String bankName;
+
+    @NotNull(message = "银行账号")
+    private String bankAccount;
+
+    @NotNull(message = "营业执照")
+    private String businessLicense;
+
+
+
+}

+ 10 - 1
sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/MethodGoodsTransitService.java

@@ -1,9 +1,11 @@
 package com.pj.tb_goods_transit;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.pj.current.dto.APPLoginUserInfo;
 import com.pj.enummj.*;
 import com.pj.tb_goods_transit.retry.SmsRetryService;
 import com.pj.tb_order.TbOrder;
+import com.pj.tb_order.TbOrderMapper;
 import com.pj.tb_people.TbPeople;
 import org.apache.poi.hssf.usermodel.HSSFCell;
 import org.apache.poi.hssf.usermodel.HSSFRow;
@@ -36,6 +38,8 @@ public class MethodGoodsTransitService {
     /** 短信运营商 */
     @Autowired
     private SmsRetryService smsRetryService;
+    @Autowired
+    private TbOrderMapper tbOrderMapper;
     //todo:
 
 
@@ -119,7 +123,8 @@ public class MethodGoodsTransitService {
         tbOrder.setShopName(tbGoodsTransit.getShopName());
         //设置下单时的默认状态
         tbOrder.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode()); // 删除状态默认是1,可用
-        tbOrder.setConfirm(EnterpriseConfirm.ENTERPRISE_CONFIRM_ZERO.getCode()); // 0为待商家确认
+        tbOrder.setEnterpriseConfirm(EnterpriseConfirm.ENTERPRISE_CONFIRM_ZERO.getCode()); // 0为待商家确认
+        tbOrder.setPeopleConfirm(EnterpriseConfirm.ENTERPRISE_CONFIRM_ZERO.getCode()); // 0为待边民确认
         tbOrder.setSend(DeliverStatus.DELIVER_STATUS_ZERO.getCode());  // 0为未发货 1为已发货
         tbOrder.setTradeStatus(TradeStatus.TRADE_STATUS_ZERO.getCode().toString()); //支付状态默认是0,未支付
         tbOrder.setResaleStatus(ResaleStatus.RESALE_STATUS_ZERO.getCode()); // 是否转售状态,默认未转售 0
@@ -128,6 +133,10 @@ public class MethodGoodsTransitService {
         tbOrder.setCreateBy(appLoginInfo.getLoginId());
         tbOrder.setCreateName(appLoginInfo.getLoginName());
         tbOrder.setCreateTime(new Date());
+        //		//查询是否已存在该订单
+        List<TbOrder> tbOrderList = tbOrderMapper.selectList(new LambdaQueryWrapper<TbOrder>().eq(TbOrder::getGoodsId, tbGoodsTransit.getId()).eq(TbOrder::getDeleteStatus,DeleteStatus.DELETE_STATUS_ON.getCode()));
+        if(tbOrderList.size() != 0)throw new RuntimeException("当前商品已存在订单,暂时无法继续下单!");
+
         return tbOrder;
     }
 

+ 5 - 4
sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/TbGoodsTransitService.java

@@ -246,15 +246,13 @@ public class TbGoodsTransitService extends ServiceImpl<TbGoodsTransitMapper, TbG
 		//执行采购,创建一级市场订单表 , 该方法只是设置tbOrder的属性
 		TbOrder tbOrder = methodGoodsTransitService.setTbOrderProperties(tbGoodsTransit, appLoginInfo);
 
-//		//查询是否已存在该订单
-		List<TbOrder> tbOrderList = tbOrderMapper.selectList(new LambdaQueryWrapper<TbOrder>().eq(TbOrder::getGoodsId, tbGoodsTransit.getId()).eq(TbOrder::getDeleteStatus,DeleteStatus.DELETE_STATUS_ON.getCode()));
-		if(tbOrderList.size() != 0)throw new RuntimeException("当前商品已存在订单,暂时无法继续下单!");
 
 		//执行保存 创建订单
 		int insert = tbOrderMapper.insert(tbOrder);
 		if(insert == 1){
 			// todo: 执行订单完成后的逻辑
 			// todo: 发送短信给边民组通知其确认
+
 			//获取互市组ID
 			Long groupId = list.get(0).getId();
 			if(groupId == null)throw new RuntimeException("订单异常,原因是没有关联的边民!");
@@ -267,7 +265,10 @@ public class TbGoodsTransitService extends ServiceImpl<TbGoodsTransitMapper, TbG
 
 			if(tbPeopleList.size() == 0)throw new RuntimeException("订单异常,原因是没有关联的边民!!!");
 			int sendSmsCounts = methodGoodsTransitService.sendSms(tbPeopleList);
-			if(sendSmsCounts != tbPeopleList.size()){
+			//边民全部确认,修改边民确认状态
+			if(sendSmsCounts == tbPeopleList.size()){
+//				tbOrder
+			}else {
 				//todo: 如果短信发送成功次数 与 边民数不一致处理
 
 			}

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

@@ -228,9 +228,13 @@ public class TbOrder extends Model<TbOrder> implements Serializable {
 	private String distribution;
 
 	/**
-	 * 是否确认(0=否,1=是)
+	 * 一级市场边民确认(0=待确认,1=是,2=否)[j]
 	 */
-	private Integer confirm;
+	private Integer peopleConfirm;
+	/**
+	 * 一级市场商户确认(0=待确认,1=是,2=否)[j]
+	 */
+	private Integer enterpriseConfirm;
 
 	/**
 	 * 是否接单

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

@@ -34,7 +34,7 @@ public class TbOrderAppController {
 //		@SaCheckPermission(TbOrder.PERMISSION_CODE)
 	public AjaxJson getList() {
 		SoMap so = SoMap.getRequestSoMap();
-		List<TbOrder> list = tbOrderService.getList(so.startPage());
+		List<TbOrder> list = tbOrderService.getAPPList(so.startPage());
 		return AjaxJson.getPageData(so.getDataCount(), list);
 	}
 

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

@@ -11,14 +11,14 @@
 	<!-- 通用映射:自动模式 -->
 	<resultMap id="model" autoMapping="true" type="com.pj.tb_order.TbOrder"></resultMap>
 
-
+<!-- id,trade_area_id,trade_no,trade_area_name,buy_user_name,buy_user_type,enterprise_name,total_weight,total_price,
+			   trade_time, trade_status, real_price,pay_type,should_price,goods_names,apply,confirm,pick,pick_time,
+			   send,send_time,level_two_order_id,goods_id,buy_user_id -->
 
 
 	<!-- 公共查询sql片段 -->
 	<sql id="select_sql">
-		select id,trade_area_id,trade_no,trade_area_name,buy_user_name,buy_user_type,enterprise_name,total_weight,total_price,
-			   trade_time, trade_status, real_price,pay_type,should_price,goods_names,apply,confirm,pick,pick_time,
-			   send,send_time,level_two_order_id,goods_id,buy_user_id
+		select *
 		from tb_order 
 	</sql>
 
@@ -26,111 +26,111 @@
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [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("tradeAreaId") '> and trade_area_id = #{tradeAreaId} </if>-->
-<!--			<if test=' this.has("tradeAreaName") '> and trade_area_name = #{tradeAreaName} </if>-->
-<!--			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>-->
-<!--			<if test=' this.has("saleMainId") '> and sale_main_id = #{saleMainId} </if>-->
-<!--			<if test=' this.has("tradeNo") '> and trade_no = #{tradeNo} </if>-->
-<!--			<if test=' this.has("buyUserId") '> and buy_user_id = #{buyUserId} </if>-->
-<!--			<if test=' this.has("buyUserName") '> and buy_user_name = #{buyUserName} </if>-->
-<!--			<if test=' this.has("buyUserType") '> and buy_user_type = #{buyUserType} </if>-->
-<!--			<if test=' this.has("enterpriseId") '> and enterprise_id = #{enterpriseId} </if>-->
-<!--			<if test=' this.has("enterpriseName") '> and enterprise_name = #{enterpriseName} </if>-->
-<!--			<if test=' this.has("totalWeight") '> and total_weight = #{totalWeight} </if>-->
-<!--			<if test=' this.has("totalPrice") '> and total_price = #{totalPrice} </if>-->
-<!--			<if test=' this.has("tradeStatus") '> and trade_status = #{tradeStatus} </if>-->
-<!--			<if test=' this.has("payType") '> and pay_type = #{payType} </if>-->
-<!--			<if test=' this.has("settleTime") '> and settle_time = #{settleTime} </if>-->
-<!--			<if test=' this.has("realPrice") '> and real_price = #{realPrice} </if>-->
-<!--			<if test=' this.has("shouldPrice") '> and should_price = #{shouldPrice} </if>-->
-<!--			<if test=' this.has("settleUserId") '> and settle_user_id = #{settleUserId} </if>-->
-<!--			<if test=' this.has("recordUserId") '> and record_user_id = #{recordUserId} </if>-->
-<!--			<if test=' this.has("recordTime") '> and record_time = #{recordTime} </if>-->
-<!--			<if test=' this.has("record") '> and record = #{record} </if>-->
-<!--			<if test=' this.has("refundReason") '> and refund_reason = #{refundReason} </if>-->
-<!--			<if test=' this.has("refundTime") '> and refund_time = #{refundTime} </if>-->
-<!--			<if test=' this.has("receiveName") '> and receive_name = #{receiveName} </if>-->
-<!--			<if test=' this.has("receivePhone") '> and receive_phone = #{receivePhone} </if>-->
-<!--			<if test=' this.has("receiveAddress") '> and receive_address = #{receiveAddress} </if>-->
-<!--			<if test=' this.has("outTime") '> and out_time = #{outTime} </if>-->
-<!--			<if test=' this.has("goodsNames") '> and goods_names = #{goodsNames} </if>-->
-<!--			<if test=' this.has("apply") '> and apply = #{apply} </if>-->
-<!--			<if test=' this.has("applyTime") '> and apply_time = #{applyTime} </if>-->
-<!--			<if test=' this.has("applyResult") '> and apply_result = #{applyResult} </if>-->
-<!--			<if test=' this.has("applyFailReason") '> and apply_fail_reason = #{applyFailReason} </if>-->
-<!--			<if test=' this.has("distribution") '> and distribution = #{distribution} </if>-->
-<!--			<if test=' this.has("confirm") '> and confirm = #{confirm} </if>-->
-<!--			<if test=' this.has("pick") '> and pick = #{pick} </if>-->
-<!--			<if test=' this.has("pickTime") '> and pick_time = #{pickTime} </if>-->
-<!--			<if test=' this.has("shopId") '> and shop_id = #{shopId} </if>-->
-<!--			<if test=' this.has("shopName") '> and shop_name = #{shopName} </if>-->
-<!--			<if test=' this.has("send") '> and send = #{send} </if>-->
-<!--			<if test=' this.has("sendTime") '> and send_time = #{sendTime} </if>-->
-<!--			<if test=' this.has("levelTwoOrderId") '> and level_two_order_id = #{levelTwoOrderId} </if>-->
-<!--			<if test=' this.has("createTime") '> and create_time = #{createTime} </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("updateTime") '> and update_time = #{updateTime} </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("deleteStatus") '> and delete_status = #{deleteStatus} </if>-->
-<!--		</where>-->
-<!--		order by-->
-<!--		<choose>-->
-<!--			<when test='sortType == 1'> id desc </when>-->
-<!--			<when test='sortType == 2'> trade_area_id desc </when>-->
-<!--			<when test='sortType == 3'> trade_area_name desc </when>-->
-<!--			<when test='sortType == 4'> address_ids desc </when>-->
-<!--			<when test='sortType == 5'> sale_main_id desc </when>-->
-<!--			<when test='sortType == 6'> trade_no desc </when>-->
-<!--			<when test='sortType == 7'> buy_user_id desc </when>-->
-<!--			<when test='sortType == 8'> buy_user_name desc </when>-->
-<!--			<when test='sortType == 9'> buy_user_type desc </when>-->
-<!--			<when test='sortType == 10'> enterprise_id desc </when>-->
-<!--			<when test='sortType == 11'> enterprise_name desc </when>-->
-<!--			<when test='sortType == 12'> total_weight desc </when>-->
-<!--			<when test='sortType == 13'> total_price desc </when>-->
-<!--			<when test='sortType == 14'> trade_time desc </when>-->
-<!--			<when test='sortType == 15'> trade_status desc </when>-->
-<!--			<when test='sortType == 16'> pay_type desc </when>-->
-<!--			<when test='sortType == 17'> settle_time desc </when>-->
-<!--			<when test='sortType == 18'> real_price desc </when>-->
-<!--			<when test='sortType == 19'> should_price desc </when>-->
-<!--			<when test='sortType == 20'> settle_user_id desc </when>-->
-<!--			<when test='sortType == 21'> record_user_id desc </when>-->
-<!--			<when test='sortType == 22'> record_time desc </when>-->
-<!--			<when test='sortType == 23'> record desc </when>-->
-<!--			<when test='sortType == 24'> refund_reason desc </when>-->
-<!--			<when test='sortType == 25'> refund_time desc </when>-->
-<!--			<when test='sortType == 26'> receive_name desc </when>-->
-<!--			<when test='sortType == 27'> receive_phone desc </when>-->
-<!--			<when test='sortType == 28'> receive_address desc </when>-->
-<!--			<when test='sortType == 29'> out_time desc </when>-->
-<!--			<when test='sortType == 30'> goods_names desc </when>-->
-<!--			<when test='sortType == 31'> apply desc </when>-->
-<!--			<when test='sortType == 32'> apply_time desc </when>-->
-<!--			<when test='sortType == 33'> apply_result desc </when>-->
-<!--			<when test='sortType == 34'> apply_fail_reason desc </when>-->
-<!--			<when test='sortType == 35'> distribution desc </when>-->
-<!--			<when test='sortType == 36'> confirm desc </when>-->
-<!--			<when test='sortType == 37'> pick desc </when>-->
-<!--			<when test='sortType == 38'> pick_time desc </when>-->
-<!--			<when test='sortType == 39'> shop_id desc </when>-->
-<!--			<when test='sortType == 40'> shop_name desc </when>-->
-<!--			<when test='sortType == 41'> send desc </when>-->
-<!--			<when test='sortType == 42'> send_time desc </when>-->
-<!--			<when test='sortType == 43'> level_two_order_id desc </when>-->
-<!--			<when test='sortType == 44'> create_time desc </when>-->
-<!--			<when test='sortType == 45'> create_by desc </when>-->
-<!--			<when test='sortType == 46'> create_name desc </when>-->
-<!--			<when test='sortType == 47'> update_time desc </when>-->
-<!--			<when test='sortType == 48'> update_by desc </when>-->
-<!--			<when test='sortType == 49'> update_name desc </when>-->
-<!--			<when test='sortType == 50'> delete_status desc </when>-->
-<!--			<otherwise> id desc </otherwise>-->
-<!--		</choose>-->
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("tradeAreaId") '> and trade_area_id = #{tradeAreaId} </if>
+			<if test=' this.has("tradeAreaName") '> and trade_area_name = #{tradeAreaName} </if>
+			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>
+			<if test=' this.has("saleMainId") '> and sale_main_id = #{saleMainId} </if>
+			<if test=' this.has("tradeNo") '> and trade_no = #{tradeNo} </if>
+			<if test=' this.has("buyUserId") '> and buy_user_id = #{buyUserId} </if>
+			<if test=' this.has("buyUserName") '> and buy_user_name = #{buyUserName} </if>
+			<if test=' this.has("buyUserType") '> and buy_user_type = #{buyUserType} </if>
+			<if test=' this.has("enterpriseId") '> and enterprise_id = #{enterpriseId} </if>
+			<if test=' this.has("enterpriseName") '> and enterprise_name = #{enterpriseName} </if>
+			<if test=' this.has("totalWeight") '> and total_weight = #{totalWeight} </if>
+			<if test=' this.has("totalPrice") '> and total_price = #{totalPrice} </if>
+			<if test=' this.has("tradeStatus") '> and trade_status = #{tradeStatus} </if>
+			<if test=' this.has("payType") '> and pay_type = #{payType} </if>
+			<if test=' this.has("settleTime") '> and settle_time = #{settleTime} </if>
+			<if test=' this.has("realPrice") '> and real_price = #{realPrice} </if>
+			<if test=' this.has("shouldPrice") '> and should_price = #{shouldPrice} </if>
+			<if test=' this.has("settleUserId") '> and settle_user_id = #{settleUserId} </if>
+			<if test=' this.has("recordUserId") '> and record_user_id = #{recordUserId} </if>
+			<if test=' this.has("recordTime") '> and record_time = #{recordTime} </if>
+			<if test=' this.has("record") '> and record = #{record} </if>
+			<if test=' this.has("refundReason") '> and refund_reason = #{refundReason} </if>
+			<if test=' this.has("refundTime") '> and refund_time = #{refundTime} </if>
+			<if test=' this.has("receiveName") '> and receive_name = #{receiveName} </if>
+			<if test=' this.has("receivePhone") '> and receive_phone = #{receivePhone} </if>
+			<if test=' this.has("receiveAddress") '> and receive_address = #{receiveAddress} </if>
+			<if test=' this.has("outTime") '> and out_time = #{outTime} </if>
+			<if test=' this.has("goodsNames") '> and goods_names = #{goodsNames} </if>
+			<if test=' this.has("apply") '> and apply = #{apply} </if>
+			<if test=' this.has("applyTime") '> and apply_time = #{applyTime} </if>
+			<if test=' this.has("applyResult") '> and apply_result = #{applyResult} </if>
+			<if test=' this.has("applyFailReason") '> and apply_fail_reason = #{applyFailReason} </if>
+			<if test=' this.has("distribution") '> and distribution = #{distribution} </if>
+			<if test=' this.has("confirm") '> and confirm = #{confirm} </if>
+			<if test=' this.has("pick") '> and pick = #{pick} </if>
+			<if test=' this.has("pickTime") '> and pick_time = #{pickTime} </if>
+			<if test=' this.has("shopId") '> and shop_id = #{shopId} </if>
+			<if test=' this.has("shopName") '> and shop_name = #{shopName} </if>
+			<if test=' this.has("send") '> and send = #{send} </if>
+			<if test=' this.has("sendTime") '> and send_time = #{sendTime} </if>
+			<if test=' this.has("levelTwoOrderId") '> and level_two_order_id = #{levelTwoOrderId} </if>
+			<if test=' this.has("createTime") '> and create_time = #{createTime} </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("updateTime") '> and update_time = #{updateTime} </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("deleteStatus") '> and delete_status = #{deleteStatus} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> trade_area_id desc </when>
+			<when test='sortType == 3'> trade_area_name desc </when>
+			<when test='sortType == 4'> address_ids desc </when>
+			<when test='sortType == 5'> sale_main_id desc </when>
+			<when test='sortType == 6'> trade_no desc </when>
+			<when test='sortType == 7'> buy_user_id desc </when>
+			<when test='sortType == 8'> buy_user_name desc </when>
+			<when test='sortType == 9'> buy_user_type desc </when>
+			<when test='sortType == 10'> enterprise_id desc </when>
+			<when test='sortType == 11'> enterprise_name desc </when>
+			<when test='sortType == 12'> total_weight desc </when>
+			<when test='sortType == 13'> total_price desc </when>
+			<when test='sortType == 14'> trade_time desc </when>
+			<when test='sortType == 15'> trade_status desc </when>
+			<when test='sortType == 16'> pay_type desc </when>
+			<when test='sortType == 17'> settle_time desc </when>
+			<when test='sortType == 18'> real_price desc </when>
+			<when test='sortType == 19'> should_price desc </when>
+			<when test='sortType == 20'> settle_user_id desc </when>
+			<when test='sortType == 21'> record_user_id desc </when>
+			<when test='sortType == 22'> record_time desc </when>
+			<when test='sortType == 23'> record desc </when>
+			<when test='sortType == 24'> refund_reason desc </when>
+			<when test='sortType == 25'> refund_time desc </when>
+			<when test='sortType == 26'> receive_name desc </when>
+			<when test='sortType == 27'> receive_phone desc </when>
+			<when test='sortType == 28'> receive_address desc </when>
+			<when test='sortType == 29'> out_time desc </when>
+			<when test='sortType == 30'> goods_names desc </when>
+			<when test='sortType == 31'> apply desc </when>
+			<when test='sortType == 32'> apply_time desc </when>
+			<when test='sortType == 33'> apply_result desc </when>
+			<when test='sortType == 34'> apply_fail_reason desc </when>
+			<when test='sortType == 35'> distribution desc </when>
+			<when test='sortType == 36'> confirm desc </when>
+			<when test='sortType == 37'> pick desc </when>
+			<when test='sortType == 38'> pick_time desc </when>
+			<when test='sortType == 39'> shop_id desc </when>
+			<when test='sortType == 40'> shop_name desc </when>
+			<when test='sortType == 41'> send desc </when>
+			<when test='sortType == 42'> send_time desc </when>
+			<when test='sortType == 43'> level_two_order_id desc </when>
+			<when test='sortType == 44'> create_time desc </when>
+			<when test='sortType == 45'> create_by desc </when>
+			<when test='sortType == 46'> create_name desc </when>
+			<when test='sortType == 47'> update_time desc </when>
+			<when test='sortType == 48'> update_by desc </when>
+			<when test='sortType == 49'> update_name desc </when>
+			<when test='sortType == 50'> delete_status desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
 	</select>
 	
 	

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

@@ -52,6 +52,18 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 		return tbOrderMapper.getList(so);
 	}
 
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * APP专用
+	 * @param so
+	 * @return
+	 */
+	List<TbOrder> getAPPList(SoMap so) {
+		//todo: 与订单相关的人能看
+		return tbOrderMapper.getList(so);
+	}
+
 	/** 获取当前登陆人订单集合 */
 	public List<TbOrder> selectSelfOrders(SoMap so) {
 		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
@@ -61,7 +73,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 		return tbOrderMapper.getList(so);
 	}
 
-	/** 查 转售列表:边民查看已完结订单,包括已转售/未转售 */
+	/** 查 转售列表:边民组长查看已完结订单,包括已转售/未转售 */
 	List<TbOrder> getResaleOrders() {
 		//获取app登录用户
 		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();

+ 1 - 1
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUser.java

@@ -65,7 +65,7 @@ public class AppUser extends Model<AppUser> implements Serializable {
 	/**
 	 * 外联id,user_type=1=>边民ID;user_type=3=>商户ID 
 	 */
-	private String fkId;	
+	private Long fkId;
 
 	/**
 	 * 状态(0=禁用,1=启用)