From d678e74e4c320e8e9a879c415c42fb46451dbdf6 Mon Sep 17 00:00:00 2001
From: wanghb <17803890193@163.com>
Date: Wed, 6 Mar 2024 18:07:36 +0800
Subject: [PATCH] =?UTF-8?q?=E5=85=A5=E8=8A=82=E7=82=B9=E6=B3=A8=E5=86=8C?=
=?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=8A=9F=E8=83=BD=20=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=90=A5=E4=B8=9A=E6=89=A7=E7=85=A7=20?=
=?UTF-8?q?=E7=94=9F=E6=88=90=E5=85=AC=E7=A7=81=E5=AF=86=E9=92=A5=E5=AF=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
BlockFinanceCentral/pom.xml | 5 +
.../handler/GlobalExceptionHandler.java | 11 +-
.../StuSupplyBusinessController.java | 78 +++++++
.../entity/dto/StuAddNodesDto.java | 77 +++++++
.../block_finance/entity/stuJoinNode.java | 13 +-
.../entity/stuJoinNodeExample.java | 70 ++++++
.../mappers/stuJoinNodeMapper.java | 4 +-
.../service/StuBusinessSupplyService.java | 26 +++
.../impl/StuBusinessSupplyServiceImpl.java | 205 ++++++++++++++++++
.../src/main/resources/generatorConfig.xml | 3 +-
.../resources/mappers/stuJoinNodeMapper.xml | 21 +-
11 files changed, 500 insertions(+), 13 deletions(-)
create mode 100644 BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/controller/StuSupplyBusinessController.java
create mode 100644 BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/entity/dto/StuAddNodesDto.java
create mode 100644 BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/service/StuBusinessSupplyService.java
create mode 100644 BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/service/impl/StuBusinessSupplyServiceImpl.java
diff --git a/BlockFinanceCentral/pom.xml b/BlockFinanceCentral/pom.xml
index e72d5d1..a76dcaf 100644
--- a/BlockFinanceCentral/pom.xml
+++ b/BlockFinanceCentral/pom.xml
@@ -22,6 +22,11 @@
org.apache.commons
commons-lang3
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
com.itextpdf
itextpdf
diff --git a/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/config/exception/handler/GlobalExceptionHandler.java b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/config/exception/handler/GlobalExceptionHandler.java
index 37f111a..1db18f7 100644
--- a/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/config/exception/handler/GlobalExceptionHandler.java
+++ b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/config/exception/handler/GlobalExceptionHandler.java
@@ -5,6 +5,7 @@ import com.sztzjy.block_finance.util.ResultEntity;
import com.sztzjy.block_finance.util.ThrowableUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.validation.FieldError;
@@ -87,16 +88,12 @@ public class GlobalExceptionHandler {
return new ResultEntity<>(HttpStatus.SEE_OTHER, e.getMessage());
}
- @ExceptionHandler(InvoceException.class)
- public ResultEntity serviceExceptionHandler(InvoceException e) {
- log.error("异常信息", e);
- return new ResultEntity<>(HttpStatus.ACCEPTED, e.getMessage());
- }
@ExceptionHandler(InvoceTException.class)
- public ResultEntity serviceExceptionHandler(InvoceTException e) {
+ public ResultEntity invoceExceptionHandler(InvoceTException e) {
log.error("异常信息", e);
- return new ResultEntity<>(HttpStatus.CREATED, e.getMessage());
+ return new ResultEntity<>(HttpStatus.BAD_REQUEST, e.getMessage());
}
+
}
\ No newline at end of file
diff --git a/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/controller/StuSupplyBusinessController.java b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/controller/StuSupplyBusinessController.java
new file mode 100644
index 0000000..01b240d
--- /dev/null
+++ b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/controller/StuSupplyBusinessController.java
@@ -0,0 +1,78 @@
+package com.sztzjy.block_finance.controller;
+/**
+ * @author 17803
+ * @date 2024-03-06 13:54
+ */
+
+import com.sztzjy.block_finance.annotation.AnonymousAccess;
+import com.sztzjy.block_finance.entity.dto.StuAddNodesDto;
+import com.sztzjy.block_finance.entity.stuJoinNode;
+import com.sztzjy.block_finance.service.StuBusinessSupplyService;
+import com.sztzjy.block_finance.util.ResultEntity;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.RequestEntity;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+
+import javax.validation.Valid;
+import java.security.NoSuchAlgorithmException;
+import java.util.List;
+
+
+@RestController
+@RequestMapping("api/stu/businessSupply")
+@Api(tags = "供应链接口")
+public class StuSupplyBusinessController {
+
+ @Autowired
+ private StuBusinessSupplyService stuBusinessSupplyService;
+
+
+ @GetMapping("/getNodesInfo")
+ @ApiOperation(value = "获取首页节点信息")
+ @AnonymousAccess
+ public ResultEntity> getNodesInfo(@ApiParam("用户ID") String userId){
+
+ List nodeList = stuBusinessSupplyService.getNodesInfo(userId);
+
+
+ return new ResultEntity<>(HttpStatus.OK,"获取成功",nodeList);
+ }
+
+
+
+
+ @PostMapping("/addNodes")
+ @ApiOperation(value = "加入节点")
+ @AnonymousAccess
+ public ResultEntity addNodes(@Valid @RequestBody StuAddNodesDto stuAddNodesDto) throws NoSuchAlgorithmException {
+
+ stuBusinessSupplyService.addNodes(stuAddNodesDto);
+ return new ResultEntity<>(HttpStatus.OK);
+ }
+
+ @PostMapping("/uploadBussinessImg")
+ @ApiOperation(value = "上传营业执照")
+ @AnonymousAccess
+ public ResultEntity uploadBussinessImg(@RequestPart MultipartFile file,
+ @ApiParam("用户ID") String userId,
+ @ApiParam("用户名")String userName){
+
+ String path = stuBusinessSupplyService.uploadBussinessImg(file,userId,userName);
+ return new ResultEntity<>(HttpStatus.OK);
+ }
+
+
+
+
+
+
+
+}
diff --git a/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/entity/dto/StuAddNodesDto.java b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/entity/dto/StuAddNodesDto.java
new file mode 100644
index 0000000..4669f67
--- /dev/null
+++ b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/entity/dto/StuAddNodesDto.java
@@ -0,0 +1,77 @@
+package com.sztzjy.block_finance.entity.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+
+/**
+ * @author 17803
+ * @date 2024-03-06 14:07
+ */
+
+
+
+
+@ApiModel(description = "加入节点,注册账号")
+public class StuAddNodesDto {
+
+ @ApiModelProperty(required = true,value = "注册用户((传参:昆明闻泰通讯有限公司 ,信丰世嘉科技有限公司 ,银邦科技有限公司 ,深圳拓朴商业保理有限公司))")
+ @NotBlank(message = "注册用户不能为空")
+ private String regName;
+
+ @ApiModelProperty(required = true,value = "纳税识别号")
+ @NotBlank(message = "纳税识别号不能为空")
+ private String taxAccount;
+
+ @ApiModelProperty(required = true,value = "营业执照地址")
+ @NotBlank(message = "营业执照上传地址不能为空")
+ private String imgAddress;
+
+ @ApiModelProperty(required = true,value = "用户ID")
+ @NotBlank(message = "用户ID不能为空")
+ private String userId;
+
+
+ public StuAddNodesDto() {
+ }
+
+ public StuAddNodesDto(String regName, String taxAccount, String imgAddress, String userId) {
+ this.regName = regName;
+ this.taxAccount = taxAccount;
+ this.imgAddress = imgAddress;
+ this.userId = userId;
+ }
+
+ public String getRegName() {
+ return regName;
+ }
+
+ public void setRegName(String regName) {
+ this.regName = regName;
+ }
+
+ public String getTaxAccount() {
+ return taxAccount;
+ }
+
+ public void setTaxAccount(String taxAccount) {
+ this.taxAccount = taxAccount;
+ }
+
+ public String getImgAddress() {
+ return imgAddress;
+ }
+
+ public void setImgAddress(String imgAddress) {
+ this.imgAddress = imgAddress;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public void setUserId(String userId) {
+ this.userId = userId;
+ }
+}
diff --git a/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/entity/stuJoinNode.java b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/entity/stuJoinNode.java
index 2903b37..6f86918 100644
--- a/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/entity/stuJoinNode.java
+++ b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/entity/stuJoinNode.java
@@ -5,7 +5,7 @@ import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
/**
*
- * @author whb
+ * @author
* stu_join_node
*/
public class stuJoinNode {
@@ -57,6 +57,9 @@ public class stuJoinNode {
@ApiModelProperty("保理融资额")
private String factorFinanceAmount;
+ @ApiModelProperty("上传执照路径")
+ private String imgPath;
+
@ApiModelProperty("保理利息收入")
private String factorInterestIncome;
@@ -197,6 +200,14 @@ public class stuJoinNode {
this.factorFinanceAmount = factorFinanceAmount == null ? null : factorFinanceAmount.trim();
}
+ public String getImgPath() {
+ return imgPath;
+ }
+
+ public void setImgPath(String imgPath) {
+ this.imgPath = imgPath == null ? null : imgPath.trim();
+ }
+
public String getFactorInterestIncome() {
return factorInterestIncome;
}
diff --git a/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/entity/stuJoinNodeExample.java b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/entity/stuJoinNodeExample.java
index ee68704..73145f7 100644
--- a/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/entity/stuJoinNodeExample.java
+++ b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/entity/stuJoinNodeExample.java
@@ -1205,6 +1205,76 @@ public class stuJoinNodeExample {
return (Criteria) this;
}
+ public Criteria andImgPathIsNull() {
+ addCriterion("img_path is null");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathIsNotNull() {
+ addCriterion("img_path is not null");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathEqualTo(String value) {
+ addCriterion("img_path =", value, "imgPath");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathNotEqualTo(String value) {
+ addCriterion("img_path <>", value, "imgPath");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathGreaterThan(String value) {
+ addCriterion("img_path >", value, "imgPath");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathGreaterThanOrEqualTo(String value) {
+ addCriterion("img_path >=", value, "imgPath");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathLessThan(String value) {
+ addCriterion("img_path <", value, "imgPath");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathLessThanOrEqualTo(String value) {
+ addCriterion("img_path <=", value, "imgPath");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathLike(String value) {
+ addCriterion("img_path like", value, "imgPath");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathNotLike(String value) {
+ addCriterion("img_path not like", value, "imgPath");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathIn(List values) {
+ addCriterion("img_path in", values, "imgPath");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathNotIn(List values) {
+ addCriterion("img_path not in", values, "imgPath");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathBetween(String value1, String value2) {
+ addCriterion("img_path between", value1, value2, "imgPath");
+ return (Criteria) this;
+ }
+
+ public Criteria andImgPathNotBetween(String value1, String value2) {
+ addCriterion("img_path not between", value1, value2, "imgPath");
+ return (Criteria) this;
+ }
+
public Criteria andFactorInterestIncomeIsNull() {
addCriterion("factor_interest_income is null");
return (Criteria) this;
diff --git a/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/mappers/stuJoinNodeMapper.java b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/mappers/stuJoinNodeMapper.java
index 91fed9f..27ba884 100644
--- a/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/mappers/stuJoinNodeMapper.java
+++ b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/mappers/stuJoinNodeMapper.java
@@ -3,8 +3,10 @@ package com.sztzjy.block_finance.mappers;
import com.sztzjy.block_finance.entity.stuJoinNode;
import com.sztzjy.block_finance.entity.stuJoinNodeExample;
import java.util.List;
-import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+@Mapper
public interface stuJoinNodeMapper {
long countByExample(stuJoinNodeExample example);
diff --git a/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/service/StuBusinessSupplyService.java b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/service/StuBusinessSupplyService.java
new file mode 100644
index 0000000..a04a70a
--- /dev/null
+++ b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/service/StuBusinessSupplyService.java
@@ -0,0 +1,26 @@
+package com.sztzjy.block_finance.service;
+
+import com.sztzjy.block_finance.entity.dto.StuAddNodesDto;
+import com.sztzjy.block_finance.entity.stuJoinNode;
+import io.swagger.annotations.ApiParam;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.security.NoSuchAlgorithmException;
+import java.util.List;
+
+/**
+ * @author 17803
+ * @date 2024-03-06 14:23
+ */
+public interface StuBusinessSupplyService {
+ //获取首页节点信息
+ List getNodesInfo(String userId);
+
+ //加入节点
+ void addNodes(StuAddNodesDto stuAddNodesDto) throws NoSuchAlgorithmException;
+
+ //上传营业执照
+ String uploadBussinessImg(MultipartFile file,
+ String userId,
+ String userName);
+}
diff --git a/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/service/impl/StuBusinessSupplyServiceImpl.java b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/service/impl/StuBusinessSupplyServiceImpl.java
new file mode 100644
index 0000000..f171248
--- /dev/null
+++ b/BlockFinanceCentral/src/main/java/com/sztzjy/block_finance/service/impl/StuBusinessSupplyServiceImpl.java
@@ -0,0 +1,205 @@
+package com.sztzjy.block_finance.service.impl;/**
+ * @author 17803
+ * @date 2024-03-06 14:23
+ */
+
+import cn.hutool.core.util.IdUtil;
+
+import com.sztzjy.block_finance.config.exception.handler.InvoceTException;
+import com.sztzjy.block_finance.config.exception.handler.NoContentException;
+import com.sztzjy.block_finance.entity.dto.StuAddNodesDto;
+import com.sztzjy.block_finance.entity.stuJoinNode;
+import com.sztzjy.block_finance.entity.stuJoinNodeExample;
+import com.sztzjy.block_finance.mappers.stuJoinNodeMapper;
+import com.sztzjy.block_finance.service.StuBusinessSupplyService;
+import com.sztzjy.block_finance.util.ResultEntity;
+import com.sztzjy.block_finance.util.RsaUtil;
+import com.sztzjy.block_finance.util.file.LocalFileUtil;
+import io.jsonwebtoken.lang.Strings;
+import org.apache.commons.lang3.ArrayUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpStatus;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.security.NoSuchAlgorithmException;
+import java.util.*;
+
+
+@Service
+public class StuBusinessSupplyServiceImpl implements StuBusinessSupplyService {
+
+
+ @Autowired
+ private stuJoinNodeMapper stuJoinNodeMapper;
+
+ @Value("${file.path}")
+ String path;
+
+ //获取首页节点信息
+ @Override
+ public List getNodesInfo(String userId) {
+
+
+ stuJoinNodeExample stuJoinNodeExample = new stuJoinNodeExample();
+ stuJoinNodeExample.createCriteria().andUserIdEqualTo(userId);
+ List nodeList = stuJoinNodeMapper.selectByExample(stuJoinNodeExample);
+ if (nodeList != null && nodeList.size() > 0)
+ {
+ return nodeList;
+
+ }else {
+
+ ArrayList arr = new ArrayList<>();
+
+ //添加信息
+ stuJoinNode stuJoinNode = new stuJoinNode();
+
+ int i = UUID.randomUUID().hashCode();
+ int id = i > 0 ? i : -i;
+ stuJoinNode.setId(id);
+ //核心企业
+ stuJoinNode.setModule(1);
+ stuJoinNode.setUserName("昆明闻泰通讯有限公司");
+ stuJoinNode.setTaxIdentifyNumber("91530100MA6NRB2A0E");
+ stuJoinNode.setTelNumber("15999857868");
+ stuJoinNode.setBaseAccount("9550880214383700108");
+ stuJoinNode.setBankOfDeposit("广发银行昆明分行");
+ stuJoinNode.setRegAddress("昆明市市场监督管理局");
+ stuJoinNode.setRegAddress("云南省昆明市高新区海源北路6号招商大厦");
+ stuJoinNode.setUserId(userId);
+ stuJoinNode.setCreateTime(new Date());
+ stuJoinNodeMapper.insertSelective(stuJoinNode);
+ arr.add(stuJoinNode);
+
+ stuJoinNode stuJoinNodeInfoTwo = new stuJoinNode();
+
+ int j = UUID.randomUUID().hashCode();
+ int idTwo = j > 0 ? j : -j;
+
+ stuJoinNodeInfoTwo.setId(idTwo);
+ //核心企业
+ stuJoinNodeInfoTwo.setModule(2);
+ stuJoinNodeInfoTwo.setUserName("信丰世嘉科技有限公司");
+ stuJoinNodeInfoTwo.setTaxIdentifyNumber("91360722MA35LME192");
+ stuJoinNodeInfoTwo.setTelNumber("15999857848");
+ stuJoinNodeInfoTwo.setBaseAccount("1917402008217");
+ stuJoinNodeInfoTwo.setBankOfDeposit("中国银行赣州市信丰县支行");
+ stuJoinNodeInfoTwo.setRegAddress("信丰县市场监督管理局");
+ stuJoinNodeInfoTwo.setRegAddress("江西省赣州市信丰县高新区深圳大道5G智能机器人产业园(众恒科技园B区)8号");
+ stuJoinNodeInfoTwo.setUserId(userId);
+ stuJoinNodeInfoTwo.setCreateTime(new Date());
+ stuJoinNodeMapper.insertSelective(stuJoinNodeInfoTwo);
+
+ arr.add(stuJoinNodeInfoTwo);
+
+
+
+ stuJoinNode stuJoinNodeInfoThree = new stuJoinNode();
+
+ int k = UUID.randomUUID().hashCode();
+ int idThree = k > 0 ? k : -k;
+
+ stuJoinNodeInfoThree.setId(idThree);
+ //核心企业
+ stuJoinNodeInfoThree.setModule(3);
+ stuJoinNodeInfoThree.setUserName("银邦科技有限公司");
+ stuJoinNodeInfoThree.setTaxIdentifyNumber("91420900MA49JL521M");
+ stuJoinNodeInfoThree.setTelNumber("15999857858");
+ stuJoinNodeInfoThree.setBaseAccount("6222000000000000011");
+ stuJoinNodeInfoThree.setBankOfDeposit("工商银行孝感市支行");
+ stuJoinNodeInfoThree.setRegAddress("孝感市市场监督管理局");
+ stuJoinNodeInfoThree.setRegAddress("孝感市航空南路特1号");
+ stuJoinNodeInfoThree.setUserId(userId);
+ stuJoinNodeInfoThree.setCreateTime(new Date());
+ stuJoinNodeMapper.insertSelective(stuJoinNodeInfoThree);
+
+
+ arr.add(stuJoinNodeInfoThree);
+
+ stuJoinNode stuJoinNodeInfoFour = new stuJoinNode();
+
+ int z = UUID.randomUUID().hashCode();
+ int idz = z > 0 ? z : -z;
+
+ stuJoinNodeInfoFour.setId(idz);
+ //核心企业
+ stuJoinNodeInfoFour.setModule(4);
+ stuJoinNodeInfoFour.setUserName("深圳拓朴商业保理有限公司");
+ stuJoinNodeInfoFour.setTaxIdentifyNumber("914403003265877025");
+ stuJoinNodeInfoFour.setTelNumber("15999855878");
+ stuJoinNodeInfoFour.setBaseAccount("7441210182600135845");
+ stuJoinNodeInfoFour.setBankOfDeposit("中信银行红树湾支行");
+ stuJoinNodeInfoFour.setRegAddress("深圳市市场监督管理局");
+ stuJoinNodeInfoFour.setRegAddress("深圳市福田区沙头街道沙嘴社区沙嘴路8号红树华府A、B、C、D栋A栋12层1211-03");
+ stuJoinNodeInfoFour.setUserId(userId);
+ stuJoinNodeInfoFour.setCreateTime(new Date());
+ stuJoinNodeMapper.insertSelective(stuJoinNodeInfoFour);
+
+ arr.add(stuJoinNodeInfoFour);
+
+ return arr;
+
+ }
+
+
+ }
+ //加入节点
+ @Override
+ public void addNodes(StuAddNodesDto stuAddNodesDto) throws NoSuchAlgorithmException {
+
+ // module校验
+ //纳税识别号 校验 上传成功生成公钥私钥
+
+ stuJoinNodeExample example = new stuJoinNodeExample();
+ example.createCriteria().andUserIdEqualTo(stuAddNodesDto.getUserId()).andUserNameEqualTo(stuAddNodesDto.getRegName());
+ List stuJoinNodes = stuJoinNodeMapper.selectByExample(example);
+ if (StringUtils.hasLength(stuJoinNodes.get(0).getPublicKey()))
+ {
+ throw new InvoceTException(HttpStatus.BAD_REQUEST,"请勿重复注册!");
+ }
+ RsaUtil.RsaKeyPair rsaKeyPair = RsaUtil.generateKeyPair();
+ stuJoinNodes.get(0).setPublicKey( rsaKeyPair.getPublicKey());
+ stuJoinNodes.get(0).setPrivateKey( rsaKeyPair.getPrivateKey());
+ stuJoinNodes.get(0).setUpdateTime(new Date());
+
+ stuJoinNodeMapper.updateByPrimaryKeySelective(stuJoinNodes.get(0));
+
+
+
+ }
+
+
+ //上传营业执照
+ @Override
+ public String uploadBussinessImg(MultipartFile file,
+ String userId,
+ String userName) {
+ if (file.isEmpty())
+ {
+ throw new InvoceTException(HttpStatus.BAD_REQUEST,"上传的文件为空!");
+ }
+
+ LocalFileUtil localFileUtil = new LocalFileUtil(path);
+ String upload = localFileUtil.upload(file);
+
+ stuJoinNodeExample example = new stuJoinNodeExample();
+ example.createCriteria().andUserIdEqualTo(userId).andUserNameEqualTo(userName);
+ List stuJoinNodes = stuJoinNodeMapper.selectByExample(example);
+ if (!CollectionUtils.isEmpty(stuJoinNodes)){
+ stuJoinNode stuJoinNode = stuJoinNodes.get(0);
+ stuJoinNode.setImgPath(upload);
+ stuJoinNodeMapper.updateByPrimaryKeySelective(stuJoinNode);
+ return upload;
+
+ }else {
+ throw new InvoceTException(HttpStatus.BAD_REQUEST,"异常!");
+
+ }
+
+
+ }
+}
diff --git a/BlockFinanceCentral/src/main/resources/generatorConfig.xml b/BlockFinanceCentral/src/main/resources/generatorConfig.xml
index 98c5baf..a6aeb6b 100644
--- a/BlockFinanceCentral/src/main/resources/generatorConfig.xml
+++ b/BlockFinanceCentral/src/main/resources/generatorConfig.xml
@@ -19,6 +19,7 @@
+
@@ -40,7 +41,7 @@
-
+
diff --git a/BlockFinanceCentral/src/main/resources/mappers/stuJoinNodeMapper.xml b/BlockFinanceCentral/src/main/resources/mappers/stuJoinNodeMapper.xml
index 4d8a9a3..e5acfa2 100644
--- a/BlockFinanceCentral/src/main/resources/mappers/stuJoinNodeMapper.xml
+++ b/BlockFinanceCentral/src/main/resources/mappers/stuJoinNodeMapper.xml
@@ -18,6 +18,7 @@
+
@@ -84,7 +85,7 @@
id, module, user_name, tax_identify_number, tel_number, base_account, bank_of_deposit,
reg_auth, reg_address, node_address, public_key, private_key, account_receive, account_pay,
- token_asset, factor_finance_amount, factor_interest_income, user_id, create_time,
+ token_asset, factor_finance_amount, img_path, factor_interest_income, user_id, create_time,
update_time