package com.unis.basic.info.modular.mq.pub;


import com.alibaba.fastjson.JSON;
import com.google.gson.Gson;

import com.unis.basic.info.modular.mq.constant.TopicConstant;
import com.unis.basic.info.modular.mq.dto.RecevieDTO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;



@Service
public class RecPublishService {

	@Resource
	private PublishService publishService;

    public void sendMessage(String czbz, String tableName, String ywId, Integer orgId) {
		// TODO Auto-generated method stub
    	RecevieDTO recevieDTO = new RecevieDTO();
    	recevieDTO.setCzbz(czbz);
    	recevieDTO.setOrgId(orgId);
    	recevieDTO.setTableName(tableName);
    	recevieDTO.setYwId(ywId);
		publishService.sendMessage(TopicConstant.DEPOT_TOPIC_NAME, JSON.toJSONString(recevieDTO));
	}
}