1
0

2 Commits 16d227b3a5 ... 4cb5c67f0c

Autor SHA1 Nachricht Datum
  Mechrevo 4cb5c67f0c Merge remote-tracking branch 'origin/feature/asyncOrder' into feature/asyncOrder vor 1 Jahr
  Mechrevo e40c048b01 8.29 当同步航通基本信息时,给对应身份的用户新增appUser账户(目前两个问题未处理: 远程调用多次,分布式事务) vor 1 Jahr
25 geänderte Dateien mit 577 neuen und 291 gelöschten Zeilen
  1. 12 0
      sp-core/sp-api/src/main/java/com/pj/api/client/admin/AdminInterface.java
  2. 12 0
      sp-core/sp-api/src/main/java/com/pj/api/client/admin/AdminInterfaceFallback.java
  3. 168 160
      sp-core/sp-api/src/main/java/com/pj/api/dto/EnterpriseDto.java
  4. 0 7
      sp-core/sp-base/pom.xml
  5. 46 0
      sp-core/sp-base/src/main/java/com/pj/aliyun/sms/AliyunInformSmsService.java
  6. 16 0
      sp-core/sp-base/src/main/java/com/pj/retry/SmsRetryService.java
  7. 2 3
      sp-core/sp-base/src/main/java/com/pj/utils/ht/AESUtil.java
  8. 9 0
      sp-service/async-server/pom.xml
  9. 0 0
      sp-service/async-server/src/main/java/com/pj/rabbitmq/RabbitMQ.java
  10. 0 0
      sp-service/async-server/src/main/java/com/pj/rabbitmq/RabbitmqConfig.java
  11. 1 3
      sp-service/async-server/src/main/java/com/pj/task/HtByteTask.java
  12. 4 4
      sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/MethodEnterpriseService.java
  13. 82 54
      sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterprise.java
  14. 2 2
      sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseController.java
  15. 50 33
      sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseMapper.xml
  16. 7 8
      sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseService.java
  17. 1 1
      sp-service/level-one-server/src/main/java/com/pj/tb_order/MethodOrderService.java
  18. 1 1
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderService.java
  19. 1 1
      sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleController.java
  20. 10 9
      sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleService.java
  21. 1 1
      sp-service/level-one-server/src/main/java/com/pj/tb_shop/TbShopController.java
  22. 55 3
      sp-service/level-one-server/src/main/java/com/pj/tb_shop/TbShopService.java
  23. 23 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserController.java
  24. 73 0
      sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserService.java
  25. 1 1
      sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/MethodVehicleService.java

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

@@ -73,4 +73,16 @@ public interface AdminInterface {
     @RequestMapping(value = "TbDistrict/rpc/getByIds")
     List<DistrictDTO> getDistrictList(@RequestParam("ids") String ids);
 
+    /**
+     * 同步航通边民信息时,自动给边民注册app账号
+     */
+    @RequestMapping("/AppUser/rpc/generatePeopleAccount")
+    public boolean generatePeopleAccount(@RequestBody PeopleDto peopleDto) throws Exception;
+
+    /**
+     * 同步航通边民信息时,自动给外籍商户注册app账号
+     */
+    @RequestMapping("/AppUser/rpc/generateEnterpriseAccount")
+    public int generateEnterpriseAccount(@RequestBody EnterpriseDto enterpriseDto) throws Exception ;
+
 }

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

@@ -74,6 +74,18 @@ public class AdminInterfaceFallback implements FallbackFactory<AdminInterface> {
             public List<DistrictDTO> getDistrictList(String ids) {
                 return null;
             }
+
+            @Override
+            public boolean generatePeopleAccount(PeopleDto appUser) throws Exception {
+                log.error("边民注册app账户失败。对象:{}",appUser);
+                return false;
+            }
+
+            @Override
+            public int generateEnterpriseAccount(EnterpriseDto enterpriseDto) throws Exception {
+                log.error("外籍商户注册app账户失败。对象:{}",enterpriseDto);
+                return 0;
+            }
         };
     }
 

+ 168 - 160
sp-core/sp-api/src/main/java/com/pj/api/dto/EnterpriseDto.java

@@ -11,128 +11,12 @@ import java.util.Date;
  **/
 public class EnterpriseDto {
 
+    private Long id;
 
     /**
-     * 名
+     * 铺主姓
      */
-    private String name;
-    /**
-     * 年龄
-     */
-    private Integer age;
-    /**
-     * 性别[1=男,2=女]
-     */
-    private Integer sex;
-    /**
-     *
-     */
-    private Long tradeAreaId;
-
-    /**
-     *
-     */
-    private String tradeAreaName;
-
-    public Long getTradeAreaId() {
-        return tradeAreaId;
-    }
-
-    public void setTradeAreaId(Long tradeAreaId) {
-        this.tradeAreaId = tradeAreaId;
-    }
-
-    public EnterpriseDto(String name, Integer age, Integer sex, Long tradeAreaId, String tradeAreaName, String nationality, String type, String legalPerson, String idCard, String contact, String businessLicense, Long shopId, String shopName, String bankNo, String bankName, String bankAccount, String dutyParagraph, String addressIds, String address, String agreement, int judgeStatus, String judgeContent, Date judgeTime, Date registerTime, Date createTime, String createBy, String createName, Date updateTime, String updateBy, String updateName, Integer deleteStatus, Integer isLock) {
-        this.name = name;
-        this.age = age;
-        this.sex = sex;
-        this.tradeAreaId = tradeAreaId;
-        this.tradeAreaName = tradeAreaName;
-        this.nationality = nationality;
-        this.type = type;
-        this.legalPerson = legalPerson;
-        this.idCard = idCard;
-        this.contact = contact;
-        this.businessLicense = businessLicense;
-        this.shopId = shopId;
-        this.shopName = shopName;
-        this.bankNo = bankNo;
-        this.bankName = bankName;
-        this.bankAccount = bankAccount;
-        this.dutyParagraph = dutyParagraph;
-        this.addressIds = addressIds;
-        this.address = address;
-        this.agreement = agreement;
-        this.judgeStatus = judgeStatus;
-        this.judgeContent = judgeContent;
-        this.judgeTime = judgeTime;
-        this.registerTime = registerTime;
-        this.createTime = createTime;
-        this.createBy = createBy;
-        this.createName = createName;
-        this.updateTime = updateTime;
-        this.updateBy = updateBy;
-        this.updateName = updateName;
-        this.deleteStatus = deleteStatus;
-        this.isLock = isLock;
-    }
-
-    public String getTradeAreaName() {
-        return tradeAreaName;
-    }
-
-    public void setTradeAreaName(String tradeAreaName) {
-        this.tradeAreaName = tradeAreaName;
-    }
-
-    public EnterpriseDto(String name, Integer age, Integer sex, String nationality, String type, String legalPerson, String idCard, String contact, String businessLicense, Long shopId, String shopName, String bankNo, String bankName, String bankAccount, String dutyParagraph, String addressIds, String address, String agreement, int judgeStatus, String judgeContent, Date judgeTime, Date registerTime, Date createTime, String createBy, String createName, Date updateTime, String updateBy, String updateName, Integer deleteStatus, Integer isLock) {
-        this.name = name;
-        this.age = age;
-        this.sex = sex;
-        this.nationality = nationality;
-        this.type = type;
-        this.legalPerson = legalPerson;
-        this.idCard = idCard;
-        this.contact = contact;
-        this.businessLicense = businessLicense;
-        this.shopId = shopId;
-        this.shopName = shopName;
-        this.bankNo = bankNo;
-        this.bankName = bankName;
-        this.bankAccount = bankAccount;
-        this.dutyParagraph = dutyParagraph;
-        this.addressIds = addressIds;
-        this.address = address;
-        this.agreement = agreement;
-        this.judgeStatus = judgeStatus;
-        this.judgeContent = judgeContent;
-        this.judgeTime = judgeTime;
-        this.registerTime = registerTime;
-        this.createTime = createTime;
-        this.createBy = createBy;
-        this.createName = createName;
-        this.updateTime = updateTime;
-        this.updateBy = updateBy;
-        this.updateName = updateName;
-        this.deleteStatus = deleteStatus;
-        this.isLock = isLock;
-    }
-
-    public Integer getAge() {
-        return age;
-    }
-
-    public void setAge(Integer age) {
-        this.age = age;
-    }
-
-    public Integer getSex() {
-        return sex;
-    }
-
-    public void setSex(Integer sex) {
-        this.sex = sex;
-    }
+    private String ownerName;
 
     /**
      * 国别
@@ -145,6 +29,11 @@ public class EnterpriseDto {
     private String type;
 
     /**
+     * 性别
+     */
+    private Integer sex;
+
+    /**
      * 法人
      */
     private String legalPerson;
@@ -157,7 +46,7 @@ public class EnterpriseDto {
     /**
      * 手机号码
      */
-    private String contact;
+    private String ownerTel;
 
     /**
      * 营业执照
@@ -180,9 +69,9 @@ public class EnterpriseDto {
     private String bankNo;
 
     /**
-     *
+     * 银行名称
      */
-    private String bankName;
+    private String bank;
 
     /**
      * 银行账号
@@ -190,56 +79,63 @@ public class EnterpriseDto {
     private String bankAccount;
 
     /**
+     * 年龄
+     */
+    private Integer age;
+
+    /**
      * 税号
      */
     private String dutyParagraph;
 
     /**
-     *
+     * 地址全路径如1,22,333
      */
     private String addressIds;
 
     /**
-     *
+     * 地址
      */
     private String address;
 
     /**
+     * 详细地址
+     */
+    private String detail;
+
+    /**
      *
      */
     private String agreement;
 
     /**
-     *
+     * 审核状态(0=未审核,1=审核通过,2=审核驳回)
      */
-    private int judgeStatus;
+    private Integer judgeStatus;
 
     /**
-     *
+     * 审核意见
      */
     private String judgeContent;
 
     /**
-     *
+     * 审核时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date judgeTime;
 
     /**
-     *
+     * 注册时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date registerTime;
 
-//	/**
-//	 *
-//	 */
-//	private String personId;
+    /**
+     * 审核人
+     */
+    private String judgeBy;
 
     /**
      * 创建时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date createTime;
 
     /**
@@ -255,7 +151,6 @@ public class EnterpriseDto {
     /**
      * 更新时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date updateTime;
 
     /**
@@ -271,21 +166,52 @@ public class EnterpriseDto {
     /**
      * 删除状态(0=禁用,1=启用)
      */
-    private Integer deleteStatus;
-
+    private Long deleteStatus;
 
     /**
-     * 是否锁
+     * 是否锁
      */
     private Integer isLock;
 
+    /**
+     * 互市区ID
+     */
+    private Long tradeAreaId;
+
+    /**
+     * 互市区名称
+     */
+    private String tradeAreaName;
+
+    /**
+     * 地方平台的内部业务编号
+     */
+    private String platSeqNo;
+
+    /**
+     * 证件类型
+     */
+    private String ownerIdtype;
+
+    /**
+     * 启停用状态: 1- 启用 2-停用 3-注销
+     */
+    private String eDStatus;
 
-    public String getName() {
-        return name;
+    public Long getId() {
+        return id;
     }
 
-    public void setName(String name) {
-        this.name = name;
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getOwnerName() {
+        return ownerName;
+    }
+
+    public void setOwnerName(String ownerName) {
+        this.ownerName = ownerName;
     }
 
     public String getNationality() {
@@ -304,6 +230,14 @@ public class EnterpriseDto {
         this.type = type;
     }
 
+    public Integer getSex() {
+        return sex;
+    }
+
+    public void setSex(Integer sex) {
+        this.sex = sex;
+    }
+
     public String getLegalPerson() {
         return legalPerson;
     }
@@ -320,12 +254,12 @@ public class EnterpriseDto {
         this.idCard = idCard;
     }
 
-    public String getContact() {
-        return contact;
+    public String getOwnerTel() {
+        return ownerTel;
     }
 
-    public void setContact(String contact) {
-        this.contact = contact;
+    public void setOwnerTel(String ownerTel) {
+        this.ownerTel = ownerTel;
     }
 
     public String getBusinessLicense() {
@@ -360,12 +294,12 @@ public class EnterpriseDto {
         this.bankNo = bankNo;
     }
 
-    public String getBankName() {
-        return bankName;
+    public String getBank() {
+        return bank;
     }
 
-    public void setBankName(String bankName) {
-        this.bankName = bankName;
+    public void setBank(String bank) {
+        this.bank = bank;
     }
 
     public String getBankAccount() {
@@ -376,6 +310,14 @@ public class EnterpriseDto {
         this.bankAccount = bankAccount;
     }
 
+    public Integer getAge() {
+        return age;
+    }
+
+    public void setAge(Integer age) {
+        this.age = age;
+    }
+
     public String getDutyParagraph() {
         return dutyParagraph;
     }
@@ -400,6 +342,14 @@ public class EnterpriseDto {
         this.address = address;
     }
 
+    public String getDetail() {
+        return detail;
+    }
+
+    public void setDetail(String detail) {
+        this.detail = detail;
+    }
+
     public String getAgreement() {
         return agreement;
     }
@@ -408,11 +358,11 @@ public class EnterpriseDto {
         this.agreement = agreement;
     }
 
-    public int getJudgeStatus() {
+    public Integer getJudgeStatus() {
         return judgeStatus;
     }
 
-    public void setJudgeStatus(int judgeStatus) {
+    public void setJudgeStatus(Integer judgeStatus) {
         this.judgeStatus = judgeStatus;
     }
 
@@ -440,6 +390,14 @@ public class EnterpriseDto {
         this.registerTime = registerTime;
     }
 
+    public String getJudgeBy() {
+        return judgeBy;
+    }
+
+    public void setJudgeBy(String judgeBy) {
+        this.judgeBy = judgeBy;
+    }
+
     public Date getCreateTime() {
         return createTime;
     }
@@ -488,11 +446,11 @@ public class EnterpriseDto {
         this.updateName = updateName;
     }
 
-    public Integer getDeleteStatus() {
+    public Long getDeleteStatus() {
         return deleteStatus;
     }
 
-    public void setDeleteStatus(Integer deleteStatus) {
+    public void setDeleteStatus(Long deleteStatus) {
         this.deleteStatus = deleteStatus;
     }
 
@@ -504,27 +462,72 @@ public class EnterpriseDto {
         this.isLock = isLock;
     }
 
-    public EnterpriseDto(String name, String nationality, String type, String legalPerson, String idCard, String contact, String businessLicense, Long shopId, String shopName, String bankNo, String bankName, String bankAccount, String dutyParagraph, String addressIds, String address, String agreement, int judgeStatus, String judgeContent, Date judgeTime, Date registerTime, Date createTime, String createBy, String createName, Date updateTime, String updateBy, String updateName, Integer deleteStatus, Integer isLock) {
-        this.name = name;
+    public Long getTradeAreaId() {
+        return tradeAreaId;
+    }
+
+    public void setTradeAreaId(Long tradeAreaId) {
+        this.tradeAreaId = tradeAreaId;
+    }
+
+    public String getTradeAreaName() {
+        return tradeAreaName;
+    }
+
+    public void setTradeAreaName(String tradeAreaName) {
+        this.tradeAreaName = tradeAreaName;
+    }
+
+    public String getPlatSeqNo() {
+        return platSeqNo;
+    }
+
+    public void setPlatSeqNo(String platSeqNo) {
+        this.platSeqNo = platSeqNo;
+    }
+
+    public String getOwnerIdtype() {
+        return ownerIdtype;
+    }
+
+    public void setOwnerIdtype(String ownerIdtype) {
+        this.ownerIdtype = ownerIdtype;
+    }
+
+    public String geteDStatus() {
+        return eDStatus;
+    }
+
+    public void seteDStatus(String eDStatus) {
+        this.eDStatus = eDStatus;
+    }
+
+    public EnterpriseDto(Long id, String ownerName, String nationality, String type, Integer sex, String legalPerson, String idCard, String ownerTel, String businessLicense, Long shopId, String shopName, String bankNo, String bank, String bankAccount, Integer age, String dutyParagraph, String addressIds, String address, String detail, String agreement, Integer judgeStatus, String judgeContent, Date judgeTime, Date registerTime, String judgeBy, Date createTime, String createBy, String createName, Date updateTime, String updateBy, String updateName, Long deleteStatus, Integer isLock, Long tradeAreaId, String tradeAreaName, String platSeqNo, String ownerIdtype, String eDStatus) {
+        this.id = id;
+        this.ownerName = ownerName;
         this.nationality = nationality;
         this.type = type;
+        this.sex = sex;
         this.legalPerson = legalPerson;
         this.idCard = idCard;
-        this.contact = contact;
+        this.ownerTel = ownerTel;
         this.businessLicense = businessLicense;
         this.shopId = shopId;
         this.shopName = shopName;
         this.bankNo = bankNo;
-        this.bankName = bankName;
+        this.bank = bank;
         this.bankAccount = bankAccount;
+        this.age = age;
         this.dutyParagraph = dutyParagraph;
         this.addressIds = addressIds;
         this.address = address;
+        this.detail = detail;
         this.agreement = agreement;
         this.judgeStatus = judgeStatus;
         this.judgeContent = judgeContent;
         this.judgeTime = judgeTime;
         this.registerTime = registerTime;
+        this.judgeBy = judgeBy;
         this.createTime = createTime;
         this.createBy = createBy;
         this.createName = createName;
@@ -533,6 +536,11 @@ public class EnterpriseDto {
         this.updateName = updateName;
         this.deleteStatus = deleteStatus;
         this.isLock = isLock;
+        this.tradeAreaId = tradeAreaId;
+        this.tradeAreaName = tradeAreaName;
+        this.platSeqNo = platSeqNo;
+        this.ownerIdtype = ownerIdtype;
+        this.eDStatus = eDStatus;
     }
 
     public EnterpriseDto() {

+ 0 - 7
sp-core/sp-base/pom.xml

@@ -29,13 +29,6 @@
 		<!-- ================= 模块依赖 end ================= -->
 
 
-        <!-- rabbitmq 依赖 -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-amqp</artifactId>
-        </dependency>
-
-
         <!-- 阿里云短信服务 -->
         <dependency>
             <groupId>com.aliyun</groupId>

+ 46 - 0
sp-core/sp-base/src/main/java/com/pj/aliyun/sms/AliyunInformSmsService.java

@@ -85,6 +85,52 @@ public class AliyunInformSmsService {
     }
 
     /**
+     * 发送注册成功通知
+     *
+     * @param mobile 手机号
+     * @return 执行结果
+     */
+    public static boolean sendRegisteSMS(String mobile,String content) {
+        try {
+            IClientProfile profile = DefaultProfile.getProfile(REGION_ID, accessKeyId, accessKeySecret);
+
+            DefaultProfile.addEndpoint(REGION_ID, REGION_ID, PRODUCT, DOMAIN);
+
+            IAcsClient acsClient = new DefaultAcsClient(profile);
+
+            SendSmsRequest request = new SendSmsRequest();
+
+            request.setMethod(MethodType.POST);
+
+            // 手机号可以单个也可以多个(多个用逗号隔开,如:15*******13,13*******27,17*******56)
+            request.setPhoneNumbers(mobile);
+
+            request.setSignName(signName);
+
+            request.setTemplateCode(templateCode);
+
+            /*  例如签名内容为:某某公司
+            例如模板内容为:亲爱的同事,很高兴的通知您,您抽中了由领导${userName}派发的大饼奖励${money}元,请及时找财务领取!
+            变量属性:userName-其他;money-其他;
+            则短信内容为:【某某公司】 亲爱的同事,很高兴的通知您,您抽中了由领导${userName}派发的大饼奖励${money}元,请及时找财务领取!*/
+            request.setTemplateParam(content);
+//            request.setTemplateParam("{\"mobile\":\""+ mobile +"\",\"mobile\":\""+ mobile +"\"}");
+
+            SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
+            if ((sendSmsResponse.getCode() != null) && (sendSmsResponse.getCode().equals("OK"))) {
+                log.info("发送成功,code:" + sendSmsResponse.getCode());
+                return true;
+            } else {
+                log.info("发送失败,code:" + sendSmsResponse.getCode());
+                return false;
+            }
+        } catch (ClientException e) {
+            log.error("发送失败,系统错误!", e);
+            return false;
+        }
+    }
+
+    /**
      * 获取逗号分隔的拼接字符串
      *
      * @param str 用于拼接的字符串集合

+ 16 - 0
sp-core/sp-base/src/main/java/com/pj/retry/SmsRetryService.java

@@ -52,6 +52,22 @@ public class SmsRetryService {
         return true;
     }
 
+    /**
+     * 注册短信
+     * @param phone 手机号
+     * @return
+     * @throws Exception
+     */
+    @Async
+    @Retryable(value = Exception.class,maxAttempts = 3,backoff = @Backoff(delay = 2000,multiplier = 1.5))
+    public boolean sendSmsRegisteMsg(String phone,String content) throws Exception {
+        System.out.println("\n发送注册成功短信!\n");
+        //todo: 发送短信业务逻辑
+        boolean result = AliyunInformSmsService.sendRegisteSMS("18934859524",content);
+        if(!result) throw new Exception("模拟短信发送失败!");
+        return true;
+    }
+
 
     //最终补偿机制
     @Recover

+ 2 - 3
sp-core/sp-base/src/main/java/com/pj/utils/ht/AESUtil.java

@@ -1,6 +1,5 @@
 package com.pj.utils.ht;
 
-import com.pj.rabbitmq.RabbitMQ;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -275,12 +274,12 @@ public class AESUtil {
                 " \"borderTel\":\"12398524563\", \n" +
                 "\"groupId\":\"14\"\n" +
                 "}\n" +
-                "] }",RabbitMQ.ACC_KEY);
+                "] }",null); // RabbitmQ.ACC_KEY
         System.out.println("aes_cbc加密结果:" + cbcResult);
         System.out.println();
 
         System.out.println("---------解密CBC---------");
-        String cbcDecrypt = decryptCBC(cbcResult, RabbitMQ.ACC_KEY);
+        String cbcDecrypt = decryptCBC(cbcResult, null);// RabbitmQ.ACC_KEY
         System.out.println("aes解密结果:" + cbcDecrypt);
         System.out.println();
     }

+ 9 - 0
sp-service/async-server/pom.xml

@@ -23,6 +23,15 @@
             <version>${project.parent.version}</version>
         </dependency>
 
+
+        <!-- rabbitmq 依赖 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+
+
+
     </dependencies>
 
 

+ 0 - 0
sp-core/sp-base/src/main/java/com/pj/rabbitmq/RabbitMQ.java → sp-service/async-server/src/main/java/com/pj/rabbitmq/RabbitMQ.java


+ 0 - 0
sp-core/sp-base/src/main/java/com/pj/rabbitmq/RabbitmqConfig.java → sp-service/async-server/src/main/java/com/pj/rabbitmq/RabbitmqConfig.java


+ 1 - 3
sp-service/async-server/src/main/java/com/pj/task/HtByteTask.java

@@ -56,9 +56,7 @@ public class HtByteTask {
         //扫描表内是否有待处理任务
         List<HtByte> byteList = htByteMapper.selectList(new LambdaQueryWrapper<HtByte>().eq(HtByte::getFinishStatus, FinishStatus.FINISH_STATUS_ZERO.getCode()));
         //判断是否有任务,没有则返回
-        if(byteList.size() == 0){
-            System.out.println("\n暂无待处理任务。\n");
-        }
+        if(byteList.size() == 0)System.out.println("\n暂无待处理任务。\n");
         //执行任务处理流程
         byteList.forEach(item -> {
             //对象转换

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

@@ -144,7 +144,7 @@ public class MethodEnterpriseService {
             TbEnterprise tbEnterprise = new TbEnterprise();
             //解析数据
             if(row.getCell(1) != null && !row.getCell(1).toString().trim().equals(""))
-                tbEnterprise.setName(row.getCell(1).getStringCellValue());
+                tbEnterprise.setOwnerName(row.getCell(1).getStringCellValue());
 
             if(row.getCell(2) != null && !row.getCell(2).toString().trim().equals(""))
                 tbEnterprise.setNationality(row.getCell(2).getStringCellValue());
@@ -159,7 +159,7 @@ public class MethodEnterpriseService {
                 tbEnterprise.setIdCard(row.getCell(5).getStringCellValue());
 
             if(row.getCell(6) != null && !row.getCell(6).toString().trim().equals(""))
-                tbEnterprise.setContact(row.getCell(6).getStringCellValue());
+                tbEnterprise.setOwnerTel(row.getCell(6).getStringCellValue());
 
             if(row.getCell(7) != null && !row.getCell(7).toString().trim().equals(""))
                 tbEnterprise.setBusinessLicense(row.getCell(7).getStringCellValue());
@@ -175,7 +175,7 @@ public class MethodEnterpriseService {
                 tbEnterprise.setBankNo(row.getCell(10).getStringCellValue());
 
             if(row.getCell(11) != null && !row.getCell(11).toString().trim().equals(""))
-                tbEnterprise.setBankName(row.getCell(11).getStringCellValue());
+                tbEnterprise.setBank(row.getCell(11).getStringCellValue());
 
             if(row.getCell(12) != null && !row.getCell(12).toString().trim().equals(""))
                 tbEnterprise.setBankAccount(row.getCell(12).getStringCellValue());
@@ -234,7 +234,7 @@ public class MethodEnterpriseService {
                 tbEnterprise.setUpdateTime(cell3.getDateCellValue());
             }
             //删除状态,默认可用
-            tbEnterprise.setDeleteStatus(1);
+            tbEnterprise.setDeleteStatus(1L);
 //			//添加到集合
 			list.add(tbEnterprise);
 //            int insert = tbEnterpriseMapper.insert(tbEnterprise);

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

@@ -1,22 +1,19 @@
 package com.pj.tb_enterprise;
 
-import java.io.Serializable;
-import java.util.Date;
-
-import com.alibaba.excel.annotation.ExcelProperty;
-import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 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;
+import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.io.Serializable;
+import java.util.Date;
+
 /**
  * Model: tb_enterprise -- 商家
- * @author qzy 
+ * @author yzs 
  */
 @Data
 @Accessors(chain = true)
@@ -39,136 +36,137 @@ public class TbEnterprise extends Model<TbEnterprise> implements Serializable {
 	public static final String PERMISSION_CODE = "tb-enterprise";
 	public static final String PERMISSION_CODE_ADD = "tb-enterprise-add";
 	public static final String PERMISSION_CODE_EDIT = "tb-enterprise-edit";
-	public static final String PERMISSION_CODE_JUDGE = "tb-enterprise-judge";
 	public static final String PERMISSION_CODE_DEL = "tb-enterprise-del";
 
 
 
+
 	// ---------- 表中字段 ----------
 	/**
 	 *  
 	 */
 	@TableId(type = IdType.AUTO)
-	@JsonSerialize(using = ToStringSerializer.class)
 	private Long id;	
 
 	/**
-	 * 名 
+	 * 铺主姓
 	 */
-	private String name;
+	private String ownerName;	
 
 	/**
 	 * 国别 
 	 */
-	private String nationality;
+	private String nationality;	
 
 	/**
 	 * 商户分类(自营商铺=自营商铺,劳务商铺=劳务商铺) 
 	 */
-	private String type;
+	private String type;	
+
+	/**
+	 * 性别 
+	 */
+	private Integer sex;	
 
 	/**
 	 * 法人 
 	 */
-	private String legalPerson;
+	private String legalPerson;	
 
 	/**
 	 * 身份证号 
 	 */
-	private String idCard;
+	private String idCard;	
 
 	/**
 	 * 手机号码 
 	 */
-	private String contact;
+	private String ownerTel;	
 
 	/**
 	 * 营业执照 
 	 */
-	private String businessLicense;
+	private String businessLicense;	
 
 	/**
 	 * 所在铺位ID 
 	 */
-	private Long shopId;
+	private Long shopId;	
 
 	/**
 	 * 所在铺位名称(1=100-2) 
 	 */
-	private String shopName;
+	private String shopName;	
 
 	/**
 	 * 银行编号(CMB= 招商银行) 
 	 */
-	private String bankNo;
+	private String bankNo;	
 
 	/**
-	 *
+	 * 银行名称 
 	 */
-	private String bankName;
+	private String bank;	
 
 	/**
 	 * 银行账号 
 	 */
-	private String bankAccount;
+	private String bankAccount;	
 
 	/**
-	 * 税号 
+	 * 年龄 
 	 */
-	private String dutyParagraph;
+	private Integer age;	
 
 	/**
-	 *
+	 * 税号 
 	 */
-	private String addressIds;
+	private String dutyParagraph;	
 
 	/**
-	 *
+	 * 地址全路径如1,22,333 
 	 */
-	private String address;
-	private String detail;
+	private String addressIds;	
 
 	/**
-	 * 年龄
+	 * 地址 
 	 */
-	private Integer age;
+	private String address;	
 
 	/**
-	 * 性别[1=男,2=女]
+	 * 详细地址 
 	 */
-	private Integer sex;
+	private String detail;	
 
 	/**
 	 *  
 	 */
-	private String agreement;
+	private String agreement;	
 
 	/**
-	 *  审核状态(0=未审核,1=审核通过,2=审核驳回)
+	 * 审核状态(0=未审核,1=审核通过,2=审核驳回) 
 	 */
-	private int judgeStatus;
+	private Integer judgeStatus;
 
 	/**
-	 *  
+	 * 审核意见 
 	 */
-	private String judgeContent;
-
-	private String judgeBy;
+	private String judgeContent;	
 
 	/**
-	 *  
+	 * 审核时间 
 	 */
 	private Date judgeTime;
 
 	/**
-	 *  
+	 * 注册时间 
 	 */
 	private Date registerTime;
 
-//	/**
-//	 *
-//	 */
-//	private String personId;
+	/**
+	 * 审核人 
+	 */
+	private String judgeBy;	
 
 	/**
 	 * 创建时间 
@@ -203,13 +201,43 @@ public class TbEnterprise extends Model<TbEnterprise> implements Serializable {
 	/**
 	 * 删除状态(0=禁用,1=启用) 
 	 */
-	private Integer deleteStatus;
-
+	private Long deleteStatus;	
 
 	/**
-	 * 是否锁
+	 * 是否锁
 	 */
 	private Integer isLock;
 
+	/**
+	 * 互市区ID 
+	 */
+	private Long tradeAreaId;	
+
+	/**
+	 * 互市区名称 
+	 */
+	private String tradeAreaName;	
+
+	/**
+	 * 地方平台的内部业务编号 
+	 */
+	private String platSeqNo;	
+
+	/**
+	 * 证件类型 
+	 */
+	private String ownerIdtype;	
+
+	/**
+	 * 启停用状态: 1- 启用 2-停用 3-注销 
+	 */
+	private String eDStatus;	
+
+
+
+
+
+	
+
 
 }

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

@@ -144,7 +144,7 @@ public class TbEnterpriseController {
 	* @date
 	*/
 	@RequestMapping("audit")
-	@SaCheckPermission(TbEnterprise.PERMISSION_CODE_JUDGE)
+//	@SaCheckPermission(TbEnterprise.PERMISSION_CODE_JUDGE)
 	public AjaxJson audit(){
 		SoMap soMap=SoMap.getRequestSoMap();
 		Long id=soMap.getLong("id");
@@ -153,7 +153,7 @@ public class TbEnterpriseController {
 		return AjaxJson.toAjax(tbEnterpriseService.audit(id,judgeStatus,judgeContent));
 	}
 	@RequestMapping("auditBatch")
-	@SaCheckPermission(TbEnterprise.PERMISSION_CODE_JUDGE)
+//	@SaCheckPermission(TbEnterprise.PERMISSION_CODE_JUDGE)
 	public AjaxJson auditBatch(){
 		SoMap soMap=SoMap.getRequestSoMap();
 		List<Long> ids=soMap.getListByComma("ids",Long.class);

+ 50 - 33
sp-service/level-one-server/src/main/java/com/pj/tb_enterprise/TbEnterpriseMapper.xml

@@ -6,7 +6,7 @@
 
 
 	<!-- ================================== 查询相关 ================================== -->
-	<!-- select id, name, nationality, type, legal_person, id_card, contact, business_license, shop_id, shop_name, bank_no, bank_name, bank_account, duty_paragraph, address_ids, address, agreement, judge_status, judge_content, judge_time, register_time, person_id, create_time, create_by, create_name, update_time, update_by, update_name, delete_status from tb_enterprise  -->
+	<!-- select id, owner_name, nationality, type, sex, legal_person, id_card, owner_tel, business_license, shop_id, shop_name, bank_no, bank, bank_account, age, duty_paragraph, address_ids, address, detail, agreement, judge_status, judge_content, judge_time, register_time, judge_by, create_time, create_by, create_name, update_time, update_by, update_name, delete_status, is_lock, trade_area_id, trade_area_name, plat_seq_no, owner_idtype, e_d_status from tb_enterprise  -->
 	
 	<!-- 通用映射:自动模式 -->
 	<resultMap id="model" autoMapping="true" type="com.pj.tb_enterprise.TbEnterprise"></resultMap>
@@ -17,33 +17,35 @@
 		from tb_enterprise 
 	</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 like concat('%',#{name},'%') </if>
+			<if test=' this.has("ownerName") '> and owner_name = #{ownerName} </if>
 			<if test=' this.has("nationality") '> and nationality = #{nationality} </if>
 			<if test=' this.has("type") '> and type = #{type} </if>
+			<if test=' this.has("sex") '> and sex = #{sex} </if>
 			<if test=' this.has("legalPerson") '> and legal_person = #{legalPerson} </if>
 			<if test=' this.has("idCard") '> and id_card = #{idCard} </if>
-			<if test=' this.has("contact") '> and contact = #{contact} </if>
+			<if test=' this.has("ownerTel") '> and owner_tel = #{ownerTel} </if>
 			<if test=' this.has("shopId") '> and shop_id = #{shopId} </if>
 			<if test=' this.has("shopName") '> and shop_name = #{shopName} </if>
 			<if test=' this.has("bankNo") '> and bank_no = #{bankNo} </if>
-			<if test=' this.has("bankName") '> and bank_name = #{bankName} </if>
+			<if test=' this.has("bank") '> and bank = #{bank} </if>
 			<if test=' this.has("bankAccount") '> and bank_account = #{bankAccount} </if>
+			<if test=' this.has("age") '> and age = #{age} </if>
 			<if test=' this.has("dutyParagraph") '> and duty_paragraph = #{dutyParagraph} </if>
 			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>
 			<if test=' this.has("address") '> and address = #{address} </if>
+			<if test=' this.has("detail") '> and detail = #{detail} </if>
 			<if test=' this.has("agreement") '> and agreement = #{agreement} </if>
 			<if test=' this.has("judgeStatus") '> and judge_status = #{judgeStatus} </if>
-			<if test=' this.has("judgeList") '> and (judge_status = 0 or judge_status=2)</if>
 			<if test=' this.has("judgeContent") '> and judge_content = #{judgeContent} </if>
 			<if test=' this.has("judgeTime") '> and judge_time = #{judgeTime} </if>
 			<if test=' this.has("registerTime") '> and register_time = #{registerTime} </if>
-			<if test=' this.has("personId") '> and person_id = #{personId} </if>
+			<if test=' this.has("judgeBy") '> and judge_by = #{judgeBy} </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>
@@ -51,41 +53,56 @@
 			<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("isLock") '> and is_lock = #{isLock} </if>
+			<if test=' this.has("tradeAreaId") '> and trade_area_id = #{tradeAreaId} </if>
+			<if test=' this.has("tradeAreaName") '> and trade_area_name = #{tradeAreaName} </if>
+			<if test=' this.has("platSeqNo") '> and plat_seq_no = #{platSeqNo} </if>
+			<if test=' this.has("ownerIdtype") '> and owner_idtype = #{ownerIdtype} </if>
+			<if test=' this.has("eDStatus") '> and e_d_status = #{eDStatus} </if>
 		</where>
 		order by
 		<choose>
 			<when test='sortType == 1'> id desc </when>
-			<when test='sortType == 2'> name desc </when>
+			<when test='sortType == 2'> owner_name desc </when>
 			<when test='sortType == 3'> nationality desc </when>
 			<when test='sortType == 4'> type desc </when>
-			<when test='sortType == 5'> legal_person desc </when>
-			<when test='sortType == 6'> id_card desc </when>
-			<when test='sortType == 7'> contact desc </when>
-			<when test='sortType == 8'> shop_id desc </when>
-			<when test='sortType == 9'> shop_name desc </when>
-			<when test='sortType == 10'> bank_no desc </when>
-			<when test='sortType == 11'> bank_name desc </when>
-			<when test='sortType == 12'> bank_account desc </when>
-			<when test='sortType == 13'> duty_paragraph desc </when>
-			<when test='sortType == 14'> address_ids desc </when>
-			<when test='sortType == 15'> address desc </when>
-			<when test='sortType == 16'> agreement desc </when>
-			<when test='sortType == 17'> judge_status desc </when>
-			<when test='sortType == 18'> judge_content desc </when>
-			<when test='sortType == 19'> judge_time desc </when>
-			<when test='sortType == 20'> register_time desc </when>
-			<when test='sortType == 21'> person_id desc </when>
-			<when test='sortType == 22'> create_time desc </when>
-			<when test='sortType == 23'> create_by desc </when>
-			<when test='sortType == 24'> create_name desc </when>
-			<when test='sortType == 25'> update_time desc </when>
-			<when test='sortType == 26'> update_by desc </when>
-			<when test='sortType == 27'> update_name desc </when>
-			<when test='sortType == 28'> delete_status desc </when>
+			<when test='sortType == 5'> sex desc </when>
+			<when test='sortType == 6'> legal_person desc </when>
+			<when test='sortType == 7'> id_card desc </when>
+			<when test='sortType == 8'> owner_tel desc </when>
+			<when test='sortType == 9'> shop_id desc </when>
+			<when test='sortType == 10'> shop_name desc </when>
+			<when test='sortType == 11'> bank_no desc </when>
+			<when test='sortType == 12'> bank desc </when>
+			<when test='sortType == 13'> bank_account desc </when>
+			<when test='sortType == 14'> age desc </when>
+			<when test='sortType == 15'> duty_paragraph desc </when>
+			<when test='sortType == 16'> address_ids desc </when>
+			<when test='sortType == 17'> address desc </when>
+			<when test='sortType == 18'> detail desc </when>
+			<when test='sortType == 19'> agreement desc </when>
+			<when test='sortType == 20'> judge_status desc </when>
+			<when test='sortType == 21'> judge_content desc </when>
+			<when test='sortType == 22'> judge_time desc </when>
+			<when test='sortType == 23'> register_time desc </when>
+			<when test='sortType == 24'> judge_by desc </when>
+			<when test='sortType == 25'> create_time desc </when>
+			<when test='sortType == 26'> create_by desc </when>
+			<when test='sortType == 27'> create_name desc </when>
+			<when test='sortType == 28'> update_time desc </when>
+			<when test='sortType == 29'> update_by desc </when>
+			<when test='sortType == 30'> update_name desc </when>
+			<when test='sortType == 31'> delete_status desc </when>
+			<when test='sortType == 32'> is_lock desc </when>
+			<when test='sortType == 33'> trade_area_id desc </when>
+			<when test='sortType == 34'> trade_area_name desc </when>
+			<when test='sortType == 35'> plat_seq_no desc </when>
+			<when test='sortType == 36'> owner_idtype desc </when>
+			<when test='sortType == 37'> e_d_status desc </when>
 			<otherwise> id desc </otherwise>
 		</choose>
 	</select>
-
+	
 	
 	
 	

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

@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 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.api.client.level_one_server.LevelOneServerInterface;
 import com.pj.api.consts.FeignFactory;
 import com.pj.api.dto.DistrictDTO;
 import com.pj.api.dto.EnterpriseAuditDto;
@@ -147,10 +146,10 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
     boolean identification(EnterpriseDto dto) {
         TbEnterprise enterprise = tbEnterpriseMapper.selectByCreateBy("" + StpAPPUserUtil.getAPPLoginInfo().getLoginId());
         dto.setJudgeStatus(0);
-        String contact = enterprise != null ? enterprise.getContact() : "";
+        String contact = enterprise != null ? enterprise.getOwnerTel() : "";
         String idCard = enterprise != null ? enterprise.getIdCard() : "";
         //手机号查重
-        if (!contact.equals(dto.getContact()) && tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getContact, dto.getContact()).eq(TbEnterprise::getDeleteStatus, DeleteStatus.DELETE_STATUS_ON.getCode())).size() != 0) {
+        if (!contact.equals(dto.getContact()) && tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getOwnerTel, dto.getContact()).eq(TbEnterprise::getDeleteStatus, DeleteStatus.DELETE_STATUS_ON.getCode())).size() != 0) {
             throw new RuntimeException("当前手机号已被认证!");
         }
         //身份证号查重
@@ -162,7 +161,7 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
             BeanUtils.copyProperties(dto, enterprise);
             enterprise.setCreateTime(new Date());
             enterprise.setCreateBy("" + StpAPPUserUtil.getAPPLoginInfo().getLoginId());
-            enterprise.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
+            enterprise.setDeleteStatus(Long.valueOf(DeleteStatus.DELETE_STATUS_ON.getCode()));
             return save(enterprise);
         }
         dto.setId(enterprise.getId());
@@ -239,7 +238,7 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
         }
         filepath = filepath + "\\商家数据表_" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + ".xlsx";
         //根据需求查询数据
-        List<TbEnterprise> selectedList = tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(StringUtils.isNoneBlank(keyword), TbEnterprise::getName, keyword));
+        List<TbEnterprise> selectedList = tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(StringUtils.isNoneBlank(keyword), TbEnterprise::getOwnerName, keyword));
         if (selectedList.size() == 0) return "没有可导出的数据。";
         //建立excel对象封装数据
         HSSFWorkbook workbook = new HSSFWorkbook();
@@ -283,17 +282,17 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
         for (int i = 0; i < selectedList.size(); i++) {
             HSSFRow sheetRow = sheet.createRow(sheet.getLastRowNum() + 1);
             sheetRow.createCell(0).setCellValue(i + 1);
-            sheetRow.createCell(1).setCellValue((selectedList.get(i).getName() + "").equals("null") ? "" : selectedList.get(i).getName() + "");
+            sheetRow.createCell(1).setCellValue((selectedList.get(i).getOwnerName() + "").equals("null") ? "" : selectedList.get(i).getOwnerName() + "");
             sheetRow.createCell(2).setCellValue((selectedList.get(i).getNationality() + "").equals("null") ? "" : selectedList.get(i).getNationality() + "");
             sheetRow.createCell(3).setCellValue((selectedList.get(i).getType() + "").equals("null") ? "" : selectedList.get(i).getType() + "");
             sheetRow.createCell(4).setCellValue((selectedList.get(i).getLegalPerson() + "").equals("null") ? "" : selectedList.get(i).getLegalPerson() + "");
             sheetRow.createCell(5).setCellValue((selectedList.get(i).getIdCard() + "").equals("null") ? "" : selectedList.get(i).getIdCard() + "");
-            sheetRow.createCell(6).setCellValue((selectedList.get(i).getContact() + "").equals("null") ? "" : selectedList.get(i).getContact() + "");
+            sheetRow.createCell(6).setCellValue((selectedList.get(i).getOwnerTel() + "").equals("null") ? "" : selectedList.get(i).getOwnerTel() + "");
             sheetRow.createCell(7).setCellValue((selectedList.get(i).getBusinessLicense() + "").equals("null") ? "" : selectedList.get(i).getBusinessLicense() + "");
             sheetRow.createCell(8).setCellValue((selectedList.get(i).getShopId() + "").equals("null") ? "" : selectedList.get(i).getShopId() + "");
             sheetRow.createCell(9).setCellValue((selectedList.get(i).getShopName() + "").equals("null") ? "" : selectedList.get(i).getShopName() + "");
             sheetRow.createCell(10).setCellValue((selectedList.get(i).getBankNo() + "").equals("null") ? "" : selectedList.get(i).getBankNo() + "");
-            sheetRow.createCell(11).setCellValue((selectedList.get(i).getBankName() + "").equals("null") ? "" : selectedList.get(i).getBankName() + "");
+            sheetRow.createCell(11).setCellValue((selectedList.get(i).getBank() + "").equals("null") ? "" : selectedList.get(i).getBank() + "");
             sheetRow.createCell(12).setCellValue((selectedList.get(i).getBankAccount() + "").equals("null") ? "" : selectedList.get(i).getBankAccount() + "");
             sheetRow.createCell(13).setCellValue((selectedList.get(i).getDutyParagraph() + "").equals("null") ? "" : selectedList.get(i).getDutyParagraph() + "");
             sheetRow.createCell(14).setCellValue((selectedList.get(i).getAddressIds() + "").equals("null") ? "" : selectedList.get(i).getAddressIds() + "");

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

@@ -114,7 +114,7 @@ public class MethodOrderService {
         //获取商家手机号
         TbEnterprise enterprise = tbEnterpriseMapper.selectById(tbOrder.getEnterpriseId());
         if(enterprise == null)throw new ServiceException("商家信息异常!");
-        orderVo.setConcat(enterprise.getContact());
+        orderVo.setConcat(enterprise.getOwnerTel());
         //获取过审商品名称 计价单位 净重 毛重 商品发布时间
         TbGoodsTransit goodsTransit = tbGoodsTransitMapper.selectById(tbOrder.getGoodsId());
         if(goodsTransit == null)

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

@@ -151,7 +151,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 		if(tbOrder.getCallCarStatus() == 1 || tbOrder.getCallCarStatus() == 2){
 			TbEnterprise enterprise = tbEnterpriseMapper.selectById(appLoginInfo.getFk());
 			String phone = null;
-			if(enterprise != null)phone = enterprise.getContact();
+			if(enterprise != null)phone = enterprise.getOwnerTel();
 			throw new ServiceException("您的订单单号为[ " + tbOrder.getTradeNo() + " ]商户已叫车,无法进行取消,请联系商户电话[ " + phone + " ]进行取消。");
 		}
 		//将状态设置已取消

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

@@ -261,7 +261,7 @@ public class TbPeopleController {
      * 注册身份时对应的表添加数据
      */
     @RequestMapping("rpc/peopleDto")
-    public boolean peopleDto(@RequestBody PeopleDto peopleDto) {
+    public boolean peopleDto(@RequestBody PeopleDto peopleDto) throws Exception {
         boolean dto = tbPeopleService.peopleDto(peopleDto);
         return dto;
     }

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

@@ -13,7 +13,6 @@ import com.pj.common.core.exception.ServiceException;
 import com.pj.current.dto.PCLoginUserInfo;
 import com.pj.current.satoken.StpUserUtil;
 import com.pj.enummj.*;
-import com.pj.rabbitmq.RabbitMQ;
 import com.pj.tb_group.TbGroup;
 import com.pj.tb_group.TbGroupMapper;
 import com.pj.tb_order.TbOrder;
@@ -29,7 +28,6 @@ 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.amqp.core.AmqpTemplate;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -70,11 +68,6 @@ public class TbPeopleService extends ServiceImpl<TbPeopleMapper, TbPeople> imple
 	@Autowired
 	TbGroupMapper tbGroupMapper;
 
-	/**
-	 * mq
-	 */
-	@Autowired
-	private AmqpTemplate amqpTemplate;
 
 	/** 增 */
 	void add(TbPeople t){
@@ -528,7 +521,7 @@ public class TbPeopleService extends ServiceImpl<TbPeopleMapper, TbPeople> imple
 	}
 
 	/** 远程调用方法 边民信息事务处理 */
-	public boolean peopleDto(PeopleDto peopleDto){
+	public boolean peopleDto(PeopleDto peopleDto) throws Exception {
 		//创建对象
 		TbPeople tbPeople = new TbPeople();
 		//数据拷贝
@@ -540,7 +533,15 @@ public class TbPeopleService extends ServiceImpl<TbPeopleMapper, TbPeople> imple
 		if(peopleList.size() == 0){
 			//新增
 			boolean save = this.save(tbPeople);
-			return save;
+			if(save){
+				//给边民生成账号
+				List<TbPeople> tbPeopleList = tbPeopleMapper.selectList(new LambdaQueryWrapper<TbPeople>().eq(TbPeople::getBorderTel, tbPeople.getBorderTel()).eq(TbPeople::getDeleteStatus, DeleteStatus.DELETE_STATUS_ON.getCode()));
+				peopleDto.setId(tbPeopleList.get(0).getId());
+				Boolean aBoolean = adminInterface.generatePeopleAccount(peopleDto);
+				if(!aBoolean)
+					throw new RuntimeException("\n边民生成账号时错误。 id = " + tbPeopleList.get(0).getId() + "\n");
+				return aBoolean;
+			}
 		}
 		//修改
 		BeanUtils.copyProperties(peopleList.get(0),tbPeople);

+ 1 - 1
sp-service/level-one-server/src/main/java/com/pj/tb_shop/TbShopController.java

@@ -131,7 +131,7 @@ public class TbShopController {
 	/*------            正常业务👆👆    rpc远程调用👇👇                         -----------*/
 
 	@RequestMapping("rpc/shopDto")
-	public boolean shopDto(@RequestBody ShopDto shopDto){
+	public boolean shopDto(@RequestBody ShopDto shopDto) throws Exception {
 		boolean b = tbShopService.shopDto(shopDto);
 		return b;
 	}

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

@@ -8,8 +8,15 @@ import java.util.Date;
 import java.util.List;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.pj.api.client.admin.AdminInterface;
+import com.pj.api.dto.EnterpriseDto;
 import com.pj.api.dto.ShopDto;
+import com.pj.common.core.exception.ServiceException;
 import com.pj.enummj.DeleteStatus;
+import com.pj.enummj.JudgeStatus;
+import com.pj.project4sp.SP;
+import com.pj.tb_enterprise.TbEnterprise;
+import com.pj.tb_enterprise.TbEnterpriseMapper;
 import com.pj.utils.so.SoMap;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFRow;
@@ -20,6 +27,7 @@ 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.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -40,6 +48,12 @@ public class TbShopService extends ServiceImpl<TbShopMapper, TbShop> implements
 	@Autowired
 	private MethodShopService methodShopService;
 
+	@Autowired
+	private TbEnterpriseMapper tbEnterpriseMapper;
+
+	@Autowired
+	private AdminInterface adminInterface;
+
 	/** 增 */
 	void add(TbShop t){
 		save(t);
@@ -177,17 +191,55 @@ public class TbShopService extends ServiceImpl<TbShopMapper, TbShop> implements
 	}
 
 	/** 远程调用方法 */
-	public boolean shopDto(ShopDto shopDto){
+	@Transactional(propagation = Propagation.REQUIRES_NEW)
+	public boolean shopDto(ShopDto shopDto) throws Exception {
 		TbShop tbShop = new TbShop();
 		BeanUtils.copyProperties(shopDto,tbShop);
 		//根据编号进行事务处理
 		List<TbShop> tbShopList = tbShopMapper.selectList(new LambdaQueryWrapper<TbShop>().eq(TbShop::getPlatSeqNo, shopDto.getPlatSeqNo()));
 		if(tbShopList.size() == 0){
-			//无则新增
+			//去重
+			List<TbShop> tbShops = tbShopMapper.selectList(new LambdaQueryWrapper<TbShop>().eq(TbShop::getPlatSeqNo, shopDto.getPlatSeqNo()));
+			if(tbShops.size() != 0)throw new ServiceException("\n该店铺已存在。platSeqNo = " + shopDto.getPlatSeqNo() + "\n");
+			//无则新增商铺
 			tbShop.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
 			tbShop.setCreateTime(new Date());
 			int insert = tbShopMapper.insert(tbShop);
-			return insert == 1;
+			long primarykey = SP.publicMapper.getPrimarykey();
+			//新增外籍商户
+			if(insert == 1){
+				//去重
+				List<TbEnterprise> tbEnterpriseList = tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getPlatSeqNo, shopDto.getPlatSeqNo()));
+				if(tbEnterpriseList.size() != 0)throw new ServiceException("\n该外籍商户信息已存在。 platSeqNo = " + shopDto.getPlatSeqNo() + "\n");
+				TbEnterprise enterprise = new TbEnterprise();
+				BeanUtils.copyProperties(tbShop,enterprise);
+				//设置基本属性
+				enterprise.setOwnerName(shopDto.getOwnerName());
+				enterprise.setDeleteStatus(Long.valueOf(DeleteStatus.DELETE_STATUS_ON.getCode()));
+				enterprise.setJudgeStatus(JudgeStatus.JUDGE_STATUS_ONE.getCode());
+				enterprise.setJudgeTime(new Date());
+				enterprise.setShopId(primarykey);
+				enterprise.setShopName(shopDto.getShopName());
+				enterprise.setBankAccount(shopDto.getBankAccount());
+				enterprise.setBank(shopDto.getBank());
+				enterprise.setAddress(shopDto.getAddress());
+				enterprise.setType(null);
+				//保存
+				int insert1 = tbEnterpriseMapper.insert(enterprise);
+				if(insert1 == 1){
+					//创建商家保存对象
+					EnterpriseDto enterpriseDto = new EnterpriseDto();
+					//查询数据库内的商家
+					List<TbEnterprise> tbEnterprises = tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getPlatSeqNo, enterprise.getPlatSeqNo()));
+					//将数据拷贝至enterpriseDto
+					BeanUtils.copyProperties(tbEnterprises.get(0),enterpriseDto);
+					//远程调用生成商家账户方法
+					int i = adminInterface.generateEnterpriseAccount(enterpriseDto);
+					if(i != 1)
+						throw new RuntimeException("\n添加商铺时,保存店铺内的外籍商户信息错误。 id = " + tbEnterprises.get(0).getId() + "\n");
+					return true;
+				}
+			}
 		}
 		//修改
 		BeanUtils.copyProperties(tbShopList.get(0),tbShop);

+ 23 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserController.java

@@ -5,6 +5,8 @@ import java.util.List;
 import com.pj.api.dto.AppUserDto;
 
 import com.pj.api.dto.EnterpriseAuditDto;
+import com.pj.api.dto.EnterpriseDto;
+import com.pj.api.dto.PeopleDto;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -127,4 +129,25 @@ public class AppUserController {
 		return info;
 	}
 
+
+	/**
+	 * 同步航通边民信息时,自动给边民注册app账号
+	 */
+	@RequestMapping("rpc/generatePeopleAccount")
+	public boolean generatePeopleAccount(@RequestBody PeopleDto peopleDto) throws Exception {
+		boolean info = appUserService.generatePeopleAccount(peopleDto);
+		return info;
+	}
+
+
+	/**
+	 * 同步航通边民信息时,自动给外籍商户注册app账号
+	 */
+	@RequestMapping("rpc/generateEnterpriseAccount")
+	public int generateEnterpriseAccount(@RequestBody EnterpriseDto enterpriseDto) throws Exception {
+		int account = appUserService.generateEnterpriseAccount(enterpriseDto);
+		return account;
+	}
+
+
 }

+ 73 - 0
sp-service/sp-admin/src/main/java/com/pj/project/app_user/AppUserService.java

@@ -1,5 +1,6 @@
 package com.pj.project.app_user;
 
+import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
 import java.util.Random;
@@ -444,4 +445,76 @@ public class AppUserService extends ServiceImpl<AppUserMapper, AppUser> implemen
 		return update == 1;
 	}
 
+	/** 远程调用: 当从航通导入数据时,自动给边民生成账号 */
+	public boolean generatePeopleAccount(PeopleDto peopleDto) throws Exception {
+		//检查是否重复注册
+		List<AppUser> appUsers = appUserMapper.selectList(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhone, peopleDto.getBorderTel()));
+		if(appUsers.size() != 0)throw new ServiceException("\n该用户已注册! phone = " + peopleDto.getBorderTel() + "\n");
+		//创建保存对象
+		AppUser appUser = new AppUser();
+		//设置基本属性
+		appUser.setAuth(1 + ""); // 默认已认证
+		appUser.setUserType(1); // 用户类型 1
+		appUser.setCreateTime(new Date()); // 创建时间
+		appUser.setPhone(peopleDto.getBorderTel()); // 电话
+		appUser.setStatus("1"); // 可用状态
+		appUser.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode()); // 默认可用
+		appUser.setAuthTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); // 认证时间
+		appUser.setName(peopleDto.getBorderName()); // 昵称
+		appUser.setFkId(peopleDto.getId()); // 外键
+		//随机生成6位数密码
+		int password = (int) (Math.random() * (999999 - 100000 + 1) + 100000);
+		//密码加密
+		String encodePassword = passwordEncoder.encode(password + "");
+		//设置密码
+		appUser.setPassword(encodePassword);
+		//保存
+		int insert = appUserMapper.insert(appUser);
+		//发送短信
+		if(insert == 1){
+			//todo: 届时放开注释
+//			boolean msg = smsRetryService.sendSmsRegisteMsg(null, "您好,您已成功注册[边民互市]app账号。账号:" + peopleDto.getBorderTel() + ", 初始密码:" + password + "。可前往app进行修改");
+//			return msg;
+			System.out.println("注册成功! 账户 = " + peopleDto.getBorderTel() + " password = " + password);
+			return true;
+		}
+		throw new RuntimeException("同步航通信息时,边民注册app信息失败,边民手机号为: " + peopleDto.getBorderTel() + "。 时间: " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
+	}
+
+	/** 远程调用: 当从航通导入数据时,自动给外籍商户生成账号 */
+	public int generateEnterpriseAccount(EnterpriseDto enterpriseDto) throws Exception {
+		//判断是否已被注册
+		List<AppUser> appUsers = appUserMapper.selectList(new LambdaQueryWrapper<AppUser>().eq(AppUser::getPhone, enterpriseDto.getOwnerTel()));
+		if(appUsers.size() != 0)throw new ServiceException("\n该用户已注册! phone = " + enterpriseDto.getOwnerTel() + "\n");
+		//创建保存对象
+		AppUser appUser = new AppUser();
+		//设置基本属性
+		appUser.setAuth(1 + ""); // 默认已认证
+		appUser.setUserType(5); // 用户类型 1
+		appUser.setCreateTime(new Date()); // 创建时间
+		appUser.setPhone(enterpriseDto.getOwnerTel()); // 电话
+		appUser.setStatus("1"); // 可用状态
+		appUser.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode()); // 默认可用
+		appUser.setAuthTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); // 认证时间
+		appUser.setName(enterpriseDto.getOwnerName()); // 昵称
+		appUser.setFkId(enterpriseDto.getId()); // 外键
+		//随机生成6位数密码
+		int password = (int) (Math.random() * (999999 - 100000 + 1) + 100000);
+		//密码加密
+		String encodePassword = passwordEncoder.encode(password + "");
+		//设置密码
+		appUser.setPassword(encodePassword);
+		//保存
+		int insert = appUserMapper.insert(appUser);
+		//发送短信
+		if(insert == 1){
+			//todo: 届时放开注释
+//			boolean msg = smsRetryService.sendSmsRegisteMsg(null, "您好,您已成功注册[边民互市]app账号。账号:" + peopleDto.getBorderTel() + ", 初始密码:" + password + "。可前往app进行修改");
+//			return msg;
+			System.out.println("\n注册成功! 账户 = " + enterpriseDto.getOwnerTel() + " password = " + password + "\n");
+			return 1;
+		}
+		throw new RuntimeException("同步航通信息时,边民注册app信息失败,边民手机号为: " + enterpriseDto.getOwnerTel() + "。 时间: " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
+	}
+
 }

+ 1 - 1
sp-service/transport-server/src/main/java/com/pj/project/tb_vehicle/MethodVehicleService.java

@@ -68,7 +68,7 @@ public class MethodVehicleService {
         carRecord.setGoodsWeight(goodsTransitById.getGrossWeight()); // 过审商品毛重
         carRecord.setShopName(goodsTransitById.getShopName());  // 一级市场商铺名称
         carRecord.setEnterpriseName(goodsTransitById.getMerchantName()); // 一级市场商户名称
-        carRecord.setEnterprisePhone(enterpriseById.getContact()); // 一级市场商户电话
+        carRecord.setEnterprisePhone(enterpriseById.getOwnerTel()); // 一级市场商户电话
         //司机处理[0=待处理,1=同意,2=拒绝]
         carRecord.setDriverResult(0); // 默认待处理
         //公共字段属性赋值