123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- package com.jtgh.cjhs.sync;
- import java.util.List;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Component;
- import com.jtgh.yjpt.entity.jyr.BwEntity;
- import com.jtgh.yjpt.entity.jyr.WxhwpmEntity;
- import com.jtgh.yjpt.entity.zyfzndjy.GkwxhwzyfzblFzEntity;
- import com.jtgh.yjpt.entity.zyfzndjy.GkwxhwzyfzblhhzEntity;
- import com.jtgh.yjpt.entity.zysqbp.ZysqbpEntity;
- import com.jtgh.yjpt.service.cjhs.GkToCjhsService;
- import com.jtgh.yjpt.service.jyr.BwService;
- import com.jtgh.yjpt.service.sys.WxhwpmService;
- import com.jtgh.yjpt.service.zyfzndjy.GkwxhwzyfzService;
- import com.jtgh.yjpt.service.zyfzndjy.GkwxhwzyfzblhhzService;
- import com.jtgh.yjpt.service.zysqbp.ZysqbpService;
- @Component
- public class CjhsSyn {
- @Autowired
- private GkToCjhsService service;
- @Autowired
- private BwService bwService;
- @Autowired
- private GkwxhwzyfzblhhzService gkwxhwzyfzblhhzService;
- @Autowired
- private GkwxhwzyfzService gkwxhwzyfzblFzService;
- @Autowired
- private WxhwpmService wxhwpmService;
- @Autowired
- private ZysqbpService zysqbpService;
- public void execute() {
- saveBw();
- saveFz();
- saveFzxx();
- saveWxhwpm();
- saveZysqbp();
- }
- /**
- * 同步泊位
- */
- private void saveBw() {
- List<BwEntity> list = bwService.findCjhsTb();
- for (BwEntity entity : list) {
- service.saveData(entity);
- }
- }
- /**
- * 同步附证
- */
- private void saveFz() {
- List<GkwxhwzyfzblhhzEntity> list = gkwxhwzyfzblhhzService.findCjhsTb();
- for (GkwxhwzyfzblhhzEntity entity : list) {
- service.saveData(entity);
- List<GkwxhwzyfzblFzEntity> fzxxList = gkwxhwzyfzblFzService.findByFzsq(entity);
- service.saveFzxxDatas(fzxxList);
- }
- }
-
- /**
- * 同步附证信息
- */
- private void saveFzxx() {
- List<GkwxhwzyfzblFzEntity> list = gkwxhwzyfzblFzService.findCjhsTb();
- for (GkwxhwzyfzblFzEntity entity : list) {
- service.saveData(entity);
- }
- }
- /**
- * 同步危险品
- */
- private void saveWxhwpm() {
- List<WxhwpmEntity> list = wxhwpmService.findCjhsTb();
- for (WxhwpmEntity entity : list) {
- service.saveData(entity);
- }
- }
- /**
- * 同步作业申报
- */
- private void saveZysqbp() {
- List<ZysqbpEntity> list = zysqbpService.findCjhsTb();
- for (ZysqbpEntity entity : list) {
- service.saveData(entity);
- }
- }
- }
|