实战:第十二章:txt文件转xml文件
开发不就这么点事吗,有个啥好bb的
controller
@RequestMapping("/DataDistributionController")
@RestController
public class DataDistributionController {
@Autowired
DataDistributionService dataDistributionService;
@PostMapping("/dataDistribution")
public JSONObject dataDistribution(DataDistributionVo dataDistributionVo){
return dataDistributionService.dataDistribution(dataDistributionVo);
}
}
serviceimpl
import cn.dreamit.dreamweb.util.UUIDGenerator;
import cn.dreamit.one.databus.constant.DatabusConstant;
import cn.dreamit.one.databus.service.DataDistributionService;
import cn.dreamit.one.databus.service.SubscriptionInfoService;
import cn.dreamit.one.databus.vo.DataDistributionVo;
import cn.dreamit.one.databus.vo.SendMqDataVo;
import cn.dreamit.one.entity.SubscriptionEntity;
import cn.dreamit.one.util.StringUtil;
import com.alibaba.fastjson.JSONObject;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.XMLWriter;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.web.multipart.MultipartFile;
import xsf.data.DBManager;
import xsf.data.DbType;
import xsf.data.Parameter;
import xsf.data.Sql;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@Service
public class DataDistributionServiceImpl implements DataDistributionService {
@Autowired
SubscriptionInfoService subscriptionInfoService;
更多内容请见原文,原文转载自:https://blog.csdn.net/weixin_44519496/article/details/120583567