diff --git a/box-bps/src/main/java/com/ruoyi/bps/domain/ExpressInfo.java b/box-bps/src/main/java/com/ruoyi/bps/domain/ExpressInfo.java index 400f41032..fdd8384e4 100644 --- a/box-bps/src/main/java/com/ruoyi/bps/domain/ExpressInfo.java +++ b/box-bps/src/main/java/com/ruoyi/bps/domain/ExpressInfo.java @@ -15,6 +15,9 @@ public class ExpressInfo extends BaseEntity { private static final long serialVersionUID = 1L; + /** 消息 */ + private String sid; + /** 消息 */ @Excel(name = "消息",type= Excel.Type.EXPORT) private String message; @@ -98,6 +101,14 @@ public class ExpressInfo extends BaseEntity return serialVersionUID; } + public String getSid() { + return sid; + } + + public void setSid(String sid) { + this.sid = sid; + } + public String getMessage() { return message; } @@ -261,7 +272,8 @@ public class ExpressInfo extends BaseEntity @Override public String toString() { return "ExpressInfo{" + - "message='" + message + '\'' + + "sid='" + sid + '\'' + + ", message='" + message + '\'' + ", deliveryNum='" + deliveryNum + '\'' + ", nu='" + nu + '\'' + ", ischeck='" + ischeck + '\'' + diff --git a/box-bps/src/main/java/com/ruoyi/bps/mapper/ExpressInfoMapper.java b/box-bps/src/main/java/com/ruoyi/bps/mapper/ExpressInfoMapper.java index 4dede87d7..9abb35afb 100644 --- a/box-bps/src/main/java/com/ruoyi/bps/mapper/ExpressInfoMapper.java +++ b/box-bps/src/main/java/com/ruoyi/bps/mapper/ExpressInfoMapper.java @@ -61,4 +61,12 @@ public interface ExpressInfoMapper * @return 结果 */ public int deleteExpressInfoByIds(String[] messages); + + /** + * 批量新增快递信息 + * + * @param expressInfoList 角色菜单列表 + * @return 结果 + */ + public int batchInsertExpressInfo(List expressInfoList); } diff --git a/box-bps/src/main/java/com/ruoyi/bps/service/impl/ExpImportQueryServiceImpl.java b/box-bps/src/main/java/com/ruoyi/bps/service/impl/ExpImportQueryServiceImpl.java index 032407c36..7ab9b07e7 100644 --- a/box-bps/src/main/java/com/ruoyi/bps/service/impl/ExpImportQueryServiceImpl.java +++ b/box-bps/src/main/java/com/ruoyi/bps/service/impl/ExpImportQueryServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.bps.service.impl; import com.ruoyi.bps.domain.ExpImportQuery; import com.ruoyi.bps.domain.ExpressInfo; import com.ruoyi.bps.mapper.ExpImportQueryMapper; +import com.ruoyi.bps.mapper.ExpressInfoMapper; import com.ruoyi.bps.service.IExpImportQueryService; import com.ruoyi.bps.service.IExpressInfoService; import com.ruoyi.common.core.domain.AjaxResult; @@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.List; /** @@ -30,6 +32,9 @@ public class ExpImportQueryServiceImpl implements IExpImportQueryService @Autowired private IExpressInfoService expressInfoService; + @Autowired + private ExpressInfoMapper expressInfoMapper; + /** * 查询Excel批量快递查询 * @@ -114,16 +119,20 @@ public class ExpImportQueryServiceImpl implements IExpImportQueryService String queryTime= DateUtils.dateTimeNow("yyyy-MM-dd HH:mm:ss"); String queryId= LocalDateTime.now().toString(); ExpImportQuery expImportQuery=new ExpImportQuery(); + List expressInfoListForInsert=new ArrayList<>(); try{ + //将查询到的快递结果放到expressInfoListForInsert,并插入到数据库表expressInfo for( ExpressInfo expressInfo:expressInfoList){ ExpressInfo ei= expressInfoService.SelectExpressInfo(expressInfo); ei.setQueryId(queryId); ei.setQueryUserName(ShiroUtils.getSysUser().getUserName()); ei.setQueryType("excel"); ei.setQueryTime(queryTime); - expressInfoService.insertExpressInfo(ei); + //expressInfoService.insertExpressInfo(ei); + expressInfoListForInsert.add(ei); } - + expressInfoMapper.batchInsertExpressInfo(expressInfoListForInsert); + //将本次excel导入查询记录到数据表exp_import_query expImportQuery.setQueryTime(queryTime); expImportQuery.setQueryLoginName(ShiroUtils.getLoginName()); expImportQuery.setQueryUserName(ShiroUtils.getSysUser().getUserName()); diff --git a/box-bps/src/main/resources/mapper/bps/ExpressInfoMapper.xml b/box-bps/src/main/resources/mapper/bps/ExpressInfoMapper.xml index 7d190b26b..5f01579ef 100644 --- a/box-bps/src/main/resources/mapper/bps/ExpressInfoMapper.xml +++ b/box-bps/src/main/resources/mapper/bps/ExpressInfoMapper.xml @@ -5,6 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -29,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select message, nu, deliveryNum, ischeck, com, status, `data`, `state`, `condition`, routeInfo, returnCode, `result`, phone, + select sid, message, nu, deliveryNum, ischeck, com, status, `data`, `state`, `condition`, routeInfo, returnCode, `result`, phone, collectTime, singedTime, lastUpdateTime, queryTime, queryUserName, queryId, queryType from expressInfo @@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -125,14 +126,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from expressInfo where message = #{message} + delete from expressInfo where sid = #{sid} delete from expressInfo where message in - #{message} + #{sid} + + insert into expressInfo(message, nu, deliveryNum, ischeck, com, status, `data`, `state`, `condition`, routeInfo, returnCode, `result`, phone, + collectTime, singedTime, lastUpdateTime, queryTime, queryUserName, queryId, queryType) values + + ( #{expressInfo.message}, #{expressInfo.nu}, #{expressInfo.deliveryNum}, #{expressInfo.ischeck}, #{expressInfo.com}, #{expressInfo.status}, + #{expressInfo.data}, #{expressInfo.state}, #{expressInfo.condition}, #{expressInfo.routeInfo}, #{expressInfo.returnCode}, + #{expressInfo.result}, #{expressInfo.phone}, #{expressInfo.collectTime}, #{expressInfo.singedTime}, #{expressInfo.lastUpdateTime}, + #{expressInfo.queryTime}, #{expressInfo.queryUserName}, #{expressInfo.queryId}, #{expressInfo.queryType} + ) + + + \ No newline at end of file diff --git a/box-bps/src/main/resources/templates/bps/expressInfo/expressInfo.html b/box-bps/src/main/resources/templates/bps/expressInfo/expressInfo.html index 3b190cb30..58f71f9ec 100644 --- a/box-bps/src/main/resources/templates/bps/expressInfo/expressInfo.html +++ b/box-bps/src/main/resources/templates/bps/expressInfo/expressInfo.html @@ -78,11 +78,17 @@ modalName: "快递信息", columns: [{ checkbox: false + }, + { + field: 'sid', + title: 'SID', + visible: false }, /* { field: 'message', - title: '消息' + title: '消息', + visible: false },*/ { field: 'deliveryNum', @@ -95,7 +101,8 @@ /* { field: 'ischeck', - title: '签收状态' + title: '签收状态', + visible: false },*/ { field: 'com', @@ -107,7 +114,8 @@ /* { field: 'status', - title: '通信状态' + title: '通信状态', + visible: false },*/ { field: 'data', @@ -125,19 +133,23 @@ },/* { field: 'condition', - title: '状态标志' + title: '状态标志', + visible: false }, { field: 'routeInfo', - title: '路由信息' + title: '路由信息', + visible: false }, { field: 'returnCode', - title: '返回码' + title: '返回码', + visible: false }, { field: 'result', - title: '返回结果' + title: '返回结果', + visible: false },*/ { @@ -170,8 +182,8 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - actions.push('编辑 '); - actions.push('删除'); + actions.push('编辑 '); + actions.push('删除'); return actions.join(''); } }*/]