| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- package xin.glue.nui.G.G02;
- import java.math.BigDecimal;
- 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;
- public class XinCreateSlab extends PosActivity
- {
-
-
- public String runActivity(PosContext context)
- {
- //if(true)return PosBizControlConstants.SUCCESS;
- try{
- PosMessage message = context.getMessage();
-
- //从电文中获取的数据项
- String chargeNo = (String)message.get("CHARGE_NO"); //炉次号
- String planChargeNo = (String)message.get("PLAN_CHARGE_NO"); //计划炉次号
-
- //通过电文中接收的炉次号查询板坯参数表 TBF01_SPEC_CHARGE 取得一个炉次的板坯的数据项 ,修改炼钢公共表 更新板坯公共表,和板坯详细公共表
-
- String sql = "select * from tbg02_charge_comm where CHARGE_NO = ?";
- PosParameter param = new PosParameter();
- param.setWhereClauseParameter(0, chargeNo);
- PosRowSet rowset = this.getDao("mesdao").findByQueryStatement(sql,param);
- if(rowset.hasNext()){
- PosRow row = rowset.next();
- String ROW_CHARGE_STAT = (String)row.getAttribute("CHARGE_STAT");
- if (ROW_CHARGE_STAT != null && ROW_CHARGE_STAT.equals("3")){
- context.put("MESSAGES", "炉次已经结束,不能操作");
- return PosBizControlConstants.SUCCESS;
- }
- }
- param = new PosParameter();
- param.setWhereClauseParameter(0, planChargeNo);
-
- PosRowSet SlabSpecVo = getDao("mesdao").find("NIG020200_SPEC_SLAB.select", param);
- while(SlabSpecVo.hasNext()) {
-
- PosRow SlabSpecROW = SlabSpecVo.next();
- Number sSlabEdtSeq= (Number)SlabSpecROW.getAttribute("SLAB_EDT_SEQ");
- String sPlanSlabNo= (String)SlabSpecROW.getAttribute("SLAB_MANA_NO");
- String sStlGrd = (String)SlabSpecROW.getAttribute("STL_GRD");
- Number sSlabThk = (Number)SlabSpecROW.getAttribute("SLAB_THK");
- Number sSlabWth = (Number)SlabSpecROW.getAttribute("SLAB_WTH");
- Number sSlabLen = (Number)SlabSpecROW.getAttribute("SLAB_LEN");
- Number sSlabWgt = (Number)SlabSpecROW.getAttribute("SLAB_WGT");
- String sProdNmCd = (String)SlabSpecROW.getAttribute("PRODNM_CD");
- String sOrdFl = (String)SlabSpecROW.getAttribute("ORD_FL");
- String sOrdNo = (String)SlabSpecROW.getAttribute("ORD_NO");
- String sOrdSeq = (String)SlabSpecROW.getAttribute("ORD_SEQ");
- String sHcrClf = (String)SlabSpecROW.getAttribute("HCR_CLF");
- String sSpecAbbsym= (String)SlabSpecROW.getAttribute("SPEC_ABBSYM");
- Number ORD_THK = (Number)SlabSpecROW.getAttribute("ORD_THK");
- Number ORD_WTH = (Number)SlabSpecROW.getAttribute("ORD_WTH");
- Number ORD_LEN = (Number)SlabSpecROW.getAttribute("ORD_LEN");
- Number ORD_WGT = (Number)SlabSpecROW.getAttribute("ORD_WGT");
- Number COIL_INDIA = (Number)SlabSpecROW.getAttribute("COIL_INDIA");
- Number COIL_OUTDIA= (Number)SlabSpecROW.getAttribute("COIL_OUTDIA");
- String SLAB_RT = (String)SlabSpecROW.getAttribute("SLAB_RT");
- String CAST_MANA_NO = (String)SlabSpecROW.getAttribute("CAST_MANA_NO");
-
- String sSlabSeq = sPlanSlabNo.substring(10,13);
- String sSlabNo = chargeNo+sSlabSeq;
-
- logger.logDebug("XinCreateSlab sSlabSeq:"+sSlabSeq );
- logger.logDebug("XinCreateSlab sSlabNo:"+sSlabNo );
-
- PosParameter param1 = new PosParameter();
- param1.setWhereClauseParameter(0, sSlabNo);
-
- PosRowSet CreatSlabVo = getDao("mesdao").find("NIG020200_CREATE_SLAB.select", param1);
- if (!CreatSlabVo.hasNext() ) {
-
-
- PosParameter param2 = new PosParameter();
- param2.setValueParamter(0, sSlabNo );
- param2.setValueParamter(1, sPlanSlabNo );
- param2.setValueParamter(2, sStlGrd );
- param2.setValueParamter(3, sSlabThk );
- param2.setValueParamter(4, sSlabWth );
- param2.setValueParamter(5, sSlabLen );
- param2.setValueParamter(6, sSlabWgt );
- param2.setValueParamter(7, sProdNmCd );
- param2.setValueParamter(8, sOrdFl );
- param2.setValueParamter(9, sOrdNo );
- param2.setValueParamter(10, sOrdSeq );
- param2.setValueParamter(11, sHcrClf );
- param2.setValueParamter(12, sSpecAbbsym );
- param2.setValueParamter(13, sOrdFl );
- param2.setValueParamter(14, sOrdNo );
- param2.setValueParamter(15, sOrdSeq );
- param2.setValueParamter(16, ORD_THK );
- param2.setValueParamter(17, ORD_WTH );
- param2.setValueParamter(18, ORD_LEN );
- param2.setValueParamter(19, COIL_INDIA );
- param2.setValueParamter(20, COIL_OUTDIA );
- param2.setValueParamter(21, ORD_WGT );
- param2.setValueParamter(22, SLAB_RT );
- param2.setValueParamter(23, CAST_MANA_NO );
-
- getDao("mesdao").insert("NIG020200_CREATE_SLAB.insert",param2);
-
- PosParameter param3 = new PosParameter();
- param3.setWhereClauseParameter(0, sSlabEdtSeq);
-
- PosRowSet CreatSlabDVo = getDao("mesdao").find("NIG020200_SPEC_SLAB_D.select", param3);
-
- while( CreatSlabDVo.hasNext()) {
- PosRow CreatSlabDROW = CreatSlabDVo.next();
- String S_SLAB_CUT_SEQ = (String)CreatSlabDROW.getAttribute("SLAB_CUT_SEQ");
- Number S_SLAB_THK = (Number)CreatSlabDROW.getAttribute("SLAB_THK");
- Number S_SLAB_WTH = (Number)CreatSlabDROW.getAttribute("SLAB_WTH");
- Number S_SLAB_LEN = (Number)CreatSlabDROW.getAttribute("SLAB_LEN");
- // Number S_SLAB_WGT = (Number)CreatSlabDROW.getAttribute("SLAB_WGT");
- Number S_ORD_THK = (Number)CreatSlabDROW.getAttribute("ORD_THK");
- Number S_ORD_WTH = (Number)CreatSlabDROW.getAttribute("ORD_WTH");
- Number S_ORD_LEN = (Number)CreatSlabDROW.getAttribute("ORD_LEN");
- Number S_ORD_WGT = (Number)CreatSlabDROW.getAttribute("ORD_WGT");
- Number S_COIL_INDIA = (Number)CreatSlabDROW.getAttribute("COIL_INDIA");
- Number S_COIL_OUTDIA = (Number)CreatSlabDROW.getAttribute("COIL_OUTDIA");
- String S_ORD_NO = (String)CreatSlabDROW.getAttribute("ORD_NO");
- String S_ORD_SEQ = (String)CreatSlabDROW.getAttribute("ORD_SEQ");
- String S_ORD_FL = (String)CreatSlabDROW.getAttribute("ORD_FL");
-
- PosParameter param5 = new PosParameter();
- param5.setWhereClauseParameter(0, sSlabNo);
- PosRowSet SalbDVo = getDao("mesdao").find("NIG020200_CREATE_SLAB_D.select", param5);
- if (!SalbDVo.hasNext()) {
-
- PosParameter param4 = new PosParameter();
- param4.setValueParamter(0, sSlabNo );
- param4.setValueParamter(1, S_SLAB_CUT_SEQ );
- param4.setValueParamter(2, S_SLAB_THK );
- param4.setValueParamter(3, S_SLAB_WTH );
- param4.setValueParamter(4, S_SLAB_LEN );
- param4.setValueParamter(5, S_ORD_THK );
- param4.setValueParamter(6, S_ORD_WTH );
- param4.setValueParamter(7, S_ORD_LEN );
- param4.setValueParamter(8, S_ORD_WGT );
- param4.setValueParamter(9, S_COIL_INDIA );
- param4.setValueParamter(10, S_COIL_OUTDIA );
- param4.setValueParamter(11, S_ORD_NO );
- param4.setValueParamter(12, S_ORD_SEQ );
- param4.setValueParamter(13, S_ORD_FL );
-
- getDao("mesdao").insert("NIG020200_CREATE_SLAB_D.insert",param4);
- }
- }
- }
-
- }
- }catch(Exception ex){
- logger.logDebug("NUI SAVE BOFRESULT-------->" + ex);
- logger.logError("NUI SAVE BOFRESULT-------->" + ex);
- }
-
- return PosBizControlConstants.SUCCESS;
- }
- }
|