Commit 31a364ed by zhu.zewen

创建单据时签名

parent 3480c561
...@@ -15,6 +15,9 @@ public class PhysicAmpouleCreateReq { ...@@ -15,6 +15,9 @@ public class PhysicAmpouleCreateReq {
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String remark; private String remark;
@ApiModelProperty(value = "签名")
private SignReq sign;
@ApiModelProperty(value = "药品记录集") @ApiModelProperty(value = "药品记录集")
private List<PhysicAmpouleCreateReq.Physic> physicList; private List<PhysicAmpouleCreateReq.Physic> physicList;
......
...@@ -4,12 +4,17 @@ package com.jmai.physic.dto; ...@@ -4,12 +4,17 @@ package com.jmai.physic.dto;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
@Data @Data
public class SignReq { public class SignReq {
@NotBlank(message = "签名token(encryptedToken)不能为空")
@ApiModelProperty(value = "签名token") @ApiModelProperty(value = "签名token")
private String encryptedToken; private String encryptedToken;
@NotBlank(message = "签名账号(relBizNo)不能为空")
@ApiModelProperty(value = "签名账号") @ApiModelProperty(value = "签名账号")
private String relBizNo; private String relBizNo;
@NotBlank(message = "签名图片(base64SourceData)不能为空")
@ApiModelProperty(value = "签名base64图片") @ApiModelProperty(value = "签名base64图片")
private String base64SourceData; private String base64SourceData;
} }
...@@ -66,8 +66,19 @@ public class PhysicAmpouleServiceImpl extends AbstractService implements PhysicA ...@@ -66,8 +66,19 @@ public class PhysicAmpouleServiceImpl extends AbstractService implements PhysicA
ampoule.setPhysicNum(physic.getPhysicNum()); ampoule.setPhysicNum(physic.getPhysicNum());
ampoule.setType(req.getType()); ampoule.setType(req.getType());
ampoule.setOrderNo(orderNo); ampoule.setOrderNo(orderNo);
ampoule.setStatus(0);
ampoule.setChUser(null);
ampoule.setFhUser(null);
ampoule.setRemark(req.getRemark()); ampoule.setRemark(req.getRemark());
physicAmpouleMapper.insert(ampoule); physicAmpouleMapper.insert(ampoule);
if (ObjectUtil.isNotEmpty(req.getSign())) {
// 接受退回处理人签名
PhysicAmpouleSignReq signReq = new PhysicAmpouleSignReq();
copyTo(req.getSign(), signReq);
signReq.setPhysicAmpouleId(ampoule.getId());
sign(signReq);
}
} }
} }
@Override @Override
......
...@@ -73,20 +73,27 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe ...@@ -73,20 +73,27 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
record.setPrescriptionNumber(req.getPrescriptionNumber()); record.setPrescriptionNumber(req.getPrescriptionNumber());
record.setPrescriptionDoctor(req.getPrescriptionDoctor()); record.setPrescriptionDoctor(req.getPrescriptionDoctor());
// TODO:sign - 签名 record.setStatus(0);
record.setDpUser(null); record.setDpUser(null);
record.setFyUser(null); record.setFyUser(null);
record.setYsUser(null); record.setYsUser(null);
record.setFhUser(null); record.setFhUser(null);
record.setStatus(0);
physicRecordMapper.insert(record); physicRecordMapper.insert(record);
if (ObjectUtil.isNotEmpty(req.getPrescriptionImages())) { if (ObjectUtil.isNotEmpty(req.getPrescriptionImages())) {
if (CollectionUtils.isNotEmpty(req.getPrescriptionImages())) { if (CollectionUtils.isNotEmpty(req.getPrescriptionImages())) {
bizFileService.addBizFilesIfAbsent(BizFileTypes.PHYSIC_RECORD_IMAGE, record.getId().toString(), req.getPrescriptionImages()); bizFileService.addBizFilesIfAbsent(BizFileTypes.PHYSIC_RECORD_IMAGE, record.getId().toString(), req.getPrescriptionImages());
} }
} }
// 调配人签名
if (ObjectUtil.isNotEmpty(req.getSign())) {
PhysicRecordSignReq signReq = new PhysicRecordSignReq();
copyTo(req.getSign(), signReq);
signReq.setPhysicRecordId(record.getId());
sign(signReq);
}
records.add(record); records.add(record);
} }
return records; return records;
......
...@@ -46,8 +46,8 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements ...@@ -46,8 +46,8 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements
@Resource @Resource
protected SysManager sysManager; protected SysManager sysManager;
@Transactional
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void create(PhysicStorageAmpouleCreateReq req) { public void create(PhysicStorageAmpouleCreateReq req) {
Long deptId = SpringContextUtils.getDeptId(); Long deptId = SpringContextUtils.getDeptId();
...@@ -82,7 +82,6 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements ...@@ -82,7 +82,6 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements
ampoule.setBatchBalance(batchNoSum+physic.getPhysicNum()); ampoule.setBatchBalance(batchNoSum+physic.getPhysicNum());
ampoule.setPhysicNum(physicSum+physic.getPhysicNum()); ampoule.setPhysicNum(physicSum+physic.getPhysicNum());
// TODO:签名
ampoule.setJsUser(null); ampoule.setJsUser(null);
ampoule.setThUser(null); ampoule.setThUser(null);
...@@ -90,6 +89,15 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements ...@@ -90,6 +89,15 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements
ampoule.setRemark(req.getRemark()); ampoule.setRemark(req.getRemark());
physicStorageAmpouleMapper.insert(ampoule); physicStorageAmpouleMapper.insert(ampoule);
if (ObjectUtil.isNotEmpty(req.getSign())) {
// 接收人签名
PhysicStorageAmpouleSignReq signReq = new PhysicStorageAmpouleSignReq();
copyTo(req.getSign(), signReq);
signReq.setPhysicStorageAmpouleId(ampoule.getId());
sign(signReq);
}
} }
}else if(ObjectUtil.equals(req.getType(), 2)) { }else if(ObjectUtil.equals(req.getType(), 2)) {
// 2-移至销毁 // 2-移至销毁
...@@ -121,7 +129,6 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements ...@@ -121,7 +129,6 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements
ampoule.setBatchBalance(batchNoSum); ampoule.setBatchBalance(batchNoSum);
ampoule.setPhysicNum(physicSum); ampoule.setPhysicNum(physicSum);
// TODO:sign - 签名
ampoule.setJsUser(null); ampoule.setJsUser(null);
ampoule.setThUser(null); ampoule.setThUser(null);
...@@ -129,6 +136,15 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements ...@@ -129,6 +136,15 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements
ampoule.setRemark(req.getRemark()); ampoule.setRemark(req.getRemark());
physicStorageAmpouleMapper.insert(ampoule); physicStorageAmpouleMapper.insert(ampoule);
if (ObjectUtil.isNotEmpty(req.getSign())) {
// 接收人签名
PhysicStorageAmpouleSignReq signReq = new PhysicStorageAmpouleSignReq();
copyTo(req.getSign(), signReq);
signReq.setPhysicStorageAmpouleId(ampoule.getId());
sign(signReq);
}
} }
} else { } else {
throw new ServiceException("类型错误:type=" + req.getType()); throw new ServiceException("类型错误:type=" + req.getType());
......
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