| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- package xin.glue.ui.G.G06;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import com.posdata.glue.biz.activity.PosActivity;
- import com.posdata.glue.biz.constants.PosBizControlConstants;
- import com.posdata.glue.component.layout.PosMessageLayoutIF;
- 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.PosMESMessageImpl;
- import com.posdata.glue.msg.PosMessageAttributeDefinition;
- import com.posdata.glue.msg.PosMessageDefinition;
- import com.posdata.glue.util.log.PosLog;
- import com.posdata.glue.util.log.PosLogFactory;
- public class XinMessageLayoutEdit extends PosActivity {
- private final PosLog log = PosLogFactory.getLogger(getClass());
- public String runActivity(PosContext context) {
-
- log.logInfo("======== XinMessageLayoutEdit start " );
-
-
- String[] TC_ID = (String[])context.get("TC_ID");
-
- log.logInfo("======== XinMessageLayoutEdit TC_ID:"+TC_ID[0] );
-
-
-
- List list = new ArrayList();
-
- String sSeqNo = null;
- String sMsgid = null;
- String sMsgName = null;
- String sMsgType = null;
- String sMsgLen = null;
- String sDataValue = null;
- PosParameter param1 = new PosParameter();
- param1.setWhereClauseParameter(0, TC_ID[0]);
- PosRowSet msgVO = this.getDao("mesdao").find("UIG060010_MSG_EDIT.select", param1);
-
- if ( msgVO.hasNext() ) {
- while(msgVO.hasNext()) {
-
- PosRow msgROW = msgVO.next();
- sSeqNo = (String)msgROW.getAttribute("SEQ_NO");
- sMsgid = (String)msgROW.getAttribute("MSG_ID");
- sMsgName = (String)msgROW.getAttribute("MSG_NAME");
- sMsgType = (String)msgROW.getAttribute("DATA_TYPE");
- sMsgLen = (String)msgROW.getAttribute("DATA_LEN");
- sDataValue = (String)msgROW.getAttribute("DATA_VALUE");
-
- /*
- int numSeq = Integer.parseInt(sSeqNo);
-
- if (numSeq < 10) {
- sSeqNo = "00"+sSeqNo;
- } else if (numSeq < 100) {
- sSeqNo = "0"+sSeqNo;
- }
- */
- HashMap map = new HashMap(200,6) ;
- list.add(map);
- map.put("SEQ_NO" , sSeqNo );
- map.put("MSG_ID" , sMsgid );
- map.put("MSG_NAME" , sMsgName );
- map.put("DATA_TYPE" , sMsgType );
- map.put("DATA_LEN" , sMsgLen );
- map.put("DATA_VALUE", sDataValue);
-
- }
- } else {
-
-
- PosMessageLayoutIF layout = (PosMessageLayoutIF) PosContext.getBeanFactory().getBeanObject("layout");
-
-
- PosContext ctx = new PosContext();
- PosMESMessageImpl message = new PosMESMessageImpl();
- message.setTCID(TC_ID[0]);
-
- ctx.setMessage(message);
- PosMessageDefinition def = layout.getAttributes(ctx);
-
- int attrsLength = def.getLength();
-
- for (int i=0; i<attrsLength; i++)
- {
- PosMessageAttributeDefinition attrDef = def.getAttribute(i);
-
- int iSeq = attrDef.getSeq();
- int iLen = attrDef.getLength();
- sSeqNo = String.valueOf(iSeq);
- sMsgLen = String.valueOf(iLen);
-
- int numSeq = Integer.parseInt(sSeqNo);
- if (numSeq < 10) {
- sSeqNo = "00"+sSeqNo;
- } else if (numSeq < 100) {
- sSeqNo = "0"+sSeqNo;
- }
-
- HashMap map = new HashMap(50,6) ;
- list.add(map);
- map.put("SEQ_NO", sSeqNo );
- map.put("MSG_ID", attrDef.getId() );
- map.put("MSG_NAME", attrDef.getName());
- map.put("DATA_TYPE", attrDef.getDatatype());
- map.put("DATA_LEN", sMsgLen);
-
- map.put("DATA_VALUE", " ");
-
-
- }
-
- }
-
- log.logInfo("======== displayMessageDefinitionOldVer context put :" );
-
- context.put("MessageEdit",list);
-
- return PosBizControlConstants.SUCCESS;
- }
- }
|