| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- package xin.glue.ui.B.B01;
- import xin.glue.ui.B.common.SaveModifyHistory;
- import com.posdata.glue.biz.activity.PosActivity;
- import com.posdata.glue.biz.constants.PosBizControlConstants;
- import com.posdata.glue.biz.control.PosBizController;
- import com.posdata.glue.context.PosContext;
- import com.posdata.glue.dao.PosGenericDao;
- import com.posdata.glue.dao.vo.PosParameter;
- /**
- * 客户公差信息保存(对应UIB010280界面)
- * @author 梅贵平
- * @date 2010-08-10
- */
- public class SaveCustDel extends PosActivity
- {
- public String runActivity(PosContext context)
- {
- PosGenericDao dao = this.getDao("mesdao");
- PosParameter param = null;
-
- String INFID = "UIB010280";
-
- String[] CUST_CD = (String[])context.get("CUST_CD");//客户公司代码
- String[] PRDNM_CD = (String[])context.get("PRDNM_CD");//交货状态
- String[] SEQ = (String[])context.get("SEQ");//序号
- String[] PROD_LINE = (String[])context.get("PROD_LINE");//产线
- String[] SPEC_STL_GRD= (String[])context.get("SPEC_STL_GRD");//标准号
-
- String[] DEL_TOL_CD = (String[])context.get("DEL_TOL_CD");//公差名
- String[] TOL_MIN_SYM = (String[])context.get("TOL_MIN_SYM");//下限符号
- String[] TOL_MIN = (String[])context.get("TOL_MIN");//下限值
- String[] TOL_MAX_SYM = (String[])context.get("TOL_MAX_SYM");//上限符号
- String[] TOL_MAX = (String[])context.get("TOL_MAX");//上限值
- String[] DEV_RMK = (String[])context.get("DEV_RMK");//备注
-
- String[] REG_NM = (String[])context.get("REG_ID");
-
- String[] rowStatusA = (String[])context.get("rowStatusA");//插入或者修改标记
- String[] rowStatusD = (String[])context.get("rowStatusD");//删除标记
-
- String custSpecNo = CUST_CD[0]+PRDNM_CD[0]+SEQ[0]+PROD_LINE[0];
- if(rowStatusA != null)
- {
- int len = rowStatusA.length;
- int j = 0;
- for(int i = 0; i < len; i++)
- {
- j = 0;
- param = new PosParameter();
- if("i".equals(rowStatusA[i]))
- {
- param.setValueParamter(j++, custSpecNo);
- param.setValueParamter(j++, DEL_TOL_CD[i]);
- param.setValueParamter(j++, SPEC_STL_GRD[0]);
- param.setValueParamter(j++, TOL_MIN_SYM[i]);
- param.setValueParamter(j++, TOL_MIN[i]);
- param.setValueParamter(j++, TOL_MAX_SYM[i]);
- param.setValueParamter(j++, TOL_MAX[i]);
- param.setValueParamter(j++, DEV_RMK[i]);
- param.setValueParamter(j++, REG_NM[0]);
- dao.insert("UIB010280_01.INSERT", param);
- SaveModifyHistory.writeLog(dao, INFID, "I", "UIB010280_01.INSERT", param.getValueParameters(), "", REG_NM[0]);
- }
- else if("u".equals(rowStatusA[i]))
- {
- param.setWhereClauseParameter(j++, TOL_MIN_SYM[i]);
- param.setWhereClauseParameter(j++, TOL_MIN[i]);
- param.setWhereClauseParameter(j++, TOL_MAX_SYM[i]);
- param.setWhereClauseParameter(j++, TOL_MAX[i]);
- param.setWhereClauseParameter(j++, DEV_RMK[i]);
- param.setWhereClauseParameter(j++, REG_NM[0]);
- param.setWhereClauseParameter(j++, custSpecNo);
- param.setWhereClauseParameter(j++, DEL_TOL_CD[i]);
- dao.update("UIB010280_01.UPDATE", param);
- SaveModifyHistory.writeLog(dao, INFID, "U", "UIB010280_01.UPDATE", param.getWhereClauseParamters(), "", REG_NM[0]);
- }
- else if("d".equals(rowStatusA[i]))
- {
- param.setWhereClauseParameter(j++, custSpecNo);
- param.setWhereClauseParameter(j++, DEL_TOL_CD[i]);
- dao.delete("UIB010280_01.DELETE", param);
- SaveModifyHistory.writeLog(dao, INFID, "D", "UIB010280_01.DELETE", param.getWhereClauseParamters(), "", REG_NM[0]);
- }
- }
- }
-
- if(rowStatusD != null)
- {
- param = new PosParameter();
- param.setWhereClauseParameter(0, custSpecNo);
- dao.delete("UIB010280_02.DELETE", param);
- SaveModifyHistory.writeLog(dao, INFID, "D", "UIB010280_02.DELETE", param.getWhereClauseParamters(), "", REG_NM[0]);
- }
-
- return PosBizControlConstants.SUCCESS;
- }
- }
|