|
@@ -31,6 +31,7 @@ import com.auth0.jwt.interfaces.DecodedJWT;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.dao.DataIntegrityViolationException;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
@@ -410,6 +411,14 @@ public class MzChargeDetailController {
|
|
|
resultMap.put("message", "病人姓名更新成功");
|
|
|
return resultMap;
|
|
|
} catch (Exception e) {
|
|
|
+ if (e instanceof DataIntegrityViolationException){
|
|
|
+ if(e.getMessage().contains("将截断字符串或二进制数据")){
|
|
|
+ resultMap.put("code", -1);
|
|
|
+ resultMap.put("message", "病人姓名超长");
|
|
|
+ log.error("系统异常,错误信息{病人姓名超长}");
|
|
|
+ return resultMap;
|
|
|
+ }
|
|
|
+ }
|
|
|
resultMap.put("code", -1);
|
|
|
resultMap.put("message", "病人姓名更新失败,系统出错,请联系管理员");
|
|
|
log.error("病人姓名更新失败,系统异常,错误信息{}", e);
|
|
@@ -1473,7 +1482,7 @@ public class MzChargeDetailController {
|
|
|
*/
|
|
|
@UserLoginToken
|
|
|
@RequestMapping(value = "/savePrescription", method = {RequestMethod.POST})
|
|
|
- public Map<String, Object> savePrescription(@RequestBody MzPrescriptionVo mzPrescriptionVo) {
|
|
|
+ public Map<String, Object> savePrescription(@RequestBody MzPrescriptionVo mzPrescriptionVo,HttpServletRequest httpServletRequest) {
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
try {
|
|
|
if (StringUtils.isBlank(mzPrescriptionVo.getSerialNo())) {
|
|
@@ -1495,7 +1504,12 @@ public class MzChargeDetailController {
|
|
|
resultMap.put("message", "当前接诊患者的分诊记录不存在");
|
|
|
return resultMap;
|
|
|
}
|
|
|
- mzPrescriptionVo.setDoctorCode(mzfzPatientOrder.getDoctorCode());
|
|
|
+ if(Constants.SIMPLE_OUTPATIENT_CODE.equals(mzfzPatientOrder.getReqType())){
|
|
|
+ User tokenUser = TokenUtil.getUser(httpServletRequest);
|
|
|
+ mzPrescriptionVo.setDoctorCode(tokenUser.getUserIdCode());
|
|
|
+ }else {
|
|
|
+ mzPrescriptionVo.setDoctorCode(mzfzPatientOrder.getDoctorCode());
|
|
|
+ }
|
|
|
mzPrescriptionVo.setVisitDeptCode(mzfzPatientOrder.getDeptCode());
|
|
|
}
|
|
|
mzPrescriptionVo.setJzFlag(YesNoEnum.NO.code);
|