Commit 7d26bbe5 by zhu.zewen

新增云签相关接口

parent 76120359
......@@ -3,8 +3,13 @@ package com.jmai.physic.cloudsign;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.jmai.api.exception.ServiceException;
import com.jmai.physic.config.CloudSignProperties;
import com.jmai.physic.entity.CloudSignToken;
import com.jmai.physic.mapper.CloudSignTokenMapper;
import com.jmai.sys.ctx.SpringContextUtils;
import com.jmai.sys.dto.UserDto;
import com.jmai.sys.util.HttpUtils;
import com.jmai.sys.util.OpenUtil;
import lombok.extern.slf4j.Slf4j;
......@@ -12,22 +17,70 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
@Slf4j
@Component
public class CloudsignService {
@Resource
private CloudSignProperties cloudSignProperties;
@Resource
private CloudSignTokenMapper cloudSignTokenMapper;
private String buildUrl(String endpoint) {
return cloudSignProperties.getHost() + endpoint;
}
/**
* 从数据库获取当前用户的云签令牌
*/
public String getCurrentUserEncryptedToken() {
Long userId = SpringContextUtils.getUserId();
if (userId == null) {
throw new ServiceException("当前用户ID为空");
}
// 从数据库查询用户的云签令牌
CloudSignToken token = cloudSignTokenMapper.selectOne(
Wrappers.<CloudSignToken>lambdaQuery()
.eq(CloudSignToken::getUserId, userId)
.eq(CloudSignToken::getStatus, 1) // 只查询有效状态的令牌
.orderByDesc(CloudSignToken::getCreateTime) // 获取最新的令牌
);
if (token == null) {
throw new ServiceException("未找到用户的云签令牌,请先登录云签");
}
// 检查令牌是否过期
if (token.getExpiryTime().isBefore(LocalDateTime.now())) {
// 更新令牌状态为失效
token.setStatus(0);
cloudSignTokenMapper.updateById(token);
throw new ServiceException("云签令牌已过期,请重新登录");
}
return token.getEncryptedToken();
}
/**
* 检查云签状态
* @param request
*/
public QueryStatusResponse queryStatus(QueryStatusRequest request){
String logTip = "queryStatus";
// 自动填充业务参数和加密令牌
if (cloudSignProperties.getTestEnabled()) {
request.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
request.setBusinessSystemCode(cloudSignProperties.getTestBusinessSystemCode());
request.setBusinessSystemAppID(cloudSignProperties.getTestBusinessSystemAppID());
} else {
request.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
request.setBusinessSystemCode(cloudSignProperties.getBusinessSystemCode());
request.setBusinessSystemAppID(cloudSignProperties.getBusinessSystemApplD());
}
request.setEncryptedToken(getCurrentUserEncryptedToken()); // 设置从数据库获取的令牌
String json = OpenUtil.toJson(request);
try {
log.info("{}-入参:{}",logTip,json);
......@@ -49,11 +102,21 @@ public class CloudsignService {
*/
public GenloginqrcodeRespon loginByPin(PinLoginRequest request){
request.setLoginType(1);
// 自动填充业务参数
if (cloudSignProperties.getTestEnabled()) {
request.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
request.setBusinessSystemCode(cloudSignProperties.getTestBusinessSystemCode());
request.setBusinessSystemAppID(cloudSignProperties.getTestBusinessSystemAppID());
} else {
request.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
request.setBusinessSystemCode(cloudSignProperties.getBusinessSystemCode());
request.setBusinessSystemAppID(cloudSignProperties.getBusinessSystemApplD());
}
String logTip = "loginByPin";
String json = OpenUtil.toJson(request);
try {
log.info("{}-入参:{}",logTip,json);
log.info("{}-入参: {}",logTip,json);
String response = HttpUtils.sendPostRequestAndParse(buildUrl(cloudSignProperties.getLoginbypinUrl()), json, null);
log.info("{}-返回数据: {}",logTip,response);
if(ObjectUtil.isEmpty(response)){
......@@ -73,6 +136,17 @@ public class CloudsignService {
*/
public GenloginqrcodeRespon genLoginQrcode(GenloginqrcodeRequest request){
String logTip = "genLoginQrcode";
// 自动填充业务参数
if (cloudSignProperties.getTestEnabled()) {
request.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
request.setBusinessSystemCode(cloudSignProperties.getTestBusinessSystemCode());
request.setBusinessSystemAppID(cloudSignProperties.getTestBusinessSystemAppID());
} else {
request.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
request.setBusinessSystemCode(cloudSignProperties.getBusinessSystemCode());
request.setBusinessSystemAppID(cloudSignProperties.getBusinessSystemApplD());
}
String json = OpenUtil.toJson(request);
try {
log.info("{}-入参: {}", logTip, json);
......@@ -95,6 +169,17 @@ public class CloudsignService {
*/
public GetLoginResultResponse getLoginByQrcodeResult(GetLoginResultRequest request){
String logTip = "getLoginResult";
// 自动填充业务参数
if (cloudSignProperties.getTestEnabled()) {
request.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
request.setBusinessSystemCode(cloudSignProperties.getTestBusinessSystemCode());
request.setBusinessSystemAppID(cloudSignProperties.getTestBusinessSystemAppID());
} else {
request.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
request.setBusinessSystemCode(cloudSignProperties.getBusinessSystemCode());
request.setBusinessSystemAppID(cloudSignProperties.getBusinessSystemApplD());
}
String json = OpenUtil.toJson(request);
try {
log.info("{}-入参:{}",logTip,json);
......@@ -111,8 +196,20 @@ public class CloudsignService {
}
}
public String sign(String encryptedToken,String relBizNo,String base64SourceData){
/**
* 云签证书数字签名
* @param base64SourceData
* @return 签名后的数据
*/
public String sign(String base64SourceData){
// 从当前用户上下文获取工号作为relBizNo
String relBizNo = SpringContextUtils.getWorkNo();
if (ObjectUtil.isEmpty(relBizNo)) {
throw new ServiceException("当前用户工号为空");
}
SignDataRequest request = new SignDataRequest();
// 不再需要外部传入encryptedToken,改为从数据库获取
if (cloudSignProperties.getTestEnabled()) {
request.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
request.setBusinessSystemCode(cloudSignProperties.getTestBusinessSystemCode());
......@@ -122,11 +219,11 @@ public class CloudsignService {
request.setBusinessSystemCode(cloudSignProperties.getBusinessSystemCode());
request.setBusinessSystemAppID(cloudSignProperties.getBusinessSystemApplD());
}
request.setEncryptedToken(getCurrentUserEncryptedToken());
request.setBusinessTypeCode("007");
request.setWithTsa(true);
request.setEncryptedToken(encryptedToken);
request.setBase64SourceData(base64SourceData);
signData(request);
SignDataRespon resp = signData(request);
GetstampRequest getstampRequest = new GetstampRequest();
getstampRequest.setRelBizNo(relBizNo);
String getstamp = getStamp(getstampRequest);
......@@ -139,6 +236,20 @@ public class CloudsignService {
*/
public SignDataRespon signData(SignDataRequest request){
String logTip = "signdata";
// 自动填充业务参数和加密令牌
if (cloudSignProperties.getTestEnabled()) {
request.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
request.setBusinessSystemCode(cloudSignProperties.getTestBusinessSystemCode());
request.setBusinessSystemAppID(cloudSignProperties.getTestBusinessSystemAppID());
} else {
request.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
request.setBusinessSystemCode(cloudSignProperties.getBusinessSystemCode());
request.setBusinessSystemAppID(cloudSignProperties.getBusinessSystemApplD());
}
request.setBusinessTypeCode("007");
request.setWithTsa(true);
request.setEncryptedToken(getCurrentUserEncryptedToken());
String json = OpenUtil.toJson(request);
try {
log.info("{}-入参:{}",logTip,json);
......@@ -188,6 +299,13 @@ public class CloudsignService {
*/
public GetCertInfoResponse getCertInfo(GetCertInfoRequest request){
String logTip = "getCertInfo";
// 自动填充业务参数
if (cloudSignProperties.getTestEnabled()) {
request.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
} else {
request.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
}
String json = OpenUtil.toJson(request);
try {
log.info("{}-入参:{}",logTip,json);
......@@ -210,6 +328,13 @@ public class CloudsignService {
*/
public VerifyDataResponse verifyData(VerifyDataRequest request){
String logTip = "verifyData";
// 自动填充业务参数
if (cloudSignProperties.getTestEnabled()) {
request.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
} else {
request.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
}
String json = OpenUtil.toJson(request);
try {
log.info("{}-入参:{}",logTip,json);
......@@ -225,4 +350,25 @@ public class CloudsignService {
throw new ServiceException("验证失败");
}
}
/**
* 保存云签令牌信息到数据库
*/
public void saveCloudSignToken(UserDto user, String encryptedToken) {
// 创建云签令牌信息并保存到数据库
CloudSignToken cloudSignToken = new CloudSignToken();
cloudSignToken.setUserId(user.getUserId());
cloudSignToken.setWorkNo(user.getWorkNo());
cloudSignToken.setEncryptedToken(encryptedToken);
// 设置令牌过期时间为当前时间加上默认有效期(例如2小时)
cloudSignToken.setExpiryTime(LocalDateTime.now().plusHours(2));
cloudSignToken.setStatus(1); // 设置为有效状态
// 保存到数据库
// 先尝试删除旧的令牌记录(如果有)
cloudSignTokenMapper.delete(Wrappers.<CloudSignToken>lambdaUpdate()
.eq(CloudSignToken::getUserId, user.getUserId()));
// 插入新的令牌记录
cloudSignTokenMapper.insert(cloudSignToken);
}
}
......@@ -14,10 +14,11 @@ public class SignDataRequest {
private String businessSystemCode;
@ApiModelProperty(value = "业务系统应用ID,业务系统的唯一标识号", required = true)
private String businessSystemAppID;
@ApiModelProperty(value = "业务类型代码", required = true)
private String businessTypeCode;
@ApiModelProperty(value = "加密令牌", required = true)
private String encryptedToken;
@ApiModelProperty(value = "业务类型代码", required = true)
private String businessTypeCode;
@ApiModelProperty(value = "患者ID")
private String patientId;
@ApiModelProperty(value = "业务ID")
......
......@@ -3,11 +3,9 @@ package com.jmai.physic.controller;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.jmai.api.exception.ServiceException;
import com.jmai.physic.cloudsign.*;
import com.jmai.physic.config.CloudSignProperties;
import com.jmai.physic.entity.CloudSignToken;
import com.jmai.physic.mapper.CloudSignTokenMapper;
import com.jmai.sys.AbstractService;
import com.jmai.sys.aop.Auth;
......@@ -15,10 +13,8 @@ import com.jmai.sys.aop.AuthSkipped;
import com.jmai.sys.ctx.SpringContextUtils;
import com.jmai.sys.dto.ResponseData;
import com.jmai.sys.dto.UserDto;
import com.jmai.sys.service.BaseService;
import com.jmai.sys.service.UserService;
import java.time.LocalDateTime;
import java.util.Optional;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -40,6 +36,10 @@ public class CloudSignController extends AbstractService {
private CloudsignService cloudsignService;
@Resource
private CloudSignProperties cloudSignProperties;
@Resource
private CloudSignTokenMapper cloudSignTokenMapper;
@PostMapping("/queryStatus")
@ApiOperation(value = "检查云签状态")
......@@ -49,20 +49,7 @@ public class CloudSignController extends AbstractService {
throw new ServiceException("当前用户工号为空");
}
queryStatusRequest.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
queryStatusRequest.setBusinessSystemCode(cloudSignProperties.getBusinessSystemCode());
queryStatusRequest.setBusinessSystemAppID(cloudSignProperties.getBusinessSystemApplD());
if (cloudSignProperties.getTestEnabled()) {
queryStatusRequest.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
queryStatusRequest.setBusinessSystemCode(cloudSignProperties.getTestBusinessSystemCode());
queryStatusRequest.setBusinessSystemAppID(cloudSignProperties.getTestBusinessSystemAppID());
} else {
queryStatusRequest.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
queryStatusRequest.setBusinessSystemCode(cloudSignProperties.getBusinessSystemCode());
queryStatusRequest.setBusinessSystemAppID(cloudSignProperties.getBusinessSystemApplD());
}
// 现在业务参数和encryptedToken会在服务层自动填充
QueryStatusResponse queryStatus = cloudsignService.queryStatus(queryStatusRequest);
return ResponseData.ok(queryStatus);
}
......@@ -77,16 +64,8 @@ public class CloudSignController extends AbstractService {
pinLoginRequest.setRelBizNo(workNo);
pinLoginRequest.setUserEncodePin(pinLoginRequest.getUserEncodePin());
if (cloudSignProperties.getTestEnabled()) {
pinLoginRequest.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
pinLoginRequest.setBusinessSystemCode(cloudSignProperties.getTestBusinessSystemCode());
pinLoginRequest.setBusinessSystemAppID(cloudSignProperties.getTestBusinessSystemAppID());
} else {
pinLoginRequest.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
pinLoginRequest.setBusinessSystemCode(cloudSignProperties.getBusinessSystemCode());
pinLoginRequest.setBusinessSystemAppID(cloudSignProperties.getBusinessSystemApplD());
}
// 现在业务参数和测试环境配置会在服务层自动处理
GenloginqrcodeRespon pinLogin = cloudsignService.loginByPin(pinLoginRequest);
return ResponseData.ok(pinLogin);
}
......@@ -99,18 +78,10 @@ public class CloudSignController extends AbstractService {
throw new ServiceException("当前用户工号为空");
}
if (cloudSignProperties.getTestEnabled()) {
req.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
req.setBusinessSystemCode(cloudSignProperties.getTestBusinessSystemCode());
req.setBusinessSystemAppID(cloudSignProperties.getTestBusinessSystemAppID());
} else {
req.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
req.setBusinessSystemCode(cloudSignProperties.getBusinessSystemCode());
req.setBusinessSystemAppID(cloudSignProperties.getBusinessSystemApplD());
}
req.setNotifyUrl(cloudSignProperties.getCallbackUrl());
req.setImageFormat(1);
// 现在业务参数和测试环境配置会在服务层自动处理
GenloginqrcodeRespon qrCodeLogin = cloudsignService.genLoginQrcode(req);
// 如果二维码生成成功,保存二维码图片到本地
......@@ -189,7 +160,7 @@ public class CloudSignController extends AbstractService {
}
// 保存云签令牌信息
saveCloudSignToken(user, encryptedToken);
cloudsignService.saveCloudSignToken(user, encryptedToken);
log.info("云签登录成功,用户ID: {}, 工号: {}, 用户名: {}", user.getUserId(), user.getWorkNo(), user.getUserName());
......@@ -259,27 +230,7 @@ public class CloudSignController extends AbstractService {
return saveDir + java.io.File.separator + fileName;
}
/**
* 保存云签令牌信息到数据库
*/
private void saveCloudSignToken(UserDto user, String encryptedToken) {
// 创建云签令牌信息并保存到数据库
CloudSignToken cloudSignToken = new CloudSignToken();
cloudSignToken.setUserId(user.getUserId());
cloudSignToken.setWorkNo(user.getWorkNo());
cloudSignToken.setEncryptedToken(encryptedToken);
// 设置令牌过期时间为当前时间加上默认有效期(例如2小时)
cloudSignToken.setExpiryTime(LocalDateTime.now().plusHours(2));
cloudSignToken.setStatus(1); // 设置为有效状态
// 保存到数据库
CloudSignTokenMapper cloudSignTokenMapper = SpringContextUtils.getBean(CloudSignTokenMapper.class);
// 先尝试删除旧的令牌记录(如果有)
cloudSignTokenMapper.delete(Wrappers.<CloudSignToken>lambdaUpdate()
.eq(CloudSignToken::getUserId, user.getUserId()));
// 插入新的令牌记录
cloudSignTokenMapper.insert(cloudSignToken);
}
@PostMapping("/getLoginByQrcodeResult")
@ApiOperation(value = "查询二维码登录结果")
......@@ -289,16 +240,7 @@ public class CloudSignController extends AbstractService {
throw new ServiceException("当前用户工号为空");
}
if (cloudSignProperties.getTestEnabled()) {
getLoginResultRequest.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
getLoginResultRequest.setBusinessSystemCode(cloudSignProperties.getTestBusinessSystemCode());
getLoginResultRequest.setBusinessSystemAppID(cloudSignProperties.getTestBusinessSystemAppID());
} else {
getLoginResultRequest.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
getLoginResultRequest.setBusinessSystemCode(cloudSignProperties.getBusinessSystemCode());
getLoginResultRequest.setBusinessSystemAppID(cloudSignProperties.getBusinessSystemApplD());
}
// 现在业务参数和测试环境配置会在服务层自动处理
GetLoginResultResponse getLoginResult = cloudsignService.getLoginByQrcodeResult(getLoginResultRequest);
return ResponseData.ok(getLoginResult);
}
......@@ -311,12 +253,7 @@ public class CloudSignController extends AbstractService {
throw new ServiceException("当前用户工号为空");
}
if (cloudSignProperties.getTestEnabled()) {
getCertInfoRequest.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
} else {
getCertInfoRequest.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
}
// 现在业务参数和测试环境配置会在服务层自动处理
GetCertInfoResponse getCertInfo = cloudsignService.getCertInfo(getCertInfoRequest);
return ResponseData.ok(getCertInfo);
}
......@@ -329,12 +266,7 @@ public class CloudSignController extends AbstractService {
throw new ServiceException("当前用户工号为空");
}
if (cloudSignProperties.getTestEnabled()) {
verifyDataRequest.setBusinessOrgCode(cloudSignProperties.getTestBusinessOrgCode());
} else {
verifyDataRequest.setBusinessOrgCode(cloudSignProperties.getBusinessOrgCode());
}
// 现在业务参数和测试环境配置会在服务层自动处理
VerifyDataResponse verifyData = cloudsignService.verifyData(verifyDataRequest);
return ResponseData.ok(verifyData);
}
......
......@@ -154,7 +154,7 @@ public class PhysicAmpouleServiceImpl extends AbstractService implements PhysicA
public PhysicAmpoule sign(PhysicAmpouleSignReq physicAmpouleSignReq) {
Boolean finished = false;
Long userId = SpringContextUtils.getUserId();
String getstamp = cloudsignService.sign(physicAmpouleSignReq.getEncryptedToken(), physicAmpouleSignReq.getRelBizNo(), physicAmpouleSignReq.getBase64SourceData());
String getstamp = cloudsignService.sign(physicAmpouleSignReq.getBase64SourceData());
PhysicAmpoule ampoule = getInfo(physicAmpouleSignReq.getPhysicAmpouleId());
SysUser sysUser = sysUserMapper.selectById(userId);
if(ampoule.getStatus().equals(0)){
......
......@@ -165,7 +165,7 @@ public class PhysicApplyServiceImpl extends AbstractService implements PhysicApp
Boolean finished =false;
Long userId = SpringContextUtils.getUserId();
SysUser sysUser = sysUserMapper.selectById(userId);
String getstamp = cloudsignService.sign(physicApplySignReq.getEncryptedToken(), physicApplySignReq.getRelBizNo(), physicApplySignReq.getBase64SourceData());
String getstamp = cloudsignService.sign(physicApplySignReq.getBase64SourceData());
PhysicApply physicApply = physicApplyMapper.selectById(physicApplySignReq.getPhysicApplyId());
if(physicApply.getStatus().equals(0)){
if(!RoleTypeEum.isPass(sysUser.getRoleAsList(),RoleTypeEum.LY)){
......
......@@ -130,7 +130,7 @@ public class PhysicBillServiceImpl extends AbstractService implements PhysicBill
public PhysicBill sign(PhysicBillSignReq physicBillSignReq) {
Boolean finished = false;
Long userId = SpringContextUtils.getUserId();
String getstamp = cloudsignService.sign(physicBillSignReq.getEncryptedToken(), physicBillSignReq.getRelBizNo(), physicBillSignReq.getBase64SourceData());
String getstamp = cloudsignService.sign(physicBillSignReq.getBase64SourceData());
PhysicBill bill = physicBillMapper.selectById(physicBillSignReq.getPhysicBillId());
SysUser sysUser = sysUserMapper.selectById(userId);
if (ObjectUtil.equals(bill.getStatus(), 0)) {
......@@ -326,7 +326,7 @@ public class PhysicBillServiceImpl extends AbstractService implements PhysicBill
boolean finished = false;
Long userId = SpringContextUtils.getUserId();
Long currentDeptId = SpringContextUtils.getDeptId();
String getstamp = cloudsignService.sign(req.getEncryptedToken(), req.getRelBizNo(), req.getBase64SourceData());
String getstamp = cloudsignService.sign(req.getBase64SourceData());
PhysicBillHandover handover = physicBillHandoverMapper.selectById(req.getHandoverId());
if (ObjectUtil.isEmpty(handover)) {
throw new ServiceException("未找到交接单:" + req.getHandoverId());
......
......@@ -122,7 +122,7 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy
boolean finished = false;
Long userId = SpringContextUtils.getUserId();
SysUser sysUser = sysUserMapper.selectById(userId);
String getstamp = cloudsignService.sign(physicDestroyCheckSignReq.getEncryptedToken(), physicDestroyCheckSignReq.getRelBizNo(), physicDestroyCheckSignReq.getBase64SourceData());
String getstamp = cloudsignService.sign(physicDestroyCheckSignReq.getBase64SourceData());
PhysicDestroyCheck physicDestroyCheck = physicDestroyCheckMapper.selectById(physicDestroyCheckSignReq.getPhysicDestroyCheckId());
if(physicDestroyCheck.getStatus().equals(0)){
if(!RoleTypeEum.isPass(sysUser.getRoleAsList(),RoleTypeEum.XH)){
......
......@@ -63,7 +63,7 @@ public class PhysicDestroyServiceImpl extends AbstractService implements PhysicD
public PhysicDestroy sign(PhysicDestroySignReq physicDestroySignReq) {
boolean finished = false;
Long userId = SpringContextUtils.getUserId();
String getstamp = cloudsignService.sign(physicDestroySignReq.getEncryptedToken(), physicDestroySignReq.getRelBizNo(), physicDestroySignReq.getBase64SourceData());
String getstamp = cloudsignService.sign(physicDestroySignReq.getBase64SourceData());
PhysicDestroy physicDestroy = physicDestroyMapper.selectById(physicDestroySignReq.getPhysicDestroyId());
SysUser sysUser = sysUserMapper.selectById(userId);
if(physicDestroy.getStatus().equals(0)){
......
......@@ -153,7 +153,7 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
public PhysicRecord sign(PhysicRecordSignReq physicRecordSignReq) {
boolean finished = false;
Long userId = SpringContextUtils.getUserId();
String getstamp = cloudsignService.sign(physicRecordSignReq.getEncryptedToken(), physicRecordSignReq.getRelBizNo(), physicRecordSignReq.getBase64SourceData());
String getstamp = cloudsignService.sign(physicRecordSignReq.getBase64SourceData());
PhysicRecord physicRecord = getInfo(physicRecordSignReq.getPhysicRecordId());
SysUser sysUser = sysUserMapper.selectById(userId);
if (ObjectUtil.equals(physicRecord.getStatus(), 0)) {
......
......@@ -211,7 +211,7 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements
public PhysicStorageAmpoule sign(PhysicStorageAmpouleSignReq physicStorageAmpouleSignReq) {
boolean finished = false;
Long userId = SpringContextUtils.getUserId();
String getstamp = cloudsignService.sign(physicStorageAmpouleSignReq.getEncryptedToken(), physicStorageAmpouleSignReq.getRelBizNo(), physicStorageAmpouleSignReq.getBase64SourceData());
String getstamp = cloudsignService.sign(physicStorageAmpouleSignReq.getBase64SourceData());
PhysicStorageAmpoule ampoule = getInfo(physicStorageAmpouleSignReq.getPhysicStorageAmpouleId());
if(ampoule.getType()==2 && ampoule.getDestroyStatus()==1){
throw new ServiceException("已销毁记录不需要签名");
......
......@@ -91,7 +91,7 @@ public class PhysicWarehouseServiceImpl extends AbstractService implements Phys
public PhysicWarehouseVO sign(PhysicWarehouseSignReq physicWarehouseSignReq) {
boolean finished = false;
Long userId = SpringContextUtils.getUserId();
String getstamp = cloudsignService.sign(physicWarehouseSignReq.getEncryptedToken(), physicWarehouseSignReq.getRelBizNo(), physicWarehouseSignReq.getBase64SourceData());
String getstamp = cloudsignService.sign(physicWarehouseSignReq.getBase64SourceData());
PhysicWarehouse physicWarehouse = physicWarehouseMapper.selectById(physicWarehouseSignReq.getPhysicWarehouseId());
SysUser sysUser = sysUserMapper.selectById(userId);
if(physicWarehouse.getStatus().equals(0)){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment