| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- package xin.glue.ui.B.common;
- import java.sql.CallableStatement;
- import java.sql.SQLException;
- 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.PosGenericDao;
- 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;
- /**
- *
- * @Description 炉次改判{界面ID:UIB030202}
- * @author 梅贵平{meiguiping}
- * @date 2009-8-24 下午05:36:47
- * @JDK Version jdk1.4.2
- */
- public class SaveChargeChangeStlgrd extends PosActivity
- {
- public String runActivity(PosContext context)
- {
- String[] CHARGENO = (String[])context.get("CHARGENO");//炉号
- String[] STLGRD = (String[])context.get("STLGRD");//牌号
- String[] REG_ID = (String[])context.get("REG_ID");//改判人
- String[] DCS_DETAIL= (String[])context.get("DCS_DETAIL");//改判说明
- // String[] INGR_GRD = (String[])context.get("INGR_GRD");//直接该为合格
- String[] FAC_CODE = (String[])context.get("FAC_CODE");//板坯去向
-
- //进行板坯是否做过申报的判断
- String sqlc = "SELECT nvl(REPORT_TIME, 'NULL') REPORT_TIME FROM TBG02_SLAB_COMM T WHERE T.CHARGE_NO = ?";
- PosParameter paramc = new PosParameter();
- paramc.setWhereClauseParameter(0,CHARGENO[0] );
- PosRowSet CoilVo1 = getDao("mesdao").findByQueryStatement(sqlc, paramc);
- if (CoilVo1.hasNext()) {
-
- PosRow CoilROW = CoilVo1.next();
- String iflag = (String)CoilROW.getAttribute("REPORT_TIME");
- if(!iflag.equals("NULL"))
- {
- String vtemp="REPORTFLAG";
- context.put("AYY", vtemp);
- return PosBizControlConstants.SUCCESS;
- }
- }
- this.DcsCharge(CHARGENO[0], STLGRD[0], DCS_DETAIL[0] , REG_ID[0] , FAC_CODE[0]);//改判
- //取消计划
- PosParameter param_hcr_mill_fl = new PosParameter();
- param_hcr_mill_fl.setWhereClauseParameter(0, CHARGENO[0]);
- PosRowSet mill_fl_vo = getDao("mesdao").find("NIG020630_HCR_MILL_FL.select", param_hcr_mill_fl);
- mill_fl_vo.reset();
-
- while (mill_fl_vo.hasNext() ) {
- PosRow mill_fl_row = mill_fl_vo.next();
- String lv_slab_no = (String)mill_fl_row.getAttribute("SLAB_NO");
- NIF024060_CALL(lv_slab_no,"XinSaveReturnCharge");
- }
-
- return PosBizControlConstants.SUCCESS;
- }
-
-
- //判定
- public void DcsCharge(String chargeNo , String stlgrd , String DCS_DETAIL , String id , String slabRt)
- {
- PosGenericDao dao = this.getDao("mesdao");
- CallableStatement cstm = null;
-
- cstm = dao.getCallableStatement("UIB030202_02.CALLSTATEMENT");
- try
- {
- cstm.setString(1, chargeNo);
- cstm.setString(2, stlgrd);
- cstm.setString(3, slabRt);
- cstm.setString(4, id);
- cstm.setString(5, DCS_DETAIL);
- cstm.registerOutParameter(6, java.sql.Types.VARCHAR);
- cstm.registerOutParameter(7, java.sql.Types.VARCHAR);
- cstm.execute();
-
- }
- catch(Exception ex)
- {
- logger.logWarn(ex.getMessage(), ex);
- }
- finally
- {
- if (cstm != null)
- {
- try
- {
- cstm.close();
- }
- catch (SQLException e)
- {
- logger.logWarn(e.getMessage(), e);
- }
- }
- }
-
- }
-
- //取消计划
- public PosContext NIF024060_CALL(String V_SLAB_NO, String V_REG_ID)
- {
- PosContext context = new PosContext();
- PosMessage message = new PosMESMessageImpl();
-
- String TcId = "NIF024060";
- message.setTCID(TcId);
- message.setObject("MSG_ID", TcId);
- message.setObject("TYPE", "M");
- message.setObject("FROM" , V_SLAB_NO);
- message.setObject("TO" , V_SLAB_NO);
- 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;
- }
- }
|