| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 |
- package xin.glue.nui.F.F02;
- import xin.glue.user.common.GlobalConstants;
- import com.posdata.glue.PosException;
- import com.posdata.glue.biz.activity.PosActivity;
- import com.posdata.glue.biz.constants.PosBizControlConstants;
- import com.posdata.glue.biz.control.PosBizProvider;
- import com.posdata.glue.context.PosContext;
- import com.posdata.glue.msg.PosMESMessageImpl;
- import com.posdata.glue.msg.PosMessage;
- /* Program Name MILLOrdMain (NIF024020)
- * Description MILL INSTRUCTION MANAGEMENT MAIN
- * Write By KIM SUNG HO
- * Date 2008-11-13
- */
- public class MILLOrdMain extends PosActivity implements GlobalConstants {
- /**
- * 轧制顺序调整和指示的主程序
- * 1.检查参数 操作单位 调整方式 操作对象
- * 2.调用各操作方法
- */
- public String runActivity(PosContext context) {
- PosMessage message = context.getMessage();
-
- //P_TYPE(R:ROLL --> ROLL_MANA_NO, S:SLAB --> SLAB_NO)
- String P_TYPE = (String)message.get("TYPE"); //操作类型
- String P_MODE = (String)message.get("MODE"); //调整方法
- String P_FROM = (String)message.get("FROM"); //起始对象
- String P_TO = (String)message.get("TO"); //终点对象
- String P_TARGET = (String)message.get("TARGET"); //目标对象
- String P_POS = (String)message.get("POS"); //移动位置
- String P_REG_ID = (String)message.get("REG_ID"); //用户登录id
-
- // try {
- //PARAMETER CHECK P_TYPE(R:ROLL, S:SLAB)
- //检查操作对象单位(R 轧辊 S 板坯)
- if (!P_TYPE.equals("R") && !P_TYPE.equals("S")) {
-
- //P_MODE PARAMETER ERROR MESSAGE
- logger.logError("MILLOrdMain..P_TYPE IS NOT ('R','S')..");
- context.put("errorMsg", "MILLOrdMain..P_TYPE IS NOT ('R','S')..");
- return PosBizControlConstants.FAILURE;
- //throw new PosException("MILLOrdMain..P_TYPE IS NOT ('R','S')..");
- //throw new PosException("请选择操作单位 按轧辊或者按板坯..");
- }
-
- //PARAMETER CHECK P_MODE(M:MOVE, D:DELETE, U:UNIT, S:SPLIT)
- //检查操作方式
- if (!P_MODE.equals("M") && !P_MODE.equals("D") &&
- !P_MODE.equals("U") && !P_MODE.equals("S")) {
-
- //P_MODE PARAMETER ERROR MESSAGE
- logger.logError("MILLOrdMain..P_MODE IS NOT ('M','D','U','S')..");
- context.put("errorMsg", "MILLOrdMain..P_TARGET IS NULL OR P_POS IS NOT ('B','A')..");
- return PosBizControlConstants.FAILURE;
- //throw new PosException("MILLOrdMain..P_MODE IS NOT ('M','D','U','S')..");
- //throw new PosException("请选择调整方式 移动/删除/合并/分离 ..");
-
- }
-
- //PARAMETER CHECK P_FROM, P_TO
- //检查选择对象
- if (P_FROM == null || P_FROM.equals("") || P_TO == null || P_TO.equals("")) {
-
- //P_MODE PARAMETER ERROR MESSAGE
- logger.logError("MILLOrdMain..P_FROM OR P_TO IS NULL..");
- context.put("errorMsg", "MILLOrdMain..P_FROM OR P_TO IS NULL..");
- return PosBizControlConstants.FAILURE;
- //throw new PosException("MILLOrdMain..P_FROM OR P_TO IS NULL..");
- //throw new PosException("操作对象无 请选择板坯或轧辊对象");
-
- }
- //对轧辊的操作
- if (P_TYPE.equals("R")) { //ROLL
-
- if (P_MODE.equals("M")) {
- //移动操作时的对象检查
- if (P_TARGET == null || P_TARGET.equals("") || (!P_POS.equals("B") && !P_POS.equals("A"))) {
-
- //P_MODE PARAMETER ERROR MESSAGE
- logger.logError("MILLOrdMain..P_TARGET IS NULL OR P_POS IS NOT ('B','A')..");
- context.put("errorMsg", "MILLOrdMain..P_TARGET IS NULL OR P_POS IS NOT ('B','A')..");
- return PosBizControlConstants.FAILURE;
- //throw new PosException("MILLOrdMain..P_TARGET IS NULL OR P_POS IS NOT ('B','A')..");
-
- }
-
- //CALL NIF024030_MillRollSeqChange
- //轧辊顺序调整
- NIF024030_CALL(P_MODE, P_FROM, P_TO, P_TARGET, P_POS, P_REG_ID);
-
- } else if (P_MODE.equals("D")) {
-
- //CALL NIF024060_MillLvlCan
- //轧辊删除
- NIF024060_CALL(P_TYPE, P_FROM, P_TO, P_REG_ID);
- } else if (P_MODE.equals("U")) {
-
- if (P_FROM.equals(P_TO)) {
-
- //P_MODE PARAMETER ERROR MESSAGE
- logger.logError("MILLOrdMain..P_TARGET IS NULL..");
- context.put("errorMsg", "MILLOrdMain..P_FROM / P_TO IS NOT EQUAL..");
- return PosBizControlConstants.FAILURE;
- //throw new PosException("MILLOrdMain..P_FROM / P_TO IS EQUAL..");
-
- }
-
- //CALL NIF024070_MillRollUnion
- //轧辊合并
- NIF024070_CALL(P_FROM, P_TO);
-
- } else if (P_MODE.equals("S")) {
-
- if (!P_FROM.equals(P_TO)) {
-
- //P_MODE PARAMETER ERROR MESSAGE
- logger.logError("MILLOrdMain..P_TARGET IS NULL..");
- context.put("errorMsg", "MILLOrdMain..P_FROM / P_TO IS NOT EQUAL..");
- return PosBizControlConstants.FAILURE;
- //throw new PosException("MILLOrdMain..P_FROM / P_TO IS NOT EQUAL..");
-
- }
- if (P_TARGET == null || P_TARGET.equals("")) {
-
- //P_MODE PARAMETER ERROR MESSAGE
- logger.logError("MILLOrdMain..P_TARGET IS NULL..");
- context.put("errorMsg", "MILLOrdMain..P_TARGET IS NULL..");
- return PosBizControlConstants.FAILURE;
- //throw new PosException("MILLOrdMain..P_TARGET IS NULL..");
-
- }
- //CALL NIF024080_MillRollSplit
- //调用轧辊分离
- NIF024080_CALL(P_FROM, P_TARGET, P_REG_ID);
-
- }
- //对板坯的操作
- } else { //SLAB
- //SLAB
- if (P_MODE.equals("M")) {
-
- if (P_TARGET == null || P_TARGET.equals("") || (!P_POS.equals("B") && !P_POS.equals("A"))) {
-
- //P_MODE PARAMETER ERROR MESSAGE
- logger.logError("MILLOrdMain..P_TARGET IS NULL OR P_POS IS NOT ('B','A')..");
- context.put("errorMsg", "MILLOrdMain..P_TARGET IS NULL OR P_POS IS NOT ('B','A')..");
- return PosBizControlConstants.FAILURE;
- //throw new PosException("MILLOrdMain..P_TARGET IS NULL OR P_POS IS NOT ('B','A')..");
-
- } else {
-
- //CALL NIF024040_MillSlabSeqChange
- //调用板坯顺序的调整
- NIF024040_CALL(P_FROM, P_TO, P_TARGET, P_POS, P_REG_ID);
-
- }
-
- } else if (P_MODE.equals("D")) {
-
- //CALL NIF024060_MillLvlCan
- //调用板坯的删除
- NIF024060_CALL(P_TYPE, P_FROM, P_TO, P_REG_ID);
-
- }
-
- }
-
- // }
- // 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;
-
- }
- /**
- * 轧辊顺序调整SUB_SERVICE
- * @param V_MODE M 移动
- * @param V_FROM 起始对象
- * @param V_TO 终点对象
- * @param V_TARGET 目标对象
- * @param V_POS 移动位置 【前:后】
- * @param V_REG_ID 登录用户id
- * @return
- */
- public PosContext NIF024030_CALL(String V_MODE, String V_FROM, String V_TO, String V_TARGET, String V_POS, String V_REG_ID)
- {
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
-
- //MillRollSeqChange
- String TcId = "NIF024030";
- message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("MODE", V_MODE);
- message.setObject("FROM", V_FROM);
- message.setObject("TO", V_TO);
- message.setObject("TARGET", V_TARGET);
- message.setObject("POS", V_POS);
- message.setObject("REG_ID", V_REG_ID);
- context.setMessage(message);
- message.setTCID(TcId);
-
- String SERVICE_POSTFIX = "-service";
- context.put(PosBizControlConstants.SERVICE_NAME, TcId + SERVICE_POSTFIX);
- PosBizProvider.getController().doSubController(context, false);
-
- String SERVICE_ERR_MSG = (String) context.get("SERVICE_ERR_MSG");
-
- if (SERVICE_ERR_MSG != null)
- {
- throw new PosException(SERVICE_ERR_MSG);
- }
-
- return null;
- }
- public PosContext NIF024040_CALL(String V_FROM, String V_TO, String V_TARGET, String V_POS, String V_REG_ID)
- {
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
-
- //MillSlabSeqChange
- String TcId = "NIF024040";
- message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("FROM", V_FROM);
- message.setObject("TO", V_TO);
- message.setObject("TARGET", V_TARGET);
- message.setObject("POS", V_POS);
- message.setObject("REG_ID", V_REG_ID);
- context.setMessage(message);
- message.setTCID(TcId);
-
- String SERVICE_POSTFIX = "-service";
- context.put(PosBizControlConstants.SERVICE_NAME, TcId + SERVICE_POSTFIX);
- PosBizProvider.getController().doSubController(context, false);
-
- String SERVICE_ERR_MSG = (String) context.get("SERVICE_ERR_MSG");
-
- if (SERVICE_ERR_MSG != null)
- {
- throw new PosException(SERVICE_ERR_MSG);
- }
-
- return null;
- }
- public PosContext NIF024060_CALL(String V_TYPE, String V_FROM, String V_TO, String V_REG_ID)
- {
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
-
- //MillLvlCan
- String TcId = "NIF024060";
- message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("TYPE", V_TYPE);
- message.setObject("FROM", V_FROM);
- message.setObject("TO", V_TO);
- message.setObject("REG_ID", V_REG_ID);
- context.setMessage(message);
- message.setTCID(TcId);
-
- String SERVICE_POSTFIX = "-service";
- context.put(PosBizControlConstants.SERVICE_NAME, TcId + SERVICE_POSTFIX);
- PosBizProvider.getController().doSubController(context, false);
-
- String SERVICE_ERR_MSG = (String) context.get("SERVICE_ERR_MSG");
-
- if (SERVICE_ERR_MSG != null)
- {
- throw new PosException(SERVICE_ERR_MSG);
- }
-
- return null;
- }
- public PosContext NIF024070_CALL(String V_FROM, String V_TO)
- {
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
-
- //MillRollUnion
- String TcId = "NIF024070";
- message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("FROM", V_FROM);
- message.setObject("TO", V_TO);
- context.setMessage(message);
- message.setTCID(TcId);
-
- String SERVICE_POSTFIX = "-service";
- context.put(PosBizControlConstants.SERVICE_NAME, TcId + SERVICE_POSTFIX);
- PosBizProvider.getController().doSubController(context, false);
-
- String SERVICE_ERR_MSG = (String) context.get("SERVICE_ERR_MSG");
-
- if (SERVICE_ERR_MSG != null)
- {
- throw new PosException(SERVICE_ERR_MSG);
- }
-
- return null;
- }
- public PosContext NIF024080_CALL(String V_FROM, String V_TARGET, String V_REG_ID)
- {
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
-
- //MillRollSplit
- String TcId = "NIF024080";
- message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("ROLL_MANA_NO", V_FROM);
- message.setObject("SLAB_NO", V_TARGET);
- message.setObject("REG_ID", V_REG_ID);
- context.setMessage(message);
- message.setTCID(TcId);
-
- String SERVICE_POSTFIX = "-service";
- context.put(PosBizControlConstants.SERVICE_NAME, TcId + SERVICE_POSTFIX);
- PosBizProvider.getController().doSubController(context, false);
-
- String SERVICE_ERR_MSG = (String) context.get("SERVICE_ERR_MSG");
-
- if (SERVICE_ERR_MSG != null)
- {
- throw new PosException(SERVICE_ERR_MSG);
- }
-
- return null;
- }
-
- }
|