| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- package xin.glue.ui.F.F01;
- import java.sql.CallableStatement;
- import java.sql.SQLException;
- 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;
- public class changeLinePorc extends PosActivity {
- public String runActivity(PosContext context) {
- PosGenericDao dao = getDao("mesdao");
- PosParameter param;
- PosRowSet rowset;
- PosRow row;
-
- String[] sChargeManaNo = (String[])context.get("CHARGE_NO");
- String[] sCurLineProc = (String[])context.get("CUR_WORK_LINE");
- String LinProc = "";
- if(sChargeManaNo[0] == null || sCurLineProc[0] == null || sChargeManaNo[0] == "" || sCurLineProc[0] == ""){
- context.put("messages", " 错误 炉次号或则作业路线为空!");
- return PosBizControlConstants.SUCCESS;
- }
- param = new PosParameter();
- param.setWhereClauseParameter(0, sCurLineProc[0]);
- rowset = dao.find("UIF012070_COMM_PATH_CD.find", param);
- if(!rowset.hasNext()){
- context.put("messages", " 错误 作业路线错误!");
- return PosBizControlConstants.SUCCESS;
- }else{
- row = rowset.next();
- LinProc = (String)row.getAttribute("SM_CD");
- }
- param = new PosParameter();
- param.setValueParamter(0, LinProc);
- param.setValueParamter(1, sChargeManaNo[0]);
- int uptCnt = dao.insert("UIF012070_UPDATE_PROC.insert", param);
- if(uptCnt == 0){
- context.put("messages", " 操作失败!");
- return PosBizControlConstants.SUCCESS;
- }
-
- param = new PosParameter();
- param.setValueParamter(0, sCurLineProc[0]);
- param.setValueParamter(1, LinProc);
- param.setValueParamter(2, sChargeManaNo[0]);
- uptCnt = dao.update("UIF012070_LINE_PROC_COMM.update", param);
-
- param = new PosParameter();
- param.setWhereClauseParameter(0, sChargeManaNo[0]);
- CallableStatement cstm = null;
- try{
- cstm = dao.getCallableStatement("UIF012070_01.CALLSTATEMENT");
- cstm.setString(1, sChargeManaNo[0]);
- cstm.execute();
- }catch(Exception ex){
- logger.logError(ex.getMessage(), ex);
- }finally
- {
- if (cstm != null)
- {
- try
- {
- cstm.close();
- }
- catch (SQLException e)
- {
- logger.logWarn(e.getMessage(), e);
- }
- }
- }
-
- context.put("messages", " 操作成功!");
- return PosBizControlConstants.SUCCESS;
- }
- }
|