| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- package xin.glue.ui.G.G02;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.Map;
- 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.PosGenericDao;
- import com.posdata.glue.dao.vo.PosParameter;
- import com.posdata.glue.dao.vo.PosRow;
- import com.posdata.glue.dao.vo.PosRowSet;
- /**
- * 转炉实绩录入信息
- *
- * BOF实绩查询后,按CHARGE_NO执行更新或插入操作
- * 铁合金、辅料、废料数据更新或插入
- *
- * @author 梅贵平
- * @date 2008-9-1
- */
- public class XinChemEdit extends PosActivity
- {
- public String runActivity(PosContext context)
- {
- logger.logInfo( "XinChemEdit start" );
- PosGenericDao dao = this.getDao("mesdao");
- PosParameter param = null;
- PosRowSet rowset = null;
-
- param = new PosParameter();
- rowset = dao.find("UIG020090_CHMNM.select", param);
- context.put("ChemNM", rowset);//返回成分代码
-
-
- ///get request data
- String[]CHARGE_NO = (String[])context.get("CHARGE_NO");//炉次号
- String[]sProcCd = (String[])context.get("SUBPROC");
- String[] proc = sProcCd[0].split("\\|"); //proc : B,C,L,R,J => BOF,CAS,LF,RH,CCM
-
- for(int i=0;i<proc.length;i++){
- if(proc[i].equals("1")){
- chemGrid(context,proc[i],CHARGE_NO[0],"C" + "chmResult");//proc[i] = '1' 氩后样
- }else
- chemGrid(context,proc[i],CHARGE_NO[0],proc[i] + "chmResult");
- }
- return PosBizControlConstants.SUCCESS;
- }
-
- //result_vo: BchmResult|CchmResult|LchmResult|RchmResult|JchmResult
- private void chemGrid(PosContext context,String sProcCd,String CHARGE_NO,String result_vo){
- PosParameter param = new PosParameter();
- String[][] CHEM_EDIT_DATA = new String[50][100];
-
- param = new PosParameter();
-
- param.setWhereClauseParameter(0, sProcCd);
- param.setWhereClauseParameter(1, sProcCd);
- param.setWhereClauseParameter(2, CHARGE_NO);
- param.setWhereClauseParameter(3, sProcCd);
- param.setWhereClauseParameter(4, sProcCd);
- param.setWhereClauseParameter(5, CHARGE_NO);
-
- PosRowSet chemCdVo = getDao("mesdao").find("UIG020COMM_CHEM_CD.select", param);
- int i = 0;
- int j = 0;
- int ii= 0;
-
- while(chemCdVo.hasNext())
- {
- PosRow chemCdROW = chemCdVo.next();
- String sCHEM_CD = (String)chemCdROW.getAttribute("CHEM_CD");
- String sCHEM_AIM = (String)chemCdROW.getAttribute("SPEC_CHEM_VAL");
- String sCHEM_MIN = (String)chemCdROW.getAttribute("FAC_CHEM_VAL");
- String sCHEM_MAX = (String)chemCdROW.getAttribute("TAFAC_CHEM_VAL");
- System.out.println("------------>" + (String)chemCdROW.getAttribute("CHEM_CD") + "---" + (String)chemCdROW.getAttribute("CHEM_AIM"));
- System.out.println("------------" + i +"-----------***");
- CHEM_EDIT_DATA[0][i] = sCHEM_CD;
- CHEM_EDIT_DATA[3][i] = sCHEM_AIM;
- CHEM_EDIT_DATA[1][i] = sCHEM_MIN;
- CHEM_EDIT_DATA[2][i] = sCHEM_MAX;
-
-
- i++;
- }
- System.out.println("--------->" + i + "----" + CHEM_EDIT_DATA[0].length + "----" + CHEM_EDIT_DATA[1].length + "----" + CHEM_EDIT_DATA[2].length + "----" + CHEM_EDIT_DATA[3].length);
-
- param = new PosParameter();
- param.setWhereClauseParameter(0,CHARGE_NO);
- PosRowSet chemSpeCdVo = getDao("mesdao").find("UIG020COMM_CHEM_SPE.select", param);
- int tag = 0;
- String[] ordArray = new String[10];
- while(chemSpeCdVo.hasNext()){
- PosRow row = chemSpeCdVo.next();
- String ordNo = (String)row.getAttribute("ORD_NO");
- String chemCd =(String)row.getAttribute("CHEM_CD");
- String chemValue =(String)row.getAttribute("CHEM_VALUE");
-
- if(ordArray[0] == null||(!ordArray[tag-1].equals(ordNo))){
- ordArray[tag] = ordNo;
- tag++;
- }
- for ( int m = 0; m < i; m++ ) {
-
- if (chemCd.equals(CHEM_EDIT_DATA[0][m])) {
- System.out.println("--------->" + chemCd + "----" + chemValue);
- CHEM_EDIT_DATA[tag + 3][m] = chemValue;
- break;
- }
- }
- }
-
- PosParameter param1 = new PosParameter();
-
- param1.setWhereClauseParameter(0, sProcCd);
- param1.setWhereClauseParameter(1, sProcCd);
- param1.setWhereClauseParameter(2, CHARGE_NO);
-
- PosRowSet chemVo = getDao("mesdao").find("UIG020COMM_CHEM.select", param1);
-
- while(chemVo.hasNext()) {
- PosRow chemROW = chemVo.next();
- String sCHEM_SEQ = (String)chemROW.getAttribute("CHEM_SEQ");
- String sCHEM_R_CD = (String)chemROW.getAttribute("CHEM_CD");
- String sCHEM_VAL = (String)chemROW.getAttribute("CHEM_VAL");
-
- if(sCHEM_R_CD.equals("S")&&sCHEM_R_CD.equals(CHEM_EDIT_DATA[0][5]))System.out.println("-------------***********************----youasdfasdfasdfas");
-
- int temp = Integer.parseInt(sCHEM_SEQ);
- ii = temp + 3 + tag +1;
- if(j < ii)j = ii;
- for ( int m = 0; m < i; m++ ) {
-
- if (sCHEM_R_CD.equals(CHEM_EDIT_DATA[0][m])) {
- System.out.println("--------->" + sCHEM_R_CD + "----" + sCHEM_VAL);
- CHEM_EDIT_DATA[ii][m] = sCHEM_VAL;
- break;
- }
- }
- }
- System.out.println("000000000000000000" + i + "*******" + ii + "@@@@" + j);
-
-
- for(int tg = 0 ; tg < j+1 ; tg++){
- if(tg == 0)CHEM_EDIT_DATA[0][i] = "xm".toString();
- else if(tg == 1)CHEM_EDIT_DATA[1][i] = "炼钢内控".toString();
- else if(tg == 2)CHEM_EDIT_DATA[2][i] = "炼钢放行".toString();
- else if(tg == 3)CHEM_EDIT_DATA[3][i] = "成品放行".toString();
- else if(tag != 0&& tag + 3 >= tg){
- // for(int t = 0 ; t < tag ; t++){
- CHEM_EDIT_DATA[tg][i] = ordArray[tag+3 -tg];
- System.out.println(ordArray[tag+3-tg]);
- // }
- }
- else CHEM_EDIT_DATA[tg][i] = ("第" + (tg-3-tag) + "次").toString();
- }
- i++;
-
- System.out.println("000000000000000000" + i + "*******" + ii + "@@@@" + j);
- for(int a = 0 ; a< j+1; a++){
-
- for(int b = 0 ; b<i;b++){
- System.out.print(CHEM_EDIT_DATA[a][b] + "-");
- }
- System.out.println("\n");
- }
- ArrayList list = new ArrayList();
-
- for (int idx = 1; idx < j+1; idx++ )
- {
- Map temp = new HashMap(50);
- list.add(temp);
- for ( int idy = 0; idy < i; idy++ )
- {
- temp.put(CHEM_EDIT_DATA[0][idy],CHEM_EDIT_DATA[idx][idy]);
- }
- }
- context.put(result_vo,list);
- }
- }
|