完成交易确认(核心企业)
parent
7a4cf5b359
commit
479aa557dc
@ -0,0 +1,149 @@
|
|||||||
|
package com.sztzjy.block_finance.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.sun.xml.bind.v2.TODO;
|
||||||
|
import com.sztzjy.block_finance.annotation.AnonymousAccess;
|
||||||
|
import com.sztzjy.block_finance.config.exception.handler.InvoceTException;
|
||||||
|
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo;
|
||||||
|
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfoExample;
|
||||||
|
import com.sztzjy.block_finance.entity.dto.StutInfoSecDto;
|
||||||
|
import com.sztzjy.block_finance.entity.dto.StutranDocDto;
|
||||||
|
import com.sztzjy.block_finance.mappers.StuTransactionDocumentsInfoMapper;
|
||||||
|
import com.sztzjy.block_finance.service.StuEncryptOnChainService;
|
||||||
|
import com.sztzjy.block_finance.util.ResultEntity;
|
||||||
|
import com.sztzjy.block_finance.util.file.IFileUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import org.checkerframework.checker.units.qual.A;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 17803
|
||||||
|
* @date 2024-03-21 15:48
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/stu/encrypt")
|
||||||
|
@Api(tags = "交易信息上链(一级供应商)")
|
||||||
|
public class stuEncryptOnChainController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StuEncryptOnChainService service;
|
||||||
|
|
||||||
|
@Value("${file.path}")
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private com.sztzjy.block_finance.util.file.IFileUtil IFileUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StuTransactionDocumentsInfoMapper docMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("交易文件数字签名加密")
|
||||||
|
@PostMapping("tranDoc")
|
||||||
|
@AnonymousAccess
|
||||||
|
public ResultEntity tranDoc(@RequestBody @Validated StutranDocDto dto ) throws NoSuchAlgorithmException {
|
||||||
|
|
||||||
|
|
||||||
|
return service.tranDoc(dto);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("交易相关信息加密")
|
||||||
|
@PostMapping("InfoSec")
|
||||||
|
@AnonymousAccess
|
||||||
|
public ResultEntity InfoSec(@RequestBody @Validated StutInfoSecDto dto ) throws Exception {
|
||||||
|
|
||||||
|
|
||||||
|
return service.InfoSec(dto);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/upload")
|
||||||
|
@ApiOperation("上传文件")
|
||||||
|
@AnonymousAccess
|
||||||
|
public ResultEntity upload(@RequestParam(required = true) @RequestPart MultipartFile file,
|
||||||
|
@RequestParam(required = true) String userId,
|
||||||
|
@ApiParam("文件名")@RequestParam(required = true) @NotBlank String fileName) {
|
||||||
|
|
||||||
|
//TODO 上传名字做校验
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (file.isEmpty()) {
|
||||||
|
throw new InvoceTException(HttpStatus.ACCEPTED, "请勿上传空文件!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取文件名
|
||||||
|
String originalFilename = file.getOriginalFilename();
|
||||||
|
|
||||||
|
// 判断文件扩展名是否为图片格式
|
||||||
|
|
||||||
|
if (!StringUtils.hasLength(originalFilename) || (!originalFilename.toLowerCase().endsWith(".pdf")))
|
||||||
|
{
|
||||||
|
throw new InvoceTException(HttpStatus.ACCEPTED, "请上传正确的文件!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
StuTransactionDocumentsInfoExample example = new StuTransactionDocumentsInfoExample();
|
||||||
|
example.createCriteria().andUserIdEqualTo(userId).andFileNameEqualTo(fileName);
|
||||||
|
|
||||||
|
|
||||||
|
List<StuTransactionDocumentsInfo> documentsInfoList = docMapper.selectByExample(example);
|
||||||
|
|
||||||
|
|
||||||
|
String uploadPath = IFileUtil.upload(file);
|
||||||
|
|
||||||
|
|
||||||
|
if (!documentsInfoList.isEmpty()){
|
||||||
|
|
||||||
|
StuTransactionDocumentsInfo documentsInfo = documentsInfoList.get(0);
|
||||||
|
documentsInfo.setUrl(uploadPath);
|
||||||
|
documentsInfo.setUpdateTime(new Date());
|
||||||
|
|
||||||
|
docMapper.updateByPrimaryKeySelective(documentsInfo);
|
||||||
|
|
||||||
|
|
||||||
|
}else {
|
||||||
|
|
||||||
|
StuTransactionDocumentsInfo documentsInfo = new StuTransactionDocumentsInfo();
|
||||||
|
documentsInfo.setCreateTime(new Date());
|
||||||
|
documentsInfo.setFileName(fileName);
|
||||||
|
documentsInfo.setUrl(uploadPath);
|
||||||
|
documentsInfo.setUploadStatus(1);
|
||||||
|
documentsInfo.setUserId(userId);
|
||||||
|
documentsInfo.setId((int) IdUtil.getSnowflakeNextId());
|
||||||
|
|
||||||
|
docMapper.insertSelective(documentsInfo);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new ResultEntity<>(HttpStatus.OK, "上传成功",uploadPath);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package com.sztzjy.block_finance.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.sztzjy.block_finance.annotation.AnonymousAccess;
|
||||||
|
import com.sztzjy.block_finance.config.exception.handler.InvoceTException;
|
||||||
|
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo;
|
||||||
|
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfoExample;
|
||||||
|
import com.sztzjy.block_finance.entity.dto.StutInfoSecDto;
|
||||||
|
import com.sztzjy.block_finance.entity.dto.StutranDocDto;
|
||||||
|
import com.sztzjy.block_finance.mappers.StuTransactionDocumentsInfoMapper;
|
||||||
|
import com.sztzjy.block_finance.service.StuEncryptOnChainService;
|
||||||
|
import com.sztzjy.block_finance.service.StuTransactionConfirmationService;
|
||||||
|
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.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 17803
|
||||||
|
* @date 2024-03-21 15:48
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("api/stu/transactConfirm")
|
||||||
|
@Api(tags = "交易确认(核心企业)")
|
||||||
|
public class stuTransactionConfirmationController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StuTransactionConfirmationService stuTransactionConfirmationService;
|
||||||
|
|
||||||
|
@Value("${file.path}")
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private com.sztzjy.block_finance.util.file.IFileUtil IFileUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StuTransactionDocumentsInfoMapper docMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("交易文件数据")
|
||||||
|
@PostMapping("tranDoc")
|
||||||
|
@AnonymousAccess
|
||||||
|
public ResultEntity<List<StuTransactionDocumentsInfo>> tranDataList(String userId ){
|
||||||
|
|
||||||
|
|
||||||
|
return stuTransactionConfirmationService.tranDataList(userId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("交易相关信息解密")
|
||||||
|
@AnonymousAccess
|
||||||
|
@PostMapping("updateEncryByInfo")
|
||||||
|
public ResultEntity updateEncryByInfo(@RequestBody @Validated StutranDocDto dto){
|
||||||
|
|
||||||
|
return stuTransactionConfirmationService.updateEncryByInfo(dto);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("数字签名解密")
|
||||||
|
@AnonymousAccess
|
||||||
|
@PostMapping("digitalEncryByInfo")
|
||||||
|
public ResultEntity digitalEncryByInfo(@RequestBody @Validated StutInfoSecDto dto){
|
||||||
|
|
||||||
|
return stuTransactionConfirmationService.digitalEncryByInfo(dto);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,215 @@
|
|||||||
|
package com.sztzjy.block_finance.entity;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class StuTransactionDocumentsInfo {
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
private Integer uploadStatus;
|
||||||
|
|
||||||
|
private Integer informationStatus;
|
||||||
|
|
||||||
|
private Integer informationStatusEncry;
|
||||||
|
|
||||||
|
private Integer signatureVerificationStatusEncry;
|
||||||
|
|
||||||
|
private Integer signatureVerificationStatus;
|
||||||
|
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
private Integer discountDisplay;
|
||||||
|
|
||||||
|
private Integer supplierDisplay;
|
||||||
|
|
||||||
|
private Integer coreEnterpriseDisplay;
|
||||||
|
|
||||||
|
private Integer coreEnterpriseReceiveStatus;
|
||||||
|
|
||||||
|
private Integer factoringCompanyDisplay;
|
||||||
|
|
||||||
|
private Integer factoringCompaniesReceiveStatus;
|
||||||
|
|
||||||
|
private Integer readStatus;
|
||||||
|
|
||||||
|
private Integer downloadStatus;
|
||||||
|
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
private String crypDigest;
|
||||||
|
|
||||||
|
private String informationCiphertext;
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileName() {
|
||||||
|
return fileName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFileName(String fileName) {
|
||||||
|
this.fileName = fileName == null ? null : fileName.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.url = url == null ? null : url.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUploadStatus() {
|
||||||
|
return uploadStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUploadStatus(Integer uploadStatus) {
|
||||||
|
this.uploadStatus = uploadStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInformationStatus() {
|
||||||
|
return informationStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInformationStatus(Integer informationStatus) {
|
||||||
|
this.informationStatus = informationStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInformationStatusEncry() {
|
||||||
|
return informationStatusEncry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInformationStatusEncry(Integer informationStatusEncry) {
|
||||||
|
this.informationStatusEncry = informationStatusEncry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSignatureVerificationStatusEncry() {
|
||||||
|
return signatureVerificationStatusEncry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSignatureVerificationStatusEncry(Integer signatureVerificationStatusEncry) {
|
||||||
|
this.signatureVerificationStatusEncry = signatureVerificationStatusEncry;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSignatureVerificationStatus() {
|
||||||
|
return signatureVerificationStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSignatureVerificationStatus(Integer signatureVerificationStatus) {
|
||||||
|
this.signatureVerificationStatus = signatureVerificationStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(String userId) {
|
||||||
|
this.userId = userId == null ? null : userId.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDiscountDisplay() {
|
||||||
|
return discountDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDiscountDisplay(Integer discountDisplay) {
|
||||||
|
this.discountDisplay = discountDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSupplierDisplay() {
|
||||||
|
return supplierDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSupplierDisplay(Integer supplierDisplay) {
|
||||||
|
this.supplierDisplay = supplierDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCoreEnterpriseDisplay() {
|
||||||
|
return coreEnterpriseDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoreEnterpriseDisplay(Integer coreEnterpriseDisplay) {
|
||||||
|
this.coreEnterpriseDisplay = coreEnterpriseDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCoreEnterpriseReceiveStatus() {
|
||||||
|
return coreEnterpriseReceiveStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCoreEnterpriseReceiveStatus(Integer coreEnterpriseReceiveStatus) {
|
||||||
|
this.coreEnterpriseReceiveStatus = coreEnterpriseReceiveStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getFactoringCompanyDisplay() {
|
||||||
|
return factoringCompanyDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFactoringCompanyDisplay(Integer factoringCompanyDisplay) {
|
||||||
|
this.factoringCompanyDisplay = factoringCompanyDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getFactoringCompaniesReceiveStatus() {
|
||||||
|
return factoringCompaniesReceiveStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFactoringCompaniesReceiveStatus(Integer factoringCompaniesReceiveStatus) {
|
||||||
|
this.factoringCompaniesReceiveStatus = factoringCompaniesReceiveStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getReadStatus() {
|
||||||
|
return readStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReadStatus(Integer readStatus) {
|
||||||
|
this.readStatus = readStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getDownloadStatus() {
|
||||||
|
return downloadStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDownloadStatus(Integer downloadStatus) {
|
||||||
|
this.downloadStatus = downloadStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCrypDigest() {
|
||||||
|
return crypDigest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCrypDigest(String crypDigest) {
|
||||||
|
this.crypDigest = crypDigest == null ? null : crypDigest.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInformationCiphertext() {
|
||||||
|
return informationCiphertext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInformationCiphertext(String informationCiphertext) {
|
||||||
|
this.informationCiphertext = informationCiphertext == null ? null : informationCiphertext.trim();
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,37 @@
|
|||||||
|
package com.sztzjy.block_finance.entity.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 17803
|
||||||
|
* @date 2024-03-07 17:34
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ApiModel(description = "密码箱")
|
||||||
|
public class StuSecretInfoDto {
|
||||||
|
@ApiModelProperty(value = "昆明闻泰通讯有限公司公钥")
|
||||||
|
private String kunMingPublicKey;
|
||||||
|
@ApiModelProperty(value = "昆明闻泰通讯有限公司私钥")
|
||||||
|
private String kunMingPrivateKey;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "银邦科技有限公司公钥")
|
||||||
|
private String yinBangPublicKey;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "银邦科技有限公司私钥")
|
||||||
|
private String yinBangPrivateKey;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "信丰世嘉科技有限公司公钥")
|
||||||
|
private String xinFengPublicKey;
|
||||||
|
@ApiModelProperty(value = "信丰世嘉科技有限公司私钥")
|
||||||
|
private String xinFengPrivateKey;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "深圳拓朴商业保理有限公司公钥")
|
||||||
|
private String shenZhenPublicKey;
|
||||||
|
@ApiModelProperty(value = "深圳拓朴商业保理有限公司私钥")
|
||||||
|
private String shenZhenPrivateKey;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.sztzjy.block_finance.entity.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 17803
|
||||||
|
* @date 2024-03-21 15:53
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class StutInfoSecDto {
|
||||||
|
|
||||||
|
|
||||||
|
// private String publicKey;
|
||||||
|
@NotBlank
|
||||||
|
private String publicKey;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package com.sztzjy.block_finance.entity.dto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 17803
|
||||||
|
* @date 2024-03-21 15:53
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class StutranDocDto {
|
||||||
|
|
||||||
|
|
||||||
|
// private String publicKey;
|
||||||
|
@NotBlank
|
||||||
|
private String privateKey;
|
||||||
|
|
||||||
|
@NotBlank
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.sztzjy.block_finance.mappers;
|
||||||
|
|
||||||
|
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo;
|
||||||
|
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfoExample;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
@Mapper
|
||||||
|
public interface StuTransactionDocumentsInfoMapper {
|
||||||
|
long countByExample(StuTransactionDocumentsInfoExample example);
|
||||||
|
|
||||||
|
int deleteByExample(StuTransactionDocumentsInfoExample example);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
int insert(StuTransactionDocumentsInfo record);
|
||||||
|
|
||||||
|
int insertSelective(StuTransactionDocumentsInfo record);
|
||||||
|
|
||||||
|
List<StuTransactionDocumentsInfo> selectByExample(StuTransactionDocumentsInfoExample example);
|
||||||
|
|
||||||
|
StuTransactionDocumentsInfo selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
|
int updateByExampleSelective(@Param("record") StuTransactionDocumentsInfo record, @Param("example") StuTransactionDocumentsInfoExample example);
|
||||||
|
|
||||||
|
int updateByExample(@Param("record") StuTransactionDocumentsInfo record, @Param("example") StuTransactionDocumentsInfoExample example);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(StuTransactionDocumentsInfo record);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(StuTransactionDocumentsInfo record);
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.sztzjy.block_finance.service;
|
||||||
|
|
||||||
|
import com.sztzjy.block_finance.entity.dto.StutInfoSecDto;
|
||||||
|
import com.sztzjy.block_finance.entity.dto.StutranDocDto;
|
||||||
|
import com.sztzjy.block_finance.util.ResultEntity;
|
||||||
|
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 17803
|
||||||
|
* @date 2024-03-21 15:57
|
||||||
|
*/
|
||||||
|
public interface StuEncryptOnChainService {
|
||||||
|
|
||||||
|
//交易文件数字签名
|
||||||
|
ResultEntity tranDoc(StutranDocDto dto) throws NoSuchAlgorithmException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易相关信息加密
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
ResultEntity InfoSec(StutInfoSecDto dto) throws Exception;
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.sztzjy.block_finance.service;
|
||||||
|
|
||||||
|
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo;
|
||||||
|
import com.sztzjy.block_finance.entity.dto.StutInfoSecDto;
|
||||||
|
import com.sztzjy.block_finance.entity.dto.StutranDocDto;
|
||||||
|
import com.sztzjy.block_finance.util.ResultEntity;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 17803
|
||||||
|
* @date 2024-03-25 17:39
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
public interface StuTransactionConfirmationService {
|
||||||
|
/**
|
||||||
|
* 交易文件数据
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
ResultEntity<List<StuTransactionDocumentsInfo>> tranDataList(String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易相关信息解密
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
ResultEntity updateEncryByInfo(StutranDocDto dto);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数字签名解密
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
ResultEntity digitalEncryByInfo(StutInfoSecDto dto);
|
||||||
|
}
|
@ -0,0 +1,119 @@
|
|||||||
|
package com.sztzjy.block_finance.service.impl;/**
|
||||||
|
* @author 17803
|
||||||
|
* @date 2024-03-21 15:58
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.sztzjy.block_finance.config.Constant;
|
||||||
|
import com.sztzjy.block_finance.config.exception.handler.InvoceTException;
|
||||||
|
import com.sztzjy.block_finance.config.exception.handler.ServiceException;
|
||||||
|
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo;
|
||||||
|
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfoExample;
|
||||||
|
import com.sztzjy.block_finance.entity.dto.StutInfoSecDto;
|
||||||
|
import com.sztzjy.block_finance.entity.dto.StutranDocDto;
|
||||||
|
import com.sztzjy.block_finance.mappers.StuTransactionDocumentsInfoMapper;
|
||||||
|
import com.sztzjy.block_finance.service.StuEncryptOnChainService;
|
||||||
|
import com.sztzjy.block_finance.util.ResultEntity;
|
||||||
|
import com.sztzjy.block_finance.util.RsaUtil;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class StuEncryptOnChainServiceImpl implements StuEncryptOnChainService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StuTransactionDocumentsInfoMapper documentsInfoMapper;
|
||||||
|
|
||||||
|
//交易文件数字签名
|
||||||
|
@Override
|
||||||
|
public ResultEntity tranDoc(StutranDocDto dto) throws NoSuchAlgorithmException {
|
||||||
|
|
||||||
|
//校验私钥
|
||||||
|
if (Constant.XINFENGPRIVATEKEY.equals(dto.getPrivateKey()))
|
||||||
|
{
|
||||||
|
|
||||||
|
//加密摘要
|
||||||
|
// String s = RsaUtil.encryptByPrivateKey(dto.getUserId(),Constant.XINFENGPRIVATEKEY);
|
||||||
|
String s = RsaUtil.generateHash(dto.getUserId());
|
||||||
|
|
||||||
|
StuTransactionDocumentsInfoExample example = new StuTransactionDocumentsInfoExample();
|
||||||
|
example.createCriteria().andUserIdEqualTo(dto.getUserId());
|
||||||
|
//查询用户数据
|
||||||
|
List<StuTransactionDocumentsInfo> stuTransactionDocumentsInfoList = documentsInfoMapper.selectByExample(example);
|
||||||
|
if (stuTransactionDocumentsInfoList.size() == 5){
|
||||||
|
|
||||||
|
//五条数据批量更新
|
||||||
|
|
||||||
|
stuTransactionDocumentsInfoList.forEach(documentsInfo->{
|
||||||
|
documentsInfo.setCrypDigest(s);
|
||||||
|
documentsInfo.setSignatureVerificationStatus(1);
|
||||||
|
documentsInfoMapper.updateByPrimaryKeySelective(documentsInfo);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new ResultEntity<>(HttpStatus.OK,"加密成功",s);
|
||||||
|
}else {
|
||||||
|
throw new ServiceException(HttpStatus.ACCEPTED,"请先完成文件上传!");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else {
|
||||||
|
throw new ServiceException(HttpStatus.ACCEPTED,"请选择正确的密钥!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易相关信息加密
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ResultEntity InfoSec(StutInfoSecDto dto) throws Exception {
|
||||||
|
|
||||||
|
//校验公钥
|
||||||
|
if (Constant.XINFENGPUBLICKEY.equals(dto.getPublicKey()))
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
String s = RsaUtil.encryptByPublicKey(dto.getUserId(),Constant.XINFENGPUBLICKEY);
|
||||||
|
StuTransactionDocumentsInfoExample example = new StuTransactionDocumentsInfoExample();
|
||||||
|
example.createCriteria().andUserIdEqualTo(dto.getUserId());
|
||||||
|
//查询用户数据
|
||||||
|
List<StuTransactionDocumentsInfo> stuTransactionDocumentsInfoList = documentsInfoMapper.selectByExample(example);
|
||||||
|
if (stuTransactionDocumentsInfoList.size() == 5){
|
||||||
|
|
||||||
|
//五条数据批量更新
|
||||||
|
stuTransactionDocumentsInfoList.forEach(documentsInfo->{
|
||||||
|
documentsInfo.setInformationCiphertext(s);
|
||||||
|
documentsInfo.setInformationStatus(1);
|
||||||
|
|
||||||
|
documentsInfoMapper.updateByPrimaryKeySelective(documentsInfo);
|
||||||
|
});
|
||||||
|
|
||||||
|
return new ResultEntity<>(HttpStatus.OK,"加密成功",s);
|
||||||
|
}else {
|
||||||
|
|
||||||
|
throw new ServiceException(HttpStatus.ACCEPTED,"请先完成文件上传!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
throw new ServiceException(HttpStatus.ACCEPTED,"请选择正确的密钥!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,155 @@
|
|||||||
|
package com.sztzjy.block_finance.service.impl;/**
|
||||||
|
* @author 17803
|
||||||
|
* @date 2024-03-25 17:39
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.sztzjy.block_finance.config.Constant;
|
||||||
|
import com.sztzjy.block_finance.config.exception.handler.ServiceException;
|
||||||
|
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo;
|
||||||
|
import com.sztzjy.block_finance.entity.StuTransactionDocumentsInfoExample;
|
||||||
|
import com.sztzjy.block_finance.entity.dto.StutInfoSecDto;
|
||||||
|
import com.sztzjy.block_finance.entity.dto.StutranDocDto;
|
||||||
|
import com.sztzjy.block_finance.mappers.StuTransactionDocumentsInfoMapper;
|
||||||
|
import com.sztzjy.block_finance.service.StuTransactionConfirmationService;
|
||||||
|
import com.sztzjy.block_finance.util.ResultEntity;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class StuTransactionConfirmationServiceImpl implements StuTransactionConfirmationService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private StuTransactionDocumentsInfoMapper documentsInfoMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易文件数据
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultEntity<List<StuTransactionDocumentsInfo>> tranDataList(String userId) {
|
||||||
|
|
||||||
|
StuTransactionDocumentsInfoExample example = new StuTransactionDocumentsInfoExample();
|
||||||
|
example.createCriteria().andUserIdEqualTo(userId);
|
||||||
|
List<StuTransactionDocumentsInfo> stuTransactionDocumentsInfoList = documentsInfoMapper.selectByExample(example);
|
||||||
|
if (!stuTransactionDocumentsInfoList.isEmpty()){
|
||||||
|
|
||||||
|
//判断交易相关信息解密状态
|
||||||
|
if (stuTransactionDocumentsInfoList.get(0).getInformationStatusEncry() == 1){
|
||||||
|
return new ResultEntity<>(HttpStatus.OK,"获取成功!",stuTransactionDocumentsInfoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
stuTransactionDocumentsInfoList.forEach(item->{
|
||||||
|
item.setFileName("--");
|
||||||
|
|
||||||
|
});
|
||||||
|
return new ResultEntity<>(HttpStatus.OK,"获取成功!",stuTransactionDocumentsInfoList);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
|
||||||
|
return new ResultEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 交易相关信息解密
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultEntity updateEncryByInfo(StutranDocDto dto) {
|
||||||
|
|
||||||
|
//判断私钥是否正确
|
||||||
|
if (Constant.XINFENGPRIVATEKEY.equals(dto.getPrivateKey())){
|
||||||
|
|
||||||
|
StuTransactionDocumentsInfoExample example = new StuTransactionDocumentsInfoExample();
|
||||||
|
example.createCriteria().andUserIdEqualTo(dto.getUserId());
|
||||||
|
|
||||||
|
List<StuTransactionDocumentsInfo> stuTransactionDocumentsInfoList = documentsInfoMapper.selectByExample(example);
|
||||||
|
if (!stuTransactionDocumentsInfoList.isEmpty()){
|
||||||
|
|
||||||
|
// 更新解密状态
|
||||||
|
stuTransactionDocumentsInfoList.forEach(item->{
|
||||||
|
item.setInformationStatus(1);
|
||||||
|
documentsInfoMapper.updateByPrimaryKey(item);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
return new ResultEntity(HttpStatus.OK,"解密成功!");
|
||||||
|
|
||||||
|
|
||||||
|
}else {
|
||||||
|
|
||||||
|
return new ResultEntity(HttpStatus.BAD_REQUEST,"暂未查到加密数据!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}else {
|
||||||
|
|
||||||
|
|
||||||
|
throw new ServiceException(HttpStatus.ACCEPTED,"请选择正确的密钥!");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数字签名解密
|
||||||
|
* @param dto
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResultEntity digitalEncryByInfo(StutInfoSecDto dto) {
|
||||||
|
|
||||||
|
if (Constant.XINFENGPUBLICKEY.equals(dto.getPublicKey()))
|
||||||
|
{
|
||||||
|
|
||||||
|
StuTransactionDocumentsInfoExample example = new StuTransactionDocumentsInfoExample();
|
||||||
|
example.createCriteria().andUserIdEqualTo(dto.getUserId());
|
||||||
|
|
||||||
|
List<StuTransactionDocumentsInfo> stuTransactionDocumentsInfoList = documentsInfoMapper.selectByExample(example);
|
||||||
|
if (!stuTransactionDocumentsInfoList.isEmpty()){
|
||||||
|
|
||||||
|
// 更新解密状态
|
||||||
|
stuTransactionDocumentsInfoList.forEach(item->{
|
||||||
|
item.setSignatureVerificationStatusEncry(1);
|
||||||
|
documentsInfoMapper.updateByPrimaryKey(item);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
return new ResultEntity(HttpStatus.OK,"解密成功!");
|
||||||
|
|
||||||
|
|
||||||
|
}else {
|
||||||
|
|
||||||
|
return new ResultEntity(HttpStatus.BAD_REQUEST,"暂未查到加密数据!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}else {
|
||||||
|
|
||||||
|
throw new ServiceException(HttpStatus.ACCEPTED,"请选择正确的密钥!");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,469 @@
|
|||||||
|
<?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.sztzjy.block_finance.mappers.StuTransactionDocumentsInfoMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo">
|
||||||
|
<id column="id" jdbcType="INTEGER" property="id" />
|
||||||
|
<result column="file_name" jdbcType="VARCHAR" property="fileName" />
|
||||||
|
<result column="url" jdbcType="VARCHAR" property="url" />
|
||||||
|
<result column="upload_status" jdbcType="INTEGER" property="uploadStatus" />
|
||||||
|
<result column="information_status" jdbcType="INTEGER" property="informationStatus" />
|
||||||
|
<result column="information_status_encry" jdbcType="INTEGER" property="informationStatusEncry" />
|
||||||
|
<result column="signature_verification_status_encry" jdbcType="INTEGER" property="signatureVerificationStatusEncry" />
|
||||||
|
<result column="signature_verification_status" jdbcType="INTEGER" property="signatureVerificationStatus" />
|
||||||
|
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||||
|
<result column="discount_display" jdbcType="INTEGER" property="discountDisplay" />
|
||||||
|
<result column="supplier_display" jdbcType="INTEGER" property="supplierDisplay" />
|
||||||
|
<result column="core_enterprise_display" jdbcType="INTEGER" property="coreEnterpriseDisplay" />
|
||||||
|
<result column="core_enterprise_receive_status" jdbcType="INTEGER" property="coreEnterpriseReceiveStatus" />
|
||||||
|
<result column="factoring_company_display" jdbcType="INTEGER" property="factoringCompanyDisplay" />
|
||||||
|
<result column="factoring_companies_receive_status" jdbcType="INTEGER" property="factoringCompaniesReceiveStatus" />
|
||||||
|
<result column="read_status" jdbcType="INTEGER" property="readStatus" />
|
||||||
|
<result column="download_status" jdbcType="INTEGER" property="downloadStatus" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
<result column="cryp_digest" jdbcType="VARCHAR" property="crypDigest" />
|
||||||
|
<result column="information_ciphertext" jdbcType="VARCHAR" property="informationCiphertext" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Update_By_Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, file_name, url, upload_status, information_status, information_status_encry,
|
||||||
|
signature_verification_status_encry, signature_verification_status, user_id, discount_display,
|
||||||
|
supplier_display, core_enterprise_display, core_enterprise_receive_status, factoring_company_display,
|
||||||
|
factoring_companies_receive_status, read_status, download_status, create_time, update_time,
|
||||||
|
cryp_digest, information_ciphertext
|
||||||
|
</sql>
|
||||||
|
<select id="selectByExample" parameterType="com.sztzjy.block_finance.entity.StuTransactionDocumentsInfoExample" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<if test="distinct">
|
||||||
|
distinct
|
||||||
|
</if>
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from stu_transaction_documents_info
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
<if test="orderByClause != null">
|
||||||
|
order by ${orderByClause}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from stu_transaction_documents_info
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||||
|
delete from stu_transaction_documents_info
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByExample" parameterType="com.sztzjy.block_finance.entity.StuTransactionDocumentsInfoExample">
|
||||||
|
delete from stu_transaction_documents_info
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" parameterType="com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo">
|
||||||
|
insert into stu_transaction_documents_info (id, file_name, url,
|
||||||
|
upload_status, information_status, information_status_encry,
|
||||||
|
signature_verification_status_encry, signature_verification_status,
|
||||||
|
user_id, discount_display, supplier_display,
|
||||||
|
core_enterprise_display, core_enterprise_receive_status,
|
||||||
|
factoring_company_display, factoring_companies_receive_status,
|
||||||
|
read_status, download_status, create_time,
|
||||||
|
update_time, cryp_digest, information_ciphertext
|
||||||
|
)
|
||||||
|
values (#{id,jdbcType=INTEGER}, #{fileName,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR},
|
||||||
|
#{uploadStatus,jdbcType=INTEGER}, #{informationStatus,jdbcType=INTEGER}, #{informationStatusEncry,jdbcType=INTEGER},
|
||||||
|
#{signatureVerificationStatusEncry,jdbcType=INTEGER}, #{signatureVerificationStatus,jdbcType=INTEGER},
|
||||||
|
#{userId,jdbcType=VARCHAR}, #{discountDisplay,jdbcType=INTEGER}, #{supplierDisplay,jdbcType=INTEGER},
|
||||||
|
#{coreEnterpriseDisplay,jdbcType=INTEGER}, #{coreEnterpriseReceiveStatus,jdbcType=INTEGER},
|
||||||
|
#{factoringCompanyDisplay,jdbcType=INTEGER}, #{factoringCompaniesReceiveStatus,jdbcType=INTEGER},
|
||||||
|
#{readStatus,jdbcType=INTEGER}, #{downloadStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
|
||||||
|
#{updateTime,jdbcType=TIMESTAMP}, #{crypDigest,jdbcType=VARCHAR}, #{informationCiphertext,jdbcType=VARCHAR}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" parameterType="com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo">
|
||||||
|
insert into stu_transaction_documents_info
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="fileName != null">
|
||||||
|
file_name,
|
||||||
|
</if>
|
||||||
|
<if test="url != null">
|
||||||
|
url,
|
||||||
|
</if>
|
||||||
|
<if test="uploadStatus != null">
|
||||||
|
upload_status,
|
||||||
|
</if>
|
||||||
|
<if test="informationStatus != null">
|
||||||
|
information_status,
|
||||||
|
</if>
|
||||||
|
<if test="informationStatusEncry != null">
|
||||||
|
information_status_encry,
|
||||||
|
</if>
|
||||||
|
<if test="signatureVerificationStatusEncry != null">
|
||||||
|
signature_verification_status_encry,
|
||||||
|
</if>
|
||||||
|
<if test="signatureVerificationStatus != null">
|
||||||
|
signature_verification_status,
|
||||||
|
</if>
|
||||||
|
<if test="userId != null">
|
||||||
|
user_id,
|
||||||
|
</if>
|
||||||
|
<if test="discountDisplay != null">
|
||||||
|
discount_display,
|
||||||
|
</if>
|
||||||
|
<if test="supplierDisplay != null">
|
||||||
|
supplier_display,
|
||||||
|
</if>
|
||||||
|
<if test="coreEnterpriseDisplay != null">
|
||||||
|
core_enterprise_display,
|
||||||
|
</if>
|
||||||
|
<if test="coreEnterpriseReceiveStatus != null">
|
||||||
|
core_enterprise_receive_status,
|
||||||
|
</if>
|
||||||
|
<if test="factoringCompanyDisplay != null">
|
||||||
|
factoring_company_display,
|
||||||
|
</if>
|
||||||
|
<if test="factoringCompaniesReceiveStatus != null">
|
||||||
|
factoring_companies_receive_status,
|
||||||
|
</if>
|
||||||
|
<if test="readStatus != null">
|
||||||
|
read_status,
|
||||||
|
</if>
|
||||||
|
<if test="downloadStatus != null">
|
||||||
|
download_status,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
<if test="crypDigest != null">
|
||||||
|
cryp_digest,
|
||||||
|
</if>
|
||||||
|
<if test="informationCiphertext != null">
|
||||||
|
information_ciphertext,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="fileName != null">
|
||||||
|
#{fileName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="url != null">
|
||||||
|
#{url,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="uploadStatus != null">
|
||||||
|
#{uploadStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="informationStatus != null">
|
||||||
|
#{informationStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="informationStatusEncry != null">
|
||||||
|
#{informationStatusEncry,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="signatureVerificationStatusEncry != null">
|
||||||
|
#{signatureVerificationStatusEncry,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="signatureVerificationStatus != null">
|
||||||
|
#{signatureVerificationStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="userId != null">
|
||||||
|
#{userId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="discountDisplay != null">
|
||||||
|
#{discountDisplay,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="supplierDisplay != null">
|
||||||
|
#{supplierDisplay,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="coreEnterpriseDisplay != null">
|
||||||
|
#{coreEnterpriseDisplay,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="coreEnterpriseReceiveStatus != null">
|
||||||
|
#{coreEnterpriseReceiveStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="factoringCompanyDisplay != null">
|
||||||
|
#{factoringCompanyDisplay,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="factoringCompaniesReceiveStatus != null">
|
||||||
|
#{factoringCompaniesReceiveStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="readStatus != null">
|
||||||
|
#{readStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="downloadStatus != null">
|
||||||
|
#{downloadStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="crypDigest != null">
|
||||||
|
#{crypDigest,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="informationCiphertext != null">
|
||||||
|
#{informationCiphertext,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<select id="countByExample" parameterType="com.sztzjy.block_finance.entity.StuTransactionDocumentsInfoExample" resultType="java.lang.Long">
|
||||||
|
select count(*) from stu_transaction_documents_info
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<update id="updateByExampleSelective" parameterType="map">
|
||||||
|
update stu_transaction_documents_info
|
||||||
|
<set>
|
||||||
|
<if test="record.id != null">
|
||||||
|
id = #{record.id,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.fileName != null">
|
||||||
|
file_name = #{record.fileName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.url != null">
|
||||||
|
url = #{record.url,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.uploadStatus != null">
|
||||||
|
upload_status = #{record.uploadStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.informationStatus != null">
|
||||||
|
information_status = #{record.informationStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.informationStatusEncry != null">
|
||||||
|
information_status_encry = #{record.informationStatusEncry,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.signatureVerificationStatusEncry != null">
|
||||||
|
signature_verification_status_encry = #{record.signatureVerificationStatusEncry,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.signatureVerificationStatus != null">
|
||||||
|
signature_verification_status = #{record.signatureVerificationStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.userId != null">
|
||||||
|
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.discountDisplay != null">
|
||||||
|
discount_display = #{record.discountDisplay,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.supplierDisplay != null">
|
||||||
|
supplier_display = #{record.supplierDisplay,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.coreEnterpriseDisplay != null">
|
||||||
|
core_enterprise_display = #{record.coreEnterpriseDisplay,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.coreEnterpriseReceiveStatus != null">
|
||||||
|
core_enterprise_receive_status = #{record.coreEnterpriseReceiveStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.factoringCompanyDisplay != null">
|
||||||
|
factoring_company_display = #{record.factoringCompanyDisplay,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.factoringCompaniesReceiveStatus != null">
|
||||||
|
factoring_companies_receive_status = #{record.factoringCompaniesReceiveStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.readStatus != null">
|
||||||
|
read_status = #{record.readStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.downloadStatus != null">
|
||||||
|
download_status = #{record.downloadStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateTime != null">
|
||||||
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="record.crypDigest != null">
|
||||||
|
cryp_digest = #{record.crypDigest,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="record.informationCiphertext != null">
|
||||||
|
information_ciphertext = #{record.informationCiphertext,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByExample" parameterType="map">
|
||||||
|
update stu_transaction_documents_info
|
||||||
|
set id = #{record.id,jdbcType=INTEGER},
|
||||||
|
file_name = #{record.fileName,jdbcType=VARCHAR},
|
||||||
|
url = #{record.url,jdbcType=VARCHAR},
|
||||||
|
upload_status = #{record.uploadStatus,jdbcType=INTEGER},
|
||||||
|
information_status = #{record.informationStatus,jdbcType=INTEGER},
|
||||||
|
information_status_encry = #{record.informationStatusEncry,jdbcType=INTEGER},
|
||||||
|
signature_verification_status_encry = #{record.signatureVerificationStatusEncry,jdbcType=INTEGER},
|
||||||
|
signature_verification_status = #{record.signatureVerificationStatus,jdbcType=INTEGER},
|
||||||
|
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||||
|
discount_display = #{record.discountDisplay,jdbcType=INTEGER},
|
||||||
|
supplier_display = #{record.supplierDisplay,jdbcType=INTEGER},
|
||||||
|
core_enterprise_display = #{record.coreEnterpriseDisplay,jdbcType=INTEGER},
|
||||||
|
core_enterprise_receive_status = #{record.coreEnterpriseReceiveStatus,jdbcType=INTEGER},
|
||||||
|
factoring_company_display = #{record.factoringCompanyDisplay,jdbcType=INTEGER},
|
||||||
|
factoring_companies_receive_status = #{record.factoringCompaniesReceiveStatus,jdbcType=INTEGER},
|
||||||
|
read_status = #{record.readStatus,jdbcType=INTEGER},
|
||||||
|
download_status = #{record.downloadStatus,jdbcType=INTEGER},
|
||||||
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||||
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||||
|
cryp_digest = #{record.crypDigest,jdbcType=VARCHAR},
|
||||||
|
information_ciphertext = #{record.informationCiphertext,jdbcType=VARCHAR}
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo">
|
||||||
|
update stu_transaction_documents_info
|
||||||
|
<set>
|
||||||
|
<if test="fileName != null">
|
||||||
|
file_name = #{fileName,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="url != null">
|
||||||
|
url = #{url,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="uploadStatus != null">
|
||||||
|
upload_status = #{uploadStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="informationStatus != null">
|
||||||
|
information_status = #{informationStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="informationStatusEncry != null">
|
||||||
|
information_status_encry = #{informationStatusEncry,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="signatureVerificationStatusEncry != null">
|
||||||
|
signature_verification_status_encry = #{signatureVerificationStatusEncry,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="signatureVerificationStatus != null">
|
||||||
|
signature_verification_status = #{signatureVerificationStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="userId != null">
|
||||||
|
user_id = #{userId,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="discountDisplay != null">
|
||||||
|
discount_display = #{discountDisplay,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="supplierDisplay != null">
|
||||||
|
supplier_display = #{supplierDisplay,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="coreEnterpriseDisplay != null">
|
||||||
|
core_enterprise_display = #{coreEnterpriseDisplay,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="coreEnterpriseReceiveStatus != null">
|
||||||
|
core_enterprise_receive_status = #{coreEnterpriseReceiveStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="factoringCompanyDisplay != null">
|
||||||
|
factoring_company_display = #{factoringCompanyDisplay,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="factoringCompaniesReceiveStatus != null">
|
||||||
|
factoring_companies_receive_status = #{factoringCompaniesReceiveStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="readStatus != null">
|
||||||
|
read_status = #{readStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="downloadStatus != null">
|
||||||
|
download_status = #{downloadStatus,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="crypDigest != null">
|
||||||
|
cryp_digest = #{crypDigest,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="informationCiphertext != null">
|
||||||
|
information_ciphertext = #{informationCiphertext,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKey" parameterType="com.sztzjy.block_finance.entity.StuTransactionDocumentsInfo">
|
||||||
|
update stu_transaction_documents_info
|
||||||
|
set file_name = #{fileName,jdbcType=VARCHAR},
|
||||||
|
url = #{url,jdbcType=VARCHAR},
|
||||||
|
upload_status = #{uploadStatus,jdbcType=INTEGER},
|
||||||
|
information_status = #{informationStatus,jdbcType=INTEGER},
|
||||||
|
information_status_encry = #{informationStatusEncry,jdbcType=INTEGER},
|
||||||
|
signature_verification_status_encry = #{signatureVerificationStatusEncry,jdbcType=INTEGER},
|
||||||
|
signature_verification_status = #{signatureVerificationStatus,jdbcType=INTEGER},
|
||||||
|
user_id = #{userId,jdbcType=VARCHAR},
|
||||||
|
discount_display = #{discountDisplay,jdbcType=INTEGER},
|
||||||
|
supplier_display = #{supplierDisplay,jdbcType=INTEGER},
|
||||||
|
core_enterprise_display = #{coreEnterpriseDisplay,jdbcType=INTEGER},
|
||||||
|
core_enterprise_receive_status = #{coreEnterpriseReceiveStatus,jdbcType=INTEGER},
|
||||||
|
factoring_company_display = #{factoringCompanyDisplay,jdbcType=INTEGER},
|
||||||
|
factoring_companies_receive_status = #{factoringCompaniesReceiveStatus,jdbcType=INTEGER},
|
||||||
|
read_status = #{readStatus,jdbcType=INTEGER},
|
||||||
|
download_status = #{downloadStatus,jdbcType=INTEGER},
|
||||||
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||||
|
cryp_digest = #{crypDigest,jdbcType=VARCHAR},
|
||||||
|
information_ciphertext = #{informationCiphertext,jdbcType=VARCHAR}
|
||||||
|
where id = #{id,jdbcType=INTEGER}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue