@ -4,9 +4,11 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject ;
import com.ynxbd.common.action.base.BaseAction ;
import com.ynxbd.common.dao.his.HisXKDao ;
import com.ynxbd.common.result.JsonResult ;
import com.ynxbd.common.result.Result ;
import com.ynxbd.common.result.ResultEnum ;
import lombok.extern.slf4j.Slf4j ;
import org.apache.commons.lang3.ObjectUtils ;
import org.apache.struts2.convention.annotation.Action ;
import org.apache.struts2.convention.annotation.Namespace ;
@ -17,7 +19,6 @@ import java.util.List;
@Namespace ( "/xk" )
public class XKAction extends BaseAction {
@Action ( "getRxDict" )
public Result getRxDict ( String callNo , String type ) {
if ( ! "xbd2026" . equals ( callNo ) ) {
@ -32,6 +33,7 @@ public class XKAction extends BaseAction {
return Result . success ( dataList ) ;
}
@Action ( "createHisRx" )
public Result createHisRx ( ) {
JSONObject body = getBody ( ) ;
@ -49,17 +51,20 @@ public class XKAction extends BaseAction {
String bzName = body . getString ( "bzName" ) ;
JSONArray rxJsonArr = body . getJSONArray ( "rxJsonArr" ) ;
log . info ( "[开方] doctCode={}, treatNum={}" , doctCode , treatNum ) ;
if ( doctCode = = null | | treatNum = = null ) {
log . info ( "[开方]doctCode={}, treatNum={}, rxType ={}" , doctCode , treatNum , rxType ) ;
if ( ObjectUtils . isEmpty ( doctCode ) | | ObjectUtils . isEmpty ( treatNum ) | | ObjectUtils . isEmpty ( rxType ) ) {
return Result . error ( ResultEnum . PARAM_IS_DEFECT ) ;
}
System . out . println ( rxJsonArr ) ;
if ( rxJsonArr = = null ) {
if ( rxJsonArr . isEmpty ( ) ) {
return Result . error ( ResultEnum . PARAM_IS_DEFECT ) ;
}
new HisXKDao ( ) . createHisRx ( doctCode , treatNum , rxType , diagnose , weight , note , ybAttrib , bzCode , bzName , rxJsonArr ) ;
JsonResult resp = new HisXKDao ( ) . createHisRx ( doctCode , treatNum , rxType , diagnose , weight , note , ybAttrib , bzCode , bzName , rxJsonArr ) ;
if ( ! resp . success ( ) ) {
return Result . error ( resp . getMessage ( ) ) ;
}
return Result . success ( ) ;
}