f47e87fc6ce86dca96f6dc3b7e4623bef7ad558f.svn-base 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. package xin.glue.ui.H.H02;
  2. import java.math.BigDecimal;
  3. import java.sql.CallableStatement;
  4. import java.sql.SQLException;
  5. import java.text.DateFormat;
  6. import java.text.SimpleDateFormat;
  7. import java.util.Date;
  8. import xin.glue.nui.G.G02.SmsProgTcSend;
  9. import xin.glue.ui.common.ProduceFactory;
  10. import com.posdata.glue.PosException;
  11. import com.posdata.glue.biz.activity.PosActivity;
  12. import com.posdata.glue.biz.constants.PosBizControlConstants;
  13. import com.posdata.glue.biz.control.PosBizControlIF;
  14. import com.posdata.glue.biz.control.PosBizProvider;
  15. import com.posdata.glue.component.PosConstants;
  16. import com.posdata.glue.context.PosContext;
  17. import com.posdata.glue.dao.vo.PosParameter;
  18. import com.posdata.glue.dao.vo.PosRow;
  19. import com.posdata.glue.dao.vo.PosRowSet;
  20. import com.posdata.glue.msg.PosMESMessageImpl;
  21. import com.posdata.glue.msg.PosMessage;
  22. import com.posdata.glue.util.log.PosLog;
  23. import com.posdata.glue.util.log.PosLogFactory;
  24. public class PosSaveMillSubResult extends PosActivity
  25. {
  26. static PosLog logger = PosLogFactory.getLogger(PosSaveMillSubResult.class);
  27. public String runActivity(PosContext context)
  28. {
  29. logger.logInfo(" UIH020036 PosSaveMillSubResult save ");
  30. //从页面获取的数据
  31. String[] OLD_SAMPL_NO = (String[])context.get("OLD_SAMPL_NO");
  32. String[] COIL_NO = (String[])context.get("COIL_NO");
  33. String[] COIL_LEN = (String[])context.get("COIL_LEN");
  34. String[] ACT_WGT = (String[])context.get("ACT_WGT");
  35. String[] MONTHJUAN = (String[])context.get("MONTHJUAN");
  36. String[] COIL_INDIA = (String[])context.get("COIL_INDIA");
  37. String[] COIL_OUTDIA = (String[])context.get("COIL_OUTDIA");
  38. String[] UPD_REG = (String[])context.get("UPD_REG");
  39. String[] UPD_DTIME = (String[])context.get("UPD_DTIME");
  40. String[] BC = (String[])context.get("BC");
  41. String[] BZ = (String[])context.get("BZ");
  42. String[] DEC_UPD_DETAIL = (String[])context.get("DEC_UPD_DETAIL");//分卷备注
  43. //String[] CUR_LOAD_LOC = (String[])context.get("CUR_LOAD_LOC");
  44. String countCoil ="";
  45. String countFl = "";
  46. //加入日志
  47. PosParameter paramhis = new PosParameter();
  48. paramhis.setValueParamter(0, COIL_NO[0]);
  49. paramhis.setValueParamter(1, ACT_WGT[0]);
  50. paramhis.setValueParamter(2, COIL_LEN[0]);
  51. paramhis.setValueParamter(3, COIL_INDIA[0]);
  52. paramhis.setValueParamter(4, COIL_OUTDIA[0]);
  53. getDao("mesdao").insert("UIH020036_08.insert", paramhis);
  54. PosParameter paramA = new PosParameter();
  55. paramA.setWhereClauseParameter(0, MONTHJUAN[0]);
  56. PosRowSet rowSetA = getDao("mesdao").find("UIH020036_06.select", paramA); //发货状态中的卷不允许修改
  57. while(rowSetA.hasNext())
  58. {
  59. return PosBizControlConstants.SUCCESS;
  60. }
  61. PosParameter param5 = new PosParameter();
  62. param5.setWhereClauseParameter(0, COIL_NO[0]);
  63. PosRowSet rowSet5 = getDao("mesdao").find("UIH020036_05.select", param5); //根据流水号获取实际钢卷号
  64. while(rowSet5.hasNext())
  65. {
  66. PosRow row = rowSet5.next();
  67. countCoil = row.getAttribute("OLD_SAMPL_NO") == null?"":row.getAttribute("OLD_SAMPL_NO").toString();
  68. }
  69. String coilOrdno = "";
  70. String coilOrdseq = "";
  71. PosParameter paramOrd = new PosParameter();
  72. paramOrd.setWhereClauseParameter(0, COIL_NO[0]);
  73. PosRowSet rowSetOrd = getDao("mesdao").find("UIH020036_08.select", paramOrd);
  74. while(rowSetOrd.hasNext())
  75. {
  76. PosRow ordRow = rowSetOrd.next();
  77. coilOrdno = ordRow.getAttribute("ORD_NO") == null ? "":ordRow.getAttribute("ORD_NO").toString();
  78. coilOrdseq = ordRow.getAttribute("ORD_SEQ") == null ? "":ordRow.getAttribute("ORD_SEQ").toString();
  79. }
  80. if(countCoil.equals("") || countCoil == null)
  81. {
  82. if(ACT_WGT[0].equals("") || ACT_WGT[0] == null||ACT_WGT[0].equals("0"))
  83. return PosBizControlConstants.SUCCESS;//如果新增钢卷重量为空,不允许录入 20220301
  84. PosParameter param = new PosParameter();
  85. param.setValueParamter(0, COIL_NO[0]);
  86. param.setValueParamter(1, COIL_LEN[0]);
  87. param.setValueParamter(2, COIL_INDIA[0]);
  88. param.setValueParamter(3, COIL_OUTDIA[0]);
  89. param.setValueParamter(4, ACT_WGT[0]);
  90. param.setValueParamter(5, coilOrdno);
  91. param.setValueParamter(6, coilOrdseq);
  92. param.setValueParamter(7, COIL_NO[0]);
  93. param.setValueParamter(8, UPD_REG[0]);
  94. param.setValueParamter(9, UPD_DTIME[0]);
  95. param.setValueParamter(10, BC[0]);
  96. param.setValueParamter(11, BZ[0]);
  97. param.setValueParamter(12, DEC_UPD_DETAIL[0]);
  98. param.setValueParamter(13, COIL_NO[0]);
  99. PosParameter paramphy = new PosParameter();
  100. paramphy.setValueParamter(0, COIL_NO[0]);
  101. paramphy.setValueParamter(1, COIL_NO[0]);
  102. PosParameter param8 = new PosParameter();
  103. param8.setWhereClauseParameter(0, COIL_NO[0]);
  104. PosRowSet rowSet8 = getDao("mesdao").find("UIH020036_07.select", param8);
  105. //判断是否为订单才余材
  106. while(rowSet8.hasNext())
  107. {
  108. PosRow row = rowSet8.next();
  109. countFl = row.getAttribute("ORD_FL").toString();
  110. }
  111. //if(countFl.equals("1"))
  112. if(!"".equals(coilOrdno)&&!"".equals(coilOrdseq))
  113. {
  114. getDao("mesdao").insert("UIH020036_01.insert", param);
  115. }
  116. else
  117. {
  118. getDao("mesdao").insert("UIH020036_07.insert", param);
  119. }
  120. getDao("mesdao").insert("UIH020036_phy.insert", paramphy);//写入判定表 1201 17:34
  121. //调用存货异动点存储过程
  122. ProduceFactory PD= new ProduceFactory();
  123. PD.ErpDataCover("HCOIL",COIL_NO[0].substring(0, 12)+"0","11AD","0","O", UPD_REG[0],"热轧分卷母卷");
  124. PD.ErpDataCoverFJ("HCOIL",COIL_NO[0],"11AD","0","N","N",ACT_WGT[0],COIL_NO[0].substring(0, 12)+"0",UPD_REG[0],"热轧分卷子卷");
  125. }
  126. else
  127. {
  128. PosParameter param6 = new PosParameter();
  129. param6.setValueParamter(0, COIL_LEN[0]);
  130. param6.setValueParamter(1, COIL_INDIA[0]);
  131. param6.setValueParamter(2, COIL_OUTDIA[0]);
  132. //param6.setValueParamter(3, ACT_WGT[0]); //更改数据不允许改重量 20220302
  133. /*param6.setValueParamter(4, UPD_REG[0]);
  134. param6.setValueParamter(5, UPD_DTIME[0]);
  135. param6.setValueParamter(6, BC[0]);
  136. param6.setValueParamter(7, BZ[0]);
  137. param6.setValueParamter(8, coilOrdno);
  138. param6.setValueParamter(9, coilOrdseq);
  139. param6.setValueParamter(10, COIL_NO[0]);*/
  140. param6.setValueParamter(3, UPD_REG[0]);
  141. param6.setValueParamter(4, UPD_DTIME[0]);
  142. param6.setValueParamter(5, BC[0]);
  143. param6.setValueParamter(6, BZ[0]);
  144. param6.setValueParamter(7, coilOrdno);
  145. param6.setValueParamter(8, coilOrdseq);
  146. param6.setValueParamter(9, COIL_NO[0]);
  147. getDao("mesdao").update("UIH020036_05.update", param6);
  148. PosParameter paramScd = new PosParameter();
  149. paramScd.setValueParamter(0, COIL_NO[0]);
  150. getDao("mesdao").update("UIH020036_06.update", paramScd);
  151. PosParameter paramSpcd = new PosParameter();
  152. paramSpcd.setValueParamter(0, COIL_NO[0]);
  153. paramSpcd.setValueParamter(1, COIL_NO[0]);
  154. paramSpcd.setValueParamter(2, COIL_NO[0]);
  155. getDao("mesdao").update("UIH020036_07.update", paramSpcd);
  156. return PosBizControlConstants.SUCCESS;
  157. }
  158. PosParameter param7 = new PosParameter();
  159. param7.setValueParamter(0, COIL_NO[0]);
  160. param7.setValueParamter(1, COIL_NO[0]);
  161. getDao("mesdao").insert("UIH020036_06.insert", param7);
  162. String count = "";
  163. PosParameter param1 = new PosParameter();
  164. param1.setWhereClauseParameter(0, COIL_NO[0]);
  165. param1.setWhereClauseParameter(1, COIL_NO[0]);
  166. PosRowSet rowSet = getDao("mesdao").find("UIH020036_02.select", param1);
  167. while(rowSet.hasNext())
  168. {
  169. PosRow row = rowSet.next();
  170. count = row.getAttribute("COIL_NO").toString();
  171. }
  172. if( count.equals("") || count == null)
  173. {
  174. PosParameter paramd = new PosParameter();
  175. paramd.setValueParamter(0, COIL_NO[0]);
  176. paramd.setValueParamter(1, COIL_NO[0]);
  177. paramd.setValueParamter(2, COIL_NO[0]);
  178. getDao("mesdao").insert("UIH020036_02.insert", paramd);
  179. }
  180. String countYard = "";
  181. PosParameter param4 = new PosParameter();
  182. param4.setWhereClauseParameter(0, COIL_NO[0]);
  183. PosRowSet rowSet1 = getDao("mesdao").find("UIH020036_03.select", param4);
  184. while(rowSet1.hasNext())
  185. {
  186. PosRow row = rowSet1.next();
  187. countYard = row.getAttribute("CUR_LOAD_LOC") == null ? "":row.getAttribute("CUR_LOAD_LOC").toString();
  188. }
  189. if( !countYard.equals("") && countYard != null)
  190. {
  191. PosParameter paramd = new PosParameter();
  192. paramd.setValueParamter(0, countYard);
  193. paramd.setValueParamter(1, countYard);
  194. paramd.setValueParamter(2, countYard);
  195. paramd.setValueParamter(3, countYard);
  196. getDao("mesdao").update("UIH020036_02.update", paramd);
  197. }
  198. PosParameter param2 = new PosParameter();
  199. param2.setValueParamter(0, UPD_REG[0]);
  200. param2.setValueParamter(1, UPD_DTIME[0]);
  201. param2.setValueParamter(2, COIL_NO[0]);
  202. getDao("mesdao").update("UIH020036_01.update", param2);
  203. //分析计划子表、总表状态
  204. PosParameter paramScd = new PosParameter();
  205. paramScd.setValueParamter(0, COIL_NO[0]);
  206. getDao("mesdao").update("UIH020036_06.update", paramScd);
  207. PosParameter paramSpcd = new PosParameter();
  208. paramSpcd.setValueParamter(0, COIL_NO[0]);
  209. paramSpcd.setValueParamter(1, COIL_NO[0]);
  210. paramSpcd.setValueParamter(2, COIL_NO[0]);
  211. getDao("mesdao").update("UIH020036_07.update", paramSpcd);
  212. logger.logInfo(" UIH020036 PosSaveMillSubResult save success");
  213. return PosBizControlConstants.SUCCESS;
  214. }
  215. }