@@ -8,5 +8,5 @@ import lombok.Setter; | |||
@Setter | |||
public class AnXinSignContractDownloadResponse extends AbstractAtsResponse { | |||
private String bizContent; | |||
private byte[] fileBytes; | |||
} |
@@ -17,6 +17,9 @@ public class AnXinSignEnterpriseAccountRequest extends AbstractAtsRequest<AnXinS | |||
/** 账号附属信息*/ | |||
private AnXinEnterpriseTransactorModel enterpriseTransactor; | |||
/** 是否发送密码短信 0:发送;1:不发送;默认为0*/ | |||
private Integer notSendPwd; | |||
public AnXinSignEnterpriseAccountRequest() { | |||
super(AnXinServiceCmd.COMPANYACCOUNT); | |||
} |
@@ -15,4 +15,7 @@ public class AnXinSignEnterpriseAccountResponse extends AbstractAtsResponse { | |||
/** 账号附属信息*/ | |||
private AnXinEnterpriseTransactorModel enterpriseTransactor; | |||
/** 是否发送密码短信 0:发送;1:不发送;默认为0*/ | |||
private Integer notSendPwd; | |||
} |
@@ -13,6 +13,9 @@ public class AnXinSignPersonalAccountRequest extends AbstractAtsRequest<AnXinSig | |||
/** 账号信息*/ | |||
private AnXinPersonModel person; | |||
/** 是否发送密码短信 0:发送;1:不发送;默认为0*/ | |||
private Integer notSendPwd; | |||
public AnXinSignPersonalAccountRequest() { | |||
super(AnXinServiceCmd.PERSONALACCOUNT); | |||
} |
@@ -11,4 +11,7 @@ import lombok.Setter; | |||
public class AnXinSignPersonalAccountResponse extends AbstractAtsResponse { | |||
/** 账号信息*/ | |||
private AnXinPersonModel person; | |||
/** 是否发送密码短信 0:发送;1:不发送;默认为0*/ | |||
private Integer notSendPwd; | |||
} |
@@ -1,22 +1,17 @@ | |||
package cn.com.taiji.core.model.comm.protocol.ats.anXin; | |||
import cn.com.taiji.core.model.comm.protocol.ats.AbstractAtsRequest; | |||
import cn.com.taiji.core.model.comm.protocol.ats.anXin.model.AnXinSendShortModel; | |||
import cn.com.taiji.core.model.comm.protocol.ats.anXin.model.AnXinSendShortModels; | |||
import cn.com.taiji.core.model.comm.protocol.ats.anXin.model.AnXinSendShortsModel; | |||
import cn.com.taiji.core.model.comm.protocol.valid.ErrorMsgBuilder; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotNull; | |||
import java.util.List; | |||
/** 安心签多合同H5签署请求*/ | |||
@Getter | |||
@Setter | |||
public class AnXinSignSendShortsRequest extends AbstractAtsRequest<AnXinSignSendShortsResponse> { | |||
private List<AnXinSendShortModels> sendShortUrls; | |||
private AnXinSendShortModels sendShortUrls; | |||
public AnXinSignSendShortsRequest() { | |||
super(AnXinServiceCmd.SENDSHORSTURL); |
@@ -13,5 +13,5 @@ import java.util.List; | |||
public class AnXinSignSendShortsResponse extends AbstractAtsResponse { | |||
/** 信息*/ | |||
private List<AnXinNoticeInfoModel> noticeInfos; | |||
private AnXinNoticeInfoModel noticeInfo; | |||
} |
@@ -6,6 +6,8 @@ import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
import java.util.List; | |||
/** 安心签合同响应*/ | |||
@@ -26,7 +28,7 @@ public class AnXinContractModel extends BaseEntity { | |||
private String contractName; | |||
/** 合同状态*/ | |||
@NotBlank(message = "合同状态不能为空") | |||
@NotNull(message = "合同状态不能为空") | |||
private Integer contractState; | |||
/** 创建合同时间*/ | |||
@@ -38,7 +40,7 @@ public class AnXinContractModel extends BaseEntity { | |||
private String expiredDate; | |||
/** 签署信息*/ | |||
@NotBlank(message = "合同签署信息不能为空") | |||
private SignInfoVO[] signatories; | |||
@NotNull(message = "合同签署信息不能为空") | |||
private List<SignInfoVO> signatories; | |||
} |
@@ -7,6 +7,8 @@ import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
import java.util.List; | |||
import java.util.Map; | |||
@@ -35,7 +37,7 @@ public class AnXinCreateContractModel extends BaseEntity { | |||
private String signLocation; | |||
/** 文本域信息*/ | |||
@NotBlank(message = "文本域信息不能为空") | |||
@NotNull(message = "文本域信息不能为空") | |||
private Map<String, String> textValueInfo; | |||
/** 是否保存文本域信息*/ | |||
@@ -60,6 +62,6 @@ public class AnXinCreateContractModel extends BaseEntity { | |||
private AttachmentVO attachment; | |||
/** 签署信息*/ | |||
private SignInfoVO[] signInfos; | |||
private List<SignInfoVO> signInfos; | |||
} |
@@ -6,6 +6,7 @@ import cn.com.taiji.core.model.comm.protocol.ats.anXin.model.contract.SignKeywor | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.Valid; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
@@ -75,7 +76,8 @@ public class AnXinSendShortModel extends BaseEntity { | |||
private Integer independenceSignAuth; | |||
/** 签署关键词*/ | |||
@NotBlank(message = "签署关键词不能为空") | |||
@NotNull(message = "签署关键词不能为空") | |||
@Valid | |||
private SignKeywordVO keywordInfo; | |||
/** 骑缝章*/ |
@@ -4,6 +4,7 @@ import cn.com.taiji.common.entity.BaseEntity; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.Valid; | |||
import javax.validation.constraints.NotNull; | |||
import java.util.List; | |||
@@ -12,6 +13,8 @@ import java.util.List; | |||
@Getter | |||
public class AnXinSendShortModels extends BaseEntity { | |||
/** 签署信息*/ | |||
@NotNull(message = "签署信息不能为空") | |||
@Valid | |||
private List<AnXinSendShortsModel> anXinSendShorts; | |||
/** 用户id*/ |
@@ -8,6 +8,7 @@ import lombok.Setter; | |||
import javax.validation.Valid; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
/** 安心签单一合同H5签署请求*/ | |||
@@ -23,7 +24,7 @@ public class AnXinSendShortsModel extends BaseEntity { | |||
private String signLocations; | |||
/** 签署关键词*/ | |||
@NotBlank(message = "签署关键词不能为空") | |||
@NotNull(message = "签署关键词不能为空") | |||
@Valid | |||
private SignKeywordVO keywordInfo; | |||
@@ -1,9 +1,11 @@ | |||
package cn.com.taiji.core.model.comm.protocol.ats.anXin.model.contract; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import javax.validation.constraints.NotBlank; | |||
import javax.validation.constraints.NotNull; | |||
/** 签署关键词*/ | |||
@Setter | |||
@@ -15,27 +17,27 @@ public class SignKeywordVO { | |||
private String keyword; | |||
/** 关键字所在页码*/ | |||
@NotBlank(message = "关键字所在页码不能为空") | |||
@NotNull(message = "关键字所在页码不能为空") | |||
private Integer pageNo; | |||
/** 关键字所在page页的索引*/ | |||
@NotBlank(message = "关键字所在page页的索引不能为空") | |||
@NotNull(message = "关键字所在page页的索引不能为空") | |||
private Integer indexInPage; | |||
/** X轴偏移坐标*/ | |||
@NotBlank(message = "X轴偏移坐标不能为空") | |||
@NotNull(message = "X轴偏移坐标不能为空") | |||
private Integer offsetX; | |||
/** Y轴偏移坐标*/ | |||
@NotBlank(message = "Y轴偏移坐标不能为空") | |||
@NotNull(message = "Y轴偏移坐标不能为空") | |||
private Integer offsetY; | |||
/** 签章图片宽度*/ | |||
@NotBlank(message = "签章图片宽度不能为空") | |||
@NotNull(message = "签章图片宽度不能为空") | |||
private Integer width; | |||
/** 签章图片高度*/ | |||
@NotBlank(message = "签章图片高度不能为空") | |||
@NotNull(message = "签章图片高度不能为空") | |||
private Integer height; | |||
} |
@@ -0,0 +1,15 @@ | |||
package cn.com.taiji.userw.dto.system; | |||
import cn.com.taiji.core.dto.AbstractBizRequestDTO; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
import javax.validation.constraints.NotBlank; | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class GetMiniProgramRoleAllRequestDTO extends AbstractBizRequestDTO { | |||
} |
@@ -64,7 +64,7 @@ public class AnXinBusinessManagerImpl extends AbstractManager implements AnXinBu | |||
public AnXinSignContractDownloadResponse downloadContract(AnXinSignContractDownloadRequest request) { | |||
InterfaceResponse response = anXinService.downloadContract(request.getContractNo()); | |||
AnXinSignContractDownloadResponse res = new AnXinSignContractDownloadResponse(); | |||
res.setBizContent(response.getBizContent()); | |||
res.setFileBytes(response.getFileBytes()); | |||
return res; | |||
} | |||
@@ -25,7 +25,7 @@ import java.util.Base64; | |||
import java.util.Map; | |||
@Service | |||
public class AnXinServiceImpl extends AbstractManager implements AnXinService{ | |||
public class AnXinServiceImpl extends AbstractManager implements AnXinService { | |||
@Override | |||
public InterfaceResponse post(InterfaceRequest request) throws ServiceHandleException { | |||
@@ -42,12 +42,12 @@ public class AnXinServiceImpl extends AbstractManager implements AnXinService{ | |||
final String txCode = request.getMethod(); | |||
String res; | |||
Map<String, Object> jsonObject = JsonTools.json2Map(req,String.class, Object.class); | |||
Map<String, Object> jsonObject = JsonTools.json2Map(req, String.class, Object.class); | |||
// 判断是否有文件 走不同的请求 | |||
String path = (String) jsonObject.get("filePath"); | |||
if (hasText(path)) { | |||
File file = getByFilePath(jsonObject.get("filePath")+""); | |||
File file = getByFilePath(jsonObject.get("filePath") + ""); | |||
res = httpConnector.post("platId/" + Request.PLAT_ID + "/txCode/" + txCode + "/transaction", req, signature, file); | |||
} else { | |||
res = httpConnector.post("platId/" + Request.PLAT_ID + "/txCode/" + txCode + "/transaction", req, signature); | |||
@@ -71,20 +71,22 @@ public class AnXinServiceImpl extends AbstractManager implements AnXinService{ | |||
// 解析业务数据 | |||
if (resJson.containsKey("data")) { | |||
interfaceResponse.setBizContent(resJson.get("data")+""); | |||
interfaceResponse.setBizContent(resJson.get("data") + ""); | |||
} | |||
// 解析错误信息 | |||
if (resJson.containsKey("errorCode")) { | |||
interfaceResponse.setErrorCode(resJson.get("errorCode")+""); | |||
interfaceResponse.setErrorMessage(resJson.get("errorMessage")+""); | |||
interfaceResponse.setErrorCode(resJson.get("errorCode") + ""); | |||
} | |||
if(resJson.containsKey("errorMessage")) { | |||
interfaceResponse.setErrorMessage(resJson.get("errorMessage") + ""); | |||
} | |||
return interfaceResponse; | |||
} catch (Exception e) { | |||
logger.error("处理请求失败", e); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("处理请求失败"+ e); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("处理请求失败" + e); | |||
} | |||
} | |||
@@ -96,15 +98,18 @@ public class AnXinServiceImpl extends AbstractManager implements AnXinService{ | |||
String uri = "platId/" + Request.PLAT_ID + "/contractNo/" + contractNo + "/downloading"; | |||
byte[] bytes = httpConnector.getFile(uri); | |||
// 包装响应参数 | |||
InterfaceResponse interfaceResponse = new InterfaceResponse(); | |||
// 合同不存在,抛出异常 | |||
if (CommonUtil.isEmpty(bytes)) { | |||
throw new RuntimeException("合同不存在,合同编号: " + contractNo); | |||
interfaceResponse.setErrorCode("0"); | |||
interfaceResponse.setErrorMessage("合同不存在,合同编号: " + contractNo); | |||
}else { | |||
// // 使用 Base64 编码二进制数据,以便在文本响应中安全传输 | |||
// String encodedBytes = Base64.getEncoder().encodeToString(bytes); | |||
// interfaceResponse.setBizContent(encodedBytes); | |||
interfaceResponse.setFileBytes(bytes); | |||
} | |||
// 包装响应参数 | |||
InterfaceResponse interfaceResponse = new InterfaceResponse(); | |||
// 使用 Base64 编码二进制数据,以便在文本响应中安全传输 | |||
String encodedBytes = Base64.getEncoder().encodeToString(bytes); | |||
interfaceResponse.setBizContent(encodedBytes); | |||
return interfaceResponse; | |||
} | |||
@@ -120,7 +125,7 @@ public class AnXinServiceImpl extends AbstractManager implements AnXinService{ | |||
outputStream.write(buffer, 0, bytesRead); | |||
} | |||
logger.info("文件已成功保存到本地: {}",localFilePath); | |||
logger.info("文件已成功保存到本地: {}", localFilePath); | |||
return new File(localFilePath); | |||
} catch (IOException e) { | |||
logger.error("文件加载失败", e); | |||
@@ -128,7 +133,9 @@ public class AnXinServiceImpl extends AbstractManager implements AnXinService{ | |||
} | |||
} | |||
/** 包装请求参数*/ | |||
/** | |||
* 包装请求参数 | |||
*/ | |||
private static String packParam(String req) throws ServiceHandleException { | |||
Map<String, Object> jsonObject = null; | |||
String resStr = null; | |||
@@ -139,7 +146,7 @@ public class AnXinServiceImpl extends AbstractManager implements AnXinService{ | |||
jsonObject.put("head", head); | |||
resStr = JsonTools.toJsonStr(jsonObject); | |||
} catch (IOException e) { | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("处理请求失败"+ e); | |||
throw GlyServiceError.BUSINESS_VALIDATE_ERR.toHandleException("处理请求失败" + e); | |||
} | |||
return resStr; | |||
} | |||
@@ -190,10 +197,10 @@ public class AnXinServiceImpl extends AbstractManager implements AnXinService{ | |||
// 解析错误信息 | |||
if (resJson.containsKey("errorCode")) { | |||
interfaceResponse.setErrorCode(resJson.get("errorCode")+""); | |||
interfaceResponse.setErrorMessage(resJson.get("errorMessage")+""); | |||
interfaceResponse.setErrorCode(resJson.get("errorCode") + ""); | |||
interfaceResponse.setErrorMessage(resJson.get("errorMessage") + ""); | |||
} | |||
System.out.println("==>"+interfaceResponse.toJson()); | |||
System.out.println("==>" + interfaceResponse.toJson()); | |||
} | |||
} |
@@ -1,7 +1,7 @@ | |||
package cn.com.taiji.ats.model.anXin; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import com.fasterxml.jackson.annotation.JsonProperty; | |||
import lombok.Data; | |||
import javax.validation.constraints.NotBlank; | |||
@@ -10,29 +10,12 @@ import javax.validation.constraints.NotBlank; | |||
* @ClassName InterfaceRequest | |||
* @Description 公共请求参数实体 | |||
*/ | |||
@Data | |||
public class InterfaceRequest extends BaseModel { | |||
@NotBlank(message = "业务参数数据不能为空") | |||
@JsonProperty("BizContent") | |||
private String bizContent; | |||
@NotBlank(message = "方法不能为空") | |||
@JsonProperty("Method") | |||
private String method; | |||
public String getBizContent() { | |||
return bizContent; | |||
} | |||
public void setBizContent(String bizContent) { | |||
this.bizContent = bizContent; | |||
} | |||
public String getMethod() { | |||
return method; | |||
} | |||
public void setMethod(String method) { | |||
this.method = method; | |||
} | |||
} |
@@ -1,79 +1,26 @@ | |||
package cn.com.taiji.ats.model.anXin; | |||
import cn.com.taiji.common.model.BaseModel; | |||
import com.fasterxml.jackson.annotation.JsonProperty; | |||
import javax.validation.constraints.NotBlank; | |||
import lombok.Data; | |||
/** | |||
* @ClassName InterfaceRequest | |||
* @Description 公共响应参数实体 | |||
*/ | |||
@Data | |||
public class InterfaceResponse extends BaseModel { | |||
@JsonProperty("BizContent") | |||
private String bizContent; | |||
@JsonProperty("TxTime") | |||
private String txTime; | |||
@JsonProperty("RetCode") | |||
private String retCode; | |||
@JsonProperty("RetMessage") | |||
private String retMessage; | |||
@JsonProperty("ErrorCode") | |||
private String errorCode; | |||
@JsonProperty("ErrorMessage") | |||
private String errorMessage; | |||
public String getBizContent() { | |||
return bizContent; | |||
} | |||
public void setBizContent(String bizContent) { | |||
this.bizContent = bizContent; | |||
} | |||
public String getTxTime() { | |||
return txTime; | |||
} | |||
public void setTxTime(String txTime) { | |||
this.txTime = txTime; | |||
} | |||
public String getRetCode() { | |||
return retCode; | |||
} | |||
public void setRetCode(String retCode) { | |||
this.retCode = retCode; | |||
} | |||
public String getRetMessage() { | |||
return retMessage; | |||
} | |||
public void setRetMessage(String retMessage) { | |||
this.retMessage = retMessage; | |||
} | |||
public String getErrorCode() { | |||
return errorCode; | |||
} | |||
public void setErrorCode(String errorCode) { | |||
this.errorCode = errorCode; | |||
} | |||
public String getErrorMessage() { | |||
return errorMessage; | |||
} | |||
public void setErrorMessage(String errorMessage) { | |||
this.errorMessage = errorMessage; | |||
} | |||
private byte[] fileBytes; | |||
} |