| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- package xin.glue.nui.F.F01;
- import xin.glue.user.common.GlobalConstants;
- import xin.glue.user.common.LogGpError;
- import com.posdata.glue.PosException;
- import com.posdata.glue.biz.activity.PosActivity;
- import com.posdata.glue.biz.constants.PosBizControlConstants;
- import com.posdata.glue.context.PosContext;
- import com.posdata.glue.dao.vo.PosParameter;
- import com.posdata.glue.dao.vo.PosRow;
- import com.posdata.glue.dao.vo.PosRowSet;
- import com.posdata.glue.msg.PosMessage;
- /* Program Name SMSCcmChange (NIF012160)
- * Description SMS WORK INSTRUCTION CCM LINE CHANGING
- * Write By KIM SUNG HO
- * Date 2008-11-10
- */
- public class SMSCcmChange extends PosActivity implements GlobalConstants {
-
- public String runActivity(PosContext context) {
-
- long V_CHARGE_EDT_SEQ = 0 ;
-
- String V_CCM_PRC_LINE = "";
- String V_TREAT_RT_CD = "";
- String V_LINE_PROC_CD = "";
-
- String V_TABLE_ID = "";
- String V_TABLE_MODE = "";
- String V_ERR_DESC = "";
- String V_RTN_NAME = "";
-
- PosMessage message = context.getMessage();
-
- Number P_CHARGE_EDT_SEQ = (Number)message.get("CHARGE_EDT_SEQ");
-
- // try {
-
- //CHARGE_MANA_NO CHECK
- PosParameter param0 = new PosParameter();
- param0.setWhereClauseParameter(0, String.valueOf(P_CHARGE_EDT_SEQ));
- PosRowSet ChargeManaNoInfVO = getDao("mesdao").find("NIF012160_ChargeManaNoInf.select",param0);
- ChargeManaNoInfVO.reset();
-
- if (ChargeManaNoInfVO.hasNext()) {
-
- PosRow ChargeManaNoInfRow = ChargeManaNoInfVO.next();
-
- V_LINE_PROC_CD = (String)ChargeManaNoInfRow.getAttribute("LINE_PROC_CD");
- V_CCM_PRC_LINE = (String)ChargeManaNoInfRow.getAttribute("CCM_PRC_LINE");
- V_CHARGE_EDT_SEQ = Long.parseLong((ChargeManaNoInfRow.getAttribute("CHARGE_EDT_SEQ")==null? "0":ChargeManaNoInfRow.getAttribute("CHARGE_EDT_SEQ")).toString());
-
- } else {
-
- //MESSAGE ERROR --> PROGRAM EXIT
- throw new PosException("SMSCcmChange..Not Found ChargeManaNoInf..");
-
- }
- //CCM LINE CHANGE
- if (V_CCM_PRC_LINE.equals("1")) {
- V_LINE_PROC_CD = V_LINE_PROC_CD.replaceAll("J1", "J2");
- V_CCM_PRC_LINE = "2";
-
- } else {
-
- V_LINE_PROC_CD = V_LINE_PROC_CD.replaceAll("J2", "J1");
- V_CCM_PRC_LINE = "1";
- }
-
- //TREAT_RT_CD CHECK
- PosParameter param1 = new PosParameter();
- param1.setWhereClauseParameter(0, V_LINE_PROC_CD);
- PosRowSet TreatRtInfVO = getDao("mesdao").find("NIF012160_TreatRtInf.select",param1);
- TreatRtInfVO.reset();
-
- if (TreatRtInfVO.hasNext()) {
-
- PosRow TreatRtInfRow = TreatRtInfVO.next();
- V_TREAT_RT_CD = (String)TreatRtInfRow.getAttribute("SM_CD");
-
- } else {
-
- //MESSAGE ERROR --> PROGRAM EXIT
- throw new PosException("SMSCcmChange..Not Found TreatRtInf..");
- }
-
- //CCM LINE CHANGE --> TBF01_SPEC_CHARGE UPDATE
- PosParameter param2 = new PosParameter();
- param2.setWhereClauseParameter(0, V_LINE_PROC_CD);
- param2.setWhereClauseParameter(1, V_TREAT_RT_CD);
- param2.setWhereClauseParameter(2, V_CCM_PRC_LINE);
- param2.setWhereClauseParameter(3, String.valueOf(V_CHARGE_EDT_SEQ));
- int UpdCnt1 = getDao("mesdao").update("NIF012160_ChargeCcmLineUpd.update",param2);
-
- if (UpdCnt1 == 0) {
-
- V_TABLE_ID = "TBF01_SPEC_CHARGE";
- V_TABLE_MODE = "U";
- V_ERR_DESC = "TBF01_SPEC_CHARGE UPDATE COUNT IS ZERO";
- V_RTN_NAME = "SMSCcmChange TBF01_SPEC_CHARGE UPDATE1" + String.valueOf(V_CHARGE_EDT_SEQ);
-
- LogGpError.logMessageToDB("SMSCcmChange", V_TABLE_ID, V_TABLE_MODE, V_ERR_DESC, V_RTN_NAME);
- throw new PosException(V_RTN_NAME);
- }
-
- //CCM LINE CHANGE --> TBF01_CHARGE_IDX UPDATE
- PosParameter param3 = new PosParameter();
- param3.setWhereClauseParameter(0, V_CCM_PRC_LINE);
- param3.setWhereClauseParameter(1, String.valueOf(V_CHARGE_EDT_SEQ));
- int UpdCnt2 = getDao("mesdao").update("NIF012160_ChargeIdxCcmLineUpd.update",param3);
-
- if (UpdCnt2 == 0) {
-
- V_TABLE_ID = "TBF01_CHARGE_IDX";
- V_TABLE_MODE = "U";
- V_ERR_DESC = "TBF01_CHARGE_IDX UPDATE COUNT IS ZERO";
- V_RTN_NAME = "SMSCcmChange TBF01_CHARGE_IDX UPDATE2" + String.valueOf(V_CHARGE_EDT_SEQ);
-
- LogGpError.logMessageToDB("SMSCcmChange", V_TABLE_ID, V_TABLE_MODE, V_ERR_DESC, V_RTN_NAME);
- throw new PosException(V_RTN_NAME);
- }
-
- // }
- // catch (PosException ex)
- // {
- // context.put(SERVICE_ERR_MSG, ex.getMessage());
- // throw ex;
- // }
- // catch (Throwable t)
- // {
- // context.put(SERVICE_ERR_MSG, t.getMessage());
- // throw new PosException(t.getMessage(), t);
- // }
-
- return PosBizControlConstants.SUCCESS;
-
- }
- }
|