eb7261330d21c037ce6d926674c3fde0ae015743.svn-base 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. package xin.glue.ui.G.G06;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. import com.posdata.glue.biz.activity.PosActivity;
  5. import com.posdata.glue.biz.constants.PosBizControlConstants;
  6. import com.posdata.glue.biz.control.PosBizControlIF;
  7. import com.posdata.glue.biz.control.PosBizProvider;
  8. import com.posdata.glue.component.PosConstants;
  9. import com.posdata.glue.context.PosContext;
  10. import com.posdata.glue.dao.vo.PosParameter;
  11. import com.posdata.glue.dao.vo.PosRow;
  12. import com.posdata.glue.dao.vo.PosRowSet;
  13. import com.posdata.glue.msg.PosMESMessageImpl;
  14. import com.posdata.glue.msg.PosMessage;
  15. /*
  16. * This program is class moving slab from address to address by crane command
  17. * @author
  18. * @date 2008.08.11
  19. */
  20. public class PosSaveEmpGroup extends PosActivity
  21. {
  22. public String runActivity(PosContext context)
  23. {
  24. String[] status1 = (String[]) context.get("rowStatus");
  25. String[] chk = (String[]) context.get("CHK");
  26. String[] FAC_CD = (String[])context.get("FAC_CD");
  27. String[] PROC_CD = (String[])context.get("PROC_CD");
  28. String[] PROC_TEL = (String[])context.get("PROC_TEL");
  29. String[] WK_GROUP = (String[])context.get("WK_GROUP");
  30. String[] WK_EMP = (String[])context.get("WK_EMP");
  31. String[] WK_EMP_HP = (String[])context.get("WK_EMP_HP");
  32. logger.logInfo("PosSaveEmpGroup- FAC_CD:"+FAC_CD[0] );
  33. int rowset = 0;
  34. if (status1 != null ) {
  35. for (int i = 0 ; i < status1.length ; i++ ) {
  36. if(!(chk[i].equals("Y")))continue ;
  37. if(status1[i].equals("d")){
  38. PosParameter param = new PosParameter();
  39. param.setWhereClauseParameter(0, WK_EMP[i]);
  40. param.setWhereClauseParameter(1, PROC_CD[i]);
  41. param.setWhereClauseParameter(2, FAC_CD[0]);
  42. int cnt = getDao("mesdao").delete("UIG060010_Emp.delete",param);
  43. }else{
  44. PosParameter param1 = new PosParameter();
  45. param1.setWhereClauseParameter(0, WK_EMP[i]);
  46. param1.setWhereClauseParameter(1, PROC_CD[i]);
  47. param1.setWhereClauseParameter(2, FAC_CD[0]);
  48. PosRowSet empVO = getDao("mesdao").find("UIG060010_Emp_Exist.select", param1);
  49. if(empVO.hasNext()) {
  50. PosRow empROW = empVO.next();
  51. PosParameter param2 = new PosParameter();
  52. param2.setValueParamter(0, PROC_TEL[i]);
  53. param2.setValueParamter(1, WK_GROUP[i]);
  54. param2.setValueParamter(2, WK_EMP_HP[i] );
  55. param2.setValueParamter(3, WK_EMP[i] );
  56. param2.setValueParamter(4, PROC_CD[i] );
  57. param2.setValueParamter(5, FAC_CD[0] );
  58. getDao("mesdao").update("UIG060010_Emp.update",param2);
  59. } else {
  60. PosParameter param2 = new PosParameter();
  61. param2.setValueParamter(0, FAC_CD[0]);
  62. param2.setValueParamter(1, PROC_CD[i]);
  63. param2.setValueParamter(2, WK_EMP[i]);
  64. param2.setValueParamter(3, PROC_TEL[i]);
  65. param2.setValueParamter(4, WK_GROUP[i]);
  66. param2.setValueParamter(5, WK_EMP_HP[i]);
  67. getDao("mesdao").update("UIG060010_Emp.insert",param2);
  68. }
  69. }
  70. }
  71. }
  72. return PosBizControlConstants.SUCCESS;
  73. }
  74. }