📄 wdscmbwhblh.java
字号:
resEvent.setRetStr("删除模板指标,模板编码:" +
mbbm +
", 模板类别:" + mblb + ", 指标信息:" + delmsg + "(删除" + String.valueOf(i) + "条)。");
} catch (Exception e) {
throw new TaxBaseSystemException(e.getMessage());
}
resEvent.setRepCode("0");
return resEvent;
}
private ResponseEvent IupdateMbNr(WDSCmbwhReqEvent reqEvent) throws TaxBaseSystemException {
WDSCmbwhResEvent resEvent = new WDSCmbwhResEvent();
String mbnr = reqEvent.getMbnr();
String mbbm = reqEvent.getMbbm();
String mblb = reqEvent.getMB_LB();
try {
//System.out.println("模板内容:\r\n" + mbnr);
updateMbNr(mbbm, mbnr, mblb);
resEvent.setRetStr("更新模板内容,模板编码:" + mbbm + ", 模板编码:" + mblb + "。");
} catch (Exception e) {
throw new TaxBaseSystemException(e.getMessage());
}
resEvent.setRepCode("0");
return resEvent;
}
//得到 没有被指定模板选中的指标信息
private ResponseEvent IgetZbMsgNotInMb (WDSCmbwhReqEvent reqEvent) throws TaxBaseSystemException{
WDSCmbwhResEvent resEvent = new WDSCmbwhResEvent();
String mbbm = reqEvent.getMbbm();
String mblb = reqEvent.getMB_LB();
try {
Vector vVo = new Vector();
WDSCmbwhVO mbwhVo = null;
DMzbglDAO zbDao = null;
List list = getZbMsgNotInMb(mbbm, mblb);
if (list != null) {
for (int i = 0; i < list.size(); i++) {
mbwhVo = new WDSCmbwhVO();
zbDao = (DMzbglDAO)list.get(i);
mbwhVo.setMbbm(zbDao.getMB_DM());
mbwhVo.setZbdm(zbDao.getZB_DM());
mbwhVo.setZbmc(zbDao.getMC());
vVo.add(mbwhVo);
}
}
resEvent.setVZbMsg(vVo);
resEvent.setRetStr("得到所有模板指标信息(不含指定模板包含的指标),模板编码:" + mbbm + "。");
} catch (Exception e) {
throw new TaxBaseSystemException(e.getMessage());
}
resEvent.setRepCode("0");
return resEvent;
}
//getCurrMbZb
private ResponseEvent IgetCurrMbZb (WDSCmbwhReqEvent reqEvent) throws TaxBaseSystemException{
WDSCmbwhResEvent resEvent = new WDSCmbwhResEvent();
String mbbm = reqEvent.getMbbm();
String mblb = reqEvent.getMB_LB();
try {
Vector vVo = new Vector();
WDSCmbwhVO mbwhVo = null;
DMzbglDAO zbDao = null;
List list = getCurrMbZb(mbbm, mblb);
if (list != null) {
for (int i = 0; i < list.size(); i++) {
mbwhVo = new WDSCmbwhVO();
zbDao = (DMzbglDAO)list.get(i);
mbwhVo.setMbbm(zbDao.getMB_DM());
mbwhVo.setZbdm(zbDao.getZB_DM());
mbwhVo.setZbmc(zbDao.getMC());
vVo.add(mbwhVo);
}
}
WDSCconstant constant = new WDSCconstant(vVo);
vVo = constant.addSysZbToVo(vVo);
resEvent.setVZbMsg(vVo);
resEvent.setRetStr("得到当前模板指标信息,模板编码:" + mbbm + ", 模板类别:" + mblb + "。");
} catch (Exception e) {
throw new TaxBaseSystemException(e.getMessage());
}
resEvent.setRepCode("0");
return resEvent;
}
//getCurrMbNr
private ResponseEvent IgetCurrMbNr (WDSCmbwhReqEvent reqEvent) throws TaxBaseSystemException{
WDSCmbwhResEvent resEvent = new WDSCmbwhResEvent();
String mbbm = reqEvent.getMbbm();
String mblb = reqEvent.getMB_LB();
String swjg = reqEvent.getSwjg();
WDSCmbwhVO mbwhVo = new WDSCmbwhVO();
try {
String nr = getCurrMbNr(mbbm, mblb, swjg);
mbwhVo.setMbbm(mbbm);
mbwhVo.setMbnr(nr);
resEvent.setMbwhNrVo(mbwhVo);
} catch (Exception e) {
throw new TaxBaseSystemException(e.getMessage());
}
resEvent.setRepCode("0");
return resEvent;
}
public ResponseEvent IaddWdMb (WDSCmbwhReqEvent reqEvent) throws TaxBaseSystemException {
WDSCmbwhResEvent resEvent = new WDSCmbwhResEvent();
WDSCwdmbDAO wdmb = new WDSCwdmbDAO();
String mbbm = reqEvent.getMbbm();
wdmb.setMB_DM(mbbm);
String mbmc = reqEvent.getMB_MC();
wdmb.setMB_MC((mbmc));
String mblb = reqEvent.getMB_LB();
wdmb.setMB_LB(mblb);
String swjg = reqEvent.getSwjg();
swjg = "%";
wdmb.setMB_SWJG(swjg);
wdmb.setMB_CZY("000000");
wdmb.setSCSJ(new Date());
wdmb.setMB_ENABLE(reqEvent.getMB_ENABLE());
//加入模板指标
String addMsg = reqEvent.getAddZbElement();
if (addMsg != null) {
Vector v = this.getMbZb(addMsg, mbbm, mblb);
wdmb.setMB_ZB_MSG(v);
}
//加入模板内容
String mbnr = reqEvent.getMbnr();
if (mbnr != null) {
wdmb.setMB_NR_BUFFER(new StringBuffer(mbnr));
}
try {
wdmb.insertWdMb();
try {
wdmb.execProc();
} catch (Exception e) {//将模板插入到T_GZDA失败
System.out.println(e.getMessage());
}
} catch (Exception e) {
throw new TaxBaseSystemException(e.getMessage());
}
resEvent.setRepCode("0");
return resEvent;
}
//getCurrMbNr
//删除单个模板接口
private ResponseEvent IdelWdMb (WDSCmbwhReqEvent reqEvent) throws TaxBaseSystemException{
WDSCmbwhResEvent resEvent = new WDSCmbwhResEvent();
String mbbm = reqEvent.getMbbm();
String swjg = reqEvent.getSwjg();
try {
WDSCwdmbDAO wdmb = new WDSCwdmbDAO();
wdmb.setMB_DM(mbbm);
wdmb.setMB_SWJG(swjg);
wdmb.deleteWdMb();
} catch (Exception e) {
throw new TaxBaseSystemException(e.getMessage());
}
resEvent.setRepCode("0");
return resEvent;
}
//删除多个模板接口
//
private ResponseEvent IdelSomeWdMb (WDSCmbwhReqEvent reqEvent) throws TaxBaseSystemException{
WDSCmbwhResEvent resEvent = new WDSCmbwhResEvent();
String delWdMbMsg = reqEvent.getDelWdMbMsg();
String delArray[] = delWdMbMsg.split("#");
String queryCondition = "";
try {
for (int i=0; i<delArray.length; i++) {
String tempElem = delArray[i];
String cond = "";
if (tempElem.length() > 1) {
String elem[] = tempElem.split(",");
if (elem.length >= 2) {
cond = " (MB_DM ='" + elem[0] + "' AND MB_SWJG like '" +
elem[2] + "' AND MB_LB ='" + elem[1] + "') ";
if (i != delArray.length - 1) {
queryCondition += cond + " OR";
} else {
queryCondition += cond;
}
}
}
}
WDSCwdmbDAO wdmb = new WDSCwdmbDAO();
wdmb.delSomeWdMb(queryCondition);
try {
wdmb.execProc();
} catch (Exception e) {//将模板插入到T_GZDA失败
System.out.println(e.getMessage());
}
} catch (Exception e) {
e.printStackTrace();
throw new TaxBaseSystemException(e.getMessage());
}
resEvent.setRepCode("0");
return resEvent;
}
//模板代码是否存在
private ResponseEvent IgetMbDmIsExist (WDSCmbwhReqEvent reqEvent) throws TaxBaseSystemException {
WDSCmbwhResEvent resEvent = new WDSCmbwhResEvent();
String mbdm = reqEvent.getMbbm();
String mblb = reqEvent.getMB_LB();
String swjg = reqEvent.getSwjg(); swjg = ((swjg.equals(""))?"%":swjg);
try {
WDSCwdmbDAO mbwh = new WDSCwdmbDAO();
mbwh.setMB_DM(mbdm);
mbwh.setMB_LB(mblb);
mbwh.setMB_SWJG(swjg);
boolean b = mbwh.getMbDmIsExist();
resEvent.setIsExistMbDm(b);
} catch (Exception e) {
throw new TaxBaseSystemException(e.getMessage());
}
resEvent.setRepCode("0");
return resEvent;
}
private ResponseEvent IupdateWdMb (WDSCmbwhReqEvent reqEvent) throws TaxBaseSystemException {
WDSCmbwhResEvent resEvent = new WDSCmbwhResEvent();
String mbdm = reqEvent.getMbbm();
String new_mbdm = reqEvent.getNew_mbbm();
String mbmc = reqEvent.getMB_MC();
String mblb = reqEvent.getMB_LB();
String new_mblb = reqEvent.getNEW_MB_LB();
String mbqybz = reqEvent.getMB_ENABLE();
String mbswjg = reqEvent.getSwjg();
String new_mbswjg = reqEvent.getNew_swjg();
try {
WDSCwdmbDAO mbwh = new WDSCwdmbDAO();
mbwh.setMB_DM(mbdm);
mbwh.setNEW_MB_DM(new_mbdm);
mbwh.setMB_MC(mbmc);
mbwh.setMB_LB(mblb);
mbwh.setNEW_MB_LB(new_mblb);
mbwh.setMB_ENABLE(mbqybz);
mbwh.setMB_CZY("00000000");
mbwh.setMB_SWJG(mbswjg);
mbwh.setNEW_MB_SWJG(new_mbswjg);
mbwh.updateWdMbWithOutMbNr();
try {
mbwh.execProc();
} catch (Exception e) {//将模板插入到T_GZDA失败
System.out.println(e.getMessage());
}
} catch (Exception e) {
throw new TaxBaseSystemException(e.getMessage());
}
resEvent.setRepCode("0");
return resEvent;
}
protected ResponseEvent performTask(RequestEvent req) throws
TaxBaseSystemException, TaxBaseBizException {
WDSCmbwhReqEvent mbwhReq = (WDSCmbwhReqEvent)req;
ResponseEvent res = new ResponseEvent();
String dealMethod = req.getDealMethod();
try {
if ("IaddMbZb".equals(dealMethod)) {
res = this.IaddMbZb(mbwhReq);
} else if ("IdelMbZb".equals(dealMethod)) {
res = this.IdelMbZb(mbwhReq);
} else if ("IupdateMbNr".equals(dealMethod)) {
res = this.IupdateMbNr(mbwhReq);
} else if ("IgetZbMsgNotInMb".equals(dealMethod)) {
res = this.IgetZbMsgNotInMb(mbwhReq);
} else if ("IgetCurrMbZb".equals(dealMethod)) {
res = this.IgetCurrMbZb(mbwhReq);
} else if ("IgetCurrMbNr".equals(dealMethod)) {
res = this.IgetCurrMbNr(mbwhReq);
} else if ("IaddWdMb".equals(dealMethod)) {
res = this.IaddWdMb(mbwhReq);
} else if ("IgetWdMbMsg".equals(dealMethod)) {
res = this.IgetWdMbMsg(mbwhReq);
} else if ("IgetMbDmIsExist".equals(dealMethod)) {
res = this.IgetMbDmIsExist(mbwhReq);
} else if ("IdelSomeWdMb".equals(dealMethod)) {
res = this.IdelSomeWdMb(mbwhReq);
} else if ("IupdateWdMb".equals(dealMethod)) {
res = this.IupdateWdMb(mbwhReq);
}
}catch(Exception e) {
e.printStackTrace();
throw new TaxBaseSystemException(e.getMessage());
}
return res;
}
protected ResponseEvent validateData(RequestEvent req) throws Exception {
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -