develop/lyx_20241225_gh
lxx 4 weeks ago
parent d241d76ba6
commit 3a172b9d8d
  1. 380
      WEB-INF/src/com/his/mz/ghmanage/mzgh/MzGhWindow_test.java
  2. 26
      WEB-INF/src/com/his/mz/ghmanage/mzgh/MzGhWindow_test.xml

@ -1,6 +1,12 @@
package com.his.mz.ghmanage.mzgh;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import com.his.mz.ghmanage.model.MzghModel;
import com.his.mz.ghmanage.model.ZffsModel;
import com.his.mz.mzsfmanage.model.MzsfParamsModel;
import com.his.mz.service.MzGhService;
import com.util.MainUtil;
import com.wat.component.DxDataBeds;
import com.wat.core.component.DxColor;
@ -12,6 +18,7 @@ import com.wat.core.component.event.WindowAdapter;
import com.wat.core.component.event.WindowEvent;
import com.wat.core.config.DaoCreator;
import com.wat.core.dal.DxNormalDataManager;
import com.wat.core.util.MathUtil;
import com.wat.delphi.util.Delphi;
public class MzGhWindow_test extends WatSDIWindow {
@ -38,24 +45,24 @@ public class MzGhWindow_test extends WatSDIWindow {
super.customerInitUI();
bedGhrq.setJgHeight(0);
bedGhrq.setBedWidth(140);
bedGhrq.setBedHeight(25);
bedGhrq.setBackground(new DxColor(239, 239, 239));
bedGhrq.setBedWidth(100);
bedGhrq.setBedHeight(80);
bedGhrq.setBackground(new DxColor(255, 255, 255));
bedGhks.setJgHeight(0);
bedGhks.setBedWidth(140);
bedGhks.setBedHeight(25);
bedGhks.setBackground(new DxColor(239, 239, 239));
bedGhks.setBedWidth(100);
bedGhks.setBedHeight(60);
bedGhks.setBackground(new DxColor(255, 255, 255));
bedGhys.setJgHeight(0);
bedGhys.setBedWidth(140);
bedGhys.setBedHeight(25);
bedGhys.setBackground(new DxColor(239, 239, 239));
bedGhys.setBedWidth(100);
bedGhys.setBedHeight(60);
bedGhys.setBackground(new DxColor(255, 255, 255));
bedGhhy.setJgHeight(0);
bedGhhy.setBedWidth(140);
bedGhhy.setBedHeight(25);
bedGhhy.setBackground(new DxColor(239, 239, 239));
bedGhhy.setBedWidth(100);
bedGhhy.setBedHeight(120);
bedGhhy.setBackground(new DxColor(255, 255, 255));
}
@ -63,11 +70,64 @@ public class MzGhWindow_test extends WatSDIWindow {
public void beforeShowLoad() {
super.beforeShowLoad();
this.centerWindow();
DxNormalDataManager hzBaseDao = (DxNormalDataManager) DaoCreator.getNormalDao(this, "hzBaseDao");
hzBaseDao.setNormalParameters(new Object[] { MainUtil.getCurCompanyID(), "651795474806607872"});
hzBaseDao.reload();
DxNormalDataManager mzghCardDao = (DxNormalDataManager) DaoCreator.getNormalDao(this, "mzghCardDao");
mzghCardDao.setNormalParameters(new Object[] { MainUtil.getCurCompanyID(), "651795474806607872" });
mzghCardDao.reload();
this.setXmlControlDao(0, hzBaseDao);
DxNormalDataManager daoBedGhrq = DaoCreator.getNormalDao(this, "daoBedGhrq");
daoBedGhrq.reload();
bedGhrq.setDataSource(daoBedGhrq);
selectGhrqAction();
bedGhys.setDataSource(daoBedGhrq);
for (int i = 0; i < 7; i++) {
Calendar begin = Calendar.getInstance();
begin.set(Calendar.DAY_OF_MONTH,begin.get(Calendar.DAY_OF_MONTH) + i);
String date=MainUtil.format(begin.getTime(),"yyyy-MM-dd");
int today = begin.get(Calendar.DAY_OF_WEEK); // 1代表星期日,2代表星期一,以此类推
String dayName="";
switch (today) {
case 1:
dayName="星期日";
break;
case 2:
dayName="星期一";
break;
case 3:
dayName="星期二";
break;
case 4:
dayName="星期三";
break;
case 5:
dayName="星期四";
break;
case 6:
dayName="星期五";
break;
case 7:
dayName="星期六";
break;
default:
break;
}
dayName="<div style=\"background-color:#fef9f9;text-align:center;border:2px solid red;border-radius-example;border-radius: 5px;\"><p>"+dayName+"</p><p>"+date+"</p></div>";
daoBedGhrq.absolute(daoBedGhrq.insert(daoBedGhrq.getRowCount()));
daoBedGhrq.setColumnValue("key",date);
daoBedGhrq.setColumnValue("value",dayName);
}
DxNormalDataManager daoBedGhks = DaoCreator.getNormalDao(this, "daoBedGhks");
@ -84,21 +144,6 @@ public class MzGhWindow_test extends WatSDIWindow {
daoBedGhhy.reload();
bedGhhy.setDataSource(daoBedGhhy);
DxNormalDataManager daoMzghPbinfo = DaoCreator.getNormalDao(this, "daoMzghPbinfo");
daoMzghPbinfo.reload(new Object[] { MainUtil.getCurCompanyID(), Delphi.getDateStr(System.currentTimeMillis()), "%", "%" });
//DxNormalDataManager daoMzghSelectKs = DaoCreator.getNormalDao(this, "daoMzghSelectKs");
//daoMzghSelectKs.reload(new Object[] { MainUtil.getCurCompanyID(), "%", "%", "%" });
for (int i = 0; i < daoMzghPbinfo.getRowCount(); i++) {
if (!daoBedGhks.local("key", daoMzghPbinfo.getColumnValueAsString(i,"DPTID"))) {
daoBedGhks.absolute(daoBedGhks.insert(daoBedGhks.getRowCount()));
daoBedGhks.setColumnValue("key",daoMzghPbinfo.getColumnValueAsString(i,"DPTID"));
daoBedGhks.setColumnValue("value",daoMzghPbinfo.getColumnValueAsString(i,"DPTNAME"));
}
}
}
public void modalFunction(int flag, Object para) {
@ -111,55 +156,267 @@ public class MzGhWindow_test extends WatSDIWindow {
}
}
private void selectGhrqAction() {
/**
* 日期
* @param key 日期
*/
private void selectGhrqAction(String key) {
DxNormalDataManager daoMzghPbinfo = DaoCreator.getNormalDao(this, "daoMzghPbinfo");
daoMzghPbinfo.reload(new Object[] { MainUtil.getCurCompanyID(),key, "%", "%" });
DxNormalDataManager daoBedGhrq = DaoCreator.getNormalDao(this, "daoBedGhrq");
daoBedGhrq.reload();
bedGhys.setDataSource(daoBedGhrq);
for (int i = 0; i < 7; i++) {
Calendar begin = Calendar.getInstance();
begin.set(Calendar.DAY_OF_MONTH,begin.get(Calendar.DAY_OF_MONTH) + i);
String date=MainUtil.format(begin.getTime(),"yyyy-MM-dd");
daoBedGhrq.absolute(daoBedGhrq.insert(daoBedGhrq.getRowCount()));
daoBedGhrq.setColumnValue("key",date);
daoBedGhrq.setColumnValue("value",date);
DxNormalDataManager daoBedGhks = DaoCreator.getNormalDao(this, "daoBedGhks");
daoBedGhks.reload();
DxNormalDataManager daoBedGhys = DaoCreator.getNormalDao(this, "daoBedGhys");
daoBedGhys.reload();
DxNormalDataManager daoBedGhhy = DaoCreator.getNormalDao(this, "daoBedGhhy");
daoBedGhhy.reload();
for (int i = 0; i < daoMzghPbinfo.getRowCount(); i++) {
if (!daoBedGhks.local("key", daoMzghPbinfo.getColumnValueAsString(i,"DPTID"))) {
daoBedGhks.absolute(daoBedGhks.insert(daoBedGhks.getRowCount()));
daoBedGhks.setColumnValue("key",daoMzghPbinfo.getColumnValueAsString(i,"DPTID"));
String ksName="<div style=\"background-color:#fef9f9;text-align:center;border:2px solid red;border-radius-example;border-radius: 5px;\"><p>"+daoMzghPbinfo.getColumnValueAsString(i,"DPTNAME")+"</p></div>";
daoBedGhks.setColumnValue("value",ksName);
}
}
bedGhks.setDataSource(daoBedGhks);
bedGhys.setDataSource(daoBedGhys);
bedGhhy.setDataSource(daoBedGhhy);
Calendar begin = Calendar.getInstance();
System.err.println(Delphi.isSaturDay(begin.getTime().getTime()));
}
private void selectGhysAction(String key) {
/**
* 科室
* @param key0 日期
* @param key1 科室
*/
private void selectGhksAction(String key0, String key1) {
DxNormalDataManager daoMzghPbinfo = DaoCreator.getNormalDao(this, "daoMzghPbinfo");
daoMzghPbinfo.reload(new Object[] { MainUtil.getCurCompanyID(), Delphi.getDateStr(System.currentTimeMillis()), key, "%" });
daoMzghPbinfo.reload(new Object[] { MainUtil.getCurCompanyID(), key0, key1, "%" });
DxNormalDataManager daoBedGhys = DaoCreator.getNormalDao(this, "daoBedGhys");
daoBedGhys.reload();
bedGhys.setDataSource(daoBedGhys);
DxNormalDataManager daoBedGhhy = DaoCreator.getNormalDao(this, "daoBedGhhy");
daoBedGhhy.reload();
for (int i = 0; i < daoMzghPbinfo.getRowCount(); i++) {
if (!daoBedGhys.local("key", daoMzghPbinfo.getColumnValueAsString(i,"YSPKEY"))) {
daoBedGhys.absolute(daoBedGhys.insert(daoBedGhys.getRowCount()));
daoBedGhys.setColumnValue("key",daoMzghPbinfo.getColumnValueAsString(i,"YSPKEY"));
daoBedGhys.setColumnValue("value",daoMzghPbinfo.getColumnValueAsString(i,"NAME"));
String ysName="<div style=\"background-color:#fef9f9;text-align:center;border:2px solid red;border-radius-example;border-radius: 5px;\"><p>"+daoMzghPbinfo.getColumnValueAsString(i,"NAME")+"</p></div>";
daoBedGhys.setColumnValue("value",ysName);
}
}
bedGhys.setDataSource(daoBedGhys);
bedGhhy.setDataSource(daoBedGhhy);
}
private void selectGhhyAction(String key0,String key1) {
/**
* 医生
* @param key0 日期
* @param key1 科室
* @param key2 医生
*/
private void selectGhysAction(String key0,String key1,String key2) {
DxNormalDataManager daoMzghPbinfo = DaoCreator.getNormalDao(this, "daoMzghPbinfo");
daoMzghPbinfo.reload(new Object[] { MainUtil.getCurCompanyID(), Delphi.getDateStr(System.currentTimeMillis()), key0, key1 });
daoMzghPbinfo.reload(new Object[] { MainUtil.getCurCompanyID(), key0, key1,key2 });
DxNormalDataManager daoBedGhhy = DaoCreator.getNormalDao(this, "daoBedGhhy");
daoBedGhhy.reload();
bedGhhy.setDataSource(daoBedGhhy);
for (int i = 0; i < daoMzghPbinfo.getRowCount(); i++) {
for (int rowNum = 0; rowNum < daoMzghPbinfo.getRowCount(); rowNum++) {
daoBedGhhy.absolute(daoBedGhhy.insert(daoBedGhhy.getRowCount()));
daoBedGhhy.setColumnValue("key",daoMzghPbinfo.getColumnValueAsString(i,"PKEY"));
daoBedGhhy.setColumnValue("value",daoMzghPbinfo.getColumnValueAsString(i,"MC")+daoMzghPbinfo.getColumnValueAsString(i,"GHZC"));
daoBedGhhy.setColumnValue("key",daoMzghPbinfo.getColumnValueAsString(rowNum,"PKEY"));
String hyztlb = daoMzghPbinfo.getColumnValueAsString(rowNum, "hyztlb");
String bzh = daoMzghPbinfo.getColumnValueAsString(rowNum, "BZH");
String jh = daoMzghPbinfo.getColumnValueAsString(rowNum, "JH");
String yyh = daoMzghPbinfo.getColumnValueAsString(rowNum, "YYH");
String GHZC = daoMzghPbinfo.getColumnValueAsString(rowNum, "GHZC");
Map lbMap = Delphi.toMapByJson(hyztlb);
List bzhghList = (List) lbMap.get("b");
List jhghList = (List) lbMap.get("j");
int ygbzh = 0;
int ygjh = 0;
if (bzhghList != null) {
for (int i = 0; i < bzhghList.size(); i++) {
int ghbm = Integer.parseInt(bzhghList.get(i).toString());
if (ghbm > 0) {
ygbzh++;
}
}
}
if (jhghList != null) {
for (int i = 0; i < jhghList.size(); i++) {
int ghbm = Integer.parseInt(jhghList.get(i).toString());
if (ghbm > 0) {
ygjh++;
}
}
}
int ygh = ygbzh + ygjh;
String zhs = MathUtil.add(bzh, jh);
String syhs = MathUtil.subtract(zhs, ygh);
DxNormalDataManager ghlbDic = DaoCreator.getNormalDao(this, "ghlbDic");
ghlbDic.setNormalParameters(new Object[] { MainUtil.getCurCompanyID() });
ghlbDic.reloadByDictionary("MC", "PKEY");
String hyName="<div style=\"background-color:#fef9f9;text-align:center;border:2px solid red;border-radius-example;border-radius: 5px;\"><p>"+daoMzghPbinfo.getColumnValueAsString(rowNum,"MC")+"</p><p>"+ghlbDic.getDicValue(GHZC)+"</p><p>剩余号:"+syhs+"</p></div>";
daoBedGhhy.setColumnValue("value",hyName);
}
bedGhhy.setDataSource(daoBedGhhy);
}
/**
* 号源
*/
private void selectGhhyAction() {
DxNormalDataManager hzBaseDao = (DxNormalDataManager) DaoCreator.getNormalDao(this, "hzBaseDao");
DxNormalDataManager mzgh_cardDao = (DxNormalDataManager) DaoCreator.getNormalDao(this, "mzghCardDao");
if (hzBaseDao.getRowCount() == 0 || mzgh_cardDao.getRowCount() == 0) {
setLabelShow("提示:当前没有选择挂号患者,请输入卡号或者进行刷卡操作");
return;
}
long csrq = hzBaseDao.getColumnValueAsLong("CSRQ");
int age2 = Integer.parseInt(Delphi.getAge(Delphi.getDateStr(csrq)));
String kspkey = bedGhks.getSelected();
if(age2 >= 18 && "410".equals(kspkey)) {
setLabelShow("提示:当前就诊患者年龄大于18,不允许挂儿科号别");
return;
}
// HisGHjcszDaoMapper hisGHjcszDaoMapper = HisGHjcszDaoMapper.getMapper(new Object[] { MainUtil.getCurCompanyID() });
// boolean issfxzlhff = hisGHjcszDaoMapper.isSFXZLHFF();//是否先诊疗后付费模式
// String edit3Str = "";
// if (!issfxzlhff) {
// int dblookupcombobox2Select = dblookupcombobox2.getSelectedIndex();
// if (dblookupcombobox2Select < 0) {
// setLabelShow("提示:支付方式必须选择!");
// return;
// }
// edit3Str = edit3.getText();
// if (Delphi.isNullString(edit3Str)) {
// setLabelShow("提示:合计金额异常!");
// return;
// }
// String edit4Str = edit4.getText();
// if (Delphi.isNullString(edit4Str)) {
// setLabelShow("提示:请实收金额!");
// edit4.setFocus();
// return;
// }
// if (Double.parseDouble(MathUtil.subtract(edit4Str, edit3Str)) < 0) {
// setLabelShow("提示:实收金额小于合计金额!");
// edit4.setFocus();
// return;
// }
// }
DxNormalDataManager daoMzghPbinfo = DaoCreator.getNormalDao(this, "daoMzghPbinfo");
daoMzghPbinfo.local("PKEY", bedGhhy.getSelected());
String pkey = daoMzghPbinfo.getColumnValueAsString("GHZC");
DxNormalDataManager lbglyzxDao = (DxNormalDataManager) DaoCreator.getNormalDao(this, "lbglyzxDao");
lbglyzxDao.setNormalParameters(new Object[] { MainUtil.getCurCompanyID(), pkey });
lbglyzxDao.reload();
String hjje = lbglyzxDao.getSumColumnValue("je");
if (Delphi.isNullString(hjje)) {
hjje = "0";
}
MzghModel model = new MzghModel();
model.setHzpkey(hzBaseDao.getColumnValueAsString("PKEY"));
model.setCardNo(mzgh_cardDao.getColumnValueAsString("KH"));
model.setCardPkey(mzgh_cardDao.getColumnValueAsString("PKEY"));
ZffsModel zffsModel = new ZffsModel();
zffsModel.setZffs("2");//暂时默认微信2
zffsModel.setZfje(hjje);
model.addZffs(zffsModel);
// model.setPjtype("F");
model.setSytype("MG");
model.setCzry(MainUtil.getCurUserAccount());
model.setCzryks(MainUtil.getCurKs());
model.setCompanyId(MainUtil.getCurCompanyID());
model.setHjje(hjje);
model.setPbPkey(bedGhhy.getSelected());
model.setPbyyhPkey("");//预约号取号
model.setHasBlb(checkbox1.isSelected());
model.setIsAccount(true);
model.setWindow(this);
MzGhService mzghService = new MzGhService();
//60岁免费挂号
if ("1".equals(str)) {
mzghService.createGhMfNoFk(model);
if (model.getResult() == 0) {
printDjhNoJf(model);
refreshData();
//insertNewContent();
} else {
setLabelShow("提示:挂号业务保存失败,原因:" + model.getMessage());
}
}else if (!issfxzlhff) {
mzghService.createGhBill(model);
if (model.getResult() == 0) {
model.setDzp(false);
MzsfParamsModel paramsmodel = (MzsfParamsModel) getWinParams("mzparamsmodel");
if (paramsmodel.isSFDYPJ() && !"fzgh".equals(getWinParams("type"))) {//分诊台挂号不用打印发票
model.setFp(true);
model.setPjtype(paramsmodel.getMRGHPJLX());
} else {
model.setFp(false);
}
mzghService.createGhJsFp(model);
if (model.getResult() == 0) {
printDjh(model);
refreshData();
//insertNewContent();
// dlg.messageDlg("提示:挂号成功,当前患者是否继续挂号",DxMessageDlg.CONFIRM,310,300);
} else {
setLabelShow("提示:挂号业务收费失败,原因:" + model.getMessage());
dbedit2Action();
}
} else {
setLabelShow("提示:挂号业务保存失败,原因:" + model.getMessage());
}
} else {
mzghService.createGhBillNoFk(model);
if (model.getResult() == 0) {
printDjhNoJf(model);
refreshData();
} else {
setLabelShow("提示:挂号业务保存失败,原因:" + model.getMessage());
}
}
if (model.getResult() == 0) {//修改年龄小于6岁的hzinfo,jz_baseinfo两张表的nl;
DxNormalDataManager hzBaseDao1 = (DxNormalDataManager) DaoCreator.getNormalDao("hzBaseDao");
hzBaseDao1.setNormalParameters(new Object[] { MainUtil.getCurCompanyID(), hzBaseDao.getColumnValueAsString("PKEY") });
hzBaseDao1.reload();
String[] age = edit1.getText().split("岁");
if(!Delphi.isNullString(age[0])) {
if(Integer.valueOf(age[0]) < 18) {
hzBaseDao1.setColumnValue("NL", edit1.getText());
hzBaseDao1.commit();
}
}
}
insertNewContent();
}
protected void initEvent() {
super.initEvent();
this.addWindowListener(new WindowAdapter(){
@ -168,17 +425,30 @@ public class MzGhWindow_test extends WatSDIWindow {
}
});
bedGhrq.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
selectGhrqAction(bedGhrq.getSelected());
}
});
bedGhks.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
selectGhysAction(bedGhks.getSelected());
selectGhksAction(bedGhrq.getSelected(),bedGhks.getSelected());
}
});
bedGhys.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
selectGhhyAction(bedGhks.getSelected(),bedGhys.getSelected());
selectGhysAction(bedGhrq.getSelected(),bedGhks.getSelected(),bedGhys.getSelected());
}
});
bedGhhy.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
selectGhhyAction();
}
});
}
}

@ -2,27 +2,21 @@
<window size="1000,600" title="患者挂号管理" controlbutton="false,false,true">
<DxDIVGrid bkcolor="255,255,255" class="LayoutManager" location="0,0" size="100,100" unit="%,%">
<row height="10" location="0,0" split="false" size="0,0" >
<row height="6" location="0,0" split="false" size="0,0" >
<col split="false">
<DxPanelBar id="panelBar1" split="false" size="100,38" tabindex="0" unit="%">
<item align="left" >
<DxLabel id="label1" size="48,13" title="姓名:"/>
<DxLabel id="label2" size="140,28" title=""/>
</item>
<item align="left" >
<DxLabel id="label3" size="48,13" title="性别:"/>
<DxLabel id="label4" size="140,28" title=""/>
</item>
<item align="left" >
<DxLabel id="label5" size="48,13" title="年龄:"/>
<DxLabel id="label5" size="140,28" />
</item>
</DxPanelBar>
<DxPanel id="panel1" size="100,38" tabindex="0" unit="%">
<DxLabel id="label1" size="48,13" location="10,10" title="姓名:"/>
<DxDataLabel id="label2" size="140,28" location="60,10" title="" ds="XM@" />
<DxLabel id="label3" size="48,13" location="160,10" title="性别:"/>
<DxDataLabel id="label4" size="140,28" location="210,10" title="" dic="MC:BH@xbdao" ds="XB@" />
<DxLabel id="label5" size="48,13" location="310,10" title="年龄:" />
<DxDataLabel id="label5" size="140,28" location="370,10" ds="NL@" />
</DxPanel>
</col>
</row>
<row height="20" location="0,0" split="false" size="0,0" >
<col split="false">
<DxTitlePanel id="titlePanel2" text-align="left" title="挂号科室" size="100,100" unit="%,%">
<DxTitlePanel id="titlePanel1" text-align="left" title="挂号科室" size="100,100" unit="%,%">
<DxDataBeds class="DxDataBeds-bed" id="bedGhrq" size="100,100" ds="key:value@" unit="%,%" />
</DxTitlePanel>
</col>

Loading…
Cancel
Save