浏览代码

Merge branch 'dev' of http://git.aseanbusiness.cn/qzyReal/market-server into dev

# Conflicts:
#	sp-core/sp-api/src/main/java/com/pj/api/client/admin/AdminInterface.java
#	sp-core/sp-api/src/main/java/com/pj/api/client/admin/AdminInterfaceFallback.java
#	sp-generate/src/main/java/com/pj/SpGenerateApplication.java
#	sp-service/sp-admin/src/main/java/com/pj/project4sp/admin4login/SpAccAdminService.java
qzyReal 2 年之前
父节点
当前提交
ce920de739
共有 81 个文件被更改,包括 3624 次插入214 次删除
  1. 3 1
      sp-core/sp-api/pom.xml
  2. 5 0
      sp-core/sp-api/src/main/java/com/pj/api/client/admin/AdminInterface.java
  3. 7 0
      sp-core/sp-api/src/main/java/com/pj/api/client/admin/AdminInterfaceFallback.java
  4. 244 0
      sp-core/sp-api/src/main/java/com/pj/api/dto/AppUserDto.java
  5. 6 6
      sp-core/sp-base/pom.xml
  6. 24 0
      sp-core/sp-base/src/main/java/com/pj/enummj/AuditStatus.java
  7. 21 0
      sp-core/sp-base/src/main/java/com/pj/enummj/BuyType.java
  8. 23 0
      sp-core/sp-base/src/main/java/com/pj/enummj/DeleteStatus.java
  9. 23 0
      sp-core/sp-base/src/main/java/com/pj/enummj/GoodsStatus.java
  10. 24 0
      sp-core/sp-base/src/main/java/com/pj/enummj/IsLock.java
  11. 2 1
      sp-core/sp-base/src/main/java/com/pj/enummj/People.java
  12. 26 0
      sp-core/sp-base/src/main/java/com/pj/enummj/UserType.java
  13. 3 0
      sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterprise.java
  14. 52 0
      sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseAppController.java
  15. 35 5
      sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseService.java
  16. 3 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods/TbGoods.java
  17. 1 2
      sp-service/level-one-server/src/main/java/com/pj/tb_goods/TbGoodsService.java
  18. 161 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCart.java
  19. 33 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCartApiController.java
  20. 88 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCartController.java
  21. 30 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCartMapper.java
  22. 80 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCartMapper.xml
  23. 110 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCartService.java
  24. 27 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCartUtil.java
  25. 54 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/dto/GoodsCartInfoDto.java
  26. 3 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/TbGoodsTransit.java
  27. 3 3
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/TbGoodsTransitController.java
  28. 14 6
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/TbGoodsTransitService.java
  29. 4 1
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_type/TbGoodsType.java
  30. 3 0
      sp-service/level-one-server/src/main/java/com/pj/tb_goods_units/TbGoodsUnits.java
  31. 3 0
      sp-service/level-one-server/src/main/java/com/pj/tb_group/TbGroup.java
  32. 4 0
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrder.java
  33. 1 1
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderMapper.xml
  34. 3 0
      sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeople.java
  35. 14 1
      sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleAppController.java
  36. 60 0
      sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleController.java
  37. 6 0
      sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleMapper.java
  38. 126 87
      sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleMapper.xml
  39. 120 13
      sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleService.java
  40. 68 0
      sp-service/level-one-server/src/main/java/com/pj/tb_people/vo/ApplyPeopleVo.java
  41. 3 0
      sp-service/level-one-server/src/main/java/com/pj/tb_shop/TbShop.java
  42. 3 0
      sp-service/level-one-server/src/main/java/com/pj/tb_trade_area/TbTradeArea.java
  43. 57 54
      sp-service/level-two-server/src/main/java/com/pj/tb_purchaser/TbPurchaser.java
  44. 56 0
      sp-service/level-two-server/src/main/java/com/pj/tb_purchaser/TbPurchaserAppController.java
  45. 29 15
      sp-service/level-two-server/src/main/java/com/pj/tb_purchaser/TbPurchaserController.java
  46. 99 0
      sp-service/level-two-server/src/main/java/com/pj/tb_purchaser/TbPurchaserDto.java
  47. 85 4
      sp-service/level-two-server/src/main/java/com/pj/tb_purchaser/TbPurchaserService.java
  48. 115 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_menu/AppMenu.java
  49. 103 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_menu/AppMenuController.java
  50. 30 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_menu/AppMenuMapper.java
  51. 67 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_menu/AppMenuMapper.xml
  52. 50 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_menu/AppMenuService.java
  53. 27 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_menu/AppMenuUtil.java
  54. 70 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_role/AppRole.java
  55. 87 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_role/AppRoleController.java
  56. 30 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_role/AppRoleMapper.java
  57. 49 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_role/AppRoleMapper.xml
  58. 51 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_role/AppRoleService.java
  59. 27 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_role/AppRoleUtil.java
  60. 31 12
      sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserController.java
  61. 37 1
      sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserService.java
  62. 1 0
      sp-service/sp-admin/src/main/java/com/pj/project4sp/admin/SpAdmin.java
  63. 39 0
      sp-service/sp-admin/src/main/java/com/pj/project4sp/admin/SpLoginInfo.java
  64. 4 0
      sp-service/sp-admin/src/main/java/com/pj/project4sp/admin4login/SpAccAdminController.java
  65. 9 1
      sp-service/sp-admin/src/main/java/com/pj/project4sp/admin4login/SpAccAdminService.java
  66. 7 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_driver/TbDriver.java
  67. 47 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_driver/TbDriverAppController.java
  68. 111 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_favorite_contacts/TbFavoriteContacts.java
  69. 88 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_favorite_contacts/TbFavoriteContactsController.java
  70. 30 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_favorite_contacts/TbFavoriteContactsMapper.java
  71. 62 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_favorite_contacts/TbFavoriteContactsMapper.xml
  72. 51 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_favorite_contacts/TbFavoriteContactsService.java
  73. 30 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_favorite_contacts/TbFavoriteContactsUtil.java
  74. 170 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogistics.java
  75. 149 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsController.java
  76. 30 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsMapper.java
  77. 89 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsMapper.xml
  78. 51 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsService.java
  79. 27 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsUtil.java
  80. 3 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_orders/TbOrders.java
  81. 3 0
      sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/TbVehicle.java

+ 3 - 1
sp-core/sp-api/pom.xml

@@ -30,7 +30,9 @@
             <artifactId>spring-cloud-starter-feign</artifactId>
             <version>1.4.0.RELEASE</version>
         </dependency>
-        
+
+
+
     </dependencies>
 
 </project>

+ 5 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/admin/AdminInterface.java

@@ -2,6 +2,7 @@ package com.pj.api.client.admin;
 
 import com.pj.api.FeignInterceptor;
 import com.pj.api.consts.FeignConsts;
+import com.pj.api.dto.AppUserDto;
 import com.pj.api.dto.DistrictDTO;
 import com.pj.api.dto.DistrictInfoDTO;
 import org.springframework.cloud.openfeign.FeignClient;
@@ -28,6 +29,10 @@ public interface AdminInterface {
 			   @RequestParam("type") Integer type,
 			   @RequestParam("status") Integer status);
 
+	/** 查单个app用户 - 根据id */
+	@RequestMapping("/AppUser/rpc/getById")
+	AppUserDto getAppUserById(@RequestParam("id") Long id);
+
 	/**
 	 * 根据城市名称查找地区数据
 	 * @param cityName

+ 7 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/admin/AdminInterfaceFallback.java

@@ -2,6 +2,7 @@ package com.pj.api.client.admin;
 
 import com.pj.api.dto.DistrictDTO;
 import com.pj.api.dto.DistrictInfoDTO;
+import com.pj.api.dto.AppUserDto;
 import feign.hystrix.FallbackFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -40,6 +41,12 @@ public class AdminInterfaceFallback implements FallbackFactory<AdminInterface>
 			}
 
 			@Override
+			public AppUserDto getAppUserById(Long id) {
+				log.error("错误的id:{},保护操作:{}",id,"熔断");
+				return null;
+			}
+
+			@Override
 			public DistrictInfoDTO findInfoByCityName(String cityName) {
 				return null;
 			}

+ 244 - 0
sp-core/sp-api/src/main/java/com/pj/api/dto/AppUserDto.java

@@ -0,0 +1,244 @@
+package com.pj.api.dto;
+
+
+import java.util.Date;
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 07 26 11 48
+ **/
+
+public class AppUserDto {
+
+    // ---------- 表中字段 ----------
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 手机号码
+     */
+    private String phone;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 类型(1=边民,2=组长,3=商户,4=收购商,5=司机)
+     */
+    private String userType;
+
+    /**
+     * 外联id,user_type=1=>边民ID;user_type=3=>商户ID
+     */
+    private String fkId;
+
+    /**
+     * 状态(0=禁用,1=启用)
+     */
+    private String status;
+
+    /**
+     * 是否认证(0=未认证,1=已认证)
+     */
+    private String auth;
+
+    /**
+     * 人证时间
+     */
+    private String authTime;
+
+    /**
+     * 登录次数
+     */
+    private Long loginCount;
+
+    /**
+     * 上次登录时间
+     */
+    private String lastLoginTime;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新者id
+     */
+    private String updateById;
+
+    /**
+     * 更新者名称
+     */
+    private String updateByName;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 逻辑删除
+     */
+    private Integer deleteStatus;
+
+    /**
+     * 密码
+     */
+    private String password;
+
+
+    public AppUserDto() {
+    }
+
+    public AppUserDto(Long id, String phone, String name, String userType, String fkId, String status, String auth, String authTime, Long loginCount, String lastLoginTime, Date createTime, String updateById, String updateByName, Date updateTime, Integer deleteStatus, String password) {
+        this.id = id;
+        this.phone = phone;
+        this.name = name;
+        this.userType = userType;
+        this.fkId = fkId;
+        this.status = status;
+        this.auth = auth;
+        this.authTime = authTime;
+        this.loginCount = loginCount;
+        this.lastLoginTime = lastLoginTime;
+        this.createTime = createTime;
+        this.updateById = updateById;
+        this.updateByName = updateByName;
+        this.updateTime = updateTime;
+        this.deleteStatus = deleteStatus;
+        this.password = password;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getUserType() {
+        return userType;
+    }
+
+    public void setUserType(String userType) {
+        this.userType = userType;
+    }
+
+    public String getFkId() {
+        return fkId;
+    }
+
+    public void setFkId(String fkId) {
+        this.fkId = fkId;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public String getAuth() {
+        return auth;
+    }
+
+    public void setAuth(String auth) {
+        this.auth = auth;
+    }
+
+    public String getAuthTime() {
+        return authTime;
+    }
+
+    public void setAuthTime(String authTime) {
+        this.authTime = authTime;
+    }
+
+    public Long getLoginCount() {
+        return loginCount;
+    }
+
+    public void setLoginCount(Long loginCount) {
+        this.loginCount = loginCount;
+    }
+
+    public String getLastLoginTime() {
+        return lastLoginTime;
+    }
+
+    public void setLastLoginTime(String lastLoginTime) {
+        this.lastLoginTime = lastLoginTime;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getUpdateById() {
+        return updateById;
+    }
+
+    public void setUpdateById(String updateById) {
+        this.updateById = updateById;
+    }
+
+    public String getUpdateByName() {
+        return updateByName;
+    }
+
+    public void setUpdateByName(String updateByName) {
+        this.updateByName = updateByName;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Integer getDeleteStatus() {
+        return deleteStatus;
+    }
+
+    public void setDeleteStatus(Integer deleteStatus) {
+        this.deleteStatus = deleteStatus;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+}

+ 6 - 6
sp-core/sp-base/pom.xml

@@ -185,16 +185,16 @@
         <dependency>
             <groupId>cn.hutool</groupId>
             <artifactId>hutool-all</artifactId>
-            <version>5.0.7</version>
+            <version>5.7.15</version>
         </dependency>
-        
-        <!--Alijson插件-->
+
         <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>fastjson</artifactId>
-            <version>1.2.73</version>
+            <groupId>cglib</groupId>
+            <artifactId>cglib</artifactId>
+            <version>3.2.8</version>
         </dependency>
 
+
 		<!-- ConfigurationProperties -->
         <dependency>
         	<groupId>org.springframework.boot</groupId>

+ 24 - 0
sp-core/sp-base/src/main/java/com/pj/enummj/AuditStatus.java

@@ -0,0 +1,24 @@
+package com.pj.enummj;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 07 26 10 11
+ **/
+@Getter
+@AllArgsConstructor
+public enum AuditStatus {
+
+    AUDIT_STATUS_ON(1,"审核通过"),
+    AUDIT_STATUS_WAIT(2,"审核不通过"),
+    AUDIT_STATUS_OFF(0,"待审核");
+
+    private Integer code;
+
+    private String msg;
+
+
+
+}

+ 21 - 0
sp-core/sp-base/src/main/java/com/pj/enummj/BuyType.java

@@ -0,0 +1,21 @@
+package com.pj.enummj;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 07 26 10 42
+ **/
+@Getter
+@AllArgsConstructor
+public enum BuyType {
+
+
+    BUY_TYPE_GROUP(2,"互助组购买"),
+    BUY_TYPE_OWN(3,"个人购买");
+
+    private Integer code;
+
+    private String msg;
+}

+ 23 - 0
sp-core/sp-base/src/main/java/com/pj/enummj/DeleteStatus.java

@@ -0,0 +1,23 @@
+package com.pj.enummj;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 07 26 10 10
+ **/
+@Getter
+@AllArgsConstructor
+public enum DeleteStatus {
+
+    DELETE_STATUS_ON(1,"启用"),
+    DELETE_STATUS_OFF(2,"禁用");
+
+    private Integer code;
+
+    private String msg;
+
+
+
+}

+ 23 - 0
sp-core/sp-base/src/main/java/com/pj/enummj/GoodsStatus.java

@@ -0,0 +1,23 @@
+package com.pj.enummj;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 07 26 10 09
+ **/
+@Getter
+@AllArgsConstructor
+public enum GoodsStatus {
+
+
+    GOODS_STATUS_ON(1,"在售"),
+    GOODS_STATUS_OFF(2,"下架");
+
+    private Integer code;
+
+    private String msg;
+
+
+}

+ 24 - 0
sp-core/sp-base/src/main/java/com/pj/enummj/IsLock.java

@@ -0,0 +1,24 @@
+package com.pj.enummj;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 07 26 10 26
+ **/
+@Getter
+@AllArgsConstructor
+public enum IsLock {
+
+    IS_LOCK_ON(1,"启用"),
+    IS_LOCK_OFF(2,"锁定");
+
+    private Integer code;
+
+    private String msg;
+
+
+
+
+}

+ 2 - 1
sp-core/sp-base/src/main/java/com/pj/enummj/People.java

@@ -12,7 +12,8 @@ import lombok.Getter;
 public enum People {
 
     PEOPLE_TYPE_ONE(1,"边民类型"),
-    PEOPLE_TYPE_TWO(2,"商户类型");
+    PEOPLE_TYPE_TWO(2,"商户类型"),
+    PEOPLE_TYPE_Three(3,"收购商类型");
 
 
 

+ 26 - 0
sp-core/sp-base/src/main/java/com/pj/enummj/UserType.java

@@ -0,0 +1,26 @@
+package com.pj.enummj;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 07 26 10 22
+ **/
+@Getter
+@AllArgsConstructor
+public enum UserType {
+
+    USER_TYPE_PEOPLE(1,"普通边民"),
+    USER_TYPE_GROUP_LEADER(2,"互市区边民组组长"),
+    USER_TYPE_ENTERPRISE(3,"互市区商家"),
+    USER_TYPE_DRIVER(4,"司机"),
+    USER_TYPE_PURCHASER(5,"国内收购商");
+
+    private Integer code;
+
+    private String msg;
+
+
+
+}

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

@@ -7,6 +7,8 @@ import com.alibaba.excel.annotation.ExcelProperty;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -46,6 +48,7 @@ public class TbEnterprise extends Model<TbEnterprise> implements Serializable {
 	 *  
 	 */
 	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;	
 
 	/**

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

@@ -0,0 +1,52 @@
+package com.pj.tb_enterprise;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.pj.project4sp.SP;
+import com.pj.utils.sg.AjaxJson;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.List;
+
+
+/**
+ * @author lbl
+ */
+@RestController
+@RequestMapping("/app/TbEnterprise/")
+public class TbEnterpriseAppController {
+
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbEnterpriseService tbEnterpriseService;
+
+
+	/** 查个人信息 - 根据id */
+	@RequestMapping("getById")
+	public AjaxJson getById(Long id){
+		TbEnterprise t = tbEnterpriseService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 改个人信息 */
+	@RequestMapping("update")
+	public AjaxJson update(TbEnterprise t){
+		tbEnterpriseService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 商家认证 */
+	@RequestMapping("identification")
+	public AjaxJson identification(TbEnterprise t){
+		boolean identification = tbEnterpriseService.identification(t);
+		if(!identification) return AjaxJson.getError("商家认证信息提交失败!!!");
+
+		return AjaxJson.getSuccess("商家认证信息已提交,管理员审核中,请耐心等待!");
+	}
+
+
+}

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

@@ -4,6 +4,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
+import java.util.Date;
 import java.util.List;
 import java.util.Objects;
 
@@ -32,7 +33,7 @@ import javax.swing.filechooser.FileSystemView;
 
 /**
  * Service: tb_enterprise -- 商家
- * @author qzy 
+ * @author qzy
  */
 @Service
 @Transactional(rollbackFor = Exception.class)
@@ -69,9 +70,9 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
 		return super.getById(id);
 	}
 
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
-	List<TbEnterprise> getList(SoMap so) { 
-		return tbEnterpriseMapper.getList(so);	
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	List<TbEnterprise> getList(SoMap so) {
+		return tbEnterpriseMapper.getList(so);
 	}
 
 	public int audit(TbEnterpriseDto tbEnterpriseDto){
@@ -115,6 +116,35 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
 		return line;
 	}
 
+	/** 商家认证 */
+	boolean identification(TbEnterprise enterprise){
+		if(null == enterprise) return false;
+
+		//手机号去重
+		String idCard = enterprise.getIdCard();
+		if(tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getIdCard,idCard).eq(TbEnterprise::getDeleteStatus,1)).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)
+			throw new RuntimeException("当前身份证号已被认证!");
+
+		//是否需要手机发送验证码认证?
+
+		//开始保存商家信息
+		//注册/认证时间
+		enterprise.setRegisterTime(new Date());
+		//创建时间
+		enterprise.setCreateTime(new Date());
+		//删除状态:启用
+		enterprise.setDeleteStatus(1);
+
+		// 保存商家信息
+		int insert = tbEnterpriseMapper.insert(enterprise);
+		return insert == 1;
+	}
+
+
 	/**
 	 * 导入
 	 * @param file excel文件
@@ -149,7 +179,7 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
 	public String outportExcel(String keyword,String filepath) throws IOException {
 		System.out.println("\n开始执行文件导出....\n");
 		//导出的文件的路径
-		if(filepath == null){
+		if(filepath == null || filepath.trim().equals("")){
 			// 获取当前用户的桌面路径
 			FileSystemView fileSystemView = FileSystemView.getFileSystemView();
 			filepath = fileSystemView.getHomeDirectory().getPath();

+ 3 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_goods/TbGoods.java

@@ -6,6 +6,8 @@ import java.util.Date;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -46,6 +48,7 @@ public class TbGoods extends Model<TbGoods> implements Serializable {
 	 * 主键 
 	 */
 	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;
 
 	/**

+ 1 - 2
sp-service/level-one-server/src/main/java/com/pj/tb_goods/TbGoodsService.java

@@ -64,7 +64,6 @@ public class TbGoodsService extends ServiceImpl<TbGoodsMapper, TbGoods> implemen
 		return tbGoodsMapper.getList(so);	
 	}
 
-
 	/**
 	 * 导入
 	 * @param file excel文件
@@ -99,7 +98,7 @@ public class TbGoodsService extends ServiceImpl<TbGoodsMapper, TbGoods> implemen
 	public String outportExcel(String keyword,String filepath) throws IOException {
 		System.out.println("\n开始执行文件导出....\n");
 		//导出的文件的路径
-		if(filepath == null){
+		if(filepath == null || filepath.trim().equals("")){
 			// 获取当前用户的桌面路径
 			FileSystemView fileSystemView = FileSystemView.getFileSystemView();
 			filepath = fileSystemView.getHomeDirectory().getPath();

+ 161 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCart.java

@@ -0,0 +1,161 @@
+package com.pj.tb_goods_cart;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: tb_goods_cart -- 购物车
+ * @author qzy 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbGoodsCart.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbGoodsCart extends Model<TbGoodsCart> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "tb_goods_cart";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "tb-goods-cart";
+	public static final String PERMISSION_CODE_ADD = "tb-goods-cart-add";
+	public static final String PERMISSION_CODE_EDIT = "tb-goods-cart-edit";
+	public static final String PERMISSION_CODE_DEL = "tb-goods-cart-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private String id;	
+
+	/**
+	 * 商家ID 
+	 */
+	private Long enterpriseId;	
+
+	/**
+	 *  
+	 */
+	private Long shopId;	
+
+	/**
+	 *  
+	 */
+	private Long tradeAreaId;
+
+	private String goodsImg;
+
+	private String goodsName;
+
+	private Integer buyNum;
+
+	/**
+	 *  
+	 */
+	private Long buyUserId;	
+
+	/**
+	 * 购买金额 
+	 */
+	private Double totalPrice;	
+
+	/**
+	 * 售卖商品详情表ID 
+	 */
+	private Long saleGoodsInfoId;	
+
+	/**
+	 * 商品重量
+	 */
+	private Double buyWeight;	
+
+	/**
+	 *  
+	 */
+	private String buyUserType;	
+
+	/**
+	 * 购买方式(2=互助组,3=个人购买) 
+	 */
+	private String buyType;	
+
+	/**
+	 * 分配方式 
+	 */
+	private Integer distribution;	
+
+	/**
+	 *  
+	 */
+	private Long publishGoodsId;
+
+	/**
+	 * 商品重量单位
+	 */
+	private String goodsUnit;
+
+	/**
+	 * 创建时间 
+	 */
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	private Date createTime;
+
+	/**
+	 * 创建人编号 
+	 */
+	private String createBy;	
+
+	/**
+	 * 创建人名称 
+	 */
+	private String createName;	
+
+	/**
+	 * 更新时间 
+	 */
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	private Date updateTime;
+
+	/**
+	 * 更新人编号 
+	 */
+	private String updateBy;	
+
+	/**
+	 * 更新人名称 
+	 */
+	private String updateName;	
+
+	/**
+	 * 删除状态(0=禁用,1=启用) 
+	 */
+	private Integer deleteStatus;	
+
+
+
+
+
+	
+
+
+}

+ 33 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCartApiController.java

@@ -0,0 +1,33 @@
+package com.pj.tb_goods_cart;
+
+import com.pj.tb_goods_cart.dto.GoodsCartInfoDto;
+import com.pj.utils.sg.AjaxJson;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+
+/**
+ * Controller: tb_goods_cart -- 购物车
+ * @author qzy 
+ */
+@RestController
+@RequestMapping("/app/TbGoodsCart/")
+public class TbGoodsCartApiController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbGoodsCartService tbGoodsCartService;
+
+	/** 添加购物车 */
+	@RequestMapping("addGoodsInShopCart")
+	public AjaxJson addGoodsInShopCart(@Validated @RequestBody GoodsCartInfoDto goodsCartInfoDto){
+		AjaxJson ajaxJson = tbGoodsCartService.addGoodsInShopCart(goodsCartInfoDto);
+		return ajaxJson;
+	}
+	
+
+}

+ 88 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCartController.java

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

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

@@ -0,0 +1,30 @@
+package com.pj.tb_goods_cart;
+
+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_goods_cart -- 购物车
+ * @author qzy 
+ */
+
+@Mapper
+@Repository
+public interface TbGoodsCartMapper extends BaseMapper <TbGoodsCart> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<TbGoodsCart> getList(SoMap so);
+
+
+}

+ 80 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCartMapper.xml

@@ -0,0 +1,80 @@
+<?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_goods_cart.TbGoodsCartMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, enterprise_id, shop_id, trade_area_id, buy_user_id, total_price, sale_goods_info_id, buy_weight, buy_user_type, buy_type, distribution, publish_goods_id, create_time, create_by, create_name, update_time, update_by, update_name, delete_status from tb_goods_cart  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.tb_goods_cart.TbGoodsCart"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from tb_goods_cart 
+	</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("enterpriseId") '> and enterprise_id = #{enterpriseId} </if>
+			<if test=' this.has("shopId") '> and shop_id = #{shopId} </if>
+			<if test=' this.has("tradeAreaId") '> and trade_area_id = #{tradeAreaId} </if>
+			<if test=' this.has("goodsName") '> and goods_name = #{goodsName} </if>
+			<if test=' this.has("buyUserId") '> and buy_user_id = #{buyUserId} </if>
+			<if test=' this.has("totalPrice") '> and total_price = #{totalPrice} </if>
+			<if test=' this.has("saleGoodsInfoId") '> and sale_goods_info_id = #{saleGoodsInfoId} </if>
+			<if test=' this.has("buyWeight") '> and buy_weight = #{buyWeight} </if>
+			<if test=' this.has("buyUserType") '> and buy_user_type = #{buyUserType} </if>
+			<if test=' this.has("buyType") '> and buy_type = #{buyType} </if>
+			<if test=' this.has("distribution") '> and distribution = #{distribution} </if>
+			<if test=' this.has("publishGoodsId") '> and publish_goods_id = #{publishGoodsId} </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'> enterprise_id desc </when>
+			<when test='sortType == 3'> shop_id desc </when>
+			<when test='sortType == 4'> trade_area_id desc </when>
+			<when test='sortType == 5'> buy_user_id desc </when>
+			<when test='sortType == 6'> total_price desc </when>
+			<when test='sortType == 7'> sale_goods_info_id desc </when>
+			<when test='sortType == 8'> buy_weight desc </when>
+			<when test='sortType == 9'> buy_user_type desc </when>
+			<when test='sortType == 10'> buy_type desc </when>
+			<when test='sortType == 11'> distribution desc </when>
+			<when test='sortType == 12'> publish_goods_id desc </when>
+			<when test='sortType == 13'> create_time desc </when>
+			<when test='sortType == 14'> create_by desc </when>
+			<when test='sortType == 15'> create_name desc </when>
+			<when test='sortType == 16'> update_time desc </when>
+			<when test='sortType == 17'> update_by desc </when>
+			<when test='sortType == 18'> update_name desc </when>
+			<when test='sortType == 19'> delete_status desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 110 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCartService.java

@@ -0,0 +1,110 @@
+package com.pj.tb_goods_cart;
+
+import java.util.Date;
+import java.util.List;
+
+import com.pj.api.client.admin.AdminInterface;
+import com.pj.api.dto.AppUserDto;
+import com.pj.current.satoken.StpUserUtil;
+import com.pj.enummj.DeleteStatus;
+import com.pj.tb_goods_cart.dto.GoodsCartInfoDto;
+import com.pj.tb_goods_transit.TbGoodsTransit;
+import com.pj.tb_goods_transit.TbGoodsTransitMapper;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.BeanUtils;
+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_goods_cart -- 购物车
+ * @author qzy 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class TbGoodsCartService extends ServiceImpl<TbGoodsCartMapper, TbGoodsCart> implements IService<TbGoodsCart>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbGoodsCartMapper tbGoodsCartMapper;
+
+	@Autowired
+	private AdminInterface adminInterface;
+	/** 已过审的商品 */
+	@Autowired
+	private TbGoodsTransitMapper tbGoodsTransitMapper;
+	/** 增 */
+	void add(TbGoodsCart t){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(TbGoodsCart t){
+		updateById(t);
+
+	}
+
+	/** 查 */
+	TbGoodsCart getById(String id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<TbGoodsCart> getList(SoMap so) { 
+		return tbGoodsCartMapper.getList(so);	
+	}
+
+	/** 添加商品进购物车 */
+	public AjaxJson addGoodsInShopCart(GoodsCartInfoDto goodsCartInfoDto){
+		//检查登录 todo: 前端完成后需释放该检查登陆验证
+//		StpUserUtil.checkLogin();
+		//验证购买者
+		Long id = goodsCartInfoDto.getBuyUserId();
+		//获取购买者对象
+		AppUserDto appUser = adminInterface.getAppUserById(id);
+		if(appUser == null)return AjaxJson.getError("购买者账号异常");
+		//获取商品对象
+		Long infoId = goodsCartInfoDto.getSaleGoodsInfoId();
+		TbGoodsTransit tbGoodsTransit = tbGoodsTransitMapper.selectById(infoId);
+		if(tbGoodsTransit == null)return AjaxJson.getError("当前商品信息存在异常");
+		//创建保存对象
+		TbGoodsCart tbGoodsCart = new TbGoodsCart();
+		BeanUtils.copyProperties(goodsCartInfoDto,tbGoodsCart);
+		//购买的用户类型
+		tbGoodsCart.setBuyType(appUser.getUserType());
+		//购买方式,默认都是互助组进行购买
+		tbGoodsCart.setBuyType(2 + "");
+		//购买商品的重量
+		tbGoodsCart.setBuyWeight(Double.valueOf(goodsCartInfoDto.getBuyNum()));
+		//当前商品的单位
+		tbGoodsCart.setGoodsUnit(tbGoodsTransit.getGoodsUnits());
+		//商品价格
+		tbGoodsCart.setTotalPrice((goodsCartInfoDto.getBuyNum() == null? 0 : goodsCartInfoDto.getBuyNum())
+				*
+				(tbGoodsTransit.getPrice() == null? 0 : tbGoodsTransit.getPrice()));
+		//设置基本属性
+		tbGoodsCart.setCreateTime(new Date());
+		tbGoodsCart.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
+		tbGoodsCart.setCreateBy(appUser.getId().toString());
+		tbGoodsCart.setCreateName(appUser.getName());
+		//执行保存
+		int insert = tbGoodsCartMapper.insert(tbGoodsCart);
+		//判断保存结果
+		if(insert != 1)AjaxJson.getError("购物车保存失败!");
+		return AjaxJson.getSuccess("添加购物车成功!");
+	}
+
+	/**
+	 * todo:采购支付,暂时预留
+	 */
+
+
+}

+ 27 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/TbGoodsCartUtil.java

@@ -0,0 +1,27 @@
+package com.pj.tb_goods_cart;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 工具类:tb_goods_cart -- 购物车
+ * @author qzy 
+ *
+ */
+@Component
+public class TbGoodsCartUtil {
+
+	
+	/** 底层 Mapper 对象 */
+	public static TbGoodsCartMapper tbGoodsCartMapper;
+	@Autowired
+	private void setTbGoodsCartMapper(TbGoodsCartMapper tbGoodsCartMapper) {
+		TbGoodsCartUtil.tbGoodsCartMapper = tbGoodsCartMapper;
+	}
+	
+
+
+	
+	
+	
+}

+ 54 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_goods_cart/dto/GoodsCartInfoDto.java

@@ -0,0 +1,54 @@
+package com.pj.tb_goods_cart.dto;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.validation.constraints.DecimalMin;
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 07 26 10 38
+ **/
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class GoodsCartInfoDto {
+
+    /** 购买者ID(组长/个人) */
+    @NotNull(message = "购买者ID必填")
+    private Long buyUserId;
+    /** 商家ID */
+    @NotNull(message = "商家ID必填")
+    private Long enterpriseId;
+    /** 店铺ID */
+    @NotNull(message = "店铺ID必填")
+    private Long shopId;
+    /** 购买地点ID */
+    @NotNull(message = "区域ID必填")
+    private Long tradeAreaId;
+//    /** 购买总价 */
+//    @NotNull(message = "必填")
+//    @DecimalMin("0.0")
+//    private Double totalPrice;
+    /** 商品ID */
+    @NotNull(message = "商品ID必填")
+    private Long saleGoodsInfoId;
+    /** 购买者类型(边民/...) */
+    @NotNull(message = "购买者ID必填")
+    private Integer buyUserType;
+    /** 购买方式 */
+    @NotNull(message = "购买类型(2=互助组,3=个人购买)必填")
+    private Integer buyType;
+    /** 商品图片 */
+    @NotNull(message = "商品ID必填")
+    private String goodsImg;
+    /** 商品名称 */
+    @NotNull(message = "商品名称必填")
+    private String goodsName;
+    /** 购买个数 */
+    @NotNull(message = "购买个数必填")
+    private Integer buyNum;
+
+}

+ 3 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/TbGoodsTransit.java

@@ -6,6 +6,8 @@ import java.util.Date;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -46,6 +48,7 @@ public class TbGoodsTransit extends Model<TbGoodsTransit> implements Serializabl
 	 * 在销商品表主键 
 	 */
 	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;	
 
 	/**

+ 3 - 3
sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/TbGoodsTransitController.java

@@ -106,11 +106,11 @@ public class TbGoodsTransitController {
 		return AjaxJson.getByLine(line);
 	}
 
-	/** 查看一级市场的在商品列表 */
+	/** 查看一级市场的在销/上架商品列表 */
 	@GetMapping("getTransitList")
-	public AjaxJson getTransitList(){
+	public AjaxJson getTransitList(@RequestParam("goodsType")String goodsType){
 		SoMap so = SoMap.getRequestSoMap();
-		List<TbGoodsTransit> transitList = tbGoodsTransitService.getTransitList(so.startPage());
+		List<TbGoodsTransit> transitList = tbGoodsTransitService.getTransitList(so.startPage(),goodsType);
 		return AjaxJson.getPageData(so.getDataCount(),transitList);
 	}
 

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

@@ -8,7 +8,11 @@ import java.util.Date;
 import java.util.List;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.pj.enummj.AuditStatus;
+import com.pj.enummj.DeleteStatus;
+import com.pj.enummj.GoodsStatus;
 import com.pj.tb_enterprise.TbEnterprise;
+import com.pj.tb_goods.TbGoods;
 import com.pj.tb_goods_transit.param.JudgeTransitParam;
 import com.pj.utils.so.SoMap;
 import org.apache.commons.lang3.StringUtils;
@@ -66,12 +70,15 @@ public class TbGoodsTransitService extends ServiceImpl<TbGoodsTransitMapper, TbG
 		return tbGoodsTransitMapper.getList(so);	
 	}
 
-	/** 查看一级市场在销商品 */
-	List<TbGoodsTransit> getTransitList(SoMap so){
+	/** 查看一级市场在销/上架商品 */
+	List<TbGoodsTransit> getTransitList(SoMap so,String goodsType){
 		//设置可展示的状态
-		so.set("audit_status",1);
-		so.set("delete_status",1);
-		so.set("goods_status",1);
+		so.set("audit_status", AuditStatus.AUDIT_STATUS_ON.getCode());
+		so.set("delete_status", DeleteStatus.DELETE_STATUS_ON.getCode());
+		so.set("goods_status", GoodsStatus.GOODS_STATUS_ON.getCode());
+		if(goodsType != null){
+			so.set("goods_type", goodsType);
+		}
 		//获取在销商品列表,根据日期进行降序排序
 		List<TbGoodsTransit> goodsTransitList = tbGoodsTransitMapper.getList(so);
 		return goodsTransitList;
@@ -106,6 +113,7 @@ public class TbGoodsTransitService extends ServiceImpl<TbGoodsTransitMapper, TbG
 		return "已完成 " + count + "条 数据审核!";
 	}
 
+
 	/**
 	 * 导入
 	 * @param file excel文件
@@ -140,7 +148,7 @@ public class TbGoodsTransitService extends ServiceImpl<TbGoodsTransitMapper, TbG
 	public String outportExcel(String keyword,String filepath) throws IOException {
 		System.out.println("\n开始执行文件导出....\n");
 		//导出的文件的路径
-		if(filepath == null){
+		if(filepath == null || filepath.trim().equals("")){
 			// 获取当前用户的桌面路径
 			FileSystemView fileSystemView = FileSystemView.getFileSystemView();
 			filepath = fileSystemView.getHomeDirectory().getPath();

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

@@ -6,6 +6,8 @@ import java.util.Date;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -46,7 +48,8 @@ public class TbGoodsType extends Model<TbGoodsType> implements Serializable {
 	 * 主键 
 	 */
 	@TableId(type = IdType.AUTO)
-	private String id;	
+	@JsonSerialize(using = ToStringSerializer.class)
+	private Long id;
 
 	/**
 	 * 类别名称 

+ 3 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_goods_units/TbGoodsUnits.java

@@ -3,6 +3,8 @@ package com.pj.tb_goods_units;
 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;
@@ -43,6 +45,7 @@ public class TbGoodsUnits extends Model<TbGoodsUnits> implements Serializable {
 	 * 商品主键 
 	 */
 	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;	
 
 	/**

+ 3 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_group/TbGroup.java

@@ -6,6 +6,8 @@ import java.util.Date;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -46,6 +48,7 @@ public class TbGroup extends Model<TbGroup> implements Serializable {
 	 *  
 	 */
 	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;
 
 	/**

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

@@ -4,6 +4,8 @@ import java.io.Serializable;
 import java.util.*;
 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;
@@ -44,11 +46,13 @@ public class TbOrder extends Model<TbOrder> implements Serializable {
 	 * 主键 
 	 */
 	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;
 
 	/**
 	 *  
 	 */
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long tradeAreaId;	
 
 	/**

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

@@ -13,7 +13,7 @@
 	
 	<!-- 公共查询sql片段 -->
 	<sql id="select_sql">
-		select trade_no,trade_area_name,buy_user_name,buy_user_type,enterprise_name,total_weight,total_price,
+		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
 		from tb_order 

+ 3 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeople.java

@@ -6,6 +6,8 @@ import java.util.Date;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -46,6 +48,7 @@ public class TbPeople extends Model<TbPeople> implements Serializable {
 	 * 主键 
 	 */
 	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;
 
 	/**

+ 14 - 1
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleAppController.java

@@ -1,5 +1,7 @@
 package com.pj.tb_people;
 
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.pj.utils.sg.AjaxJson;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -15,7 +17,18 @@ public class TbPeopleAppController {
     @Autowired
     private TbPeopleService tbPeopleService;
 
+    /** 查个人信息 - 根据id */
+    @RequestMapping("getById")
+    public AjaxJson getById(String id){
+        TbPeople t = tbPeopleService.getById(id);
+        return AjaxJson.getSuccessData(t);
+    }
 
-
+    /** 改个人信息 */
+    @RequestMapping("update")
+    public AjaxJson update(TbPeople t){
+        tbPeopleService.update(t);
+        return AjaxJson.getSuccess();
+    }
 
 }

+ 60 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleController.java

@@ -3,7 +3,10 @@ package com.pj.tb_people;
 import java.io.IOException;
 import java.util.List;
 
+import cn.hutool.extra.cglib.CglibUtil;
+import com.pj.tb_group.TbGroup;
 import com.pj.tb_people.dto.StartStopDto;
+import com.pj.tb_people.vo.ApplyPeopleVo;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
@@ -115,6 +118,63 @@ public class TbPeopleController {
 	}
 
 	/**
+	*边民申请加入互助组
+	*
+	* @author loovi
+	* @date
+	*/
+	@RequestMapping("applyAddGroup")
+	public AjaxJson addAppleGroup(@RequestParam("peopleId") Long peopleId, @RequestParam("groupId") Long groupId){
+		int i = tbPeopleService.applyAddGroup(peopleId, groupId);
+		return AjaxJson.getSuccess("申请成功等待组长批准",i);
+	}
+   /**
+   *获取申请互助组的申请人列表
+   *
+   * @author loovi
+   * @date
+   */
+   @RequestMapping("getApplyList")
+	public AjaxJson getApplyList(@RequestParam("leaderId") Long leaderId){
+	   SoMap so = SoMap.getRequestSoMap();
+	   so.set("leader_id",leaderId);
+		AjaxJson ajaxJson = tbPeopleService.getApplyList(so);
+		return ajaxJson;
+	}
+	/**
+	*组长是否同意申请
+	*
+	* @author loovi
+	* @date
+	*/
+	@RequestMapping("passApply")
+	public AjaxJson passApply(@RequestParam("leaderId") Long leaderId,@RequestParam("peopleId") Long peopleId,@RequestParam("approve")int approve){
+		int line = tbPeopleService.passApply(leaderId, peopleId, approve);
+		return AjaxJson.getByLine(line);
+
+	}
+
+	/**
+	 *查看互助组内成员列表
+	 *
+	 * @author loovi
+	 * @date
+	 */
+	@RequestMapping("getMemberList")
+//	@SaCheckPermission(TbGroup.PERMISSION_CODE_EDIT)
+	public AjaxJson getMemberList(@RequestParam("leaderId") Long leaderId){
+		SoMap so = SoMap.getRequestSoMap();
+		so.set("leader_id",leaderId);
+		AjaxJson ajaxJson =  tbPeopleService.getMemberList(so);
+		return ajaxJson;
+	}
+
+
+
+
+
+
+	/**
 	 * 数据导入接口
 	 * @param file
 	 * @return

+ 6 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleMapper.java

@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Mapper;
 
 import com.pj.utils.so.*;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
 /**
@@ -25,6 +26,11 @@ public interface TbPeopleMapper extends BaseMapper <TbPeople> {
 	 * @return 数据列表 
 	 */
 	List<TbPeople> getList(SoMap so);
+	int checkApplyExist(@Param("peopleId") Long peopleId);
+	int addApply(@Param("peopleId") Long peopleId, @Param("groupId") Long groupId);
+	List <TbPeople>getApplyList(SoMap so);
+	List <TbPeople>getMemberList(SoMap so);
+	int updateApplyStatus(@Param("status") int status,@Param("peopleId") Long peopleId);
 
 
 }

+ 126 - 87
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleMapper.xml

@@ -9,101 +9,140 @@
 	<!-- select id, name, code, sex, age, id_card, id_card_img, phone, bank_no, bank_code, bank_name, group_id, group_name, status, role, lng, lat, last_location, address, address_ids, detail_address, is_lock, left_price, judge_status, judge_content, register_time, judge_time, person_id, create_time, create_by, create_name, update_time, update_by, update_name, delete_status from tb_people  -->
 	
 	<!-- 通用映射:自动模式 -->
-	<resultMap id="model" autoMapping="true" type="com.pj.tb_people.TbPeople"></resultMap>
+	<resultMap id="model" autoMapping="true" type="com.pj.tb_people.TbPeople">
+
+	</resultMap>
+	<sql id="select_tbPeople">
+		select p.id, p.name, p.code, p.sex, p.age, p.id_card, p.id_card_img, p.phone, p.bank_no, p.bank_code, p.bank_name,
+			   p.group_id, p.group_name, p.status, p.role, p.lng, p.lat, p.last_location, p.address, p.address_ids,
+			   p.detail_address, p.is_lock, p.left_price, p.judge_status, p.judge_content, p.register_time, p.judge_time,
+			   p.person_id, p.create_time, p.create_by, p.create_name, p.update_time, p.update_by, p.update_name,
+			   p.delete_status
+		from  tb_people p
+	</sql>
+
 	
 	<!-- 公共查询sql片段 -->
 	<sql id="select_sql">
-		select * 
-		from tb_people 
+		select * from tb_people
 	</sql>
+	<insert id="addApply">
+		insert into tb_people_apply
+		(people_id,group_id,status)
+		values
+		(
+		<if test="peopleId">#{peopleId},</if>
+		<if test="groupId"> #{groupId}</if>
+		 0
+		)
+	</insert>
 
-	
+	<update id="updateApplyStatus" >
+		update  tb_people_apply
+		set
+		<if test="status !=  null and status != '' ">status=#{status}</if>
+		<where>
+			<if test="peopleId != null and peopleId != ''"> people_id=#{peopleId}</if>
+			and status=0
+		</where>
+
+	</update>
+
+	<select id="checkApplyExist" resultType="Integer">
+		select  count(1) from tb_people_apply where people_id=#{peopleId} and status=0
+	</select>
+
+	<select id="getApplyList"  resultType="com.pj.tb_people.TbPeople">
+		<include refid="select_tbPeople"></include>
+		 right join
+			 tb_people_apply ap
+			 on p.id = ap.people_id
+		where ap.group_id = (select id from tb_group g where g.leader_id =#{leaderId})and ap.status=0
+	</select>
+
+	<select id="getMemberList" resultType="com.pj.tb_people.TbPeople">
+		<include refid="select_tbPeople"></include>
+		where group_id = (select id from tb_group where leader_id =#{leaderId})
+	</select>
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [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("name") '> and name = #{name} </if>
-			<if test=' this.has("code") '> and code = #{code} </if>
-			<if test=' this.has("sex") '> and sex = #{sex} </if>
-			<if test=' this.has("age") '> and age = #{age} </if>
-			<if test=' this.has("idCard") '> and id_card = #{idCard} </if>
-			<if test=' this.has("phone") '> and phone = #{phone} </if>
-			<if test=' this.has("bankNo") '> and bank_no = #{bankNo} </if>
-			<if test=' this.has("bankCode") '> and bank_code = #{bankCode} </if>
-			<if test=' this.has("bankName") '> and bank_name = #{bankName} </if>
-			<if test=' this.has("groupId") '> and group_id = #{groupId} </if>
-			<if test=' this.has("groupName") '> and group_name = #{groupName} </if>
-			<if test=' this.has("status") '> and status = #{status} </if>
-			<if test=' this.has("role") '> and role = #{role} </if>
-			<if test=' this.has("lng") '> and lng = #{lng} </if>
-			<if test=' this.has("lat") '> and lat = #{lat} </if>
-			<if test=' this.has("lastLocation") '> and last_location = #{lastLocation} </if>
-			<if test=' this.has("address") '> and address = #{address} </if>
-			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>
-			<if test=' this.has("detailAddress") '> and detail_address = #{detailAddress} </if>
-			<if test=' this.has("isLock") '> and is_lock = #{isLock} </if>
-			<if test=' this.has("leftPrice") '> and left_price = #{leftPrice} </if>
-			<if test=' this.has("judgeStatus") '> and judge_status = #{judgeStatus} </if>
-			<if test=' this.has("judgeContent") '> and judge_content = #{judgeContent} </if>
-			<if test=' this.has("registerTime") '> and register_time = #{registerTime} </if>
-			<if test=' this.has("judgeTime") '> and judge_time = #{judgeTime} </if>
-			<if test=' this.has("personId") '> and person_id = #{personId} </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'> name desc </when>
-			<when test='sortType == 3'> code desc </when>
-			<when test='sortType == 4'> sex desc </when>
-			<when test='sortType == 5'> age desc </when>
-			<when test='sortType == 6'> id_card desc </when>
-			<when test='sortType == 7'> phone desc </when>
-			<when test='sortType == 8'> bank_no desc </when>
-			<when test='sortType == 9'> bank_code desc </when>
-			<when test='sortType == 10'> bank_name desc </when>
-			<when test='sortType == 11'> group_id desc </when>
-			<when test='sortType == 12'> group_name desc </when>
-			<when test='sortType == 13'> status desc </when>
-			<when test='sortType == 14'> role desc </when>
-			<when test='sortType == 15'> lng desc </when>
-			<when test='sortType == 16'> lat desc </when>
-			<when test='sortType == 17'> last_location desc </when>
-			<when test='sortType == 18'> address desc </when>
-			<when test='sortType == 19'> address_ids desc </when>
-			<when test='sortType == 20'> detail_address desc </when>
-			<when test='sortType == 21'> is_lock desc </when>
-			<when test='sortType == 22'> left_price desc </when>
-			<when test='sortType == 23'> judge_status desc </when>
-			<when test='sortType == 24'> judge_content desc </when>
-			<when test='sortType == 25'> register_time desc </when>
-			<when test='sortType == 26'> judge_time desc </when>
-			<when test='sortType == 27'> person_id desc </when>
-			<when test='sortType == 28'> create_time desc </when>
-			<when test='sortType == 29'> create_by desc </when>
-			<when test='sortType == 30'> create_name desc </when>
-			<when test='sortType == 31'> update_time desc </when>
-			<when test='sortType == 32'> update_by desc </when>
-			<when test='sortType == 33'> update_name desc </when>
-			<when test='sortType == 34'> delete_status desc </when>
-			<otherwise> id desc </otherwise>
-		</choose>
+<!--		<where>-->
+<!--			<if test=' this.has("id") '> and id = #{id} </if>-->
+<!--			<if test=' this.has("name") '> and name = #{name} </if>-->
+<!--			<if test=' this.has("code") '> and code = #{code} </if>-->
+<!--			<if test=' this.has("sex") '> and sex = #{sex} </if>-->
+<!--			<if test=' this.has("age") '> and age = #{age} </if>-->
+<!--			<if test=' this.has("idCard") '> and id_card = #{idCard} </if>-->
+<!--			<if test=' this.has("phone") '> and phone = #{phone} </if>-->
+<!--			<if test=' this.has("bankNo") '> and bank_no = #{bankNo} </if>-->
+<!--			<if test=' this.has("bankCode") '> and bank_code = #{bankCode} </if>-->
+<!--			<if test=' this.has("bankName") '> and bank_name = #{bankName} </if>-->
+<!--			<if test=' this.has("groupId") '> and group_id = #{groupId} </if>-->
+<!--			<if test=' this.has("groupName") '> and group_name = #{groupName} </if>-->
+<!--			<if test=' this.has("status") '> and status = #{status} </if>-->
+<!--			<if test=' this.has("role") '> and role = #{role} </if>-->
+<!--			<if test=' this.has("lng") '> and lng = #{lng} </if>-->
+<!--			<if test=' this.has("lat") '> and lat = #{lat} </if>-->
+<!--			<if test=' this.has("lastLocation") '> and last_location = #{lastLocation} </if>-->
+<!--			<if test=' this.has("address") '> and address = #{address} </if>-->
+<!--			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>-->
+<!--			<if test=' this.has("detailAddress") '> and detail_address = #{detailAddress} </if>-->
+<!--			<if test=' this.has("isLock") '> and is_lock = #{isLock} </if>-->
+<!--			<if test=' this.has("leftPrice") '> and left_price = #{leftPrice} </if>-->
+<!--			<if test=' this.has("judgeStatus") '> and judge_status = #{judgeStatus} </if>-->
+<!--			<if test=' this.has("judgeContent") '> and judge_content = #{judgeContent} </if>-->
+<!--			<if test=' this.has("registerTime") '> and register_time = #{registerTime} </if>-->
+<!--			<if test=' this.has("judgeTime") '> and judge_time = #{judgeTime} </if>-->
+<!--			<if test=' this.has("personId") '> and person_id = #{personId} </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'> name desc </when>-->
+<!--			<when test='sortType == 3'> code desc </when>-->
+<!--			<when test='sortType == 4'> sex desc </when>-->
+<!--			<when test='sortType == 5'> age desc </when>-->
+<!--			<when test='sortType == 6'> id_card desc </when>-->
+<!--			<when test='sortType == 7'> phone desc </when>-->
+<!--			<when test='sortType == 8'> bank_no desc </when>-->
+<!--			<when test='sortType == 9'> bank_code desc </when>-->
+<!--			<when test='sortType == 10'> bank_name desc </when>-->
+<!--			<when test='sortType == 11'> group_id desc </when>-->
+<!--			<when test='sortType == 12'> group_name desc </when>-->
+<!--			<when test='sortType == 13'> status desc </when>-->
+<!--			<when test='sortType == 14'> role desc </when>-->
+<!--			<when test='sortType == 15'> lng desc </when>-->
+<!--			<when test='sortType == 16'> lat desc </when>-->
+<!--			<when test='sortType == 17'> last_location desc </when>-->
+<!--			<when test='sortType == 18'> address desc </when>-->
+<!--			<when test='sortType == 19'> address_ids desc </when>-->
+<!--			<when test='sortType == 20'> detail_address desc </when>-->
+<!--			<when test='sortType == 21'> is_lock desc </when>-->
+<!--			<when test='sortType == 22'> left_price desc </when>-->
+<!--			<when test='sortType == 23'> judge_status desc </when>-->
+<!--			<when test='sortType == 24'> judge_content desc </when>-->
+<!--			<when test='sortType == 25'> register_time desc </when>-->
+<!--			<when test='sortType == 26'> judge_time desc </when>-->
+<!--			<when test='sortType == 27'> person_id desc </when>-->
+<!--			<when test='sortType == 28'> create_time desc </when>-->
+<!--			<when test='sortType == 29'> create_by desc </when>-->
+<!--			<when test='sortType == 30'> create_name desc </when>-->
+<!--			<when test='sortType == 31'> update_time desc </when>-->
+<!--			<when test='sortType == 32'> update_by desc </when>-->
+<!--			<when test='sortType == 33'> update_name desc </when>-->
+<!--			<when test='sortType == 34'> delete_status desc </when>-->
+<!--			<otherwise> id desc </otherwise>-->
+<!--		</choose>-->
 	</select>
-	
-	
-	
-	
-	
-	
-	
-	
-	
+
+
 
 </mapper>

+ 120 - 13
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleService.java

@@ -1,18 +1,21 @@
 package com.pj.tb_people;
 
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
-import java.util.Date;
-import java.util.List;
-
-import cn.dev33.satoken.stp.StpUtil;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.extra.cglib.CglibUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.api.client.admin.AdminInterface;
+import com.pj.enummj.DeleteStatus;
+import com.pj.enummj.IsLock;
 import com.pj.enummj.People;
-import com.pj.tb_goods_transit.TbGoodsTransit;
+import com.pj.tb_group.TbGroup;
+import com.pj.tb_group.TbGroupMapper;
 import com.pj.tb_people.dto.StartStopDto;
+import com.pj.tb_people.vo.ApplyPeopleVo;
+import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFRow;
@@ -20,13 +23,17 @@ import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 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.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.swing.filechooser.FileSystemView;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
 
 /**
  * Service: tb_people -- 边民
@@ -46,6 +53,8 @@ public class TbPeopleService extends ServiceImpl<TbPeopleMapper, TbPeople> imple
 	@Autowired
 	private AdminInterface adminInterface;
 
+	@Autowired
+	TbGroupMapper tbGroupMapper;
 	/** 增 */
 	void add(TbPeople t){
 		save(t);
@@ -141,7 +150,105 @@ public class TbPeopleService extends ServiceImpl<TbPeopleMapper, TbPeople> imple
 //
 //	}
 
-
+	/**
+	*边民申请加入互助组
+	*
+	* @author loovi
+	* @date
+	*/
+   public int applyAddGroup(Long peopleId, Long groupId){
+	   // 检查是否有待通过的申请
+	   int res = tbPeopleMapper.checkApplyExist(peopleId);
+	   if(res > 0){
+		   throw new RuntimeException("存在带通过的申请");
+	   }
+	   // 获取边民信息
+	   TbPeople tbPeople = tbPeopleMapper.selectById(peopleId);
+		// 获取互助组信息
+	   TbGroup tbGroup = tbGroupMapper.selectById(groupId);
+	   // 如果互助组不存在抛出异常
+	   if(Objects.isNull(tbGroup)){
+		   throw new RuntimeException("该互助组不存在");
+	   }
+	   // 如果互助组已删除抛出异常
+	   if(tbGroup.getDeleteStatus()== DeleteStatus.DELETE_STATUS_OFF.getCode()){
+		   throw new RuntimeException("该互助组已被删除");
+	   }
+	   // 如果边民已加入此互助组,信息提示已加入
+	   if(tbPeople.getGroupId()==groupId){
+		   throw new RuntimeException("您已加入该互助组");
+	   }
+	   // 如果边民没有加入任何互助组则可以申请加入
+	   int i = 0;
+	   if(Objects.isNull(tbPeople.getGroupId())&& StrUtil.isEmpty(tbPeople.getGroupName())){
+		   // 将申请边民和所申请的互助组id写入申请表
+		  i = tbPeopleMapper.addApply(peopleId, groupId);
+	   }else{
+		   throw new RuntimeException("您已加入互助组");
+	   }
+	   return i;
+   }
+   /**
+   *组长获取待通过申请人列表
+   *
+   * @author loovi
+   * @date
+   */
+   public AjaxJson getApplyList(SoMap so){
+	   // 根据组长id获取申请该互助组的所有申请人信息
+	   List<TbPeople> list = tbPeopleMapper.getApplyList(so.startPage());
+	   List<ApplyPeopleVo> resList = CglibUtil.copyList(list, ApplyPeopleVo::new);
+	   return AjaxJson.getPageData(so.getDataCount(), resList);
+   }
+	/**
+	 *查看互助组内成员
+	 *
+	 * @author loovi
+	 * @date
+	 */
+	public AjaxJson getMemberList(SoMap so){
+		List<TbPeople> list = tbPeopleMapper.getMemberList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	/**
+	 *组长批准是否同意加入申请
+	 *
+	 * @author loovi
+	 * @date
+	 */
+	public int passApply(Long leaderId,Long peopleId,int approve){
+		// 组长不同意申请
+		if(approve==2){
+			int i = tbPeopleMapper.updateApplyStatus(approve,peopleId);
+			return i;
+		}
+		// 组长同意申请
+		// 获取申请人信息
+		TbPeople tbPeople = tbPeopleMapper.selectById(peopleId);
+		// 用户不存在抛异常
+		if(Objects.isNull(tbPeople)){
+			throw new RuntimeException("用户不存在");
+		}
+		// 用户被锁定抛异常
+		if(tbPeople.getIsLock()== IsLock.IS_LOCK_OFF.getCode()){
+			throw new RuntimeException("用户已被锁定");
+		}
+		// 用户已删除抛异常
+		if(tbPeople.getIsLock()== DeleteStatus.DELETE_STATUS_OFF.getCode()){
+			throw new RuntimeException("用户已删除");
+		}
+		//根据互助组组长id查询互助组
+		QueryWrapper<TbGroup> queryWrapper = new QueryWrapper<>();
+		queryWrapper.eq("leader_id", leaderId);
+		TbGroup tbGroup = tbGroupMapper.selectOne(queryWrapper);
+		// 修改申请表状态为1通过
+		tbPeopleMapper.updateApplyStatus(approve,peopleId);
+		// 把互助组信息写入申请的边民表
+		tbPeople.setGroupId(tbGroup.getId());
+		tbPeople.setGroupName(tbGroup.getName());
+		int line = tbPeopleMapper.updateById(tbPeople);
+		return line;
+	}
 
 
 

+ 68 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_people/vo/ApplyPeopleVo.java

@@ -0,0 +1,68 @@
+package com.pj.tb_people.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class ApplyPeopleVo {
+
+    /**
+     * 主键
+     */
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long id;
+
+    /**
+     * 姓名
+     */
+    private String name;
+
+    /**
+     * 边民号
+     */
+    private String code;
+
+    /**
+     * 性别(1=男,2=女)
+     */
+    private Integer sex;
+
+    /**
+     * 年龄
+     */
+    private Integer age;
+
+    /**
+     * 手机号码
+     */
+    private String phone;
+
+    /**
+     * 角色(1=普通边民,2=兼组长)
+     */
+    private Integer role;
+
+
+    /**
+     * 联系地址
+     */
+    private String address;
+
+
+    /**
+     * 详细地址
+     */
+    private String detailAddress;
+
+
+}

+ 3 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_shop/TbShop.java

@@ -5,6 +5,8 @@ import java.util.*;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -45,6 +47,7 @@ public class TbShop extends Model<TbShop> implements Serializable {
 	 * 主键 
 	 */
 	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;
 
 	/**

+ 3 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_trade_area/TbTradeArea.java

@@ -5,6 +5,8 @@ import java.util.*;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -45,6 +47,7 @@ public class TbTradeArea extends Model<TbTradeArea> implements Serializable {
 	 * 主键 
 	 */
 	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;
 
 	/**

+ 57 - 54
sp-service/level-two-server/src/main/java/com/pj/tb_purchaser/TbPurchaser.java

@@ -5,6 +5,8 @@ import java.util.*;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.pj.common.core.annotation.Excel;
 import lombok.EqualsAndHashCode;
 
@@ -13,7 +15,7 @@ import lombok.experimental.Accessors;
 
 /**
  * Model: tb_purchaser -- 收购商
- * @author qzy 
+ * @author qzy
  */
 @Data
 @Accessors(chain = true)
@@ -23,15 +25,15 @@ public class TbPurchaser extends Model<TbPurchaser> implements Serializable {
 
 	// ---------- 模块常量 ----------
 	/**
-	 * 序列化版本id 
+	 * 序列化版本id
 	 */
-	private static final long serialVersionUID = 1L;	
+	private static final long serialVersionUID = 1L;
 	/**
-	 * 此模块对应的表名 
+	 * 此模块对应的表名
 	 */
-	public static final String TABLE_NAME = "tb_purchaser";	
+	public static final String TABLE_NAME = "tb_purchaser";
 	/**
-	 * 此模块对应的权限码 
+	 * 此模块对应的权限码
 	 */
 	public static final String PERMISSION_CODE = "tb-purchaser";
 	public static final String PERMISSION_CODE_ADD = "tb-purchaser-add";
@@ -43,159 +45,160 @@ public class TbPurchaser extends Model<TbPurchaser> implements Serializable {
 
 	// ---------- 表中字段 ----------
 	/**
-	 * 主键 
+	 * 主键
 	 */
 	@Excel(name = "id")
 	@TableId(type = IdType.AUTO)
-	private Long id;	
+	@JsonSerialize(using = ToStringSerializer.class)
+	private Long id;
 
 	/**
-	 * 名称 
+	 * 名称
 	 */
 	@Excel(name = "名称")
 	private String name;
 
 	/**
-	 * 法人 
+	 * 法人
 	 */
 	@Excel(name = "法人")
-	private String legalPerson;	
+	private String legalPerson;
 
 	/**
-	 * 身份证号 
+	 * 身份证号
 	 */
 	@Excel(name = "身份证号码")
-	private String idCard;	
+	private String idCard;
 
 	/**
-	 * 手机号码 
+	 * 手机号码
 	 */
 	@Excel(name = "手机号码")
-	private String contact;	
+	private String contact;
 
 	/**
-	 * 营业执照 
+	 * 营业执照
 	 */
 	@Excel(name = "营业执照")
-	private String businessLicense;	
+	private String businessLicense;
 
 	/**
-	 * 银行编号 
+	 * 银行编号
 	 */
 	@Excel(name = "银行编号")
-	private String bankNo;	
+	private String bankNo;
 
 	/**
-	 * 银行名称 
+	 * 银行名称
 	 */
 	@Excel(name = "银行名称")
-	private String bankName;	
+	private String bankName;
 
 	/**
-	 * 银行账号 
+	 * 银行账号
 	 */
 	@Excel(name = "银行账号")
-	private String bankAccount;	
+	private String bankAccount;
 
 	/**
-	 * 税号 
+	 * 税号
 	 */
 	@Excel(name = "税号")
-	private String dutyParagraph;	
+	private String dutyParagraph;
 
 	/**
-	 * 地址编号 
+	 * 地址编号
 	 */
 	@Excel(name = "地址编号")
-	private String addressIds;	
+	private String addressIds;
 
 	/**
-	 * 地址 
+	 * 地址
 	 */
 	@Excel(name = "地址")
-	private String address;	
+	private String address;
 
 	/**
-	 * 审核状态(0=未通过,1=已通过) 
+	 * 审核状态(0=未通过,1=已通过)
 	 */
 	@Excel(name = "审核状态")
 	private Integer judgeStatus;
 
 	/**
-	 * 审核意见 
+	 * 审核意见
 	 */
 	@Excel(name = "审核意见")
-	private String judgeContent;	
+	private String judgeContent;
 
 	/**
-	 * 上次审核时间 
+	 * 上次审核时间
 	 */
 	@Excel(name = "上次审核时间")
 	@JsonFormat(pattern = "yyyy-MM-dd")
-	private Date judgeTime;	
+	private Date judgeTime;
 
 	/**
-	 * 注册时间 
+	 * 注册时间
 	 */
 	@Excel(name = "注册时间")
 	@JsonFormat(pattern = "yyyy-MM-dd")
-	private Date registerTime;	
+	private Date registerTime;
 
 	/**
-	 * 人脸编号 
+	 * 人脸编号
 	 */
 	@Excel(name = "人脸编号")
-	private String personId;	
+	private String personId;
 
 	/**
-	 * 创建时间 
+	 * 创建时间
 	 */
 	@Excel(name = "创建时间")
 	@JsonFormat(pattern = "yyyy-MM-dd")
 	private Date createTime;
 
 	/**
-	 * 创建人编号 
+	 * 创建人编号
 	 */
 	@Excel(name = "创建人编号")
-	private String createBy;	
+	private String createBy;
 
 	/**
-	 * 创建人名称 
+	 * 创建人名称
 	 */
 	@Excel(name = "创建人名称")
-	private String createName;	
+	private String createName;
 
 	/**
-	 * 更新时间 
+	 * 更新时间
 	 */
 	@Excel(name = "更新时间")
 	@JsonFormat(pattern = "yyyy-MM-dd")
 	private Date updateTime;
 
 	/**
-	 * 更新人编号 
+	 * 更新人编号
 	 */
 	@Excel(name = "更信人编号")
-	private String updateBy;	
+	private String updateBy;
 
 	/**
-	 * 更新人名称 
+	 * 更新人名称
 	 */
 	@Excel(name = "更新人名称")
-	private String updateName;	
+	private String updateName;
 
 	/**
-	 * 删除状态(0=禁用,1=启用) 
+	 * 删除状态(0=禁用,1=启用)
 	 */
 	@Excel(name = "删除状态")
-	private Integer deleteStatus;	
+	private Integer deleteStatus;
 
 
-
-
-
-	
+	/**
+	 * 是否锁定
+	 */
+	private Integer isLock;
 
 
 }

+ 56 - 0
sp-service/level-two-server/src/main/java/com/pj/tb_purchaser/TbPurchaserAppController.java

@@ -0,0 +1,56 @@
+package com.pj.tb_purchaser;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.pj.common.core.utils.poi.ExcelUtil;
+import com.pj.project4sp.SP;
+import com.pj.utils.sg.AjaxJson;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.List;
+
+
+/**
+ * @author lbl
+ */
+@RestController
+@RequestMapping("/app/TbPurchaser/")
+public class TbPurchaserAppController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbPurchaserService tbPurchaserService;
+
+	/** 查个人信息 - 根据id */
+	@RequestMapping("getById")
+	public AjaxJson getById(Long id){
+		TbPurchaser t = tbPurchaserService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 改个人信息 */
+	@RequestMapping("update")
+	public AjaxJson update(TbPurchaser t){
+		tbPurchaserService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 收购商认证 */
+	@RequestMapping("identification")
+	public AjaxJson identification(TbPurchaser purchaser) {
+		boolean identification = tbPurchaserService.identification(purchaser);
+		if(!identification) return AjaxJson.getError("收购商认证信息提交失败!!!");
+
+		return AjaxJson.getSuccess("收购商认证信息已提交,管理员审核中,请耐心等待!");
+	}
+
+
+
+}

+ 29 - 15
sp-service/level-two-server/src/main/java/com/pj/tb_purchaser/TbPurchaserController.java

@@ -19,7 +19,7 @@ import javax.servlet.http.HttpServletResponse;
 
 /**
  * Controller: tb_purchaser -- 收购商
- * @author qzy 
+ * @author qzy
  */
 @RestController
 @RequestMapping("/TbPurchaser/")
@@ -29,7 +29,7 @@ public class TbPurchaserController {
 	@Autowired
 	TbPurchaserService tbPurchaserService;
 
-	/** 增 */  
+	/** 增 */
 	@RequestMapping("add")
 	@SaCheckPermission(TbPurchaser.PERMISSION_CODE_ADD)
 	public AjaxJson add(TbPurchaser t){
@@ -38,24 +38,24 @@ public class TbPurchaserController {
 		return AjaxJson.getSuccessData(t);
 	}
 
-	/** 删 */  
+	/** 删 */
 	@RequestMapping("delete")
 	@SaCheckPermission(TbPurchaser.PERMISSION_CODE_DEL)
 	public AjaxJson delete(Long id){
 		 tbPurchaserService.delete(id);
 		return AjaxJson.getSuccess();
 	}
-	
-	/** 删 - 根据id列表 */  
+
+	/** 删 - 根据id列表 */
 	@RequestMapping("deleteByIds")
 	@SaCheckPermission(TbPurchaser.PERMISSION_CODE_DEL)
 	public AjaxJson deleteByIds(){
-		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
 		int line = SP.publicMapper.deleteByIds(TbPurchaser.TABLE_NAME, ids);
 		return AjaxJson.getByLine(line);
 	}
-	
-	/** 改 */  
+
+	/** 改 */
 	@RequestMapping("update")
 	@SaCheckPermission(TbPurchaser.PERMISSION_CODE_EDIT)
 	public AjaxJson update(TbPurchaser t){
@@ -63,7 +63,7 @@ public class TbPurchaserController {
 		return AjaxJson.getSuccess();
 	}
 
-	/** 查 - 根据id */  
+	/** 查 - 根据id */
 	@RequestMapping("getById")
 		@SaCheckPermission(TbPurchaser.PERMISSION_CODE)
 	public AjaxJson getById(Long id){
@@ -71,18 +71,18 @@ public class TbPurchaserController {
 		return AjaxJson.getSuccessData(t);
 	}
 
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
 	@RequestMapping("getList")
 		@SaCheckPermission(TbPurchaser.PERMISSION_CODE)
-	public AjaxJson getList() { 
+	public AjaxJson getList() {
 		SoMap so = SoMap.getRequestSoMap();
 		List<TbPurchaser> list = tbPurchaserService.getList(so.startPage());
 		return AjaxJson.getPageData(so.getDataCount(), list);
 	}
-	
-	
-	
-	/** 改 - 删除状态(0=禁用,1=启用) */  
+
+
+
+	/** 改 - 删除状态(0=禁用,1=启用) */
 	@RequestMapping("updateDeleteStatus")
 	@SaCheckPermission(TbPurchaser.PERMISSION_CODE_EDIT)
 	public AjaxJson updateDeleteStatus(Long id, Integer value){
@@ -130,8 +130,22 @@ public class TbPurchaserController {
 	}
 
 
+	/** 收购商审核 */
+	@RequestMapping("audit")
+	@SaCheckPermission(TbPurchaser.PERMISSION_CODE_EDIT)
+	public AjaxJson audit(@RequestBody TbPurchaserDto purchaserDto){
 
+		int line = tbPurchaserService.audit(purchaserDto);
+		return AjaxJson.getByLine(line);
+	}
 
+	/** 是否锁住收购商 */
+	@RequestMapping("isLock")
+	@SaCheckPermission(TbPurchaser.PERMISSION_CODE_EDIT)
+	public AjaxJson isLock(@RequestBody TbPurchaserDto purchaserDto){
 
+		int line = tbPurchaserService.isLock(purchaserDto);
+		return AjaxJson.getByLine(line);
+	}
 
 }

+ 99 - 0
sp-service/level-two-server/src/main/java/com/pj/tb_purchaser/TbPurchaserDto.java

@@ -0,0 +1,99 @@
+package com.pj.tb_purchaser;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class TbPurchaserDto {
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键
+	 */
+	private Long id;
+
+	/**
+	 * 名称
+	 */
+	private String name;
+
+	/**
+	 * 法人
+	 */
+	private String legalPerson;
+
+	/**
+	 * 身份证号
+	 */
+	private String idCard;
+
+	/**
+	 * 手机号码
+	 */
+	private String contact;
+
+	/**
+	 * 营业执照
+	 */
+	private String businessLicense;
+
+	/**
+	 * 银行编号
+	 */
+	private String bankNo;
+
+	/**
+	 * 银行名称
+	 */
+	private String bankName;
+
+	/**
+	 * 银行账号
+	 */
+	private String bankAccount;
+
+	/**
+	 * 税号
+	 */
+	private String dutyParagraph;
+
+	/**
+	 * 地址编号
+	 */
+	private String addressIds;
+
+	/**
+	 * 地址
+	 */
+	private String address;
+
+	/**
+	 * 审核状态(0=未通过,1=已通过)
+	 */
+	private Integer judgeStatus;
+
+	/**
+	 * 审核意见
+	 */
+	private String judgeContent;
+
+	/**
+	 * 人脸编号
+	 */
+	private String personId;
+
+	/**
+	 * 是否锁定
+	 */
+	private Integer isLock;
+
+
+
+}

+ 85 - 4
sp-service/level-two-server/src/main/java/com/pj/tb_purchaser/TbPurchaserService.java

@@ -4,14 +4,20 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
+import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.pj.api.client.admin.AdminInterface;
+import com.pj.current.satoken.StpUserUtil;
+import com.pj.enummj.People;
 import com.pj.utils.so.SoMap;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFRow;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.IService;
@@ -23,7 +29,7 @@ import javax.swing.filechooser.FileSystemView;
 
 /**
  * Service: tb_purchaser -- 收购商
- * @author qzy 
+ * @author qzy
  */
 @Service
 @Transactional(rollbackFor = Exception.class)
@@ -34,6 +40,9 @@ public class TbPurchaserService extends ServiceImpl<TbPurchaserMapper, TbPurchas
 	TbPurchaserMapper tbPurchaserMapper;
 
 	@Autowired
+	AdminInterface adminInterface;
+
+	@Autowired
 	private MethodPurchaserService methodPurchaserService;
 
 	/** 增 */
@@ -57,11 +66,83 @@ public class TbPurchaserService extends ServiceImpl<TbPurchaserMapper, TbPurchas
 		return super.getById(id);
 	}
 
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
-	List<TbPurchaser> getList(SoMap so) { 
-		return tbPurchaserMapper.getList(so);	
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	List<TbPurchaser> getList(SoMap so) {
+		return tbPurchaserMapper.getList(so);
 	}
 
+	/** 收购商认证 */
+	boolean identification(TbPurchaser purchaser){
+		if(null == purchaser) return false;
+
+		//手机号去重
+		String idCard = purchaser.getIdCard();
+		if(tbPurchaserMapper.selectList(new LambdaQueryWrapper<TbPurchaser>().eq(TbPurchaser::getIdCard,idCard).eq(TbPurchaser::getDeleteStatus,1)).size() != 0)
+			throw new RuntimeException("当前手机号已被认证!");
+		//身份证号去重
+		String contact = purchaser.getContact();
+		if(tbPurchaserMapper.selectList(new LambdaQueryWrapper<TbPurchaser>().eq(TbPurchaser::getContact,contact).eq(TbPurchaser::getDeleteStatus,1)).size() != 0)
+			throw new RuntimeException("当前身份证号已被认证!");
+
+		//是否需要手机发送验证码认证?
+
+		//开始保存收购商信息
+		//注册/认证时间
+		purchaser.setRegisterTime(new Date());
+		//创建时间
+		purchaser.setCreateTime(new Date());
+		//删除状态:启用
+		purchaser.setDeleteStatus(1);
+
+		// 保存收购商信息
+		int insert = tbPurchaserMapper.insert(purchaser);
+		return insert == 1;
+	}
+
+	/** 收购商审核 */
+	public int audit(TbPurchaserDto purchaserDto){
+
+		// 获取当前登录用户id
+		Long loginId = StpUserUtil.getLoginIdAsLong();
+
+		// 根据id获取收购商
+		TbPurchaser purchaser = tbPurchaserMapper.selectById(purchaserDto.getId());
+		// 如果收购商不存在则抛出异常
+		if(Objects.isNull(purchaser)){
+			throw new RuntimeException("该收购商不存在");
+		}
+		BeanUtils.copyProperties(purchaserDto,purchaser);
+		// 写入更新者id
+		purchaser.setUpdateBy(String.valueOf(loginId));
+		// 更新收购商审核状态
+		int line = tbPurchaserMapper.updateById(purchaser);
+		return line;
+	}
+
+	/** 是否锁住收购商 */
+	public int isLock(TbPurchaserDto purchaserDto) {
+		// 获取当前登录用户id
+		Long loginId = StpUserUtil.getLoginIdAsLong();
+
+		// 根据id获取收购商
+		TbPurchaser purchaser = tbPurchaserMapper.selectById(purchaserDto.getId());
+		// 如果收购商不存在则抛出异常
+		if(Objects.isNull(purchaser)){
+			throw new RuntimeException("该收购商不存在");
+		}
+		BeanUtils.copyProperties(purchaserDto,purchaser);
+		// 写入更新者id
+		purchaser.setUpdateBy(String.valueOf(loginId));
+		// 更新收购商锁定状态
+		int  line = tbPurchaserMapper.updateById(purchaser);
+		//获取收购商锁定状态
+		int isLock = purchaser.getIsLock();
+		// 如果收购商被锁住则禁止app端登录
+		// TODO
+		adminInterface.isLock(String.valueOf(purchaser.getId()), People.PEOPLE_TYPE_Three.getCode(),isLock);
+
+		return line;
+	}
 
 	/**
 	 * 导入

+ 115 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_menu/AppMenu.java

@@ -0,0 +1,115 @@
+package com.pj.project.app_menu;
+
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: app_menu -- app菜单管理
+ * @author qzy 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(AppMenu.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class AppMenu extends Model<AppMenu> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "app_menu";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "app-menu";
+	public static final String PERMISSION_CODE_ADD = "app-menu-add";
+	public static final String PERMISSION_CODE_EDIT = "app-menu-edit";
+	public static final String PERMISSION_CODE_DEL = "app-menu-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 前端路径 
+	 */
+	private String path;	
+
+	/**
+	 * 菜单名称 
+	 */
+	private String menuName;	
+
+	/**
+	 * 图标 
+	 */
+	private String icon;	
+
+	/**
+	 * 排序 
+	 */
+	private Integer sort;	
+
+	/**
+	 * 状态(0=禁用,1=启用) 
+	 */
+	private String enable;	
+
+	/**
+	 * 是否认证后访问(0=否,1=是) 
+	 */
+	private String auth;	
+
+	/**
+	 * 创建时间 
+	 */
+	private String createTime;	
+
+	/**
+	 * 创建人编号 
+	 */
+	private String createBy;	
+
+	/**
+	 * 创建人名称 
+	 */
+	private String createName;	
+
+	/**
+	 * 更新时间 
+	 */
+	private String updateTime;	
+
+	/**
+	 * 更新人编号 
+	 */
+	private String updateBy;	
+
+	/**
+	 * 更新人名称 
+	 */
+	private String updateName;	
+
+
+
+
+
+	
+
+
+}

+ 103 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_menu/AppMenuController.java

@@ -0,0 +1,103 @@
+package com.pj.project.app_menu;
+
+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: app_menu -- app菜单管理
+ * @author qzy 
+ */
+@RestController
+@RequestMapping("/AppMenu/")
+public class AppMenuController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	AppMenuService appMenuService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(AppMenu.PERMISSION_CODE_ADD)
+	public AjaxJson add(AppMenu a){
+		appMenuService.add(a);
+		a = appMenuService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(a);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(AppMenu.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 appMenuService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(AppMenu.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(AppMenu.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(AppMenu.PERMISSION_CODE_EDIT)
+	public AjaxJson update(AppMenu a){
+		appMenuService.update(a);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(AppMenu.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		AppMenu a = appMenuService.getById(id);
+		return AjaxJson.getSuccessData(a);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(AppMenu.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<AppMenu> list = appMenuService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	/** 改 - 状态(0=禁用,1=启用) */  
+	@RequestMapping("updateEnable")
+	@SaCheckPermission(AppMenu.PERMISSION_CODE_EDIT)
+	public AjaxJson updateEnable(Long id, String value){
+		int line = SP.publicMapper.updateColumnById(AppMenu.TABLE_NAME, "enable", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 - 是否认证后访问(0=否,1=是) */  
+	@RequestMapping("updateAuth")
+	@SaCheckPermission(AppMenu.PERMISSION_CODE_EDIT)
+	public AjaxJson updateAuth(Long id, String value){
+		int line = SP.publicMapper.updateColumnById(AppMenu.TABLE_NAME, "auth", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	
+
+	
+	
+	
+
+}

+ 30 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_menu/AppMenuMapper.java

@@ -0,0 +1,30 @@
+package com.pj.project.app_menu;
+
+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: app_menu -- app菜单管理
+ * @author qzy 
+ */
+
+@Mapper
+@Repository
+public interface AppMenuMapper extends BaseMapper <AppMenu> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<AppMenu> getList(SoMap so);
+
+
+}

+ 67 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_menu/AppMenuMapper.xml

@@ -0,0 +1,67 @@
+<?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.project.app_menu.AppMenuMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, path, menu_name, icon, sort, enable, auth, create_time, create_by, create_name, update_time, update_by, update_name from app_menu  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.project.app_menu.AppMenu"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from app_menu 
+	</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("path") '> and path = #{path} </if>
+			<if test=' this.has("menuName") '> and menu_name = #{menuName} </if>
+			<if test=' this.has("icon") '> and icon = #{icon} </if>
+			<if test=' this.has("sort") '> and sort = #{sort} </if>
+			<if test=' this.has("enable") '> and enable = #{enable} </if>
+			<if test=' this.has("auth") '> and auth = #{auth} </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>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> path desc </when>
+			<when test='sortType == 3'> menu_name desc </when>
+			<when test='sortType == 4'> icon desc </when>
+			<when test='sortType == 5'> sort desc </when>
+			<when test='sortType == 6'> enable desc </when>
+			<when test='sortType == 7'> auth desc </when>
+			<when test='sortType == 8'> create_time desc </when>
+			<when test='sortType == 9'> create_by desc </when>
+			<when test='sortType == 10'> create_name desc </when>
+			<when test='sortType == 11'> update_time desc </when>
+			<when test='sortType == 12'> update_by desc </when>
+			<when test='sortType == 13'> update_name desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 50 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_menu/AppMenuService.java

@@ -0,0 +1,50 @@
+package com.pj.project.app_menu;
+
+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;
+
+/**
+ * Service: app_menu -- app菜单管理
+ * @author qzy 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class AppMenuService extends ServiceImpl<AppMenuMapper, AppMenu> implements IService<AppMenu>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	AppMenuMapper appMenuMapper;
+
+	/** 增 */
+	void add(AppMenu a){
+		save(a);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(AppMenu a){
+		updateById(a);
+
+	}
+
+	/** 查 */
+	AppMenu getById(Long id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<AppMenu> getList(SoMap so) { 
+		return appMenuMapper.getList(so);	
+	}
+	
+
+}

+ 27 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_menu/AppMenuUtil.java

@@ -0,0 +1,27 @@
+package com.pj.project.app_menu;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 工具类:app_menu -- app菜单管理
+ * @author qzy 
+ *
+ */
+@Component
+public class AppMenuUtil {
+
+	
+	/** 底层 Mapper 对象 */
+	public static AppMenuMapper appMenuMapper;
+	@Autowired
+	private void setAppMenuMapper(AppMenuMapper appMenuMapper) {
+		AppMenuUtil.appMenuMapper = appMenuMapper;
+	}
+	
+
+
+	
+	
+	
+}

+ 70 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_role/AppRole.java

@@ -0,0 +1,70 @@
+package com.pj.project.app_role;
+
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: app_role -- 
+ * @author qzy 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(AppRole.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class AppRole extends Model<AppRole> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "app_role";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "app-role";
+	public static final String PERMISSION_CODE_ADD = "app-role-add";
+	public static final String PERMISSION_CODE_EDIT = "app-role-edit";
+	public static final String PERMISSION_CODE_DEL = "app-role-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 角色名称 
+	 */
+	private String roleName;	
+
+	/**
+	 * 创建时间 
+	 */
+	private String createTime;	
+
+	/**
+	 * 类型(1=边民,2=组长,3=商户,4=收购商,5=司机) 
+	 */
+	private String userType;	
+
+
+
+
+
+	
+
+
+}

+ 87 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_role/AppRoleController.java

@@ -0,0 +1,87 @@
+package com.pj.project.app_role;
+
+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: app_role -- 
+ * @author qzy 
+ */
+@RestController
+@RequestMapping("/AppRole/")
+public class AppRoleController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	AppRoleService appRoleService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(AppRole.PERMISSION_CODE_ADD)
+	public AjaxJson add(AppRole a){
+		appRoleService.add(a);
+		a = appRoleService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(a);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(AppRole.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 appRoleService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(AppRole.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(AppRole.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(AppRole.PERMISSION_CODE_EDIT)
+	public AjaxJson update(AppRole a){
+		appRoleService.update(a);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(AppRole.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		AppRole a = appRoleService.getById(id);
+		return AjaxJson.getSuccessData(a);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(AppRole.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<AppRole> list = appRoleService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	
+
+	
+	
+	
+
+}

+ 30 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_role/AppRoleMapper.java

@@ -0,0 +1,30 @@
+package com.pj.project.app_role;
+
+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: app_role -- 
+ * @author qzy 
+ */
+
+@Mapper
+@Repository
+public interface AppRoleMapper extends BaseMapper <AppRole> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<AppRole> getList(SoMap so);
+
+
+}

+ 49 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_role/AppRoleMapper.xml

@@ -0,0 +1,49 @@
+<?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.project.app_role.AppRoleMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, role_name, create_time, user_type from app_role  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.project.app_role.AppRole"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from app_role 
+	</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("roleName") '> and role_name = #{roleName} </if>
+			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
+			<if test=' this.has("userType") '> and user_type = #{userType} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> role_name desc </when>
+			<when test='sortType == 3'> create_time desc </when>
+			<when test='sortType == 4'> user_type desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 51 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_role/AppRoleService.java

@@ -0,0 +1,51 @@
+package com.pj.project.app_role;
+
+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: app_role -- 
+ * @author qzy 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class AppRoleService extends ServiceImpl<AppRoleMapper, AppRole> implements IService<AppRole>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	AppRoleMapper appRoleMapper;
+
+	/** 增 */
+	void add(AppRole a){
+		save(a);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(AppRole a){
+		updateById(a);
+
+	}
+
+	/** 查 */
+	AppRole getById(Long id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<AppRole> getList(SoMap so) { 
+		return appRoleMapper.getList(so);	
+	}
+	
+
+}

+ 27 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_role/AppRoleUtil.java

@@ -0,0 +1,27 @@
+package com.pj.project.app_role;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 工具类:app_role -- 
+ * @author qzy 
+ *
+ */
+@Component
+public class AppRoleUtil {
+
+	
+	/** 底层 Mapper 对象 */
+	public static AppRoleMapper appRoleMapper;
+	@Autowired
+	private void setAppRoleMapper(AppRoleMapper appRoleMapper) {
+		AppRoleUtil.appRoleMapper = appRoleMapper;
+	}
+	
+
+
+	
+	
+	
+}

+ 31 - 12
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserController.java

@@ -2,6 +2,7 @@ package com.pj.project.app_user;
 
 import java.util.List;
 
+import com.pj.api.dto.AppUserDto;
 import com.pj.project.app_user.dto.ForgetPasswordDto;
 import com.pj.project.app_user.dto.RegisterDto;
 import com.pj.utils.so.SoMap;
@@ -19,7 +20,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
 
 /**
  * Controller: app_user -- 移动端账号
- * @author qzy 
+ * @author qzy
  */
 @RestController
 @RequestMapping("/AppUser/")
@@ -29,7 +30,7 @@ public class AppUserController {
 	@Autowired
 	AppUserService appUserService;
 
-	/** 增 */  
+	/** 增 */
 	@RequestMapping("add")
 	@SaCheckPermission(AppUser.PERMISSION_CODE_ADD)
 	public AjaxJson add(AppUser a){
@@ -38,24 +39,24 @@ public class AppUserController {
 		return AjaxJson.getSuccessData(a);
 	}
 
-	/** 删 */  
+	/** 删 */
 	@RequestMapping("delete")
 	@SaCheckPermission(AppUser.PERMISSION_CODE_DEL)
 	public AjaxJson delete(Long id){
 		 appUserService.delete(id);
 		return AjaxJson.getSuccess();
 	}
-	
-	/** 删 - 根据id列表 */  
+
+	/** 删 - 根据id列表 */
 	@RequestMapping("deleteByIds")
 	@SaCheckPermission(AppUser.PERMISSION_CODE_DEL)
 	public AjaxJson deleteByIds(){
-		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
 		int line = SP.publicMapper.deleteByIds(AppUser.TABLE_NAME, ids);
 		return AjaxJson.getByLine(line);
 	}
-	
-	/** 改 */  
+
+	/** 改 */
 	@RequestMapping("update")
 	@SaCheckPermission(AppUser.PERMISSION_CODE_EDIT)
 	public AjaxJson update(AppUser a){
@@ -63,7 +64,7 @@ public class AppUserController {
 		return AjaxJson.getSuccess();
 	}
 
-	/** 查 - 根据id */  
+	/** 查 - 根据id */
 	@RequestMapping("getById")
 		@SaCheckPermission(AppUser.PERMISSION_CODE)
 	public AjaxJson getById(Long id){
@@ -71,16 +72,26 @@ public class AppUserController {
 		return AjaxJson.getSuccessData(a);
 	}
 
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
 	@RequestMapping("getList")
 		@SaCheckPermission(AppUser.PERMISSION_CODE)
-	public AjaxJson getList() { 
+	public AjaxJson getList() {
 		SoMap so = SoMap.getRequestSoMap();
 		List<AppUser> list = appUserService.getList(so.startPage());
 		return AjaxJson.getPageData(so.getDataCount(), list);
 	}
 
-
+	/**
+	 * 更换角色
+	 *
+	 * 当前用户已登录,app点击该按钮时,从缓存获取用户类型与选择要更换的角色id做对比,相同则进入此方法,故在此不做用户角色权限过滤
+	 * @param appRoleId
+	 * @return
+	 */
+	@RequestMapping("updateRole")
+	AjaxJson updateRole(@RequestParam("appRoleId")String appRoleId) {
+		return appUserService.updateRole(appRoleId);
+	}
 
 	/*-----               正常业务接口👆👆    不越界     rpc远程调用 👇👇                     -----*/
 
@@ -95,5 +106,13 @@ public class AppUserController {
 		return AjaxJson.getError();
 	}
 
+	/** 查单个app有效用户 - 根据id */
+	@RequestMapping("rpc/getById")
+	public AppUserDto getAppUserById(@RequestParam("id") Long id){
+		AppUserDto appUser = appUserService.getUserById(id);
+		return appUser;
+	}
+
+
 
 }

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

@@ -6,6 +6,7 @@ import java.util.stream.Collectors;
 
 import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.pj.api.dto.AppUserDto;
 import com.pj.current.satoken.StpUserUtil;
 import com.pj.project.app_user.dto.ForgetPasswordDto;
 import com.pj.project.app_user.dto.RegisterDto;
@@ -15,6 +16,7 @@ import com.pj.utils.cache.RedisUtil;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.stereotype.Service;
@@ -40,6 +42,8 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
 	//权限字符
 	@Autowired
 	private ReRoleMenuMapper reRoleMenuMapper;
+	/** 验证码前缀 */
+	String PREFIX = "app_user:phone:sms_code:";
 
 
 
@@ -66,6 +70,20 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
 		return super.getById(id);
 	}
 
+	/** 查询单个APP有效用户 */
+	public AppUserDto getUserById(Long id){
+		//查单个
+		AppUser appUser = appUserMapper.selectById(id);
+		if (appUser == null)return null;
+		//判断有效性
+		if(!appUser.getStatus().equals("0") && appUser.getDeleteStatus() != 0){
+			AppUserDto appUserDto = new AppUserDto();
+			BeanUtils.copyProperties(appUser,appUserDto);
+			return appUserDto;
+		}
+		return null;
+	}
+
 	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
 	List<AppUser> getList(SoMap so) {
 		return appUserMapper.getList(so);
@@ -233,8 +251,26 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
 		// return false;
 
 		//todo: 保存到缓存,默认1分钟
-		RedisUtil.setByMINUTES(phone,smsCode, 1);
+		RedisUtil.setByMINUTES(PREFIX + phone,smsCode, 1);
 
 		return true;
 	}
+
+
+	/** 更换角色 */
+	AjaxJson updateRole(String appRoleId){
+		// 获取当前用户角色权限字符
+		List<ReRoleMenu> reRoleMenus = reRoleMenuMapper.selectList(new LambdaQueryWrapper<ReRoleMenu>().eq(ReRoleMenu::getAppRoleId, appRoleId));
+		// 使用stream流对其reRoleMenus集合的权限字符进行过滤顺便转成String类型
+		List<String> per_list = reRoleMenus.stream().map(ReRoleMenu::getAppMenuId).collect(Collectors.toList()).stream().map(String::valueOf).collect(Collectors.toList());
+		if(reRoleMenus.size() == 0)return AjaxJson.getError("当前用户角色暂无权限!");
+
+		SoMap map = new SoMap();
+		map.put("per_list", per_list);
+		StpUserUtil.cachePerList(per_list);
+
+		return AjaxJson.getSuccessData(map);
+	}
+
+
 }

+ 1 - 0
sp-service/sp-admin/src/main/java/com/pj/project4sp/admin/SpAdmin.java

@@ -3,6 +3,7 @@ package com.pj.project4sp.admin;
 import java.io.Serializable;
 import java.util.Date;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 
 import lombok.Data;

+ 39 - 0
sp-service/sp-admin/src/main/java/com/pj/project4sp/admin/SpLoginInfo.java

@@ -0,0 +1,39 @@
+package com.pj.project4sp.admin;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class SpLoginInfo {
+    /** id,--主键、自增 */
+    private String id;
+    /** admin名称 */
+    private String name;
+    /** 手机号 */
+    private String phone;
+
+    /** 所属角色id */
+    private Integer roleId;
+
+    /** 账号状态(1=正常, 2=禁用) */
+    private Integer status;
+
+    /** 上次登陆时间 */
+
+    private Date loginTime;
+
+    /** 上次登陆IP */
+    private String loginIp;
+
+    /** 登陆次数 */
+    private Integer loginCount;
+
+}

+ 4 - 0
sp-service/sp-admin/src/main/java/com/pj/project4sp/admin4login/SpAccAdminController.java

@@ -3,7 +3,9 @@ package com.pj.project4sp.admin4login;
 import javax.servlet.http.HttpServletRequest;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.json.JSONUtil;
 import com.pj.current.satoken.AuthConst;
+import com.pj.utils.cache.RedisUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
@@ -49,6 +51,8 @@ public class SpAccAdminController {
 	/** 退出登录  */
 	@RequestMapping("doExit")
 	AjaxJson doExit() {
+		// 退出时删除登录信息
+		RedisUtil.del("loginInfo:");
 		StpUtil.logout();
 		return AjaxJson.getSuccess();
 	}

+ 9 - 1
sp-service/sp-admin/src/main/java/com/pj/project4sp/admin4login/SpAccAdminService.java

@@ -5,7 +5,11 @@ import java.util.Date;
 import java.util.List;
 
 import com.pj.current.dto.PCLoginUserInfo;
+import cn.hutool.json.JSONUtil;
 import com.pj.current.satoken.StpUserUtil;
+import com.pj.project4sp.admin.SpLoginInfo;
+import com.pj.utils.cache.RedisUtil;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
@@ -91,16 +95,20 @@ public class SpAccAdminService {
             return AjaxJson.getError("此账号已被禁用,如有疑问,请联系管理员");
         }
 
-        // =========== 至此, 已登录成功 ============ 
+        // =========== 至此, 已登录成功 ============
         successLogin(admin);
         StpUtil.login(admin.getId());
         // 组织返回参数
+        SpLoginInfo spLoginInfo = new SpLoginInfo();
+        BeanUtils.copyProperties(admin,spLoginInfo);
         SoMap map = new SoMap();
         map.put("admin", admin);
         List<String> per_list = spRolePermissionService.getPcodeByRid2(admin.getRoleId());
         map.put("per_list", per_list);
         map.put("tokenInfo", StpUtil.getTokenInfo());
         StpUserUtil.cachePerList(per_list);
+        // 记录登录信息至redis
+        RedisUtil.set("loginInfo:", JSONUtil.toJsonStr(spLoginInfo));
         PCLoginUserInfo info=new PCLoginUserInfo();
         info.setLoginId(admin.getId()).setLoginName(admin.getName());
         StpUserUtil.cachePcLoginInfo(info);

+ 7 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_driver/TbDriver.java

@@ -5,6 +5,9 @@ import java.util.*;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.pj.common.core.annotation.Excel;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -45,21 +48,25 @@ public class TbDriver extends Model<TbDriver> implements Serializable {
 	 * 主键 
 	 */
 	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;	
 
 	/**
 	 * 姓名 
 	 */
+	@Excel(name = "姓名")
 	private String name;	
 
 	/**
 	 * 年龄 
 	 */
+	@Excel(name = "年龄")
 	private Integer age;	
 
 	/**
 	 * 性别性别(1=男,2=女) 
 	 */
+	@Excel(name = "性别")
 	private Integer sex;
 
 	/**

+ 47 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_driver/TbDriverAppController.java

@@ -0,0 +1,47 @@
+package com.pj.project.tb_driver;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.pj.project4sp.SP;
+import com.pj.utils.sg.AjaxJson;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.List;
+
+
+/**
+ * @author lbl
+ */
+@RestController
+@RequestMapping("/app/TbDriver/")
+public class TbDriverAppController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbDriverService tbDriverService;
+
+	/** 查个人信息 - 根据id */
+	@RequestMapping("getById")
+	public AjaxJson getById(Long id){
+		TbDriver t = tbDriverService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 改个人信息 */
+	@RequestMapping("update")
+	public AjaxJson update(TbDriver t){
+		tbDriverService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+
+
+
+
+}

+ 111 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_favorite_contacts/TbFavoriteContacts.java

@@ -0,0 +1,111 @@
+package com.pj.project.tb_favorite_contacts;
+
+import java.io.Serializable;
+import java.util.*;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: tb_favorite_contacts -- 常用联系人
+ * @author lbl
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbFavoriteContacts.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbFavoriteContacts extends Model<TbFavoriteContacts> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id
+	 */
+	private static final long serialVersionUID = 1L;
+	/**
+	 * 此模块对应的表名
+	 */
+	public static final String TABLE_NAME = "tb_favorite_contacts";
+	/**
+	 * 此模块对应的权限码
+	 */
+	public static final String PERMISSION_CODE = "tb-favorite-contacts";
+	public static final String PERMISSION_CODE_ADD = "tb-favorite-contacts-add";
+	public static final String PERMISSION_CODE_EDIT = "tb-favorite-contacts-edit";
+	public static final String PERMISSION_CODE_DEL = "tb-favorite-contacts-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;
+
+	/**
+	 * 姓名
+	 */
+	private String name;
+
+	/**
+	 * 手机号
+	 */
+	private String phone;
+
+	/**
+	 * 联系地址
+	 */
+	private String address;
+
+	/**
+	 * 管理人(外联id,与app_user表的id相等)
+	 */
+	private Long fkAppUserId;
+
+	/**
+	 * 创建时间
+	 */
+	private Date createTime;
+
+	/**
+	 * 创建者id
+	 */
+	private String createBy;
+
+	/**
+	 * 创建者名称
+	 */
+	private String createName;
+
+	/**
+	 * 更新时间
+	 */
+	private Date updateTime;
+
+	/**
+	 * 更新者id
+	 */
+	private String updateBy;
+
+	/**
+	 * 更新者名称
+	 */
+	private String updateName;
+
+	/**
+	 * 删除状态
+	 */
+	private String deleteStatus;
+
+
+
+
+
+
+
+
+}

+ 88 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_favorite_contacts/TbFavoriteContactsController.java

@@ -0,0 +1,88 @@
+package com.pj.project.tb_favorite_contacts;
+
+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_favorite_contacts -- 常用联系人
+ * @author lbl
+ */
+@RestController
+@RequestMapping("/TbFavoriteContacts/")
+public class TbFavoriteContactsController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbFavoriteContactsService tbFavoriteContactsService;
+
+	/** 增 */
+	@RequestMapping("add")
+	@SaCheckPermission(TbFavoriteContacts.PERMISSION_CODE_ADD)
+	public AjaxJson add(TbFavoriteContacts t){
+		tbFavoriteContactsService.add(t);
+		t = tbFavoriteContactsService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */
+	@RequestMapping("delete")
+	@SaCheckPermission(TbFavoriteContacts.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 tbFavoriteContactsService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 删 - 根据id列表 */
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbFavoriteContacts.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+		int line = SP.publicMapper.deleteByIds(TbFavoriteContacts.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+
+	/** 改 */
+	@RequestMapping("update")
+	@SaCheckPermission(TbFavoriteContacts.PERMISSION_CODE_EDIT)
+	public AjaxJson update(TbFavoriteContacts t){
+		tbFavoriteContactsService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */
+	@RequestMapping("getById")
+		@SaCheckPermission(TbFavoriteContacts.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		TbFavoriteContacts t = tbFavoriteContactsService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	@RequestMapping("getList")
+		@SaCheckPermission(TbFavoriteContacts.PERMISSION_CODE)
+	public AjaxJson getList() {
+		SoMap so = SoMap.getRequestSoMap();
+		so.set("deleteStatus", 1);
+		List<TbFavoriteContacts> list = tbFavoriteContactsService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+
+
+
+
+
+
+
+
+
+}

+ 30 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_favorite_contacts/TbFavoriteContactsMapper.java

@@ -0,0 +1,30 @@
+package com.pj.project.tb_favorite_contacts;
+
+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_favorite_contacts -- 常用联系人
+ * @author lbl
+ */
+
+@Mapper
+@Repository
+public interface TbFavoriteContactsMapper extends BaseMapper <TbFavoriteContacts> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合
+	 * @return 数据列表
+	 */
+	List<TbFavoriteContacts> getList(SoMap so);
+
+
+}

+ 62 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_favorite_contacts/TbFavoriteContactsMapper.xml

@@ -0,0 +1,62 @@
+<?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.project.tb_favorite_contacts.TbFavoriteContactsMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, name, phone, address, fk_app_user_id, create_time, create_by, create_name, update_time, update_by, update_name, delete_status from tb_favorite_contacts  -->
+
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.project.tb_favorite_contacts.TbFavoriteContacts"></resultMap>
+
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select *
+		from tb_favorite_contacts
+	</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("name") '> and name = #{name} </if>
+			<if test=' this.has("phone") '> and phone = #{phone} </if>
+			<if test=' this.has("address") '> and address = #{address} </if>
+			<if test=' this.has("fkAppUserId") '> and fk_app_user_id = #{fkAppUserId} </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("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'> name desc </when>
+			<when test='sortType == 3'> phone desc </when>
+			<when test='sortType == 4'> address desc </when>
+			<when test='sortType == 5'> fk_app_user_id desc </when>
+			<when test='sortType == 6'> create_time desc </when>
+			<when test='sortType == 7'> create_by desc </when>
+			<when test='sortType == 8'> create_name desc </when>
+			<when test='sortType == 9'> update_time desc </when>
+			<when test='sortType == 10'> update_by desc </when>
+			<when test='sortType == 11'> update_name desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+
+
+
+
+
+
+
+
+
+
+</mapper>

+ 51 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_favorite_contacts/TbFavoriteContactsService.java

@@ -0,0 +1,51 @@
+package com.pj.project.tb_favorite_contacts;
+
+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_favorite_contacts -- 常用联系人
+ * @author lbl
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class TbFavoriteContactsService extends ServiceImpl<TbFavoriteContactsMapper, TbFavoriteContacts> implements IService<TbFavoriteContacts>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbFavoriteContactsMapper tbFavoriteContactsMapper;
+
+	/** 增 */
+	void add(TbFavoriteContacts t){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(TbFavoriteContacts t){
+		updateById(t);
+
+	}
+
+	/** 查 */
+	TbFavoriteContacts getById(Long id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	List<TbFavoriteContacts> getList(SoMap so) {
+		return tbFavoriteContactsMapper.getList(so);
+	}
+
+
+}

+ 30 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_favorite_contacts/TbFavoriteContactsUtil.java

@@ -0,0 +1,30 @@
+package com.pj.project.tb_favorite_contacts;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.pj.utils.sg.*;
+import java.util.*;
+
+/**
+ * 工具类:tb_favorite_contacts -- 常用联系人
+ * @author lbl
+ *
+ */
+@Component
+public class TbFavoriteContactsUtil {
+
+
+	/** 底层 Mapper 对象 */
+	public static TbFavoriteContactsMapper tbFavoriteContactsMapper;
+	@Autowired
+	private void setTbFavoriteContactsMapper(TbFavoriteContactsMapper tbFavoriteContactsMapper) {
+		TbFavoriteContactsUtil.tbFavoriteContactsMapper = tbFavoriteContactsMapper;
+	}
+
+
+
+
+
+
+}

+ 170 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogistics.java

@@ -0,0 +1,170 @@
+package com.pj.project.tb_logistics;
+
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: tb_logistics -- 物流表
+ * @author qzy 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbLogistics.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbLogistics extends Model<TbLogistics> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "tb_logistics";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "tb-logistics";
+	public static final String PERMISSION_CODE_ADD = "tb-logistics-add";
+	public static final String PERMISSION_CODE_EDIT = "tb-logistics-edit";
+	public static final String PERMISSION_CODE_DEL = "tb-logistics-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 物流表主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 订单表ID 
+	 */
+	private Long ordersId;	
+
+	/**
+	 * (预留字段) 申报订单号 
+	 */
+	private String declarationNumber;	
+
+	/**
+	 * 订单待确认(0=待确认,1=订单已确认,2=订单确认失败) 
+	 */
+	private Integer prepare;	
+
+	/**
+	 * 订单确认时间 
+	 */
+	private String prepareTime;	
+
+	/**
+	 * 待装货(0=待装货,1=已装货) 
+	 */
+	private Integer loading;	
+
+	/**
+	 * 已装货时间 
+	 */
+	private String loadingTime;	
+
+	/**
+	 * 发货(0=未发,1=已发) 
+	 */
+	private Integer delivery;	
+
+	/**
+	 * 发货时间 
+	 */
+	private String deliveryTime;	
+
+	/**
+	 * 已出海关(0=禁用,1=启用) 
+	 */
+	private Integer clearedCustom;	
+
+	/**
+	 * 出海关时间 
+	 */
+	private String clearedCustomTime;	
+
+	/**
+	 * 接货人确定接货(0=禁用,1=启用) 
+	 */
+	private Integer makeCargo;	
+
+	/**
+	 * 接货完成时间 
+	 */
+	private String makeCargoTime;	
+
+	/**
+	 * 收购商确认(0=禁用,1=启用) 
+	 */
+	private Integer confirmReceipt;	
+
+	/**
+	 * 收货方确认时间(相当于订单完成时间) 
+	 */
+	private String confirmReceiptTime;	
+
+	/**
+	 * 订单状态已完成(0=进行中,1=已完成) 
+	 */
+	private Integer orderFinish;	
+
+	/**
+	 * 创建时间 
+	 */
+	private String createTime;	
+
+	/**
+	 * 创建人编号 
+	 */
+	private String createBy;	
+
+	/**
+	 * 创建人名称 
+	 */
+	private String createName;	
+
+	/**
+	 * 更新时间 
+	 */
+	private String updateTime;	
+
+	/**
+	 * 更新人编号 
+	 */
+	private String updateBy;	
+
+	/**
+	 * 更新人名称 
+	 */
+	private String updateName;	
+
+	/**
+	 * 删除状态(0=禁用,1=启用) 
+	 */
+	private Integer deleteStatus;	
+
+	/**
+	 * 一级市场订单ID 
+	 */
+	private Long levelOneOrderId;	
+
+
+
+
+
+	
+
+
+}

+ 149 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsController.java

@@ -0,0 +1,149 @@
+package com.pj.project.tb_logistics;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: tb_logistics -- 物流表
+ * @author qzy 
+ */
+@RestController
+@RequestMapping("/TbLogistics/")
+public class TbLogisticsController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbLogisticsService tbLogisticsService;
+
+	/** 增 */
+	@RequestMapping("add")
+	@SaCheckPermission(TbLogistics.PERMISSION_CODE_ADD)
+	public AjaxJson add(TbLogistics t){
+		tbLogisticsService.add(t);
+		t = tbLogisticsService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(TbLogistics.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 tbLogisticsService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbLogistics.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(TbLogistics.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(TbLogistics.PERMISSION_CODE_EDIT)
+	public AjaxJson update(TbLogistics t){
+		tbLogisticsService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(TbLogistics.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		TbLogistics t = tbLogisticsService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(TbLogistics.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<TbLogistics> list = tbLogisticsService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	/** 改 - 订单待确认(0=待确认,1=订单已确认,2=订单确认失败) */  
+	@RequestMapping("updatePrepare")
+	@SaCheckPermission(TbLogistics.PERMISSION_CODE_EDIT)
+	public AjaxJson updatePrepare(Long id, Integer value){
+		int line = SP.publicMapper.updateColumnById(TbLogistics.TABLE_NAME, "prepare", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 - 待装货(0=待装货,1=已装货) */  
+	@RequestMapping("updateLoading")
+	@SaCheckPermission(TbLogistics.PERMISSION_CODE_EDIT)
+	public AjaxJson updateLoading(Long id, Integer value){
+		int line = SP.publicMapper.updateColumnById(TbLogistics.TABLE_NAME, "loading", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 - 发货(0=未发,1=已发) */  
+	@RequestMapping("updateDelivery")
+	@SaCheckPermission(TbLogistics.PERMISSION_CODE_EDIT)
+	public AjaxJson updateDelivery(Long id, Integer value){
+		int line = SP.publicMapper.updateColumnById(TbLogistics.TABLE_NAME, "delivery", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 - 已出海关(0=禁用,1=启用) */  
+	@RequestMapping("updateClearedCustom")
+	@SaCheckPermission(TbLogistics.PERMISSION_CODE_EDIT)
+	public AjaxJson updateClearedCustom(Long id, Integer value){
+		int line = SP.publicMapper.updateColumnById(TbLogistics.TABLE_NAME, "cleared_custom", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 - 接货人确定接货(0=禁用,1=启用) */  
+	@RequestMapping("updateMakeCargo")
+	@SaCheckPermission(TbLogistics.PERMISSION_CODE_EDIT)
+	public AjaxJson updateMakeCargo(Long id, Integer value){
+		int line = SP.publicMapper.updateColumnById(TbLogistics.TABLE_NAME, "make_cargo", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 - 收购商确认(0=禁用,1=启用) */  
+	@RequestMapping("updateConfirmReceipt")
+	@SaCheckPermission(TbLogistics.PERMISSION_CODE_EDIT)
+	public AjaxJson updateConfirmReceipt(Long id, Integer value){
+		int line = SP.publicMapper.updateColumnById(TbLogistics.TABLE_NAME, "confirm_receipt", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 - 订单状态已完成(0=进行中,1=已完成) */  
+	@RequestMapping("updateOrderFinish")
+	@SaCheckPermission(TbLogistics.PERMISSION_CODE_EDIT)
+	public AjaxJson updateOrderFinish(Long id, Integer value){
+		int line = SP.publicMapper.updateColumnById(TbLogistics.TABLE_NAME, "order_finish", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 - 删除状态(0=禁用,1=启用) */  
+	@RequestMapping("updateDeleteStatus")
+	@SaCheckPermission(TbLogistics.PERMISSION_CODE_EDIT)
+	public AjaxJson updateDeleteStatus(Long id, Integer value){
+		int line = SP.publicMapper.updateColumnById(TbLogistics.TABLE_NAME, "delete_status", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	
+
+	
+	
+	
+
+}

+ 30 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsMapper.java

@@ -0,0 +1,30 @@
+package com.pj.project.tb_logistics;
+
+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_logistics -- 物流表
+ * @author qzy 
+ */
+
+@Mapper
+@Repository
+public interface TbLogisticsMapper extends BaseMapper <TbLogistics> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<TbLogistics> getList(SoMap so);
+
+
+}

+ 89 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsMapper.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.project.tb_logistics.TbLogisticsMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, orders_id, declaration_number, prepare, prepare_time, loading, loading_time, delivery, delivery_time, cleared_custom, cleared_custom_time, make_cargo, make_cargo_time, confirm_receipt, confirm_receipt_time, order_finish, create_time, create_by, create_name, update_time, update_by, update_name, delete_status, level_one_order_id from tb_logistics  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.project.tb_logistics.TbLogistics"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from tb_logistics 
+	</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("ordersId") '> and orders_id = #{ordersId} </if>
+			<if test=' this.has("declarationNumber") '> and declaration_number = #{declarationNumber} </if>
+			<if test=' this.has("prepare") '> and prepare = #{prepare} </if>
+			<if test=' this.has("prepareTime") '> and prepare_time = #{prepareTime} </if>
+			<if test=' this.has("loading") '> and loading = #{loading} </if>
+			<if test=' this.has("loadingTime") '> and loading_time = #{loadingTime} </if>
+			<if test=' this.has("delivery") '> and delivery = #{delivery} </if>
+			<if test=' this.has("deliveryTime") '> and delivery_time = #{deliveryTime} </if>
+			<if test=' this.has("clearedCustom") '> and cleared_custom = #{clearedCustom} </if>
+			<if test=' this.has("clearedCustomTime") '> and cleared_custom_time = #{clearedCustomTime} </if>
+			<if test=' this.has("makeCargo") '> and make_cargo = #{makeCargo} </if>
+			<if test=' this.has("makeCargoTime") '> and make_cargo_time = #{makeCargoTime} </if>
+			<if test=' this.has("confirmReceipt") '> and confirm_receipt = #{confirmReceipt} </if>
+			<if test=' this.has("confirmReceiptTime") '> and confirm_receipt_time = #{confirmReceiptTime} </if>
+			<if test=' this.has("orderFinish") '> and order_finish = #{orderFinish} </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>
+			<if test=' this.has("levelOneOrderId") '> and level_one_order_id = #{levelOneOrderId} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> orders_id desc </when>
+			<when test='sortType == 3'> declaration_number desc </when>
+			<when test='sortType == 4'> prepare desc </when>
+			<when test='sortType == 5'> prepare_time desc </when>
+			<when test='sortType == 6'> loading desc </when>
+			<when test='sortType == 7'> loading_time desc </when>
+			<when test='sortType == 8'> delivery desc </when>
+			<when test='sortType == 9'> delivery_time desc </when>
+			<when test='sortType == 10'> cleared_custom desc </when>
+			<when test='sortType == 11'> cleared_custom_time desc </when>
+			<when test='sortType == 12'> make_cargo desc </when>
+			<when test='sortType == 13'> make_cargo_time desc </when>
+			<when test='sortType == 14'> confirm_receipt desc </when>
+			<when test='sortType == 15'> confirm_receipt_time desc </when>
+			<when test='sortType == 16'> order_finish desc </when>
+			<when test='sortType == 17'> create_time desc </when>
+			<when test='sortType == 18'> create_by desc </when>
+			<when test='sortType == 19'> create_name desc </when>
+			<when test='sortType == 20'> update_time desc </when>
+			<when test='sortType == 21'> update_by desc </when>
+			<when test='sortType == 22'> update_name desc </when>
+			<when test='sortType == 23'> delete_status desc </when>
+			<when test='sortType == 24'> level_one_order_id desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 51 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsService.java

@@ -0,0 +1,51 @@
+package com.pj.project.tb_logistics;
+
+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;
+
+/**
+ * Service: tb_logistics -- 物流表
+ * @author qzy 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class TbLogisticsService extends ServiceImpl<TbLogisticsMapper, TbLogistics> implements IService<TbLogistics>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbLogisticsMapper tbLogisticsMapper;
+
+	/** 增 */
+	void add(TbLogistics t){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(TbLogistics t){
+		updateById(t);
+
+	}
+
+	/** 查 */
+	TbLogistics getById(Long id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<TbLogistics> getList(SoMap so) { 
+		return tbLogisticsMapper.getList(so);	
+	}
+
+
+
+}

+ 27 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_logistics/TbLogisticsUtil.java

@@ -0,0 +1,27 @@
+package com.pj.project.tb_logistics;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 工具类:tb_logistics -- 物流表
+ * @author qzy 
+ *
+ */
+@Component
+public class TbLogisticsUtil {
+
+	
+	/** 底层 Mapper 对象 */
+	public static TbLogisticsMapper tbLogisticsMapper;
+	@Autowired
+	private void setTbLogisticsMapper(TbLogisticsMapper tbLogisticsMapper) {
+		TbLogisticsUtil.tbLogisticsMapper = tbLogisticsMapper;
+	}
+	
+
+
+	
+	
+	
+}

+ 3 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_orders/TbOrders.java

@@ -3,6 +3,8 @@ package com.pj.project.tb_orders;
 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;
@@ -43,6 +45,7 @@ public class TbOrders extends Model<TbOrders> implements Serializable {
 	 * 货运订单管理表主键 
 	 */
 	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;	
 
 	/**

+ 3 - 0
sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/TbVehicle.java

@@ -5,6 +5,8 @@ import java.util.*;
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import lombok.EqualsAndHashCode;
 
 import lombok.Data;
@@ -45,6 +47,7 @@ public class TbVehicle extends Model<TbVehicle> implements Serializable {
 	 * 主键 
 	 */
 	@TableId(type = IdType.AUTO)
+	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;	
 
 	/**