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 list = bwService.findCjhsTb(); for (BwEntity entity : list) { service.saveData(entity); } } /** * 同步附证 */ private void saveFz() { List list = gkwxhwzyfzblhhzService.findCjhsTb(); for (GkwxhwzyfzblhhzEntity entity : list) { service.saveData(entity); List fzxxList = gkwxhwzyfzblFzService.findByFzsq(entity); service.saveFzxxDatas(fzxxList); } } /** * 同步附证信息 */ private void saveFzxx() { List list = gkwxhwzyfzblFzService.findCjhsTb(); for (GkwxhwzyfzblFzEntity entity : list) { service.saveData(entity); } } /** * 同步危险品 */ private void saveWxhwpm() { List list = wxhwpmService.findCjhsTb(); for (WxhwpmEntity entity : list) { service.saveData(entity); } } /** * 同步作业申报 */ private void saveZysqbp() { List list = zysqbpService.findCjhsTb(); for (ZysqbpEntity entity : list) { service.saveData(entity); } } }