CjhsSyn.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. package com.jtgh.cjhs.sync;
  2. import java.util.List;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.stereotype.Component;
  5. import com.jtgh.yjpt.entity.jyr.BwEntity;
  6. import com.jtgh.yjpt.entity.jyr.WxhwpmEntity;
  7. import com.jtgh.yjpt.entity.zyfzndjy.GkwxhwzyfzblFzEntity;
  8. import com.jtgh.yjpt.entity.zyfzndjy.GkwxhwzyfzblhhzEntity;
  9. import com.jtgh.yjpt.entity.zysqbp.ZysqbpEntity;
  10. import com.jtgh.yjpt.service.cjhs.GkToCjhsService;
  11. import com.jtgh.yjpt.service.jyr.BwService;
  12. import com.jtgh.yjpt.service.sys.WxhwpmService;
  13. import com.jtgh.yjpt.service.zyfzndjy.GkwxhwzyfzService;
  14. import com.jtgh.yjpt.service.zyfzndjy.GkwxhwzyfzblhhzService;
  15. import com.jtgh.yjpt.service.zysqbp.ZysqbpService;
  16. @Component
  17. public class CjhsSyn {
  18. @Autowired
  19. private GkToCjhsService service;
  20. @Autowired
  21. private BwService bwService;
  22. @Autowired
  23. private GkwxhwzyfzblhhzService gkwxhwzyfzblhhzService;
  24. @Autowired
  25. private GkwxhwzyfzService gkwxhwzyfzblFzService;
  26. @Autowired
  27. private WxhwpmService wxhwpmService;
  28. @Autowired
  29. private ZysqbpService zysqbpService;
  30. public void execute() {
  31. saveBw();
  32. saveFz();
  33. saveFzxx();
  34. saveWxhwpm();
  35. saveZysqbp();
  36. }
  37. /**
  38. * 同步泊位
  39. */
  40. private void saveBw() {
  41. List<BwEntity> list = bwService.findCjhsTb();
  42. for (BwEntity entity : list) {
  43. service.saveData(entity);
  44. }
  45. }
  46. /**
  47. * 同步附证
  48. */
  49. private void saveFz() {
  50. List<GkwxhwzyfzblhhzEntity> list = gkwxhwzyfzblhhzService.findCjhsTb();
  51. for (GkwxhwzyfzblhhzEntity entity : list) {
  52. service.saveData(entity);
  53. List<GkwxhwzyfzblFzEntity> fzxxList = gkwxhwzyfzblFzService.findByFzsq(entity);
  54. service.saveFzxxDatas(fzxxList);
  55. }
  56. }
  57. /**
  58. * 同步附证信息
  59. */
  60. private void saveFzxx() {
  61. List<GkwxhwzyfzblFzEntity> list = gkwxhwzyfzblFzService.findCjhsTb();
  62. for (GkwxhwzyfzblFzEntity entity : list) {
  63. service.saveData(entity);
  64. }
  65. }
  66. /**
  67. * 同步危险品
  68. */
  69. private void saveWxhwpm() {
  70. List<WxhwpmEntity> list = wxhwpmService.findCjhsTb();
  71. for (WxhwpmEntity entity : list) {
  72. service.saveData(entity);
  73. }
  74. }
  75. /**
  76. * 同步作业申报
  77. */
  78. private void saveZysqbp() {
  79. List<ZysqbpEntity> list = zysqbpService.findCjhsTb();
  80. for (ZysqbpEntity entity : list) {
  81. service.saveData(entity);
  82. }
  83. }
  84. }