| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- package xin.glue.ui.H.H05;
- import xin.glue.ui.common.PosGridSave;
- //import xin.glue.ui.common.component.PosSiteConfig;
- import xin.glue.ui.common.component.PosSiteLog;
- 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.PosRowSet;
- /*
- * 钢卷仓库CRANE 命令执行
- * @author TangLiang 唐亮
- * 由于钢卷库标准登录与查询新增和修改时,更新的信息是根据种类和钢卷存放信息来判断的。
- * 如果已经存在种类和钢卷存放信息就更新,不存在就插入。rowStuts标识位无法起到判断左右
- * @data 2008.11.17
- */
- public class SaveSCOIL_NO extends PosActivity{
- public String runActivity(PosContext context)
- {
- // 从页面获取数据供插入和更新使用
- //行状态
- String[] rowStuts = (String[]) context.get("rowStuts");
- //选择标志
- String[] CHK = (String[]) context.get("CHK");
- //种类
- String[] AREA_KIND = (String[]) context.get("AREA_KIND");
- //钢卷存放地址信息
- String[] YARD_ADDR = (String[]) context.get("YARD_ADDR");
- //来源钢号
- String[] FROM_STL_GRD = (String[]) context.get("FROM_STL_GRD");
- //去向钢号
- String[] TO_STL_GRD = (String[]) context.get("TO_STL_GRD");
- //钢号1
- String[] STL_GRD1 = (String[]) context.get("STL_GRD1");
- //钢号2
- String[] STL_GRD2 = (String[]) context.get("STL_GRD2");
- //钢号3
- String[] STL_GRD3 = (String[]) context.get("STL_GRD3");
- //钢号4
- String[] STL_GRD4 = (String[]) context.get("STL_GRD4");
- //钢号5
- String[] STL_GRD5 = (String[]) context.get("STL_GRD5");
- //钢号6
- String[] STL_GRD6 = (String[]) context.get("STL_GRD6");
- //钢号7
- String[] STL_GRD7 = (String[]) context.get("STL_GRD7");
- //循环rowStuts,取出相应的接点行数
- for(int i=0;i<rowStuts.length;i++){
- //如果选择标志为Y的情况,说明是需要操作的。
- if(CHK[i].equals("Y")){
- // 定义查询sql语句
- String sql = "select area_kind,yard_addr from TBH05_YARD_STD_STOCK where area_kind = ? and yard_addr = ? ";
- PosParameter param0 = new PosParameter();
-
- param0.setWhereClauseParameter(0, AREA_KIND[i]);
- param0.setWhereClauseParameter(1, YARD_ADDR[i]);
-
- PosRowSet rows = getDao("mesdao").findByQueryStatement(sql, param0);
-
- if(rows.hasNext()){
- //更新操作
- PosParameter param1 = new PosParameter();
-
- param1.setWhereClauseParameter(0, FROM_STL_GRD[i]);
- param1.setWhereClauseParameter(1, TO_STL_GRD[i]);
- param1.setWhereClauseParameter(2, STL_GRD1[i]);
- param1.setWhereClauseParameter(3, STL_GRD2[i]);
- param1.setWhereClauseParameter(4, STL_GRD3[i]);
- param1.setWhereClauseParameter(5, STL_GRD4[i]);
- param1.setWhereClauseParameter(6, STL_GRD5[i]);
- param1.setWhereClauseParameter(7, STL_GRD6[i]);
- param1.setWhereClauseParameter(8, STL_GRD7[i]);
- param1.setWhereClauseParameter(9, AREA_KIND[i]);
- param1.setWhereClauseParameter(10, YARD_ADDR[i]);
-
- getDao("mesdao").update("UIH050100_01.update", param1);
-
- //打印日志
- // if (PosSiteConfig.writeLog)
- // PosSiteLog.writeLog(context, getDao("mesdao"),"UIH050100_01.update", param1.getWhereClauseParamters());
- }else{
- //插入操作
- PosParameter param1 = new PosParameter();
- param1.setValueParamter(0, AREA_KIND[i]);
- param1.setValueParamter(1, YARD_ADDR[i]);
- param1.setValueParamter(2, FROM_STL_GRD[i]);
- param1.setValueParamter(3, TO_STL_GRD[i]);
- param1.setValueParamter(4, STL_GRD1[i]);
- param1.setValueParamter(5, STL_GRD2[i]);
- param1.setValueParamter(6, STL_GRD3[i]);
- param1.setValueParamter(7, STL_GRD4[i]);
- param1.setValueParamter(8, STL_GRD5[i]);
- param1.setValueParamter(9, STL_GRD6[i]);
- param1.setValueParamter(10, STL_GRD7[i]);
-
- getDao("mesdao").insert("UIH050100_01.insert", param1);
-
- // 打印日志
- // if (PosSiteConfig.writeLog)
- // PosSiteLog.writeLog(context, getDao("mesdao"),"UIH050100_01.insert", param1.getValueParameters());
- }
- }
- }
- return PosBizControlConstants.SUCCESS;
- }
- }
|