| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- package xin.glue.ui.H.H01;
- /********
- 为轧制标准作一个维护厚度组的类,以便厚度组范围变化的时候使用
- ************/
- import com.posdata.glue.biz.activity.PosActivity;
- import com.posdata.glue.biz.constants.PosBizControlConstants;
- import com.posdata.glue.biz.control.PosBizControlIF;
- import com.posdata.glue.biz.control.PosBizProvider;
- import com.posdata.glue.component.PosConstants;
- 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 XINTHKStd extends PosActivity{
- public String runActivity(PosContext context)
- {
- // 从页面获取参数数据,供更新页面使用
- //行状态
- String[] rowStuts = (String[])context.get("rowStuts1");
- //选择标志
- String[] CHK = (String[])context.get("CHK");
- //厚度组
- String[] THK_TGT = (String[])context.get("THK_TGT");
- //钢号
- String[] STL_GRD = (String[])context.get("STL_GRD");
- //下限值
- String[] THK_MIN = (String[])context.get("THK_MIN");
- //下限值符号标志
- String[] THK_MIN_LABEL = (String[])context.get("THK_MIN_LABEL");
- //上限值
- String[] THK_MAX = (String[])context.get("THK_MAX");
- //上限值符号标志
- String[] THK_MAX_LABEL = (String[])context.get("THK_MAX_LABEL");
- //登录人
- String[] REG_ID = (String[])context.get("REG_ID");
- //登录人
- String name = null;
-
- //这里需要获取登录的用户名,但是数组中只有一个存在值,所以循环取出
- for(int j=0;j<REG_ID.length;j++){
- if(!REG_ID[j].equals("") && REG_ID[j] != null){
- name = REG_ID[j];
- }
- }
-
- for(int i=0;i<rowStuts.length;i++){
- //选中的情况,才能够增加或者更新厚度组数据
- if(CHK[i].equals("Y")){
- //这里需要判断厚度组标志是否存在,不存在就更新。存在就插入
- PosParameter param0 = new PosParameter();
- param0.setWhereClauseParameter(0, THK_TGT[i]);
-
- PosRowSet thkVow = getDao("mesdao").find("UIH010030_02.select", param0);
-
- if(thkVow.hasNext()){
- //更新
- PosParameter param1 = new PosParameter();
-
- param1.setWhereClauseParameter(0, STL_GRD[i]);
- param1.setWhereClauseParameter(1, THK_MIN[i]);
- param1.setWhereClauseParameter(2, THK_MIN_LABEL[i]);
- param1.setWhereClauseParameter(3, THK_MAX[i]);
- param1.setWhereClauseParameter(4, THK_MAX_LABEL[i]);
- param1.setWhereClauseParameter(5, name);
- param1.setWhereClauseParameter(6, THK_TGT[i]);
-
- getDao("mesdao").update("UIH010030_01.update", param1);
- logger.logInfo("THKStd---> THK_tgt UPDATE"+param1);
- }else{
- //插入
- //if(!THK_TGT[i].equals("") && THK_TGT[i]!= null){
- PosParameter param1 = new PosParameter();
-
- //param1.setValueParamter(0, THK_TGT[i]);
- param1.setValueParamter(0, STL_GRD[i]);
- param1.setValueParamter(1, THK_MIN[i]);
- param1.setValueParamter(2, THK_MIN_LABEL[i]);
- param1.setValueParamter(3, THK_MAX[i]);
- param1.setValueParamter(4, THK_MAX_LABEL[i]);
- param1.setValueParamter(5, name);
-
- getDao("mesdao").insert("UIH010030_01.insert", param1);
- logger.logInfo("THKStd---> THK_tgt INSERT"+param1);
- //}
- }
- }
- }
-
- return PosBizControlConstants.SUCCESS;
- }
- }
|