?? a.java
字號:
this.getComboBox("YSZYS").setEnabled(false);
}
/**
* 初始化給付類別ComboBox
*/
public void initGIVETYPEComboBox(){
Vector vc = new Vector();
Vector code = new Vector();
Vector desc = new Vector();
code.add("A");
code.add("B");
code.add("C");
desc.add("A 醫(yī)保");
desc.add("B 增費");
desc.add("C 自費");
vc.add(code);
vc.add(desc);
this.getComboBox("GIVETYPE").setCombo(vc);
this.getComboBox("GIVETYPE").setEnabled(true);
}
/**
* 獲得時間控件
* @return DyDatePlus
*/
public DyDatePlus getDatePlus(String tag){
return (DyDatePlus)this.getComponent(tag);
}
/**
* 初始化時間
*/
public void initDateTime(){
this.setValue("DATE_STATR", manager.
SysManager.getInstance().getOPTDate());
this.setValue("DATE_END", manager.
SysManager.getInstance().getOPTDate());
this.getDatePlus("DATE_STATR").setEnabled(true);
this.getDatePlus("DATE_END").setEnabled(true);
// this.setValue("STDATE", manager.
// SysManager.getInstance().getOPTDate());
// this.setValue("EXITDATE", manager.
// SysManager.getInstance().getOPTDate());
this.getDatePlus("STDATE").setEnabled(false);
this.getDatePlus("EXITDATE").setEnabled(false);
}
/**
* 初始化數(shù)字文本控件
*/
public void initNumberic(){
this.getDyNumberic("ZFJG").setValue("");
this.getDyNumberic("YBJG").setValue("");
this.getDyNumberic("ZFBL").setValue("");
this.getDyNumberic("ZFJE").setValue("");
this.getDyNumberic("ZFZGJG").setValue("");
this.getDyNumberic("ZFJG").setEnabled(true);
this.getDyNumberic("YBJG").setEnabled(true);
this.getDyNumberic("ZFBL").setEnabled(true);
this.getDyNumberic("ZFJE").setEnabled(true);
this.getDyNumberic("ZFZGJG").setEnabled(true);
//第二個頁簽
//開藥單位
this.getDyNumberic("KYDW").setValue("");
//發(fā)藥單位1
this.getDyNumberic("FYDW").setValue("");
//發(fā)藥單位2
this.getDyNumberic("FYDWEDIT").setValue("");
//庫存單位
this.getDyNumberic("KCDWEDIT").setValue("");
this.getDyNumberic("KYDW").setEnabled(true);
this.getDyNumberic("FYDW").setEnabled(true);
this.getDyNumberic("FYDWEDIT").setEnabled(true);
this.getDyNumberic("KCDWEDIT").setEnabled(true);
}
/**
* 初始化EDIT控件
*/
public void initEdit(){
this.getEdit("ORDER_CODE").setValue("");
this.getEdit("PHYSIC_NAME").setValue("");
this.getEdit("EDH_CODE").setValue("");
this.getEdit("MEDICINE_SAFETY").setValue("");
this.getEdit("ENG_CODE").setValue("");
this.getEdit("CHYMIST_NAME").setValue("");
this.getEdit("OTHER_NAME").setValue("");
this.getEdit("OTHER_NAMEPY").setValue("");
this.getEdit("SPEC_EXPLAIN").setValue("");
this.getEdit("REMARK").setValue("");
this.getEdit("WSPZZH").setValue("");
this.getEdit("IYBM").setValue("");
this.getEdit("OYBM").setValue("");
this.getEdit("EYBM").setValue("");
//初始化可編輯狀態(tài)
this.getEdit("ORDER_CODE").setEnabled(true);
this.getEdit("PHYSIC_NAME").setEnabled(true);
this.getEdit("EDH_CODE").setEnabled(true);
this.getEdit("MEDICINE_SAFETY").setEnabled(true);
this.getEdit("ENG_CODE").setEnabled(true);
this.getEdit("CHYMIST_NAME").setEnabled(true);
this.getEdit("OTHER_NAME").setEnabled(true);
this.getEdit("OTHER_NAMEPY").setEnabled(true);
this.getEdit("SPEC_EXPLAIN").setEnabled(true);
this.getEdit("REMARK").setEnabled(true);
this.getEdit("WSPZZH").setEnabled(true);
this.getEdit("IYBM").setEnabled(true);
this.getEdit("OYBM").setEnabled(true);
this.getEdit("EYBM").setEnabled(true);
//第二個頁簽
//常用天數(shù)
this.getEdit("CYTS").setValue("");
//常用劑型
this.getEdit("CYJX").setValue("");
//默認總量
this.getEdit("DUFROUTCOUNT").setValue("");
this.getEdit("CYTS").setEnabled(true);
this.getEdit("CYJX").setEnabled(true);
this.getEdit("DUFROUTCOUNT").setEnabled(true);
}
/**
* 獲得數(shù)字控件
* @param tag String
* @return DyNumberic
*/
public DyNumberic getDyNumberic(String tag){
return (DyNumberic)this.getComponent(tag);
}
/**
* 獲得下拉列表
* @param tag String
* @return DyComboBox
*/
public DyComboBox getComboBox(String tag){
return (DyComboBox)this.getComponent(tag);
}
/**
* 獲得角色權(quán)限
* @return String
*/
public String getUserRole(){
String userRole = "";
ActionParm parm = new ActionParm();
parm.setCommitData("OPERATOR_OBJECT", SysManager.getInstance().getOperator());
IOperator operator = (IOperator) parm.getCommitData("OPERATOR_OBJECT");
operator.setActionParmCommit(parm);
userRole = parm.getCommitValue("USER_ROLE");
System.out.println("集合個人信息:"+parm+"角色權(quán)限:"+userRole);
return userRole;
}
/**
* 新增事件方法
*/
public void onAdd(){
System.out.println("新增");
System.out.println("全局結(jié)點ID:"+this.treeStringId);
if(!checkPhaType()){
return;
}
this.checkMaxOrderNo();
this.initToolBar(new Boolean(true));
this.phaAction.setCommitData("SAVE_FLG","Y");
this.getTabledPane("MAINEDIT").setSelectedIndex(0);
}
/**
* 檢查最大藥品序號
*/
public void checkMaxOrderNo(){
String newOrderCode = this.getMaxOrderNo();
if(newOrderCode.length()<=0){
return;
}
this.messageBox("新增的藥品代碼為"+newOrderCode+"!");
//變換的初始化頁面方法
this.pageInitAdd();
this.setValue("ORDER_CODE",newOrderCode);
this.getEdit("ORDER_CODE").setEnabled(true);
this.treeStringId = this.getValue("ORDER_CODE").substring(0,4);
}
/**
* 判斷是否選擇了種類
* @return boolean
*/
public boolean checkPhaType(){
if(this.treeStringId.trim().length()<=0){
this.messageBox("請選擇要添加的類別種類!");
return false;
}
return true;
}
/**
* 獲得新增的序號
* @return String
*/
public String getMaxOrderNo(){
ActionParm parm = new ActionParm();
parm.setCommitData("ORDER_CODE",this.treeStringId);
IOperator operator = SysManager.getInstance().getOperator();
operator.setActionParmCommit(parm);
return SysManager.getInstance().getMaxOrderNo(parm);
}
/**
* 清空事件方法
*/
public void onClean(){
System.out.println("清空");
this.pageInit();
}
/**
* 導(dǎo)入事件方法
*/
public void onExport(){
System.out.println("匯入");
}
/**
* 保存事件方法 SysManager.getInstance().valDataNumber("1ff.312")數(shù)字驗證方法
*/
public void onSave(){
System.out.println("保存");
System.out.println("取得用戶輸入數(shù)據(jù):"+this.getPhaSysFeeData());
ActionParm parm = this.getPhaSysFeeData();
ActionParm parmPhaBase = this.getPhaBaseData();
System.out.println("保存狀態(tài):"+this.phaAction.getCommitValue("SAVE_FLG").toString());
if(this.phaAction.getCommitValue("SAVE_FLG").toString().equals("Y")){
//新增
this.insertSysFeeData(parm);
if(this.getValue("ROLE").equals("0")){
String[] buttonType = new String[2];
buttonType[0] = "確定";
buttonType[1] = "取消";
if (!this.messageJwindow("是否添加藥品屬性?", "信息", buttonType)) {
return;
}
this.getTabledPane("MAINEDIT").setSelectedIndex(1);
this.savePhaBaseData(parmPhaBase);
}
}else{
//保存修改
if(this.getValue("ROLE").equals("2")){
System.out.println("保存藥品屬性");
this.savePhaBaseData(parmPhaBase);
}else{
if(this.getValue("ROLE").equals("1")||this.getValue("ROLE").equals("3")){
this.saveSysFeeData(parm);
}else{
//保存SYSFEE
this.saveSysFeeData(parm);
//保存PHABASE
this.savePhaBaseData(parmPhaBase);
}
}
}
this.onGridEvent();
}
/**
* 保存PHABASE數(shù)據(jù)
* @param parm ActionParm
*/
public void savePhaBaseData(ActionParm parm){
System.out.println("保存PHABASE數(shù)據(jù):"+parm);
if(!this.checkPhaBaseData(parm)){
return;
}
if(SysManager.getInstance().savePhaBaseData(parm)){
this.messageBox("保存成功!");
}else{
this.messageBox("保存失敗!");
}
}
/**
* 新增SysFeeData
* @param parm ActionParm
*/
public void insertSysFeeData(ActionParm parm){
//鑒核用戶輸入數(shù)據(jù)
if (!this.checkSysFeeDatas(parm)) {
return;
}
//新增
if(!this.checkOrderCodeLenght(this.getValue("ORDER_CODE"))){
this.messageBox("不符合藥品代碼格式前4位分類代碼此類別的"+this.treeStringId.substring(0,4)+",后幾位必須是數(shù)字!");
return;
}else{
this.messageBox("可以保存!");
if(!this.valdataSysFeeData(parm)){
this.messageBox("有相同藥品代碼不能添加,請重新設(shè)置藥品代碼!");
return;
}
if(SysManager.getInstance().insertSysFeeDataPha(parm)){
this.messageBox("添加成功!");
}else{
this.messageBox("添加失敗!");
}
if(!this.getValue("ROLE").equals("0")){
System.out.println("不是最高權(quán)限"+this.getValue("ROLE"));
this.pageInit();
}
}
}
/**
* 保存SysFeeData
* @param parm ActionParm
*/
public void saveSysFeeData(ActionParm parm){
//鑒核用戶輸入數(shù)據(jù)
if(!this.checkSysFeeDatas(parm)){
return;
}
if(this.phaAction.getReturnCount("ORDER_CODE")<=0){
this.messageBox("全局修改數(shù)據(jù)為空!");
return;
}else{
Vector vc = new Vector();
vc.add(parm);
vc.add(this.phaAction);
List list = new ArrayList();
if (this.checkPricePha(vc)) {
System.out.println("相同");
if (SysManager.getInstance().updatePhaEditData(parm)) {
//this.onClean();
}
}
else {
System.out.println("不同");
list.add(this.creatPhaInsertData(parm));
if (SysManager.getInstance().indupdateSysFeePrice(list)) {
//this.onClean();
}
}
}
}
/**
* 驗證用戶輸入藥品代碼是否符合要求
* @param orderCode String
* @return boolean
*/
public boolean checkOrderCodeLenght(String orderCode){
boolean falg = false;
if(orderCode.trim().substring(0,4).equals(this.getMaxOrderNo().substring(0,4))&&SysManager.getInstance().valDataNumber(orderCode.trim().substring(4,orderCode.trim().length()))){
falg = true;
}
return falg;
}
/**
* 驗證是否有同樣的數(shù)據(jù)
* @param parm ActionParm
* @return boolean
*/
public boolean valdataSysFeeData(ActionParm parm){
boolean falg = false;
ActionParm result = SysManager.getInstance().valdataSysFeeData(parm);
if(result.getReturnCount("ORDER_CODE")<=0){
falg = true;
}
return falg;
}
/**
* 修改價格后的插入數(shù)據(jù)方法
* @param pram ActionParm
* @return ActionParm
*/
public ActionParm creatPhaInsertData(ActionParm pram){
ActionParm result = new ActionParm();
result.setCommitData("HOSP_AREA",pram.getCommitValue("HOSP_AREA"));
result.setCommitData("ORDER_CODE",pram.getCommitValue("ORDER_CODE"));
result.setCommitData("START_DATE",(new Date_Proc()).AddDay(SysManager.getInstance().getAllDate().substring(0,8), 1));
result.setCommitData("OWN_PRICE",pram.getCommitValue("OWN_PRICE"));
result.setCommitData("NHI_PRICE",pram.getCommitValue("NHI_PRICE"));
result.setCommitData("USER_IP",pram.getCommitValue("USER_IP"));
result.setCommitData("USER_ID",pram.getCommitValue("USER_ID"));
result.setCommitData("OPT_DATE",pram.getCommitValue("OPT_DATE"));
return result;
}
/**
* 查看是否修改價格
* @param parm List
* @return boolean
*/
public boolean checkPricePha(Vector parm){
ActionParm newPriceData = (ActionParm)parm.get(0);
ActionParm oldPriceData = (ActionParm)parm.get(1);
System.out.println("新編輯的數(shù)據(jù):"+newPriceData);
System.out.println("舊的數(shù)據(jù):"+oldPriceData);
String newOwnPrice = newPriceData.getCommitValue("OWN_PRICE").toString();
String oldOwnPrice = oldPriceData.getReturnData("OWN_PRICE",0).toString();
String newNhiPrice = newPriceData.getCommitValue("NHI_PRICE").toString();
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -