28f451b16dc2f9d23f65d3ae21c5bb60be24775a.svn-base 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. package xin.glue.ui.F.F01;
  2. import java.sql.CallableStatement;
  3. import java.sql.SQLException;
  4. import com.posdata.glue.biz.activity.PosActivity;
  5. import com.posdata.glue.biz.constants.PosBizControlConstants;
  6. import com.posdata.glue.context.PosContext;
  7. import com.posdata.glue.dao.PosGenericDao;
  8. import com.posdata.glue.dao.vo.PosParameter;
  9. import com.posdata.glue.dao.vo.PosRow;
  10. import com.posdata.glue.dao.vo.PosRowSet;
  11. public class changeLinePorc extends PosActivity {
  12. public String runActivity(PosContext context) {
  13. PosGenericDao dao = getDao("mesdao");
  14. PosParameter param;
  15. PosRowSet rowset;
  16. PosRow row;
  17. String[] sChargeManaNo = (String[])context.get("CHARGE_NO");
  18. String[] sCurLineProc = (String[])context.get("CUR_WORK_LINE");
  19. String LinProc = "";
  20. if(sChargeManaNo[0] == null || sCurLineProc[0] == null || sChargeManaNo[0] == "" || sCurLineProc[0] == ""){
  21. context.put("messages", " 错误 炉次号或则作业路线为空!");
  22. return PosBizControlConstants.SUCCESS;
  23. }
  24. param = new PosParameter();
  25. param.setWhereClauseParameter(0, sCurLineProc[0]);
  26. rowset = dao.find("UIF012070_COMM_PATH_CD.find", param);
  27. if(!rowset.hasNext()){
  28. context.put("messages", " 错误 作业路线错误!");
  29. return PosBizControlConstants.SUCCESS;
  30. }else{
  31. row = rowset.next();
  32. LinProc = (String)row.getAttribute("SM_CD");
  33. }
  34. param = new PosParameter();
  35. param.setValueParamter(0, LinProc);
  36. param.setValueParamter(1, sChargeManaNo[0]);
  37. int uptCnt = dao.insert("UIF012070_UPDATE_PROC.insert", param);
  38. if(uptCnt == 0){
  39. context.put("messages", " 操作失败!");
  40. return PosBizControlConstants.SUCCESS;
  41. }
  42. param = new PosParameter();
  43. param.setValueParamter(0, sCurLineProc[0]);
  44. param.setValueParamter(1, LinProc);
  45. param.setValueParamter(2, sChargeManaNo[0]);
  46. uptCnt = dao.update("UIF012070_LINE_PROC_COMM.update", param);
  47. param = new PosParameter();
  48. param.setWhereClauseParameter(0, sChargeManaNo[0]);
  49. CallableStatement cstm = null;
  50. try{
  51. cstm = dao.getCallableStatement("UIF012070_01.CALLSTATEMENT");
  52. cstm.setString(1, sChargeManaNo[0]);
  53. cstm.execute();
  54. }catch(Exception ex){
  55. logger.logError(ex.getMessage(), ex);
  56. }finally
  57. {
  58. if (cstm != null)
  59. {
  60. try
  61. {
  62. cstm.close();
  63. }
  64. catch (SQLException e)
  65. {
  66. logger.logWarn(e.getMessage(), e);
  67. }
  68. }
  69. }
  70. context.put("messages", " 操作成功!");
  71. return PosBizControlConstants.SUCCESS;
  72. }
  73. }