12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- package com.steerinfo.dil.controller;
- import com.steerinfo.dil.feign.ESFeign;
- import com.steerinfo.dil.service.ITmstruckSmsRusultService;
- import com.steerinfo.dil.util.BaseRESTfulController;
- import com.steerinfo.dil.util.ColumnDataUtil;
- import com.steerinfo.dil.util.DataChange;
- import com.steerinfo.dil.util.PageListAdd;
- import com.steerinfo.framework.controller.RESTfulResult;
- import com.steerinfo.framework.service.pagehelper.PageHelper;
- import io.swagger.annotations.ApiImplicitParam;
- import io.swagger.annotations.ApiImplicitParams;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.text.SimpleDateFormat;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- /**
- * TmstruckSmsRusult RESTful接口:
- * @author generator
- * @version 1.0-SNAPSHORT 2021-10-18 09:19
- * 类描述
- * 修订历史:
- * 日期:2021-10-18
- * 作者:generator
- * 参考:
- * 描述:TmstruckSmsRusult RESTful接口
- * @see null
- * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
- */
- @RestController
- @RequestMapping("/${api.version}/tmstrucksmsrusults")
- public class TmstruckSmsRusultController extends BaseRESTfulController{
- @Autowired
- ITmstruckSmsRusultService tmstruckSmsRusultService;
- @Autowired
- ESFeign esFeign;
- @Autowired
- ColumnDataUtil columnDataUtil;
- private final SimpleDateFormat sdfDateTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- //查询短信实绩
- @ApiOperation(value="查询短信实绩")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "mapValue", value = "表头和参数", required = false, dataType = "map"),
- @ApiImplicitParam(name = "apiId(175)", value = "动态表头", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageNum", value = "页码", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "页", required = false, dataType = "Integer"),
- })
- @PostMapping("/getSmsResult")
- public RESTfulResult getSmsResult(@RequestBody(required=false) Map<String,Object> mapValue,
- Integer apiId,
- Integer pageNum,
- Integer pageSize,
- String con
- ){
- PageHelper.startPage(pageNum,pageSize);
- if(con!=null){
- mapValue.put("con","%"+con+"%");
- }
- //分页数据
- DataChange.queryDataByDateTime(""+mapValue.get("startTime"),""+mapValue.get("endTime") , mapValue,sdfDateTime);//根据时间段查询数据
- List<Map<String, Object>> smsResult = tmstruckSmsRusultService.getSmsResult(mapValue);
- PageListAdd pageList = columnDataUtil.tableColumnData(apiId, null,smsResult);
- return success(pageList);
- }
- @PostMapping("/sendMeaage")
- public RESTfulResult sendMeaage(@RequestParam String mobile,
- @RequestParam String content){
- int i = 0;
- try {
- i = tmstruckSmsRusultService.sendMessage(mobile,content);
- } catch (Exception e) {
- return failed(e.getMessage());
- }
- if(i == 0){
- return failed("发送失败");
- }
- return success("发送成功");
- }
- }
|