| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211 |
- package xin.glue.nui.E.E03;
- import java.math.BigDecimal;
- import java.sql.CallableStatement;
- import java.sql.SQLException;
- import java.sql.Types;
- 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.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.PosMessage;
- public class RepSaveQZ extends PosActivity {
- String P_RTN_MSG = "";
- String V_MAT_TYPE = "";
- public String runActivity(PosContext context) {
- String[] rowStatus = (String[]) context.get("rowStatus");
- String[] V_MAT_NO = (String[]) context.get("DSP_NO");
- String[] P_REG_ID = (String[]) context.get("P_REG_ID");
- String[] V_ORD_NO = (String[]) context.get("R_ORD_NO");
- String[] V_ORD_SEQ = (String[]) context.get("R_ORD_SEQ");
- String[] V_SIGN_STL = (String[]) context.get("SIGN_STL");
- String[] V_SIGN_CHEN_FEN = (String[]) context.get("SIGN_CHEN_FEN");
- String[] V_SING_CAIZHI = (String[]) context.get("SING_CAIZHI");
- String[] V_SIGN_QIANGZHI = (String[]) context.get("SIGN_QIANGZHI");
- P_REG_ID[0] = (P_REG_ID == null || "".equals(P_REG_ID[0])) ? " no user "
- : P_REG_ID[0];
- for (int i = 0; i < rowStatus.length; i++) {
- CallableStatement cStmt = null;
- PosRowSet MatVO = null;
- cStmt = this.getDao("mesdao").getCallableStatement(
- "callNIE03_SERVEAS");
- try {
- if (cStmt != null) {
- cStmt.setString(1, V_MAT_NO[i]);
- cStmt.setString(2, V_ORD_NO[0]);
- cStmt.setString(3, V_ORD_SEQ[0]);
- cStmt.setString(4, V_SIGN_STL[0]);
- cStmt.setString(5, V_SIGN_CHEN_FEN[0]);
- cStmt.setString(6, V_SING_CAIZHI[0]);
- cStmt.setString(7, V_SIGN_QIANGZHI[0]);
- cStmt.setString(8, P_REG_ID[0]);
- cStmt.registerOutParameter(9, Types.VARCHAR);
- cStmt.execute();
- P_RTN_MSG = cStmt.getString(9);
- // NIF024050_CALL(P_TYPE,P_ST,P_EN);
- }
- } catch (SQLException e) {
- // e.printStackTrace();
- logger.logError(e.getMessage());
- context.put("errorMsg", e.getMessage());
- return PosBizControlConstants.FAILURE;
- //throw new PosException(e.getMessage());
- //logger.logError(e);
- //isSuccess = false;
- } finally {
- if (cStmt != null) {
- try {
- cStmt.close();
- } catch (SQLException e) {
- logger.logWarn(e.getMessage(), e);
- }
- }
- }
- if (P_RTN_MSG == null || "".equals(P_RTN_MSG)) {
- ;
- } else {
- logger.logError(P_RTN_MSG);
- context.put("errorMsg", P_RTN_MSG);
- return PosBizControlConstants.FAILURE;
- }
- PosParameter param = new PosParameter();
- param.setWhereClauseParameter(0, V_MAT_NO[i]);
- if ('J' == (V_MAT_NO[0].charAt(0))) {
- V_MAT_TYPE = "TM";
- MatVO = getDao("mesdao")
- .find("UIF031046_SlabInf.select", param);
- } else if ('R' == (V_MAT_NO[0].charAt(0))) {
- V_MAT_TYPE = "AR";
- MatVO = getDao("mesdao")
- .find("UIF031046_CoilInf.select", param);
- } else {
- }
- MatVO.reset();
- while (MatVO.hasNext()) {
- PosRow MatInfRow = MatVO.next();
- String LV_MAT_NO = (String) MatInfRow.getAttribute("MAT_NO");
- long LV_MAT_WGT = Long.parseLong((MatInfRow
- .getAttribute("MAT_WGT") == null ? "0" : MatInfRow
- .getAttribute("MAT_WGT")).toString());
- String LV_BEF_ORD_NO = (String) MatInfRow
- .getAttribute("ORG_ORD_NO") == null ? ""
- : (String) MatInfRow.getAttribute("ORG_ORD_NO");
- String LV_BEF_PROG_CD = (String) MatInfRow
- .getAttribute("BEF_PROG_CD") == null ? ""
- : (String) MatInfRow.getAttribute("BEF_PROG_CD");
- String LV_BEF_ORD_SEQ = (String) MatInfRow
- .getAttribute("ORG_ORD_SEQ") == null ? ""
- : (String) MatInfRow.getAttribute("ORG_ORD_SEQ");
- String LV_CUR_PROG_CD = (String) MatInfRow
- .getAttribute("CUR_PROG_CD") == null ? ""
- : (String) MatInfRow.getAttribute("CUR_PROG_CD");
- // CALL NIE012070_SaveOrdSts
- NIE012070_CALL(LV_MAT_NO, LV_MAT_WGT, V_ORD_NO[0],
- V_ORD_SEQ[0], LV_BEF_ORD_NO, LV_BEF_ORD_SEQ,
- LV_BEF_PROG_CD, LV_CUR_PROG_CD, V_MAT_TYPE, P_REG_ID[0]);
- } // SlabInfVO while END
- }
- NIE012080_CALL();
- if (new OrdChk(V_ORD_NO[0], V_ORD_SEQ[0]).isOver()) {
- throw new PosException("¶©µ¥³¬Á¿...RepSaveQZ.OrdChk.isOver..."
- + V_ORD_NO[0] + " - " + V_ORD_SEQ[0]);
- }
- ;
- return PosBizControlConstants.SUCCESS;
- }
- public PosContext NIE012070_CALL(String P_MAT_NO, long V_WGT,
- String V_ORD_NO, String V_ORD_SEQ, String P_BEF_ORD_NO,
- String P_BEF_ORD_SEQ, String P_BEF_PROG_CD, String P_CUR_PROG_CD,
- String P_MAT_TYPE, String V_REG_ID) {
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
- // SaveOrdSts
- String TcId = "NIE012070";
- message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("BEF_ORD_NO", P_BEF_ORD_NO);
- message.setObject("BEF_ORD_SEQ", P_BEF_ORD_SEQ);
- message.setObject("ORD_NO", V_ORD_NO);
- message.setObject("ORD_SEQ", V_ORD_SEQ);
- message.setObject("BEF_PROG_CD", P_BEF_PROG_CD);
- message.setObject("PROG_CD", P_CUR_PROG_CD);
- message.setObject("MAT_TYPE", P_MAT_TYPE);
- message.setObject("MAT_NO", P_MAT_NO);
- message.setObject("WGT", new BigDecimal(V_WGT));
- message.setObject("PGMID", "OrdRepSaveQZ");
- 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 context;
- }
- public PosContext NIE012080_CALL() {
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
- // OrdStsMain
- String TcId = "NIE012080";
- message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("AA", "");
- 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 context;
- }
- }
|