增加Excel导入查询(详细页面-进行中)

This commit is contained in:
bo.yang 2021-07-23 17:49:37 +08:00
parent 671f3d4b73
commit 9f63b7bf24
9 changed files with 278 additions and 96 deletions

View File

@ -3,6 +3,7 @@ package com.ruoyi.bps.controller;
import com.ruoyi.bps.domain.ExpImportQuery;
import com.ruoyi.bps.domain.ExpSubsPushResp;
import com.ruoyi.bps.domain.ExpressInfo;
import com.ruoyi.bps.mapper.ExpressInfoMapper;
import com.ruoyi.bps.service.IExpImportQueryService;
import com.ruoyi.bps.service.IExpressInfoService;
import com.ruoyi.common.annotation.Log;
@ -43,6 +44,9 @@ public class ExpImportQueryController extends BaseController
@Autowired
private IExpressInfoService expressInfoService;
@Autowired
private ExpressInfoMapper expressInfoMapper;
@RequiresPermissions("bps:expImportQuery:view")
@GetMapping()
public String expImportQuery()
@ -77,6 +81,21 @@ public class ExpImportQueryController extends BaseController
return util.exportExcel(list, "Excel批量快递查询数据");
}
/**
* 导出Excel批量快递查询列表
*/
@RequiresPermissions("bps:expImportQuery:export")
@Log(title = "详细快递信息导出", businessType = BusinessType.EXPORT)
@PostMapping("/exportDetail")
@ResponseBody
public AjaxResult exportDetail(ExpressInfo expressInfo)
{
List<ExpressInfo> list = expressInfoService.selectLocalExpressInfoList(expressInfo);
ExcelUtil<ExpressInfo> util = new ExcelUtil<ExpressInfo>(ExpressInfo.class);
return util.exportExcel(list, "Excel批量快递查询数据");
}
/**
* 新增Excel批量快递查询
*/
@ -138,11 +157,16 @@ public class ExpImportQueryController extends BaseController
* 快递查询明细信息
*/
@RequiresPermissions("bps:expImportQuery:detail")
@GetMapping("/detail/{queryId}")
public String detail(@PathVariable("queryId") String queryId, ModelMap mmap)
@GetMapping("/detail/{sid}")
public String detail(@PathVariable("sid") Long sid, ModelMap mmap)
{
/*ExpSubsPushResp expSubsPushResp = expSubsPushRespService.selectExpSubsPushRespById(sid);
mmap.put("expSubsPushResp", expSubsPushResp);*/
/*ExpImportQuery expImportQuery = expImportQueryService.selectExpImportQueryById(sid);
mmap.put("expImportQuery", expImportQuery);*/
String queryId = expImportQueryService.selectExpImportQueryById(sid).getQueryId();
ExpressInfo expressInfo= new ExpressInfo();
expressInfo.setQueryId(queryId);
mmap.put("expressInfo",expressInfo);
return prefix + "/detail";
}
@ -160,14 +184,14 @@ public class ExpImportQueryController extends BaseController
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
String queryTime= DateUtils.dateTimeNow("yyyy-MM-dd HH:mm:ss");
String queryID= LocalDateTime.now().toString();
String queryId= LocalDateTime.now().toString();
ExcelUtil<ExpressInfo> util= new ExcelUtil<ExpressInfo>(ExpressInfo.class);
List<ExpressInfo> expressInfoList=util.importExcel(file.getInputStream());
ExpImportQuery expImportQuery=new ExpImportQuery();
try{
for( ExpressInfo expressInfo:expressInfoList){
ExpressInfo ei= expressInfoService.SelectExpressInfo(expressInfo);
ei.setQueryID(queryID);
ei.setQueryId(queryId);
ei.setQueryUserName(ShiroUtils.getSysUser().getUserName());
ei.setQueryType("excel");
ei.setQueryTime(queryTime);
@ -181,7 +205,7 @@ public class ExpImportQueryController extends BaseController
expImportQuery.setQueryIp(ShiroUtils.getIp());
expImportQuery.setStatus("success");
expImportQuery.setQueryQty(String.valueOf(expressInfoList.size()));
expImportQuery.setQueryId(queryID);
expImportQuery.setQueryId(queryId);
expImportQueryService.insertExpImportQuery(expImportQuery);
return AjaxResult.success("导入查询成功!");

View File

@ -55,6 +55,20 @@ public class ExpressInfoController extends BaseController
return getDataTable(list);
}
/**
* 查询快递信息列表
*/
@RequiresPermissions("bps:expressInfo:list")
@PostMapping("/localList")
@ResponseBody
public TableDataInfo localList(ExpressInfo expressInfo)
{
startPage();
List<ExpressInfo> list = expressInfoService.selectLocalExpressInfoList(expressInfo);
return getDataTable(list);
}
/**
* 导出快递信息列表
*/

View File

@ -89,123 +89,117 @@ public class ExpressInfo extends BaseEntity
private String queryUserName;
/** 查询ID*/
private String queryID;
private String queryId;
/** 查询类型*/
private String queryType;
public static long getSerialVersionUID() {
return serialVersionUID;
}
public void setMessage(String message)
{
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getMessage()
{
return message;
public String getDeliveryNum() {
return deliveryNum;
}
public void setNu(String nu)
{
public void setDeliveryNum(String deliveryNum) {
this.deliveryNum = deliveryNum;
}
public String getNu() {
return nu;
}
public void setNu(String nu) {
this.nu = nu;
}
public String getNu()
{
return nu;
public String getIscheck() {
return ischeck;
}
public void setIscheck(String ischeck)
{
public void setIscheck(String ischeck) {
this.ischeck = ischeck;
}
public String getIscheck()
{
return ischeck;
public String getCom() {
return com;
}
public void setCom(String com)
{
public void setCom(String com) {
this.com = com;
}
public String getCom()
{
return com;
public String getStatus() {
return status;
}
public void setStatus(String status)
{
public void setStatus(String status) {
this.status = status;
}
public String getStatus()
{
return status;
public String getData() {
return data;
}
public void setData(String data)
{
public void setData(String data) {
this.data = data;
}
public String getData()
{
return data;
public String getState() {
return state;
}
public void setState(String state)
{
public void setState(String state) {
this.state = state;
}
public String getState()
{
return state;
public String getCondition() {
return condition;
}
public void setCondition(String condition)
{
public void setCondition(String condition) {
this.condition = condition;
}
public String getCondition()
{
return condition;
public String getRouteInfo() {
return routeInfo;
}
public void setRouteInfo(String routeInfo)
{
public void setRouteInfo(String routeInfo) {
this.routeInfo = routeInfo;
}
public String getRouteInfo()
{
return routeInfo;
public String getReturnCode() {
return returnCode;
}
public void setReturnCode(String returnCode)
{
public void setReturnCode(String returnCode) {
this.returnCode = returnCode;
}
public String getReturnCode()
{
return returnCode;
public String getResult() {
return result;
}
public void setResult(String result)
{
public void setResult(String result) {
this.result = result;
}
public String getResult()
{
return result;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
public String getPhone() {
return phone;
}
public static long getSerialVersionUID() {
return serialVersionUID;
public void setPhone(String phone) {
this.phone = phone;
}
public String getCollectTime() {
@ -248,20 +242,12 @@ public class ExpressInfo extends BaseEntity
this.queryUserName = queryUserName;
}
public String getDeliveryNum() {
return deliveryNum;
public String getQueryId() {
return queryId;
}
public void setDeliveryNum(String deliveryNum) {
this.deliveryNum = deliveryNum;
}
public String getQueryID() {
return queryID;
}
public void setQueryID(String queryID) {
this.queryID = queryID;
public void setQueryId(String queryId) {
this.queryId = queryId;
}
public String getQueryType() {
@ -293,7 +279,7 @@ public class ExpressInfo extends BaseEntity
", lastUpdateTime='" + lastUpdateTime + '\'' +
", queryTime='" + queryTime + '\'' +
", queryUserName='" + queryUserName + '\'' +
", queryID='" + queryID + '\'' +
", queryId='" + queryId + '\'' +
", queryType='" + queryType + '\'' +
'}';
}

View File

@ -21,11 +21,19 @@ public interface IExpressInfoService
public ExpressInfo selectExpressInfoById(String message);
/**
* 查询快递信息列表
* 查询本地快递信息列表
*
* @param expressInfo 快递信息
* @return 快递信息集合
*/
public List<ExpressInfo> selectLocalExpressInfoList(ExpressInfo expressInfo);
/**
* 查询本地快递信息列表
*
* @param expressInfo 快递信息
* @return 快递信息集合
*/
public List<ExpressInfo> selectExpressInfoList(ExpressInfo expressInfo);
/**

View File

@ -72,6 +72,17 @@ public class ExpressInfoServiceImpl implements IExpressInfoService
return expressInfoMapper.selectExpressInfoById(message);
}
/**
* 查询本地快递信息列表
*
* @param expressInfo 快递信息
* @return 快递信息集合
*/
@Override
public List<ExpressInfo> selectLocalExpressInfoList(ExpressInfo expressInfo) {
return expressInfoMapper.selectExpressInfoList(expressInfo);
}
/**
* 查询快递信息列表
*

View File

@ -22,13 +22,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="lastUpdateTime" column="lastUpdateTime" />
<result property="queryTime" column="queryTime" />
<result property="queryUserName" column="queryUserName" />
<result property="queryID" column="queryID" />
<result property="queryId" column="queryId" />
<result property="queryType" column="queryType" />
</resultMap>
<sql id="selectExpressInfoVo">
select message, nu, ischeck, com, status, `data`, `state`, `condition`, routeInfo, returnCode, `result`, phone,
collectTime, singedTime, lastUpdateTime, queryTime, queryUserName, queryID, queryType
collectTime, singedTime, lastUpdateTime, queryTime, queryUserName, queryId, queryType
from expressInfo
</sql>
@ -38,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="nu != null and nu != ''"> and nu = #{nu}</if>
<if test="com != null and com != ''"> and com = #{com}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="queryId != null and queryId != ''"> and queryId = #{queryId}</if>
</where>
</select>
@ -66,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lastUpdateTime != null">lastUpdateTime,</if>
<if test="queryTime != null">queryTime,</if>
<if test="queryUserName != null">queryUserName,</if>
<if test="queryID != null">queryID,</if>
<if test="queryId != null">queryId,</if>
<if test="queryType != null">queryType,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -87,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lastUpdateTime != null">#{lastUpdateTime},</if>
<if test="queryTime != null">#{queryTime},</if>
<if test="queryUserName != null">#{queryUserName},</if>
<if test="queryID != null">#{queryID},</if>
<if test="queryId != null">#{queryId},</if>
<if test="queryType != null">#{queryType},</if>
</trim>
</insert>
@ -111,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lastUpdateTime != null">lastUpdateTime = #{lastUpdateTime},</if>
<if test="queryTime != null">queryTime = #{queryTime},</if>
<if test="queryUserName != null">queryUserName = #{queryUserName},</if>
<if test="queryID != null">queryID = #{queryID},</if>
<if test="queryId != null">queryId = #{queryId},</if>
<if test="queryType != null">queryType = #{queryType},</if>
</trim>
where message = #{message}

View File

@ -9,7 +9,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">查询ID</label>
<div class="col-sm-8">
<input name="queryID" class="form-control" type="text">
<input name="queryId" class="form-control" type="text">
</div>
</div>
<div class="form-group">

View File

@ -1 +1,139 @@
222
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('快递信息列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId" th:object="${expressInfo}">
<div class="select-list">
<ul>
<li>
<label>查询ID</label>
<input type="text" name="queryId" th:field="*{queryId}"/>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="bps:expressInfo:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('bps:expressInfo:edit')}]];
var removeFlag = [[${@permission.hasPermi('bps:expressInfo:remove')}]];
var prefix = ctx + "bps/expressInfo";
var datas = [[${@dict.getType('express_company')}]];
var stats= [[${@dict.getType('express_stats')}]];
$(function() {
var options = {
url: prefix + "/localList",
exportUrl: prefix + "/exportDetail",
modalName: "快递信息",
columns: [{
checkbox: true
},
/*
{
field: 'message',
title: '消息'
},*/
{
field: 'deliveryNum',
title: '出货单号'
},
{
field: 'nu',
title: '快递单号'
},
/*
{
field: 'ischeck',
title: '签收状态'
},*/
{
field: 'com',
title: '快递公司',
formatter: function(value, row, index) {
return $.table.selectDictLabel(datas, value);
}
},
/*
{
field: 'status',
title: '通信状态'
},*/
{
field: 'data',
title: '运单详情',
formatter:function (value,row,index){
return value.replace(/(\r\n)|(\n)/g,'<br>');
}
},
{
field: 'state',
title: '当前状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(stats, value);
}
},/*
{
field: 'condition',
title: '状态标志'
},
{
field: 'routeInfo',
title: '路由信息'
},
{
field: 'returnCode',
title: '返回码'
},
{
field: 'result',
title: '返回结果'
},*/
{
field: 'phone',
title: '电话号码'
},
{
field: 'singedTime',
title: '签收时间'
},
{
field: 'collectTime',
title: '揽收时间'
},
{
field: 'lastUpdateTime',
title: '最后更新时间'
},
{
field: 'queryTime',
title: '查询时间'
},
{
field: 'queryUserName',
title: '查询人'
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -74,7 +74,7 @@
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
detailUrl: prefix + "/detail/{queryId}",
detailUrl: prefix + "/detail/{id}",
exportUrl: prefix + "/export",
importUrl: prefix + "/importData",
importTemplateUrl: prefix + "/importTemplate",
@ -127,7 +127,7 @@
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.sid + '\')"><i class="fa fa-edit"></i>详细</a> ');
actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detailTab(\'' + row.sid + '\')"><i class="fa fa-edit"></i>详细</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.sid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.sid + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');