Merge branch 'dev' of gitee.com:septemyang/RuoYi into master

This commit is contained in:
Bo 2021-06-02 11:33:29 +08:00 committed by Gitee
commit c16b92173b
101 changed files with 7736 additions and 1257 deletions

47
box-bps/pom.xml Normal file
View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>4.6.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>box-bps</artifactId>
<description>
bps系统模块
</description>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160810</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.21</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.kuaidi100-api</groupId>
<artifactId>sdk</artifactId>
<version>1.0.2</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,46 @@
package com.ruoyi.bps.controller;
import com.kuaidi100.sdk.response.SubscribeResp;
import com.ruoyi.bps.domain.ExpSubscribe;
import com.ruoyi.bps.service.IExpSubsPushApiService;
import com.ruoyi.common.core.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* 接受快递推送信息的API接口Controller
*
* @author box
* @date 2021-05-13
*/
@Api("快递信息订阅推送")
@RestController
@RequestMapping("/anon")
public class ExpSubsPushApiController extends BaseController {
@Autowired
IExpSubsPushApiService expSubsPushApiService;
//推送
@CrossOrigin
@PostMapping("/subscribeCallBackUrl")
@ApiOperation("快递信息订阅推送接受")
public SubscribeResp SubscribeCallBackUrl(HttpServletRequest request) {
return expSubsPushApiService.ExpressSubscribeCallBackUrl(request);
}
//订阅
@CrossOrigin
@PostMapping("/subscribe")
public SubscribeResp Subscribe(ExpSubscribe expSubscribe){
return expSubsPushApiService.ExpressSubscribe(expSubscribe);
}
}

View File

@ -0,0 +1,123 @@
package com.ruoyi.bps.controller;
import com.ruoyi.bps.domain.ExpSubsPushResp;
import com.ruoyi.bps.service.IExpSubsPushRespService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 快递订阅推送信息增删改查Controller
*
* @author box
* @date 2021-05-13
*/
@Controller
@RequestMapping("/bps/expsubspushresp")
public class ExpSubsPushRespController extends BaseController
{
private String prefix = "bps/expsubspushresp";
@Autowired
private IExpSubsPushRespService expSubsPushRespService;
@RequiresPermissions("bps:expsubspushresp:view")
@GetMapping()
public String expsubspushresp()
{
return prefix + "/expsubspushresp";
}
/**
* 查询快递订阅推送信息列表
*/
@RequiresPermissions("bps:expsubspushresp:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ExpSubsPushResp expSubsPushResp)
{
startPage();
List<ExpSubsPushResp> list = expSubsPushRespService.selectExpSubsPushRespList(expSubsPushResp);
return getDataTable(list);
}
/**
* 导出快递订阅推送信息列表
*/
@RequiresPermissions("bps:expsubspushresp:export")
@Log(title = "快递订阅推送信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ExpSubsPushResp expSubsPushResp)
{
List<ExpSubsPushResp> list = expSubsPushRespService.selectExpSubsPushRespList(expSubsPushResp);
ExcelUtil<ExpSubsPushResp> util = new ExcelUtil<ExpSubsPushResp>(ExpSubsPushResp.class);
return util.exportExcel(list, "快递订阅推送信息数据");
}
/**
* 新增快递订阅推送信息
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存快递订阅推送信息
*/
@RequiresPermissions("bps:expsubspushresp:add")
@Log(title = "快递订阅推送信息", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ExpSubsPushResp expSubsPushResp)
{
return toAjax(expSubsPushRespService.insertExpSubsPushResp(expSubsPushResp));
}
/**
* 修改快递订阅推送信息
*/
@GetMapping("/edit/{sid}")
public String edit(@PathVariable("sid") Long sid, ModelMap mmap)
{
ExpSubsPushResp expSubsPushResp = expSubsPushRespService.selectExpSubsPushRespById(sid);
mmap.put("expSubsPushResp", expSubsPushResp);
return prefix + "/edit";
}
/**
* 修改保存快递订阅推送信息
*/
@RequiresPermissions("bps:expsubspushresp:edit")
@Log(title = "快递订阅推送信息", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(ExpSubsPushResp expSubsPushResp)
{
return toAjax(expSubsPushRespService.updateExpSubsPushResp(expSubsPushResp));
}
/**
* 删除快递订阅推送信息
*/
@RequiresPermissions("bps:expsubspushresp:remove")
@Log(title = "快递订阅推送信息", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(expSubsPushRespService.deleteExpSubsPushRespByIds(ids));
}
}

View File

@ -0,0 +1,139 @@
package com.ruoyi.bps.controller;
import com.ruoyi.bps.domain.ExpSubscribe;
import com.ruoyi.bps.service.IExpSubsPushApiService;
import com.ruoyi.bps.service.IExpSubscribeService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.kuaidi100.sdk.response.SubscribeResp;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 快递订阅Controller
*
* @author box
* @date 2021-05-20
*/
@Controller
@RequestMapping("/bps/subscribe")
public class ExpSubscribeController extends BaseController
{
private String prefix = "bps/subscribe";
@Autowired
private IExpSubscribeService expSubscribeService;
@Autowired
private IExpSubsPushApiService iExpSubsPushApiService;
@RequiresPermissions("bps:subscribe:view")
@GetMapping()
public String subscribe()
{
return prefix + "/subscribe";
}
/**
* 订阅快递
*/
@CrossOrigin
@RequestMapping("/subscribe")
@ResponseBody
public SubscribeResp ExpressSubscribe(@RequestBody ExpSubscribe expSubscribe) {
return iExpSubsPushApiService.ExpressSubscribe(expSubscribe);
}
/**
* 查询快递订阅列表
*/
@RequiresPermissions("bps:subscribe:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ExpSubscribe expSubscribe)
{
startPage();
List<ExpSubscribe> list = expSubscribeService.selectExpSubscribeList(expSubscribe);
return getDataTable(list);
}
/**
* 导出快递订阅列表
*/
@RequiresPermissions("bps:subscribe:export")
@Log(title = "快递订阅", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ExpSubscribe expSubscribe)
{
List<ExpSubscribe> list = expSubscribeService.selectExpSubscribeList(expSubscribe);
ExcelUtil<ExpSubscribe> util = new ExcelUtil<ExpSubscribe>(ExpSubscribe.class);
return util.exportExcel(list, "快递订阅数据");
}
/**
* 新增快递订阅
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存快递订阅
*/
@RequiresPermissions("bps:subscribe:add")
@Log(title = "快递订阅", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ExpSubscribe expSubscribe)
{
return toAjax(expSubscribeService.insertExpSubscribe(expSubscribe));
}
/**
* 修改快递订阅
*/
@GetMapping("/edit/{sid}")
public String edit(@PathVariable("sid") Long sid, ModelMap mmap)
{
ExpSubscribe expSubscribe = expSubscribeService.selectExpSubscribeById(sid);
mmap.put("expSubscribe", expSubscribe);
return prefix + "/edit";
}
/**
* 修改保存快递订阅
*/
@RequiresPermissions("bps:subscribe:edit")
@Log(title = "快递订阅", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(ExpSubscribe expSubscribe)
{
return toAjax(expSubscribeService.updateExpSubscribe(expSubscribe));
}
/**
* 删除快递订阅
*/
@RequiresPermissions("bps:subscribe:remove")
@Log(title = "快递订阅", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(expSubscribeService.deleteExpSubscribeByIds(ids));
}
}

View File

@ -0,0 +1,124 @@
package com.ruoyi.bps.controller;
import com.ruoyi.bps.domain.ExpressInfo;
import com.ruoyi.bps.service.IExpressInfoService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.controller.BaseController;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 快递信息Controller
*
* @author box
* @date 2021-05-06
*/
@Controller
@RequestMapping("/bps/expressInfo")
public class ExpressInfoController extends BaseController
{
private String prefix = "bps/expressInfo";
@Autowired
private IExpressInfoService expressInfoService;
@RequiresPermissions("bps:expressInfo:view")
@GetMapping()
public String expressInfo()
{
return prefix + "/expressInfo";
}
/**
* 查询快递信息列表
*/
@RequiresPermissions("bps:expressInfo:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ExpressInfo expressInfo)
{
startPage();
List<ExpressInfo> list = expressInfoService.selectExpressInfoList(expressInfo);
return getDataTable(list);
}
/**
* 导出快递信息列表
*/
@RequiresPermissions("bps:expressInfo:export")
@Log(title = "快递信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ExpressInfo expressInfo)
{
List<ExpressInfo> list = expressInfoService.selectExpressInfoList(expressInfo);
ExcelUtil<ExpressInfo> util = new ExcelUtil<ExpressInfo>(ExpressInfo.class);
return util.exportExcel(list, "快递信息数据");
}
/**
* 新增快递信息
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存快递信息
*/
@RequiresPermissions("bps:expressInfo:add")
@Log(title = "快递信息", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ExpressInfo expressInfo)
{
return toAjax(expressInfoService.insertExpressInfo(expressInfo));
}
/**
* 修改快递信息
*/
@GetMapping("/edit/{message}")
public String edit(@PathVariable("message") String message, ModelMap mmap)
{
ExpressInfo expressInfo = expressInfoService.selectExpressInfoById(message);
mmap.put("expressInfo", expressInfo);
return prefix + "/edit";
}
/**
* 修改保存快递信息
*/
@RequiresPermissions("bps:expressInfo:edit")
@Log(title = "快递信息", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(ExpressInfo expressInfo)
{
return toAjax(expressInfoService.updateExpressInfo(expressInfo));
}
/**
* 删除快递信息
*/
@RequiresPermissions("bps:expressInfo:remove")
@Log(title = "快递信息", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(expressInfoService.deleteExpressInfoByIds(ids));
}
}

View File

@ -0,0 +1,50 @@
package com.ruoyi.bps.controller;
//import com.ruoyi.bps.express.contant.CompanyConstant;
//import com.ruoyi.bps.express.request.QueryTrackParam;
import com.ruoyi.bps.service.IExpressService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.kuaidi100.sdk.request.QueryTrackParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class ExpressTestController extends BaseController {
@Autowired
private IExpressService expressService;
@RequestMapping("/anon/bps/express/test/queryTrackMultiList")
public TableDataInfo QueryTrackMultiList(){
//return expressService.QueryTrackExpressMultiList(expressService.GetTestQueryTrackParam()).toString();
return getDataTable(expressService.QueryTrackExpressMultiList(expressService.GetTestQueryTrackParam()));
}
@RequestMapping("/anon/bps/express/test/queryTrackMulti")
public String QueryTrackMulti(){
return expressService.QueryTrackExpressMulti(expressService.GetTestQueryTrackParam());
}
@RequestMapping("/anon/bps/express/test/queryTrack")
public String QueryTrack(){
QueryTrackParam queryTrackParam = new QueryTrackParam();
queryTrackParam.setCom("annengwuliu");
queryTrackParam.setNum("3004459671351");
queryTrackParam.setPhone("17725390266");
return expressService.QueryTrackExpress(queryTrackParam);
}
@RequestMapping("/anon/bps/express/test/subscribe")
public String Subscribe(){
return expressService.SubscribeExpress();
}
}

View File

@ -0,0 +1,102 @@
package com.ruoyi.bps.controller;
import com.ruoyi.bps.service.TopgpDdlService;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@RestController
public class FrForCrTopgpController {
@Autowired
private TopgpDdlService topgpDdlService;
//访问 ../anon/bps/frforcr/topprod时使用topprod
@CrossOrigin
@Log(title = "CSFR412_CR报表_TOPPROD", businessType = BusinessType.DROP)
@RequestMapping("/anon/bps/frforcr/topprod")
@DataSource(value = DataSourceType.TOPPRODDSREPORT)
public AjaxResult frforcrtopprod(@RequestBody Map<String,Object> map){
return frforcrtoppgp(map);
}
//访问../anon/bps/frforcr/topprod时使用toptest实例
@CrossOrigin
@Log(title = "CSFR412_CR报表_TOPTEST", businessType = BusinessType.DROP)
@RequestMapping("/anon/bps/frforcr/toptest")
@DataSource(value = DataSourceType.TOPTESTDSREPORT)
public AjaxResult frforcrtoptest(@RequestBody Map<String,Object> map){
return frforcrtoppgp(map);
}
private AjaxResult frforcrtoppgp(Map<String,Object> map){
/* 多此一举@RequestBody时取不到值是已经会报500错误了并不会执行到这一段
if(map.isEmpty()){ //如果传过来的值为空返回未取到表名
// System.out.println(LocalTime.now()+"未获取到表名!");
return AjaxResult.error("未取到表名传参!");
}
*/
StringBuilder droppedTable = new StringBuilder();
StringBuilder errorDroppedTable = new StringBuilder();
StringBuilder notExistsTable = new StringBuilder();
for (String tableName : getTableName(map)) {
if(topgpDdlService.isTableInDb("ds_report",tableName) <=0){
//表名在数据库中不存在
//System.out.println(LocalTime.now() + "" + tableName + "】不存在!");
notExistsTable.append(tableName+",");
continue;
}
try {
topgpDdlService.dropTable("ds_report." + tableName);
//System.out.println(LocalTime.now() + "" + tableName + "】已被删除!");
droppedTable.append(tableName+",");
} catch (Exception e) {
//System.out.println(LocalTime.now() + "" + tableName + "】删除异常!");
errorDroppedTable.append(tableName+",");
}
}
//删除异常写入日志
if (StringUtils.isNotEmpty(errorDroppedTable)){
return AjaxResult.error(errorDroppedTable+"删除异常!");
}
//表不存在写入日志
if(StringUtils.isNotEmpty(notExistsTable)){
return AjaxResult.warn(notExistsTable+"表不存在!");
}
//被删除的表写入日志
if(StringUtils.isNotEmpty(droppedTable)){
return AjaxResult.success(droppedTable + "删除成功!");
}
//以上三种情况都不存在说明发生了不明异常写入日志
return AjaxResult.warn("发生不明异常!");
}
//防止意手抖把SID也当成表传过来
//排除sid的key值
private List<String> getTableName(Map<String,Object> map){
List<String> list=new ArrayList<String>();
for(String key:map.keySet()){
if(key !="sid")
{
list.add(map.get(key).toString());
}
}
return list;
}
}

View File

@ -0,0 +1,103 @@
package com.ruoyi.bps.controller;
//import com.ruoyi.bps.express.contant.CompanyConstant;
//import com.ruoyi.bps.express.request.QueryTrackParam;
//import com.ruoyi.bps.express.response.QueryTrackResp;
import com.ruoyi.bps.service.IExpressService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.google.gson.Gson;
import com.kuaidi100.sdk.request.QueryTrackParam;
import com.kuaidi100.sdk.response.QueryTrackResp;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.HashMap;
import java.util.Map;
@Controller
public class QueryExpressController extends BaseController {
@Autowired
private IExpressService expressService;
@RequiresPermissions("bps:express:view")
@RequestMapping("/bps/express/queryExpress")
public String queryExpress()
{
//return "express/queryExpress";
//说明此处不能用绝对路径否则当application.yml中设定context-path: /it_war后打Jar包时会找不到thymeleaf对应的文件
return "express/queryExpress";
}
@CrossOrigin
@RequestMapping("/bps/express/queryExpress/list")
@ResponseBody
public Map<String, String> queryExpressList(@RequestBody QueryTrackParam queryTrackParam){
Map<String,String> result = null;
if (queryTrackParam != null) {
System.out.println("运单号码:" + queryTrackParam.getNum());
System.out.println("快递公司:" + queryTrackParam.getCom());
System.out.println("电话:" + queryTrackParam.getPhone());
result = new HashMap<>();
result.put("code", "1");
result.put("msg", "ok");
result.put("info",expressService.QueryTrackExpress(queryTrackParam));
}
return result;
}
@CrossOrigin
@RequestMapping("/bps/express/queryExpress/list1")
@ResponseBody
public Map<String, Object> queryExpressList1(@RequestBody QueryTrackParam queryTrackParam){
Map<String, Object> result = null;
if (queryTrackParam != null) {
System.out.println("运单号码:" + queryTrackParam.getNum());
System.out.println("快递公司:" + queryTrackParam.getCom());
System.out.println("电话:" + queryTrackParam.getPhone());
String info=expressService.QueryTrackExpress(queryTrackParam);
QueryTrackResp queryTrackResp = new Gson().fromJson(info,QueryTrackResp.class);
result = new HashMap<>();
result.put("code", "1");
result.put("msg", "ok");
result.put("nu",queryTrackResp.getNu());
result.put("com",queryTrackResp.getCom());
result.put("state",queryTrackResp.getState());
result.put("info",queryTrackResp.getData());
}
return result;
}
@RequestMapping("/anon/bps/express/queryTrackMultiList")
public TableDataInfo QueryTrackMultiList(@RequestBody QueryTrackParam queryTrackParam){
return getDataTable(expressService.QueryTrackExpressMultiList(expressService.GetTestQueryTrackParam()));
}
@RequestMapping("/anon/bps/express/queryTrackMulti")
public String QueryTrackMulti(){
return expressService.QueryTrackExpressMulti(expressService.GetTestQueryTrackParam());
}
@RequestMapping("/anon/bps/express/queryTrack")
public String QueryTrack(){
QueryTrackParam queryTrackParam = new QueryTrackParam();
queryTrackParam.setCom("annengwuliu");
queryTrackParam.setNum("3004459671351");
queryTrackParam.setPhone("17725390266");
return expressService.QueryTrackExpress(queryTrackParam);
}
@RequestMapping("/anon/bps/express/subscribe")
public String Subscribe(){
return expressService.SubscribeExpress();
}
}

View File

@ -0,0 +1,345 @@
package com.ruoyi.bps.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 快递订阅推送信息对象 exp_subs_push_resp
*
* @author box
* @date 2021-05-13
*/
public class ExpSubsPushResp extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** SID */
private Long sid;
/** 监控状态 */
@Excel(name = "监控状态")
private String status;
/** 状态 */
@Excel(name = "状态")
private String billStatus;
/** 监控状态消息 */
@Excel(name = "监控状态消息")
private String message;
/** 快递公司编码是否出错 */
@Excel(name = "快递公司编码是否出错")
private String autoCheck;
/** 原始快递公司编码 */
@Excel(name = "原始快递公司编码")
private String comOld;
/** 修正快递公司编码 */
@Excel(name = "修正快递公司编码")
private String comNew;
/** 当前快递消息 */
@Excel(name = "当前快递消息")
private String lastResultMessage;
/** 当前快递单状态 */
@Excel(name = "当前快递单状态")
private String lastResultState;
/** 通讯状态 */
@Excel(name = "通讯状态")
private String lastResulStatus;
/** 快递单明细状态 */
@Excel(name = "快递单明细状态")
private String lastResultCondition;
/** 是否签收 */
@Excel(name = "是否签收")
private String lastResultIsCheck;
/** 快递公司编码 */
@Excel(name = "快递公司编码")
private String lastResultCom;
/** 快递单号 */
@Excel(name = "快递单号")
private String lastResultNu;
/** 快递流转信息 */
@Excel(name = "快递流转信息")
private String lastResultData;
/** 目的国快递消息 */
@Excel(name = "目的国快递消息")
private String destResultMessage;
/** 目的国快递单状态 */
@Excel(name = "目的国快递单状态")
private String destResultState;
/** 目的国通讯状态 */
@Excel(name = "目的国通讯状态")
private String destResultStatus;
/** 目的国快递单明细状态 */
@Excel(name = "目的国快递单明细状态")
private String destResultCondition;
/** 目的国是否签收 */
@Excel(name = "目的国是否签收")
private String destResultIsCheck;
/** 目的国快递公司编码 */
@Excel(name = "目的国快递公司编码")
private String destResultCom;
/** 目的国快递单号 */
@Excel(name = "目的国快递单号")
private String destResultNu;
/** 目的国快递流转信息 */
@Excel(name = "目的国快递流转信息")
private String destResultData;
public void setSid(Long sid)
{
this.sid = sid;
}
public Long getSid()
{
return sid;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setBillStatus(String billStatus)
{
this.billStatus = billStatus;
}
public String getBillStatus()
{
return billStatus;
}
public void setMessage(String message)
{
this.message = message;
}
public String getMessage()
{
return message;
}
public void setAutoCheck(String autoCheck)
{
this.autoCheck = autoCheck;
}
public String getAutoCheck()
{
return autoCheck;
}
public void setComOld(String comOld)
{
this.comOld = comOld;
}
public String getComOld()
{
return comOld;
}
public void setComNew(String comNew)
{
this.comNew = comNew;
}
public String getComNew()
{
return comNew;
}
public void setLastResultMessage(String lastResultMessage)
{
this.lastResultMessage = lastResultMessage;
}
public String getLastResultMessage()
{
return lastResultMessage;
}
public void setLastResultState(String lastResultState)
{
this.lastResultState = lastResultState;
}
public String getLastResultState()
{
return lastResultState;
}
public void setLastResulStatus(String lastResulStatus)
{
this.lastResulStatus = lastResulStatus;
}
public String getLastResulStatus()
{
return lastResulStatus;
}
public void setLastResultCondition(String lastResultCondition)
{
this.lastResultCondition = lastResultCondition;
}
public String getLastResultCondition()
{
return lastResultCondition;
}
public void setLastResultIsCheck(String lastResultIsCheck)
{
this.lastResultIsCheck = lastResultIsCheck;
}
public String getLastResultIsCheck()
{
return lastResultIsCheck;
}
public void setLastResultCom(String lastResultCom)
{
this.lastResultCom = lastResultCom;
}
public String getLastResultCom()
{
return lastResultCom;
}
public void setLastResultNu(String lastResultNu)
{
this.lastResultNu = lastResultNu;
}
public String getLastResultNu()
{
return lastResultNu;
}
public void setLastResultData(String lastResultData)
{
this.lastResultData = lastResultData;
}
public String getLastResultData()
{
return lastResultData;
}
public void setDestResultMessage(String destResultMessage)
{
this.destResultMessage = destResultMessage;
}
public String getDestResultMessage()
{
return destResultMessage;
}
public void setDestResultState(String destResultState)
{
this.destResultState = destResultState;
}
public String getDestResultState()
{
return destResultState;
}
public void setDestResultStatus(String destResultStatus)
{
this.destResultStatus = destResultStatus;
}
public String getDestResultStatus()
{
return destResultStatus;
}
public void setDestResultCondition(String destResultCondition)
{
this.destResultCondition = destResultCondition;
}
public String getDestResultCondition()
{
return destResultCondition;
}
public void setDestResultIsCheck(String destResultIsCheck)
{
this.destResultIsCheck = destResultIsCheck;
}
public String getDestResultIsCheck()
{
return destResultIsCheck;
}
public void setDestResultCom(String destResultCom)
{
this.destResultCom = destResultCom;
}
public String getDestResultCom()
{
return destResultCom;
}
public void setDestResultNu(String destResultNu)
{
this.destResultNu = destResultNu;
}
public String getDestResultNu()
{
return destResultNu;
}
public void setDestResultData(String destResultData)
{
this.destResultData = destResultData;
}
public String getDestResultData()
{
return destResultData;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("sid", getSid())
.append("status", getStatus())
.append("billStatus", getBillStatus())
.append("message", getMessage())
.append("autoCheck", getAutoCheck())
.append("comOld", getComOld())
.append("comNew", getComNew())
.append("lastResultMessage", getLastResultMessage())
.append("lastResultState", getLastResultState())
.append("lastResulStatus", getLastResulStatus())
.append("lastResultCondition", getLastResultCondition())
.append("lastResultIsCheck", getLastResultIsCheck())
.append("lastResultCom", getLastResultCom())
.append("lastResultNu", getLastResultNu())
.append("lastResultData", getLastResultData())
.append("destResultMessage", getDestResultMessage())
.append("destResultState", getDestResultState())
.append("destResultStatus", getDestResultStatus())
.append("destResultCondition", getDestResultCondition())
.append("destResultIsCheck", getDestResultIsCheck())
.append("destResultCom", getDestResultCom())
.append("destResultNu", getDestResultNu())
.append("destResultData", getDestResultData())
.toString();
}
}

View File

@ -0,0 +1,149 @@
package com.ruoyi.bps.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 快递订阅对象 exp_subscribe
*
* @author box
* @date 2021-05-20
*/
public class ExpSubscribe extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** SID */
private Long sid;
/** 快递公司编码 */
@Excel(name = "快递公司编码")
private String company;
/** 快递单号 */
@Excel(name = "快递单号")
private String number;
/** 收/寄件人电话 */
@Excel(name = "收/寄件人电话")
private String phone;
/** 盐 */
@Excel(name = "")
private String salt;
/** 订阅时间 */
@Excel(name = "订阅时间")
private String subscribeTime;
/** 订阅结果 */
@Excel(name = "订阅结果")
private String result;
/** 返回码 */
@Excel(name = "返回码")
private String returnCode;
/** 返回消息 */
@Excel(name = "返回消息")
private String message;
public void setSid(Long sid)
{
this.sid = sid;
}
public Long getSid()
{
return sid;
}
public void setCompany(String company)
{
this.company = company;
}
public String getCompany()
{
return company;
}
public void setNumber(String number)
{
this.number = number;
}
public String getNumber()
{
return number;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
public void setSalt(String salt)
{
this.salt = salt;
}
public String getSalt()
{
return salt;
}
public void setSubscribeTime(String subscribeTime)
{
this.subscribeTime = subscribeTime;
}
public String getSubscribeTime()
{
return subscribeTime;
}
public void setResult(String result)
{
this.result = result;
}
public String getResult()
{
return result;
}
public void setReturnCode(String returnCode)
{
this.returnCode = returnCode;
}
public String getReturnCode()
{
return returnCode;
}
public void setMessage(String message)
{
this.message = message;
}
public String getMessage()
{
return message;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("sid", getSid())
.append("company", getCompany())
.append("number", getNumber())
.append("phone", getPhone())
.append("salt", getSalt())
.append("subscribeTime", getSubscribeTime())
.append("result", getResult())
.append("returnCode", getReturnCode())
.append("message", getMessage())
.toString();
}
}

View File

@ -0,0 +1,192 @@
package com.ruoyi.bps.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 快递信息对象 expressInfo
*
* @author box
* @date 2021-05-06
*/
public class ExpressInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 消息 */
@Excel(name = "消息")
private String message;
/** 快递单号 */
@Excel(name = "快递单号")
private String nu;
/** 签收状态 */
@Excel(name = "签收状态")
private String ischeck;
/** 快递公司 */
@Excel(name = "快递公司")
private String com;
/** 通信状态 */
@Excel(name = "通信状态")
private String status;
/** 运单详情 */
@Excel(name = "运单详情")
private String data;
/** 当前状态 */
@Excel(name = "当前状态")
private String state;
/** 状态标志 */
@Excel(name = "状态标志")
private String condition;
/** 路由信息 */
@Excel(name = "路由信息")
private String routeInfo;
/** 返回码 */
@Excel(name = "返回码")
private String returnCode;
/** 返回结果 */
@Excel(name = "返回结果")
private String result;
/** 电话号码 */
@Excel(name = "电话号码")
private String phone;
public void setMessage(String message)
{
this.message = message;
}
public String getMessage()
{
return message;
}
public void setNu(String nu)
{
this.nu = nu;
}
public String getNu()
{
return nu;
}
public void setIscheck(String ischeck)
{
this.ischeck = ischeck;
}
public String getIscheck()
{
return ischeck;
}
public void setCom(String com)
{
this.com = com;
}
public String getCom()
{
return com;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setData(String data)
{
this.data = data;
}
public String getData()
{
return data;
}
public void setState(String state)
{
this.state = state;
}
public String getState()
{
return state;
}
public void setCondition(String condition)
{
this.condition = condition;
}
public String getCondition()
{
return condition;
}
public void setRouteInfo(String routeInfo)
{
this.routeInfo = routeInfo;
}
public String getRouteInfo()
{
return routeInfo;
}
public void setReturnCode(String returnCode)
{
this.returnCode = returnCode;
}
public String getReturnCode()
{
return returnCode;
}
public void setResult(String result)
{
this.result = result;
}
public String getResult()
{
return result;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("message", getMessage())
.append("nu", getNu())
.append("ischeck", getIscheck())
.append("com", getCom())
.append("status", getStatus())
.append("data", getData())
.append("state", getState())
.append("condition", getCondition())
.append("routeInfo", getRouteInfo())
.append("returnCode", getReturnCode())
.append("result", getResult())
.append("phone", getPhone())
.toString();
}
}

View File

@ -0,0 +1,64 @@
package com.ruoyi.bps.mapper;
import com.ruoyi.bps.domain.ExpSubsPushResp;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
/**
* 快递订阅推送信息Mapper接口
*
* @author box
* @date 2021-05-13
*/
public interface ExpSubsPushRespMapper
{
/**
* 查询快递订阅推送信息
*
* @param sid 快递订阅推送信息ID
* @return 快递订阅推送信息
*/
public ExpSubsPushResp selectExpSubsPushRespById(Long sid);
/**
* 查询快递订阅推送信息列表
*
* @param expSubsPushResp 快递订阅推送信息
* @return 快递订阅推送信息集合
*/
public List<ExpSubsPushResp> selectExpSubsPushRespList(ExpSubsPushResp expSubsPushResp);
/**
* 新增快递订阅推送信息
*
* @param expSubsPushResp 快递订阅推送信息
* @return 结果
*/
public int insertExpSubsPushResp(ExpSubsPushResp expSubsPushResp);
/**
* 修改快递订阅推送信息
*
* @param expSubsPushResp 快递订阅推送信息
* @return 结果
*/
public int updateExpSubsPushResp(ExpSubsPushResp expSubsPushResp);
/**
* 删除快递订阅推送信息
*
* @param sid 快递订阅推送信息ID
* @return 结果
*/
public int deleteExpSubsPushRespById(Long sid);
/**
* 批量删除快递订阅推送信息
*
* @param sids 需要删除的数据ID
* @return 结果
*/
public int deleteExpSubsPushRespByIds(String[] sids);
}

View File

@ -0,0 +1,64 @@
package com.ruoyi.bps.mapper;
import com.ruoyi.bps.domain.ExpSubscribe;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
/**
* 快递订阅Mapper接口
*
* @author box
* @date 2021-05-20
*/
public interface ExpSubscribeMapper
{
/**
* 查询快递订阅
*
* @param sid 快递订阅ID
* @return 快递订阅
*/
public ExpSubscribe selectExpSubscribeById(Long sid);
/**
* 查询快递订阅列表
*
* @param expSubscribe 快递订阅
* @return 快递订阅集合
*/
public List<ExpSubscribe> selectExpSubscribeList(ExpSubscribe expSubscribe);
/**
* 新增快递订阅
*
* @param expSubscribe 快递订阅
* @return 结果
*/
public int insertExpSubscribe(ExpSubscribe expSubscribe);
/**
* 修改快递订阅
*
* @param expSubscribe 快递订阅
* @return 结果
*/
public int updateExpSubscribe(ExpSubscribe expSubscribe);
/**
* 删除快递订阅
*
* @param sid 快递订阅ID
* @return 结果
*/
public int deleteExpSubscribeById(Long sid);
/**
* 批量删除快递订阅
*
* @param sids 需要删除的数据ID
* @return 结果
*/
public int deleteExpSubscribeByIds(String[] sids);
}

View File

@ -0,0 +1,64 @@
package com.ruoyi.bps.mapper;
import com.ruoyi.bps.domain.ExpressInfo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
/**
* 快递信息Mapper接口
*
* @author box
* @date 2021-05-06
*/
public interface ExpressInfoMapper
{
/**
* 查询快递信息
*
* @param message 快递信息ID
* @return 快递信息
*/
public ExpressInfo selectExpressInfoById(String message);
/**
* 查询快递信息列表
*
* @param expressInfo 快递信息
* @return 快递信息集合
*/
public List<ExpressInfo> selectExpressInfoList(ExpressInfo expressInfo);
/**
* 新增快递信息
*
* @param expressInfo 快递信息
* @return 结果
*/
public int insertExpressInfo(ExpressInfo expressInfo);
/**
* 修改快递信息
*
* @param expressInfo 快递信息
* @return 结果
*/
public int updateExpressInfo(ExpressInfo expressInfo);
/**
* 删除快递信息
*
* @param message 快递信息ID
* @return 结果
*/
public int deleteExpressInfoById(String message);
/**
* 批量删除快递信息
*
* @param messages 需要删除的数据ID
* @return 结果
*/
public int deleteExpressInfoByIds(String[] messages);
}

View File

@ -0,0 +1,32 @@
package com.ruoyi.bps.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
@Mapper
@Component("TopgpDdlMapper")
public interface TopgpDdlMapper {
// alter table
int alterTableName(@Param("originalTableName") String originalTableName,
@Param("newTableName") String newTableName);
//truncate table
int truncateTable(@Param("tableName") String tableName);
//drop table
int dropTable(@Param("tableName") String tableName);
//copy table
void copyTable(@Param("newTableName") String newTableName,
@Param("originalTableName") String originalTableName);
//获取表记录数
int getRecordCount(@Param("tableName") String tableName);
//查询数据库中表是否存在
int isTableInDb(@Param("dataBaseName") String dataBaseName,
@Param("tableName") String tableName);
}

View File

@ -0,0 +1,22 @@
package com.ruoyi.bps.service;
import com.ruoyi.bps.domain.ExpSubscribe;
import com.kuaidi100.sdk.response.SubscribeResp;
import javax.servlet.http.HttpServletRequest;
public interface IExpSubsPushApiService {
public SubscribeResp ExpressSubscribe(ExpSubscribe expSubscribe);
/**
* 快递100订阅推送处理
*
* 回调接口支持自定义参数,比如订阅时回调地址填写的是 http://www.xxx.com?orderId=1233333
* 可以通过下面这种方式获取到orderId String orderId = request.getParameter("orderId");
*
* 返回值必须是下面这样的格式否则快递100将认为该推送失败快递100将会重试3次该推送时间间隔35分钟
* 成功结果返回例子 {"result":true,"returnCode":"200","message":"提交成功"}
*
*/
public SubscribeResp ExpressSubscribeCallBackUrl(HttpServletRequest request);
}

View File

@ -0,0 +1,63 @@
package com.ruoyi.bps.service;
import com.ruoyi.bps.domain.ExpSubsPushResp;
import java.util.List;
/**
* 快递订阅推送信息Service接口
*
* @author box
* @date 2021-05-13
*/
public interface IExpSubsPushRespService
{
/**
* 查询快递订阅推送信息
*
* @param sid 快递订阅推送信息ID
* @return 快递订阅推送信息
*/
public ExpSubsPushResp selectExpSubsPushRespById(Long sid);
/**
* 查询快递订阅推送信息列表
*
* @param expSubsPushResp 快递订阅推送信息
* @return 快递订阅推送信息集合
*/
public List<ExpSubsPushResp> selectExpSubsPushRespList(ExpSubsPushResp expSubsPushResp);
/**
* 新增快递订阅推送信息
*
* @param expSubsPushResp 快递订阅推送信息
* @return 结果
*/
public int insertExpSubsPushResp(ExpSubsPushResp expSubsPushResp);
/**
* 修改快递订阅推送信息
*
* @param expSubsPushResp 快递订阅推送信息
* @return 结果
*/
public int updateExpSubsPushResp(ExpSubsPushResp expSubsPushResp);
/**
* 批量删除快递订阅推送信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteExpSubsPushRespByIds(String ids);
/**
* 删除快递订阅推送信息信息
*
* @param sid 快递订阅推送信息ID
* @return 结果
*/
public int deleteExpSubsPushRespById(Long sid);
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.bps.service;
import com.ruoyi.bps.domain.ExpSubscribe;
import java.util.List;
/**
* 快递订阅Service接口
*
* @author box
* @date 2021-05-20
*/
public interface IExpSubscribeService
{
/**
* 查询快递订阅
*
* @param sid 快递订阅ID
* @return 快递订阅
*/
public ExpSubscribe selectExpSubscribeById(Long sid);
/**
* 查询快递订阅列表
*
* @param expSubscribe 快递订阅
* @return 快递订阅集合
*/
public List<ExpSubscribe> selectExpSubscribeList(ExpSubscribe expSubscribe);
/**
* 新增快递订阅
*
* @param expSubscribe 快递订阅
* @return 结果
*/
public int insertExpSubscribe(ExpSubscribe expSubscribe);
/**
* 修改快递订阅
*
* @param expSubscribe 快递订阅
* @return 结果
*/
public int updateExpSubscribe(ExpSubscribe expSubscribe);
/**
* 批量删除快递订阅
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteExpSubscribeByIds(String ids);
/**
* 删除快递订阅信息
*
* @param sid 快递订阅ID
* @return 结果
*/
public int deleteExpSubscribeById(Long sid);
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.bps.service;
import com.ruoyi.bps.domain.ExpressInfo;
import java.util.List;
/**
* 快递信息Service接口
*
* @author box
* @date 2021-05-06
*/
public interface IExpressInfoService
{
/**
* 查询快递信息
*
* @param message 快递信息ID
* @return 快递信息
*/
public ExpressInfo selectExpressInfoById(String message);
/**
* 查询快递信息列表
*
* @param expressInfo 快递信息
* @return 快递信息集合
*/
public List<ExpressInfo> selectExpressInfoList(ExpressInfo expressInfo);
/**
* 新增快递信息
*
* @param expressInfo 快递信息
* @return 结果
*/
public int insertExpressInfo(ExpressInfo expressInfo);
/**
* 修改快递信息
*
* @param expressInfo 快递信息
* @return 结果
*/
public int updateExpressInfo(ExpressInfo expressInfo);
/**
* 批量删除快递信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteExpressInfoByIds(String ids);
/**
* 删除快递信息信息
*
* @param message 快递信息ID
* @return 结果
*/
public int deleteExpressInfoById(String message);
}

View File

@ -0,0 +1,33 @@
package com.ruoyi.bps.service;
//import com.ruoyi.bps.express.request.QueryTrackParam;
//import com.ruoyi.bps.express.response.QueryTrackResp;
import com.kuaidi100.sdk.request.QueryTrackParam;
import com.kuaidi100.sdk.response.QueryTrackResp;
import java.util.List;
public interface IExpressService {
public List<QueryTrackResp> QueryTrackExpressMultiList(List<QueryTrackParam> list);
/**
* 查询多条物流轨迹
*/
public String QueryTrackExpressMulti(List<QueryTrackParam> list);
/**
* 查询物流轨迹
*/
public String QueryTrackExpress(QueryTrackParam qt);
/**
* 订阅
*/
public String SubscribeExpress();
/**
* 测试快递单号合集
*/
public List<QueryTrackParam> GetTestQueryTrackParam();
}

View File

@ -0,0 +1,22 @@
package com.ruoyi.bps.service;
public interface TopgpDdlService {
//修改表名
int alterTableName(String originalTableName, String newTableName);
// truncate指定数据库表的数据
int truncateTable(String tableName);
//drop 指定定数据库表
int dropTable(String tableName);
//根据传入的表明创建新的表并且将原表的数据插入到新的Occur表中
void copyTable(String newTableName,String originalTableName);
//统计某张表中的总数据条数
int getRecordCount(String tableName);
//从指定数据库中查询是否存在某张表
int isTableInDb(String dataBaseName, String tableName);
}

View File

@ -0,0 +1,45 @@
package com.ruoyi.bps.service;
import com.ruoyi.bps.mapper.TopgpDdlMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
//@DataSource(value = DataSourceType.SLAVE)
//@DataSource(value = DataSourceType.TOPTESTDSREPORT)
public class TopgpDdlServiceImpl implements TopgpDdlService {
@Autowired
private TopgpDdlMapper topgpDdlMapper;
//修改表名
public int alterTableName(String originalTableName, String newTableName)
{
return topgpDdlMapper.alterTableName(originalTableName,newTableName);
}
// truncate指定数据库表的数据
public int truncateTable(String tableName){
return topgpDdlMapper.truncateTable(tableName);
}
//drop 指定定数据库表
public int dropTable(String tableName){
return topgpDdlMapper.dropTable(tableName);
}
//根据传入的表明创建新的表并且将原表的数据插入到新的Occur表中
public void copyTable(String newTableName,String originalTableName){
return ;
}
//统计某张表中的总数据条数
public int getRecordCount(String tableName){
return topgpDdlMapper.getRecordCount(tableName);
}
//从指定数据库中查询是否存在某张表
public int isTableInDb(String dataBaseName, String tableName){
return topgpDdlMapper.isTableInDb(dataBaseName,tableName);
}
}

View File

@ -0,0 +1,257 @@
package com.ruoyi.bps.service.impl;
import com.ruoyi.bps.domain.ExpSubsPushResp;
import com.ruoyi.bps.domain.ExpSubscribe;
import com.ruoyi.bps.service.IExpSubsPushApiService;
import com.ruoyi.bps.service.IExpSubsPushRespService;
import com.ruoyi.bps.service.IExpSubscribeService;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.google.gson.Gson;
import com.kuaidi100.sdk.api.Subscribe;
import com.kuaidi100.sdk.contant.ApiInfoConstant;
import com.kuaidi100.sdk.core.IBaseClient;
import com.kuaidi100.sdk.pojo.HttpResult;
import com.kuaidi100.sdk.request.SubscribeParam;
import com.kuaidi100.sdk.request.SubscribeParameters;
import com.kuaidi100.sdk.request.SubscribeReq;
import com.kuaidi100.sdk.response.SubscribePushData;
import com.kuaidi100.sdk.response.SubscribePushParamResp;
import com.kuaidi100.sdk.response.SubscribePushResult;
import com.kuaidi100.sdk.response.SubscribeResp;
import com.kuaidi100.sdk.utils.PropertiesReader;
import com.kuaidi100.sdk.utils.SignUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Service
public class ExpSubsPushApiServiceImpl implements IExpSubsPushApiService {
String key = PropertiesReader.get("key");
String customer = PropertiesReader.get("customer");
String secret = PropertiesReader.get("secret");
String siid = PropertiesReader.get("siid");
String userid = PropertiesReader.get("userid");
String tid = PropertiesReader.get("tid");
String secret_key = PropertiesReader.get("secret_key");
String secret_secret = PropertiesReader.get("secret_secret");
@Autowired
private IExpSubsPushRespService expSubsPushRespService;
@Autowired
IExpSubscribeService expSubscribeService;
/**
* 订阅快递
* @throws Exception
*/
@Override
public SubscribeResp ExpressSubscribe(ExpSubscribe expSubscribe) {
SubscribeParameters subscribeParameters = new SubscribeParameters();
SubscribeResp subscribeResp = new SubscribeResp();
subscribeParameters.setCallbackurl("http://report.bpsemi.cn:8081/it_war/anon/subscribeCallBackUrl");
subscribeParameters.setPhone(expSubscribe.getPhone());
subscribeParameters.setSalt("bpsemi");
SubscribeParam subscribeParam = new SubscribeParam();
subscribeParam.setParameters(subscribeParameters);
subscribeParam.setCompany(expSubscribe.getCompany());
subscribeParam.setNumber(expSubscribe.getNumber());
subscribeParam.setKey(key);
SubscribeReq subscribeReq = new SubscribeReq();
subscribeReq.setSchema(ApiInfoConstant.SUBSCRIBE_SCHEMA);
subscribeReq.setParam(new Gson().toJson(subscribeParam));
IBaseClient subscribe = new Subscribe();
try{
HttpResult httpResult= subscribe.execute(subscribeReq);
System.out.println(httpResult);
subscribeResp= new Gson().fromJson(httpResult.getBody(),SubscribeResp.class);
}catch (Exception e)
{
return subscribeResp;
}
//如果快递公司或快递单号为空则直接返回订阅结果
if(StringUtils.isEmpty(expSubscribe.getCompany()) || StringUtils.isEmpty(expSubscribe.getNumber()))
{
return subscribeResp;
}
//订阅记录写入数据库
ExpSubscribe newExpSubscribe = new ExpSubscribe();
newExpSubscribe.setCompany(expSubscribe.getCompany());
newExpSubscribe.setNumber(expSubscribe.getNumber());
newExpSubscribe.setPhone(expSubscribe.getPhone());
newExpSubscribe.setSalt("bpsemi");
newExpSubscribe.setSubscribeTime(DateUtils.dateTimeNow("yyyy-MM-dd HH:mm:ss"));
newExpSubscribe.setResult((subscribeResp.isResult())?"ture":"false");
newExpSubscribe.setReturnCode(subscribeResp.getReturnCode());
newExpSubscribe.setMessage(subscribeResp.getMessage());
ExpSubscribe queryExpSubscribe = new ExpSubscribe();
queryExpSubscribe.setCompany(expSubscribe.getCompany());
queryExpSubscribe.setNumber(expSubscribe.getNumber());
queryExpSubscribe.setResult(expSubscribe.getResult());
queryExpSubscribe.setReturnCode(expSubscribe.getReturnCode());
List<ExpSubscribe> list=expSubscribeService.selectExpSubscribeList(queryExpSubscribe);
if(list.size()>0){
//如果数据库中存在快递单号+快递公司编码+结果+返回码相同则更新记录
for(ExpSubscribe es:list){
queryExpSubscribe= newExpSubscribe;
queryExpSubscribe.setSid(es.getSid());
expSubscribeService.updateExpSubscribe(queryExpSubscribe);
}
}else {
//如果数据库中没有快递单号+快递公司编码则更插入新记录
expSubscribeService.insertExpSubscribe(newExpSubscribe);
}
//返回订阅结果
return subscribeResp;
}
/**
* 获取从快递100订阅的快递推送信息并返回响应结果
*
* @param request 快递100推送的订阅信息
* @return 结果
*/
@Override
public SubscribeResp ExpressSubscribeCallBackUrl(HttpServletRequest request) {
//如果推送信息中没有包含
if(StringUtils.isEmpty(request.getParameter("param"))
|| StringUtils.isEmpty(request.getParameter("sign"))) {
SubscribeResp subscribeResp= new SubscribeResp();
subscribeResp.setResult(Boolean.FALSE);
subscribeResp.setReturnCode("701");
subscribeResp.setMessage("推送的信息不合法!");
return subscribeResp;
}
String param= request.getParameter("param");
String sign = request.getParameter("sign");
//log.debug("快递100订阅推送回调结果|{}|{}",param,sign);
//订阅时传的salt
String salt = "bpsemi";
String ourSign = SignUtils.sign(param + salt);
SubscribeResp subscribeResp = new SubscribeResp();
subscribeResp.setResult(Boolean.TRUE);
subscribeResp.setReturnCode("200");
//加密如果不等则不属于快递100推送忽略掉当前请求
if (!ourSign.equals(sign)){
subscribeResp.setMessage("接受成功!但加密验证不通过【sign】"+sign+"【ourSign】"+ourSign);
return subscribeResp;
}
//加密相等继续处理业务逻辑
subscribeResp.setMessage("接受成功!加密验证通过【sign】"+sign+"【ourSign】"+ourSign);
SubscribePushParamResp subscribePushParamResp = new Gson().fromJson(param, SubscribePushParamResp.class);
SubscribePushResult subscribePushResult = subscribePushParamResp.getLastResult();
//快递单号
String nu = subscribePushResult.getNu();
//监控状态 (polling:监控中shutdown:结束abort:中止updateall重新推送其中当快递单为已签收时status=shutdown)
String status= subscribePushParamResp.getStatus();
if(status.equals("abort")){
//todo
//当message为3天查询无记录60天无变化时status= abort 对于status=abort的状态的处理逻辑
//将Abort信息存档然后预警
}
//快递单当前状态 0在途1揽收2疑难3签收4退签5派件6退回7转单10待清关11清关中12已清关13清关异常14收件人拒签)
String state = subscribePushResult.getState();
if(state.equals("3")){
//处理签收逻辑
//将快递流转状态存入数据库
ExpSubsPushResp expSubsPushResp=new ExpSubsPushResp();
expSubsPushResp.setLastResultNu(subscribePushResult.getNu());
expSubsPushResp.setLastResultCom(subscribePushResult.getCom());
List<ExpSubsPushResp> list=expSubsPushRespService.selectExpSubsPushRespList(expSubsPushResp);
if(list.size()>0){
//如果数据库中存在快递单号+快递公司编码则更新记录
ExpSubsPushResp newExpSubsPushResp= ToExpSubsPushResp(subscribePushParamResp);
for(ExpSubsPushResp expr:list){
newExpSubsPushResp.setSid(expr.getSid());
expSubsPushRespService.updateExpSubsPushResp(newExpSubsPushResp);
newExpSubsPushResp.setSid(null);
}
}else {
//如果数据库中没有快递单号+快递公司编码则更插入新记录
expSubsPushRespService.insertExpSubsPushResp(ToExpSubsPushResp(subscribePushParamResp));
}
}
return subscribeResp;
}
/**
* 将快递100推送的信息转换为ExpSubsPushResp
* @param subscribePushParamResp
* @return ExpSubsPushResp
*/
private ExpSubsPushResp ToExpSubsPushResp(SubscribePushParamResp subscribePushParamResp){
ExpSubsPushResp expSubsPushResp=new ExpSubsPushResp();
SubscribePushResult subscribePushLastResult = subscribePushParamResp.getLastResult();
SubscribePushResult subscribePushDestResult = subscribePushParamResp.getDestResult();
expSubsPushResp.setStatus(subscribePushParamResp.getStatus());
expSubsPushResp.setBillStatus(subscribePushParamResp.getBillstatus());
expSubsPushResp.setMessage(subscribePushParamResp.getMessage());
expSubsPushResp.setAutoCheck(subscribePushParamResp.getAutoCheck());
expSubsPushResp.setComOld(subscribePushParamResp.getComOld());
expSubsPushResp.setComNew(subscribePushParamResp.getComNew());
expSubsPushResp.setLastResultMessage(subscribePushLastResult.getMessage());
expSubsPushResp.setLastResultState(subscribePushLastResult.getState());
expSubsPushResp.setLastResulStatus(subscribePushLastResult.getStatus());
expSubsPushResp.setLastResultCondition(subscribePushLastResult.getCondition());
expSubsPushResp.setLastResultIsCheck(subscribePushLastResult.getIscheck());
expSubsPushResp.setLastResultCom(subscribePushLastResult.getCom());
expSubsPushResp.setLastResultNu(subscribePushLastResult.getNu());
expSubsPushResp.setLastResultData(SubscribePushDataToString(subscribePushLastResult.getData()));
if(subscribePushDestResult != null) {
//只有邮政国外的快递推送才会有DestResult信息
expSubsPushResp.setDestResultMessage(subscribePushDestResult.getMessage());
expSubsPushResp.setDestResultState(subscribePushDestResult.getState());
expSubsPushResp.setDestResultStatus(subscribePushDestResult.getStatus());
expSubsPushResp.setDestResultCondition(subscribePushDestResult.getCondition());
expSubsPushResp.setDestResultIsCheck(subscribePushDestResult.getIscheck());
expSubsPushResp.setDestResultCom(subscribePushDestResult.getCom());
expSubsPushResp.setDestResultNu(subscribePushDestResult.getNu());
expSubsPushResp.setDestResultData(SubscribePushDataToString(subscribePushDestResult.getData()));
}
return expSubsPushResp;
}
/**
*
* @param list 将List<SubscribePushData>转化为字符串
* @return
*/
private String SubscribePushDataToString(List<SubscribePushData> list){
String str="";
for(SubscribePushData subscribePushData:list){
str+=""+subscribePushData.getTime()+"";
if(StringUtils.isNotEmpty(subscribePushData.getAreaName()))
{
str+=subscribePushData.getAreaName()+"/"; //某些快递没有AreaName信息
}
str+=subscribePushData.getContext();
if(list.size()-1>list.indexOf(subscribePushData)){
//str+="\r\n";
str+="</br>";
}
}
System.out.println(str);
return str;
}
}

View File

@ -0,0 +1,95 @@
package com.ruoyi.bps.service.impl;
import com.ruoyi.bps.domain.ExpSubsPushResp;
import com.ruoyi.bps.mapper.ExpSubsPushRespMapper;
import com.ruoyi.bps.service.IExpSubsPushRespService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 快递订阅推送信息Service业务层处理
*
* @author box
* @date 2021-05-13
*/
@Service
public class ExpSubsPushRespServiceImpl implements IExpSubsPushRespService
{
@Autowired
private ExpSubsPushRespMapper expSubsPushRespMapper;
/**
* 查询快递订阅推送信息
*
* @param sid 快递订阅推送信息ID
* @return 快递订阅推送信息
*/
@Override
public ExpSubsPushResp selectExpSubsPushRespById(Long sid)
{
return expSubsPushRespMapper.selectExpSubsPushRespById(sid);
}
/**
* 查询快递订阅推送信息列表
*
* @param expSubsPushResp 快递订阅推送信息
* @return 快递订阅推送信息
*/
@Override
public List<ExpSubsPushResp> selectExpSubsPushRespList(ExpSubsPushResp expSubsPushResp)
{
return expSubsPushRespMapper.selectExpSubsPushRespList(expSubsPushResp);
}
/**
* 新增快递订阅推送信息
*
* @param expSubsPushResp 快递订阅推送信息
* @return 结果
*/
@Override
public int insertExpSubsPushResp(ExpSubsPushResp expSubsPushResp)
{
return expSubsPushRespMapper.insertExpSubsPushResp(expSubsPushResp);
}
/**
* 修改快递订阅推送信息
*
* @param expSubsPushResp 快递订阅推送信息
* @return 结果
*/
@Override
public int updateExpSubsPushResp(ExpSubsPushResp expSubsPushResp)
{
return expSubsPushRespMapper.updateExpSubsPushResp(expSubsPushResp);
}
/**
* 删除快递订阅推送信息对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteExpSubsPushRespByIds(String ids)
{
return expSubsPushRespMapper.deleteExpSubsPushRespByIds(Convert.toStrArray(ids));
}
/**
* 删除快递订阅推送信息信息
*
* @param sid 快递订阅推送信息ID
* @return 结果
*/
@Override
public int deleteExpSubsPushRespById(Long sid)
{
return expSubsPushRespMapper.deleteExpSubsPushRespById(sid);
}
}

View File

@ -0,0 +1,95 @@
package com.ruoyi.bps.service.impl;
import com.ruoyi.bps.domain.ExpSubscribe;
import com.ruoyi.bps.mapper.ExpSubscribeMapper;
import com.ruoyi.bps.service.IExpSubscribeService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 快递订阅Service业务层处理
*
* @author box
* @date 2021-05-20
*/
@Service
public class ExpSubscribeServiceImpl implements IExpSubscribeService
{
@Autowired
private ExpSubscribeMapper expSubscribeMapper;
/**
* 查询快递订阅
*
* @param sid 快递订阅ID
* @return 快递订阅
*/
@Override
public ExpSubscribe selectExpSubscribeById(Long sid)
{
return expSubscribeMapper.selectExpSubscribeById(sid);
}
/**
* 查询快递订阅列表
*
* @param expSubscribe 快递订阅
* @return 快递订阅
*/
@Override
public List<ExpSubscribe> selectExpSubscribeList(ExpSubscribe expSubscribe)
{
return expSubscribeMapper.selectExpSubscribeList(expSubscribe);
}
/**
* 新增快递订阅
*
* @param expSubscribe 快递订阅
* @return 结果
*/
@Override
public int insertExpSubscribe(ExpSubscribe expSubscribe)
{
return expSubscribeMapper.insertExpSubscribe(expSubscribe);
}
/**
* 修改快递订阅
*
* @param expSubscribe 快递订阅
* @return 结果
*/
@Override
public int updateExpSubscribe(ExpSubscribe expSubscribe)
{
return expSubscribeMapper.updateExpSubscribe(expSubscribe);
}
/**
* 删除快递订阅对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteExpSubscribeByIds(String ids)
{
return expSubscribeMapper.deleteExpSubscribeByIds(Convert.toStrArray(ids));
}
/**
* 删除快递订阅信息
*
* @param sid 快递订阅ID
* @return 结果
*/
@Override
public int deleteExpSubscribeById(Long sid)
{
return expSubscribeMapper.deleteExpSubscribeById(sid);
}
}

View File

@ -0,0 +1,259 @@
package com.ruoyi.bps.service.impl;
import com.ruoyi.bps.domain.ExpressInfo;
import com.ruoyi.bps.mapper.ExpressInfoMapper;
import com.ruoyi.bps.service.IExpressInfoService;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.StringUtils;
import com.google.gson.Gson;
import com.kuaidi100.sdk.api.AutoNum;
import com.kuaidi100.sdk.api.QueryTrack;
import com.kuaidi100.sdk.core.IBaseClient;
import com.kuaidi100.sdk.pojo.HttpResult;
import com.kuaidi100.sdk.request.AutoNumReq;
import com.kuaidi100.sdk.request.QueryTrackParam;
import com.kuaidi100.sdk.request.QueryTrackReq;
import com.kuaidi100.sdk.response.AutoNumResp;
import com.kuaidi100.sdk.response.QueryTrackData;
import com.kuaidi100.sdk.response.QueryTrackResp;
import com.kuaidi100.sdk.utils.PropertiesReader;
import com.kuaidi100.sdk.utils.SignUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* 快递信息Service业务层处理
*
* @author box
* @date 2021-05-06
*/
@Service
public class ExpressInfoServiceImpl implements IExpressInfoService
{
/*
String key = "Jydbrxsm2311";
String customer = "2DD48B3469B82F2B7700569093AB792B";
String secret = "8781ed9b35a7438499eb02fee915915a";
String userid = "2a62da2192c24d17a943ff78ee64f8c6";
*/
String key = PropertiesReader.get("key");
String customer = PropertiesReader.get("customer");
String secret = PropertiesReader.get("secret");
String siid = PropertiesReader.get("siid");
String userid = PropertiesReader.get("userid");
String tid = PropertiesReader.get("tid");
String secret_key = PropertiesReader.get("secret_key");
String secret_secret = PropertiesReader.get("secret_secret");
String msg="";
@Autowired
private ExpressInfoMapper expressInfoMapper;
/**
* 查询快递信息
*
* @param message 快递信息ID
* @return 快递信息
*/
@Override
public ExpressInfo selectExpressInfoById(String message)
{
return expressInfoMapper.selectExpressInfoById(message);
}
/**
* 查询快递信息列表
*
* @param expressInfo 快递信息
* @return 快递信息列表
*/
@Override
public List<ExpressInfo> selectExpressInfoList(ExpressInfo expressInfo)
{
List<ExpressInfo> expressInfoList=new ArrayList<>();
//如果没有输入订单号则返回空信息
String nuStr=expressInfo.getNu();
if(StringUtils.isEmpty(nuStr)){
expressInfo.setData("请输入订单号进行查询!");
expressInfoList.add(expressInfo);
return expressInfoList;
}
//如果是顺丰则必须要输入电话号码
if( StringUtils.isEmpty(expressInfo.getPhone())
&& (expressInfo.getCom().equals("nsf") || expressInfo.getCom().contains("shunfeng"))){
expressInfo.setData("查询顺丰快递信息,必须要提供收/寄人电话号码");
expressInfoList.add(expressInfo);
return expressInfoList;
}
List<String> stringList= Arrays.asList(nuStr.split(","));
ExpressInfo newExpressInfo= expressInfo;
for(String str:stringList){
newExpressInfo.setNu(str);
expressInfoList.add(SelectExpressInfo(newExpressInfo));
}
return expressInfoList;
//return expressInfoMapper.selectExpressInfoList(expressInfo);
}
private ExpressInfo SelectExpressInfo(ExpressInfo expressInfo){
String nu=expressInfo.getNu(); //快递单号
String com=expressInfo.getCom(); //快递公司
String phone=expressInfo.getPhone(); //寄件人电话号码
ExpressInfo callbackExpressInfo=new ExpressInfo();
callbackExpressInfo.setNu(nu);
callbackExpressInfo.setPhone(phone);
//如果没有输入快递公司编号则查询快递公司编号
if(StringUtils.isEmpty(com)){
if(AutoGetExpressCom(nu)==null){
callbackExpressInfo.setData("根据快递单号查询不到快递公司,请确认快递单号是否正确!");
return callbackExpressInfo;
}
com=AutoGetExpressCom(nu).getComCode();
}
callbackExpressInfo.setCom(com);
//return callbackExpressInfo;
return QueryExpressInfo(callbackExpressInfo);
}
private ExpressInfo QueryExpressInfo(ExpressInfo expressInfo){
//从expressInfo中获取快递单号物流信息电话,生成快递请求参数
QueryTrackParam queryTrackParam= new QueryTrackParam();
queryTrackParam.setNum(expressInfo.getNu());
queryTrackParam.setCom(expressInfo.getCom());
queryTrackParam.setPhone(expressInfo.getPhone());
//获取快递信息
String param = new Gson().toJson(queryTrackParam);
QueryTrackReq queryTrackReq=new QueryTrackReq();
queryTrackReq.setParam(param);
queryTrackReq.setCustomer(customer);
queryTrackReq.setSign(SignUtils.querySign(param ,key,customer));
HttpResult httpResult =new HttpResult();
IBaseClient baseClient = new QueryTrack();
try {
httpResult = baseClient.execute(queryTrackReq);
msg=httpResult.getBody();
}
catch (Exception e) {
msg=e.toString();
}
//将快递信息转化为QueryTrackResp对象
QueryTrackResp queryTrackResp = new Gson().fromJson(msg,QueryTrackResp.class);
//如果没有查到物流信息则返回错误信息
if(StringUtils.isEmpty(queryTrackResp.getStatus()) || !queryTrackResp.getStatus().equals("200")){
expressInfo.setData(queryTrackResp.getMessage());
return expressInfo;
}
//将快递信息中的Context转化为字符
String dataStr="";
for(QueryTrackData queryTrackData :queryTrackResp.getData()){
dataStr+=""+queryTrackData.getTime()+"";
dataStr+=queryTrackData.getContext();
if(queryTrackResp.getData().size()-1>queryTrackResp.getData().indexOf(queryTrackData)){
dataStr+="\r";
}
}
ExpressInfo callbackExpressInfo=new ExpressInfo();
callbackExpressInfo.setMessage(queryTrackResp.getMessage());
callbackExpressInfo.setNu(queryTrackResp.getNu());
callbackExpressInfo.setIscheck(queryTrackResp.getIscheck());
callbackExpressInfo.setCom(queryTrackResp.getCom());
callbackExpressInfo.setStatus(queryTrackResp.getStatus());
callbackExpressInfo.setData(dataStr);
callbackExpressInfo.setState(queryTrackResp.getState());
callbackExpressInfo.setCondition(queryTrackResp.getCondition());
callbackExpressInfo.setRouteInfo(""); //出发位置当前位置到达位置暂无信息
callbackExpressInfo.setReturnCode(queryTrackResp.getReturnCode());
callbackExpressInfo.setResult(queryTrackResp.isResult()?"Y":"N");
callbackExpressInfo.setPhone(expressInfo.getPhone());
return callbackExpressInfo;
}
/**
* 根据快递单号查询快递公司编码
* @param num 快递单号
* @return 快递公司编码
*/
private AutoNumResp AutoGetExpressCom(String num){
AutoNumReq autoNumReq = new AutoNumReq();
autoNumReq.setKey(key);
autoNumReq.setNum(num);
IBaseClient baseClient = new AutoNum();
AutoNumResp autoNumResp=new AutoNumResp();
try {
String str= baseClient.execute(autoNumReq).getBody().replace("[","").replace("]","");
autoNumResp = new Gson().fromJson(str,AutoNumResp.class);
} catch (Exception e) {
e.printStackTrace();
}
return autoNumResp;
}
/**
* 新增快递信息
*
* @param expressInfo 快递信息
* @return 结果
*/
@Override
public int insertExpressInfo(ExpressInfo expressInfo)
{
return expressInfoMapper.insertExpressInfo(expressInfo);
}
/**
* 修改快递信息
*
* @param expressInfo 快递信息
* @return 结果
*/
@Override
public int updateExpressInfo(ExpressInfo expressInfo)
{
return expressInfoMapper.updateExpressInfo(expressInfo);
}
/**
* 删除快递信息对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteExpressInfoByIds(String ids)
{
return expressInfoMapper.deleteExpressInfoByIds(Convert.toStrArray(ids));
}
/**
* 删除快递信息信息
*
* @param message 快递信息ID
* @return 结果
*/
@Override
public int deleteExpressInfoById(String message)
{
return expressInfoMapper.deleteExpressInfoById(message);
}
}

View File

@ -0,0 +1,199 @@
package com.ruoyi.bps.service.impl;
//import com.ruoyi.bps.express.api.QueryTrack;
//import com.ruoyi.bps.express.api.Subscribe;
//import com.ruoyi.bps.express.contant.ApiInfoConstant;
//import com.ruoyi.bps.express.contant.CompanyConstant;
//import com.ruoyi.bps.express.core.IBaseClient;
//import com.ruoyi.bps.express.pojo.HttpResult;
//import com.ruoyi.bps.express.request.*;
//import com.ruoyi.bps.express.response.QueryTrackResp;
//import com.ruoyi.bps.express.utils.PropertiesReader;
//import com.ruoyi.bps.express.utils.SignUtils;
import com.google.gson.Gson;
import com.kuaidi100.sdk.api.QueryTrack;
import com.kuaidi100.sdk.api.Subscribe;
import com.kuaidi100.sdk.contant.ApiInfoConstant;
import com.kuaidi100.sdk.core.IBaseClient;
import com.kuaidi100.sdk.pojo.HttpResult;
import com.kuaidi100.sdk.request.*;
import com.kuaidi100.sdk.response.QueryTrackResp;
import com.kuaidi100.sdk.utils.PropertiesReader;
import com.kuaidi100.sdk.utils.SignUtils;
import com.ruoyi.bps.service.IExpressService;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class ExpressServiceImpl implements IExpressService {
/*
String key = "Jydbrxsm2311";
String customer = "2DD48B3469B82F2B7700569093AB792B";
String secret = "8781ed9b35a7438499eb02fee915915a";
String userid = "2a62da2192c24d17a943ff78ee64f8c6";
*/
String key = PropertiesReader.get("key");
String customer = PropertiesReader.get("customer");
String secret = PropertiesReader.get("secret");
String siid = PropertiesReader.get("siid");
String userid = PropertiesReader.get("userid");
String tid = PropertiesReader.get("tid");
String secret_key = PropertiesReader.get("secret_key");
String secret_secret = PropertiesReader.get("secret_secret");
String msg="";
@Autowired
IExpressService expressService;
@Override
public List<QueryTrackResp> QueryTrackExpressMultiList(List<QueryTrackParam> list) {
List<QueryTrackResp> qtList=new ArrayList<>();
for(QueryTrackParam queryTrackParam:list)
{
QueryTrackResp queryTrackResp = new Gson().fromJson(expressService.QueryTrackExpress(queryTrackParam),QueryTrackResp.class);
qtList.add(queryTrackResp);
}
return qtList;
}
/**
*查询多个物流轨迹
*/
@Override
public String QueryTrackExpressMulti(List<QueryTrackParam> list) {
String str="";
for(QueryTrackParam qt:list){
str += QueryTrackExpress(qt);
}
return str;
}
/**
* 查询单个物流轨迹
*/
@Override
public String QueryTrackExpress(QueryTrackParam queryTrackParam) {
String str="";
QueryTrackReq queryTrackReq = new QueryTrackReq();
String param = new Gson().toJson(queryTrackParam);
queryTrackReq.setParam(param);
queryTrackReq.setCustomer(customer);
queryTrackReq.setSign(SignUtils.querySign(param ,key,customer));
HttpResult httpResult=new HttpResult();
IBaseClient baseClient = new QueryTrack();
try {
httpResult = baseClient.execute(queryTrackReq);
msg=httpResult.getBody();
}
catch (Exception e) {
msg=e.toString();
}
JSONObject jsonObject = new JSONObject(msg);
if (jsonObject.has("returnCode")){
QueryTrackResp queryTrackResp= new Gson().fromJson(msg,QueryTrackResp.class);
queryTrackResp.setStatus(queryTrackResp.getReturnCode());
queryTrackResp.setNu(queryTrackParam.getNum());
msg= new Gson().toJson(queryTrackResp);
}
/* else {
QueryTrackResp queryTrackResp=new Gson().fromJson(msg,QueryTrackResp.class);
for(int i=0;i<queryTrackResp.getData().size();i++) {
QueryTrackData queryTrackData = queryTrackResp.getData().get(i);
str += "时间:" + queryTrackData.getTime();
str += " 物流信息:" + queryTrackData.getContext();
str += " 格式化后时间+" + queryTrackData.getFtime();
} *
}*/
// System.out.println(msg);
return msg;
}
/**
* 查询物流转迹
*/
@Override
public String SubscribeExpress() {
SubscribeParameters subscribeParameters = new SubscribeParameters();
subscribeParameters.setCallbackurl("http://www.baidu.com"); //回调接口的地址必须
subscribeParameters.setPhone("17725390266"); //寄件人电话号码非必须
SubscribeParam subscribeParam = new SubscribeParam();
subscribeParam.setParameters(subscribeParameters);
subscribeParam.setCompany("annengwuliu"); //快递公司编码小写必须
subscribeParam.setNumber("300445967949"); //快递单号, 必须
subscribeParam.setKey(key); //授权码必须
SubscribeReq subscribeReq = new SubscribeReq();
subscribeReq.setSchema(ApiInfoConstant.SUBSCRIBE_SCHEMA); //返回的数据格式必须
subscribeReq.setParam(new Gson().toJson(subscribeParam));
IBaseClient subscribe = new Subscribe();
try{
msg=subscribe.execute(subscribeReq).toString();
}
catch (Exception e) {
msg=e.toString();
}
System.out.println(msg);
return msg;
}
@Override
public List<QueryTrackParam> GetTestQueryTrackParam() {
QueryTrackParam queryTrackParam = new QueryTrackParam();
List<QueryTrackParam> list=new ArrayList<QueryTrackParam>();
queryTrackParam.setCom("annengwuliu");
queryTrackParam.setNum("300445967949");
queryTrackParam.setPhone("17725390266");
list.add(queryTrackParam);
QueryTrackParam queryTrackParam1 = new QueryTrackParam();
queryTrackParam1.setCom("annengwuliu");
queryTrackParam1.setNum("300445967135");
queryTrackParam1.setPhone("17725390266");
list.add(queryTrackParam1);
QueryTrackParam queryTrackParam2 = new QueryTrackParam();
queryTrackParam2.setCom("annengwuliu");
queryTrackParam2.setNum("3004459670971");
queryTrackParam2.setPhone("17725390266");
list.add(queryTrackParam2);
/*
QueryTrackParam queryTrackParam3 = new QueryTrackParam();
queryTrackParam3.setCom(CompanyConstant.AN);
queryTrackParam3.setNum("300445967045");
queryTrackParam3.setPhone("17725390266");
list.add(queryTrackParam3);
QueryTrackParam queryTrackParam4 = new QueryTrackParam();
queryTrackParam4.setCom(CompanyConstant.AN);
queryTrackParam4.setNum("300443569920");
queryTrackParam4.setPhone("17725390266");
list.add(queryTrackParam4);
QueryTrackParam queryTrackParam5 = new QueryTrackParam();
queryTrackParam5.setCom(CompanyConstant.AN);
queryTrackParam5.setNum("300443569878");
queryTrackParam5.setPhone("17725390266");
list.add(queryTrackParam5);
QueryTrackParam queryTrackParam6 = new QueryTrackParam();
queryTrackParam6.setCom(CompanyConstant.AN);
queryTrackParam6.setNum("300443569880");
queryTrackParam6.setPhone("17725390266");
list.add(queryTrackParam6);
*/
return list;
}
}

View File

@ -0,0 +1,25 @@
#快递100的基础账号信息可以在这里获取
# https://poll.kuaidi100.com/manager/page/myinfo/enterprise
key = Jydbrxsm2311
customer = 2DD48B3469B82F2B7700569093AB792B
secret = 8781ed9b35a7438499eb02fee915915a
userid = 2a62da2192c24d17a943ff78ee64f8c6
#电子面单快递公司账号信息(非必填)
partnerId =
partnerKey =
net =
siid =
#短信模板id非必填
tid =
#云平台相关(非必填)
#登录云平台 https://cloud.kuaidi100.com/buyer/user/info
secret_key =
secret_secret =
#是否记录快递100接口返回结果建议记录日志或者入库方便后期有问题双方排查true:启用 false: 关闭
log.return.record = true
#日志记录位置,建议根据自身情况配置
logPath = logs

View File

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.bps.mapper.ExpSubsPushRespMapper">
<resultMap type="ExpSubsPushResp" id="ExpSubsPushRespResult">
<result property="sid" column="sid" />
<result property="status" column="status" />
<result property="billStatus" column="billStatus" />
<result property="message" column="message" />
<result property="autoCheck" column="autoCheck" />
<result property="comOld" column="comOld" />
<result property="comNew" column="comNew" />
<result property="lastResultMessage" column="lastResultMessage" />
<result property="lastResultState" column="lastResultState" />
<result property="lastResulStatus" column="lastResulStatus" />
<result property="lastResultCondition" column="lastResultCondition" />
<result property="lastResultIsCheck" column="lastResultIsCheck" />
<result property="lastResultCom" column="lastResultCom" />
<result property="lastResultNu" column="lastResultNu" />
<result property="lastResultData" column="lastResultData" />
<result property="destResultMessage" column="destResultMessage" />
<result property="destResultState" column="destResultState" />
<result property="destResultStatus" column="destResultStatus" />
<result property="destResultCondition" column="destResultCondition" />
<result property="destResultIsCheck" column="destResultIsCheck" />
<result property="destResultCom" column="destResultCom" />
<result property="destResultNu" column="destResultNu" />
<result property="destResultData" column="destResultData" />
</resultMap>
<sql id="selectExpSubsPushRespVo">
select sid, status, billStatus, message, autoCheck, comOld, comNew, lastResultMessage, lastResultState, lastResulStatus, lastResultCondition, lastResultIsCheck, lastResultCom, lastResultNu, lastResultData, destResultMessage, destResultState, destResultStatus, destResultCondition, destResultIsCheck, destResultCom, destResultNu, destResultData from exp_subs_push_resp
</sql>
<select id="selectExpSubsPushRespList" parameterType="ExpSubsPushResp" resultMap="ExpSubsPushRespResult">
<include refid="selectExpSubsPushRespVo"/>
<where>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="lastResultState != null and lastResultState != ''"> and lastResultState = #{lastResultState}</if>
<if test="lastResultIsCheck != null and lastResultIsCheck != ''"> and lastResultIsCheck = #{lastResultIsCheck}</if>
<if test="lastResultCom != null and lastResultCom != ''"> and lastResultCom = #{lastResultCom}</if>
<if test="lastResultNu != null and lastResultNu != ''"> and lastResultNu = #{lastResultNu}</if>
<if test="destResultState != null and destResultState != ''"> and destResultState = #{destResultState}</if>
<if test="destResultIsCheck != null and destResultIsCheck != ''"> and destResultIsCheck = #{destResultIsCheck}</if>
<if test="destResultCom != null and destResultCom != ''"> and destResultCom = #{destResultCom}</if>
<if test="destResultNu != null and destResultNu != ''"> and destResultNu = #{destResultNu}</if>
</where>
</select>
<select id="selectExpSubsPushRespById" parameterType="Long" resultMap="ExpSubsPushRespResult">
<include refid="selectExpSubsPushRespVo"/>
where sid = #{sid}
</select>
<insert id="insertExpSubsPushResp" parameterType="ExpSubsPushResp" useGeneratedKeys="true" keyProperty="sid">
insert into exp_subs_push_resp
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="status != null">status,</if>
<if test="billStatus != null">billStatus,</if>
<if test="message != null">message,</if>
<if test="autoCheck != null">autoCheck,</if>
<if test="comOld != null">comOld,</if>
<if test="comNew != null">comNew,</if>
<if test="lastResultMessage != null">lastResultMessage,</if>
<if test="lastResultState != null">lastResultState,</if>
<if test="lastResulStatus != null">lastResulStatus,</if>
<if test="lastResultCondition != null">lastResultCondition,</if>
<if test="lastResultIsCheck != null">lastResultIsCheck,</if>
<if test="lastResultCom != null">lastResultCom,</if>
<if test="lastResultNu != null">lastResultNu,</if>
<if test="lastResultData != null">lastResultData,</if>
<if test="destResultMessage != null">destResultMessage,</if>
<if test="destResultState != null">destResultState,</if>
<if test="destResultStatus != null">destResultStatus,</if>
<if test="destResultCondition != null">destResultCondition,</if>
<if test="destResultIsCheck != null">destResultIsCheck,</if>
<if test="destResultCom != null">destResultCom,</if>
<if test="destResultNu != null">destResultNu,</if>
<if test="destResultData != null">destResultData,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="status != null">#{status},</if>
<if test="billStatus != null">#{billStatus},</if>
<if test="message != null">#{message},</if>
<if test="autoCheck != null">#{autoCheck},</if>
<if test="comOld != null">#{comOld},</if>
<if test="comNew != null">#{comNew},</if>
<if test="lastResultMessage != null">#{lastResultMessage},</if>
<if test="lastResultState != null">#{lastResultState},</if>
<if test="lastResulStatus != null">#{lastResulStatus},</if>
<if test="lastResultCondition != null">#{lastResultCondition},</if>
<if test="lastResultIsCheck != null">#{lastResultIsCheck},</if>
<if test="lastResultCom != null">#{lastResultCom},</if>
<if test="lastResultNu != null">#{lastResultNu},</if>
<if test="lastResultData != null">#{lastResultData},</if>
<if test="destResultMessage != null">#{destResultMessage},</if>
<if test="destResultState != null">#{destResultState},</if>
<if test="destResultStatus != null">#{destResultStatus},</if>
<if test="destResultCondition != null">#{destResultCondition},</if>
<if test="destResultIsCheck != null">#{destResultIsCheck},</if>
<if test="destResultCom != null">#{destResultCom},</if>
<if test="destResultNu != null">#{destResultNu},</if>
<if test="destResultData != null">#{destResultData},</if>
</trim>
</insert>
<update id="updateExpSubsPushResp" parameterType="ExpSubsPushResp">
update exp_subs_push_resp
<trim prefix="SET" suffixOverrides=",">
<if test="status != null">status = #{status},</if>
<if test="billStatus != null">billStatus = #{billStatus},</if>
<if test="message != null">message = #{message},</if>
<if test="autoCheck != null">autoCheck = #{autoCheck},</if>
<if test="comOld != null">comOld = #{comOld},</if>
<if test="comNew != null">comNew = #{comNew},</if>
<if test="lastResultMessage != null">lastResultMessage = #{lastResultMessage},</if>
<if test="lastResultState != null">lastResultState = #{lastResultState},</if>
<if test="lastResulStatus != null">lastResulStatus = #{lastResulStatus},</if>
<if test="lastResultCondition != null">lastResultCondition = #{lastResultCondition},</if>
<if test="lastResultIsCheck != null">lastResultIsCheck = #{lastResultIsCheck},</if>
<if test="lastResultCom != null">lastResultCom = #{lastResultCom},</if>
<if test="lastResultNu != null">lastResultNu = #{lastResultNu},</if>
<if test="lastResultData != null">lastResultData = #{lastResultData},</if>
<if test="destResultMessage != null">destResultMessage = #{destResultMessage},</if>
<if test="destResultState != null">destResultState = #{destResultState},</if>
<if test="destResultStatus != null">destResultStatus = #{destResultStatus},</if>
<if test="destResultCondition != null">destResultCondition = #{destResultCondition},</if>
<if test="destResultIsCheck != null">destResultIsCheck = #{destResultIsCheck},</if>
<if test="destResultCom != null">destResultCom = #{destResultCom},</if>
<if test="destResultNu != null">destResultNu = #{destResultNu},</if>
<if test="destResultData != null">destResultData = #{destResultData},</if>
</trim>
where sid = #{sid}
</update>
<delete id="deleteExpSubsPushRespById" parameterType="Long">
delete from exp_subs_push_resp where sid = #{sid}
</delete>
<delete id="deleteExpSubsPushRespByIds" parameterType="String">
delete from exp_subs_push_resp where sid in
<foreach item="sid" collection="array" open="(" separator="," close=")">
#{sid}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.bps.mapper.ExpSubscribeMapper">
<resultMap type="ExpSubscribe" id="ExpSubscribeResult">
<result property="sid" column="sid" />
<result property="company" column="company" />
<result property="number" column="number" />
<result property="phone" column="phone" />
<result property="salt" column="salt" />
<result property="subscribeTime" column="subscribeTime" />
<result property="result" column="result" />
<result property="returnCode" column="returnCode" />
<result property="message" column="message" />
</resultMap>
<sql id="selectExpSubscribeVo">
select sid, company, number, phone, salt, subscribeTime, result, returnCode, message from exp_subscribe
</sql>
<select id="selectExpSubscribeList" parameterType="ExpSubscribe" resultMap="ExpSubscribeResult">
<include refid="selectExpSubscribeVo"/>
<where>
<if test="company != null and company != ''"> and company = #{company}</if>
<if test="number != null and number != ''"> and number = #{number}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="subscribeTime != null and subscribeTime != ''"> and subscribeTime like concat('%', #{subscribeTime}, '%')</if>
<if test="result != null and result != ''"> and result = #{result}</if>
<if test="returnCode != null and returnCode != ''"> and returnCode = #{returnCode}</if>
</where>
</select>
<select id="selectExpSubscribeById" parameterType="Long" resultMap="ExpSubscribeResult">
<include refid="selectExpSubscribeVo"/>
where sid = #{sid}
</select>
<insert id="insertExpSubscribe" parameterType="ExpSubscribe" useGeneratedKeys="true" keyProperty="sid">
insert into exp_subscribe
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="company != null">company,</if>
<if test="number != null">number,</if>
<if test="phone != null">phone,</if>
<if test="salt != null">salt,</if>
<if test="subscribeTime != null">subscribeTime,</if>
<if test="result != null">result,</if>
<if test="returnCode != null">returnCode,</if>
<if test="message != null">message,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="company != null">#{company},</if>
<if test="number != null">#{number},</if>
<if test="phone != null">#{phone},</if>
<if test="salt != null">#{salt},</if>
<if test="subscribeTime != null">#{subscribeTime},</if>
<if test="result != null">#{result},</if>
<if test="returnCode != null">#{returnCode},</if>
<if test="message != null">#{message},</if>
</trim>
</insert>
<update id="updateExpSubscribe" parameterType="ExpSubscribe">
update exp_subscribe
<trim prefix="SET" suffixOverrides=",">
<if test="company != null">company = #{company},</if>
<if test="number != null">number = #{number},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="salt != null">salt = #{salt},</if>
<if test="subscribeTime != null">subscribeTime = #{subscribeTime},</if>
<if test="result != null">result = #{result},</if>
<if test="returnCode != null">returnCode = #{returnCode},</if>
<if test="message != null">message = #{message},</if>
</trim>
where sid = #{sid}
</update>
<delete id="deleteExpSubscribeById" parameterType="Long">
delete from exp_subscribe where sid = #{sid}
</delete>
<delete id="deleteExpSubscribeByIds" parameterType="String">
delete from exp_subscribe where sid in
<foreach item="sid" collection="array" open="(" separator="," close=")">
#{sid}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.bps.mapper.ExpressInfoMapper">
<resultMap type="ExpressInfo" id="ExpressInfoResult">
<result property="message" column="message" />
<result property="nu" column="nu" />
<result property="ischeck" column="ischeck" />
<result property="com" column="com" />
<result property="status" column="status" />
<result property="data" column="data" />
<result property="state" column="state" />
<result property="condition" column="condition" />
<result property="routeInfo" column="routeInfo" />
<result property="returnCode" column="returnCode" />
<result property="result" column="result" />
<result property="phone" column="phone" />
</resultMap>
<sql id="selectExpressInfoVo">
select message, nu, ischeck, com, status, data, state, condition, routeInfo, returnCode, result, phone from expressInfo
</sql>
<select id="selectExpressInfoList" parameterType="ExpressInfo" resultMap="ExpressInfoResult">
<include refid="selectExpressInfoVo"/>
<where>
<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>
</where>
</select>
<select id="selectExpressInfoById" parameterType="String" resultMap="ExpressInfoResult">
<include refid="selectExpressInfoVo"/>
where message = #{message}
</select>
<insert id="insertExpressInfo" parameterType="ExpressInfo">
insert into expressInfo
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="message != null">message,</if>
<if test="nu != null">nu,</if>
<if test="ischeck != null">ischeck,</if>
<if test="com != null">com,</if>
<if test="status != null">status,</if>
<if test="data != null">data,</if>
<if test="state != null">state,</if>
<if test="condition != null">condition,</if>
<if test="routeInfo != null">routeInfo,</if>
<if test="returnCode != null">returnCode,</if>
<if test="result != null">result,</if>
<if test="phone != null">phone,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="message != null">#{message},</if>
<if test="nu != null">#{nu},</if>
<if test="ischeck != null">#{ischeck},</if>
<if test="com != null">#{com},</if>
<if test="status != null">#{status},</if>
<if test="data != null">#{data},</if>
<if test="state != null">#{state},</if>
<if test="condition != null">#{condition},</if>
<if test="routeInfo != null">#{routeInfo},</if>
<if test="returnCode != null">#{returnCode},</if>
<if test="result != null">#{result},</if>
<if test="phone != null">#{phone},</if>
</trim>
</insert>
<update id="updateExpressInfo" parameterType="ExpressInfo">
update expressInfo
<trim prefix="SET" suffixOverrides=",">
<if test="nu != null">nu = #{nu},</if>
<if test="ischeck != null">ischeck = #{ischeck},</if>
<if test="com != null">com = #{com},</if>
<if test="status != null">status = #{status},</if>
<if test="data != null">data = #{data},</if>
<if test="state != null">state = #{state},</if>
<if test="condition != null">condition = #{condition},</if>
<if test="routeInfo != null">routeInfo = #{routeInfo},</if>
<if test="returnCode != null">returnCode = #{returnCode},</if>
<if test="result != null">result = #{result},</if>
<if test="phone != null">phone = #{phone},</if>
</trim>
where message = #{message}
</update>
<delete id="deleteExpressInfoById" parameterType="String">
delete from expressInfo where message = #{message}
</delete>
<delete id="deleteExpressInfoByIds" parameterType="String">
delete from expressInfo where message in
<foreach item="message" collection="array" open="(" separator="," close=")">
#{message}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.bps.mapper.TopgpDdlMapper">
<update id="alterTableName">
alter table ${originalTableName} rename ${newTableName}
</update>
<update id="truncateTable">
truncate table ${tableName}
</update>
<update id="dropTable">
drop table ${tableName}
</update>
<update id="copyTable">
create table ${newTableName} as select * from ${originalTableName}
</update>
<select id="getRecordCount" resultType="int">
select count(1) from ${tableName}
</select>
<select id="isTableInDb" resultType="int">
SELECT COUNT(*) FROM ALL_TABLES WHERE OWNER = UPPER(#{dataBaseName}) AND TABLE_NAME = UPPER(#{tableName})
</select>
</mapper>

View File

@ -0,0 +1,97 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增快递信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-expressInfo-add">
<div class="form-group">
<label class="col-sm-3 control-label">消息:</label>
<div class="col-sm-8">
<input name="message" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递单号:</label>
<div class="col-sm-8">
<input name="nu" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">签收状态:</label>
<div class="col-sm-8">
<input name="ischeck" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递公司:</label>
<div class="col-sm-8">
<input name="com" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">通信状态:</label>
<div class="col-sm-8">
<input name="status" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">运单详情:</label>
<div class="col-sm-8">
<input name="data" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">当前状态:</label>
<div class="col-sm-8">
<input name="state" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态标志:</label>
<div class="col-sm-8">
<input name="condition" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">路由信息:</label>
<div class="col-sm-8">
<input name="routeInfo" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">返回码:</label>
<div class="col-sm-8">
<input name="returnCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">返回结果:</label>
<div class="col-sm-8">
<input name="result" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">电话号码:</label>
<div class="col-sm-8">
<input name="phone" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "bps/expressInfo"
$("#form-expressInfo-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-expressInfo-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,98 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改快递信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-expressInfo-edit" th:object="${expressInfo}">
<input name="message" th:field="*{message}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">消息:</label>
<div class="col-sm-8">
<input name="message" th:field="*{message}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递单号:</label>
<div class="col-sm-8">
<input name="nu" th:field="*{nu}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">签收状态:</label>
<div class="col-sm-8">
<input name="ischeck" th:field="*{ischeck}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递公司:</label>
<div class="col-sm-8">
<input name="com" th:field="*{com}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">通信状态:</label>
<div class="col-sm-8">
<input name="status" th:field="*{status}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">运单详情:</label>
<div class="col-sm-8">
<input name="data" th:field="*{data}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">当前状态:</label>
<div class="col-sm-8">
<input name="state" th:field="*{state}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态标志:</label>
<div class="col-sm-8">
<input name="condition" th:field="*{condition}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">路由信息:</label>
<div class="col-sm-8">
<input name="routeInfo" th:field="*{routeInfo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">返回码:</label>
<div class="col-sm-8">
<input name="returnCode" th:field="*{returnCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">返回结果:</label>
<div class="col-sm-8">
<input name="result" th:field="*{result}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">电话号码:</label>
<div class="col-sm-8">
<input name="phone" th:field="*{phone}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "bps/expressInfo";
$("#form-expressInfo-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-expressInfo-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,145 @@
<!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">
<div class="select-list">
<ul>
<li>
<label>快递单号:</label>
<input type="text" name="nu"/>
</li>
<li>
<label>快递公司:</label>
<input type="text" name="com"/>
</li>
<li>
<label>电话号码:</label>
<input type="text" name="phone"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="bps:expressInfo:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="bps:expressInfo:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="bps:expressInfo:remove">
<i class="fa fa-remove"></i> 删除
</a>
<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 + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "快递信息",
columns: [{
checkbox: true
},
/*
{
field: 'message',
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: '运单详情'
},
{
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: '电话号码'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.message + '\')"><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.message + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,169 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增快递订阅推送信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-expsubspushresp-add">
<div class="form-group">
<label class="col-sm-3 control-label">监控状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="status" value="">
<label th:for="status" th:text="未知"></label>
</div>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="billStatus" value="">
<label th:for="billStatus" th:text="未知"></label>
</div>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">监控状态消息:</label>
<div class="col-sm-8">
<input name="message" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递公司编码是否出错:</label>
<div class="col-sm-8">
<input name="autoCheck" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">原始快递公司编码:</label>
<div class="col-sm-8">
<input name="comOld" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">修正快递公司编码:</label>
<div class="col-sm-8">
<input name="comNew" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">当前快递消息:</label>
<div class="col-sm-8">
<input name="lastResultMessage" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">当前快递单状态:</label>
<div class="col-sm-8">
<input name="lastResultState" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">通讯状态:</label>
<div class="col-sm-8">
<input name="lastResulStatus" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递单明细状态:</label>
<div class="col-sm-8">
<input name="lastResultCondition" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否签收:</label>
<div class="col-sm-8">
<input name="lastResultIsCheck" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递公司编码:</label>
<div class="col-sm-8">
<input name="lastResultCom" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递单号:</label>
<div class="col-sm-8">
<input name="lastResultNu" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递流转信息:</label>
<div class="col-sm-8">
<input name="lastResultData" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国快递消息:</label>
<div class="col-sm-8">
<input name="destResultMessage" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国快递单状态:</label>
<div class="col-sm-8">
<input name="destResultState" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国通讯状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="destResultStatus" value="">
<label th:for="destResultStatus" th:text="未知"></label>
</div>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国快递单明细状态:</label>
<div class="col-sm-8">
<input name="destResultCondition" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国是否签收:</label>
<div class="col-sm-8">
<input name="destResultIsCheck" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国快递公司编码:</label>
<div class="col-sm-8">
<input name="destResultCom" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国快递单号:</label>
<div class="col-sm-8">
<input name="destResultNu" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国快递流转信息:</label>
<div class="col-sm-8">
<input name="destResultData" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "bps/expsubspushresp"
$("#form-expsubspushresp-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-expsubspushresp-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,170 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改快递订阅推送信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-expsubspushresp-edit" th:object="${expSubsPushResp}">
<input name="sid" th:field="*{sid}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">监控状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="status" value="">
<label th:for="status" th:text="未知"></label>
</div>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="billStatus" value="">
<label th:for="billStatus" th:text="未知"></label>
</div>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">监控状态消息:</label>
<div class="col-sm-8">
<input name="message" th:field="*{message}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递公司编码是否出错:</label>
<div class="col-sm-8">
<input name="autoCheck" th:field="*{autoCheck}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">原始快递公司编码:</label>
<div class="col-sm-8">
<input name="comOld" th:field="*{comOld}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">修正快递公司编码:</label>
<div class="col-sm-8">
<input name="comNew" th:field="*{comNew}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">当前快递消息:</label>
<div class="col-sm-8">
<input name="lastResultMessage" th:field="*{lastResultMessage}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">当前快递单状态:</label>
<div class="col-sm-8">
<input name="lastResultState" th:field="*{lastResultState}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">通讯状态:</label>
<div class="col-sm-8">
<input name="lastResulStatus" th:field="*{lastResulStatus}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递单明细状态:</label>
<div class="col-sm-8">
<input name="lastResultCondition" th:field="*{lastResultCondition}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否签收:</label>
<div class="col-sm-8">
<input name="lastResultIsCheck" th:field="*{lastResultIsCheck}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递公司编码:</label>
<div class="col-sm-8">
<input name="lastResultCom" th:field="*{lastResultCom}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递单号:</label>
<div class="col-sm-8">
<input name="lastResultNu" th:field="*{lastResultNu}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递流转信息:</label>
<div class="col-sm-8">
<input name="lastResultData" th:field="*{lastResultData}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国快递消息:</label>
<div class="col-sm-8">
<input name="destResultMessage" th:field="*{destResultMessage}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国快递单状态:</label>
<div class="col-sm-8">
<input name="destResultState" th:field="*{destResultState}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国通讯状态:</label>
<div class="col-sm-8">
<div class="radio-box">
<input type="radio" name="destResultStatus" value="">
<label th:for="destResultStatus" th:text="未知"></label>
</div>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国快递单明细状态:</label>
<div class="col-sm-8">
<input name="destResultCondition" th:field="*{destResultCondition}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国是否签收:</label>
<div class="col-sm-8">
<input name="destResultIsCheck" th:field="*{destResultIsCheck}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国快递公司编码:</label>
<div class="col-sm-8">
<input name="destResultCom" th:field="*{destResultCom}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国快递单号:</label>
<div class="col-sm-8">
<input name="destResultNu" th:field="*{destResultNu}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">目的国快递流转信息:</label>
<div class="col-sm-8">
<input name="destResultData" th:field="*{destResultData}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "bps/expsubspushresp";
$("#form-expsubspushresp-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-expsubspushresp-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,237 @@
<!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">
<div class="select-list">
<ul>
<!--<li>
<label>监控状态:</label>
<select name="status">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
</select>
</li>-->
<!--<li>
<label>当前状态:</label>
<input type="text" name="lastResultState"/>
</li>
<li>
<label>是否签收:</label>
<input type="text" name="lastResultIsCheck"/>
</li>
<li>
<label>快递公司编码:</label>
<input type="text" name="lastResultCom"/>
<label class="font-noraml">快递公司:</label>
</li>-->
<li>
<label class="font-noraml">当前状态:</label>
<select class="form-control" name="lastResultState" th:with="type=${@dict.getType('express_stats')}">
<option value="">---所有---</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label class="font-noraml">是否签收:</label>
<select class="form-control" name="lastResultIsCheck">
<option value="">---所有---</option>
<option value="0">未签收</option>
<option value="1">已签收</option>
</select>
</li>
<li>
<label class="font-noraml">快递公司:</label>
<select class="form-control" name="lastResultCom" th:with="type=${@dict.getType('express_company')}">
<option value="">---所有---</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>快递单号:</label>
<input type="text" name="lastResultNu"/>
</li>
<!--<li>
<label>目的国快递单状态:</label>
<input type="text" name="destResultState"/>
</li>
<li>
<label>目的国是否签收:</label>
<input type="text" name="destResultIsCheck"/>
</li>
<li>
<label>目的国快递公司编码:</label>
<input type="text" name="destResultCom"/>
</li>
<li>
<label>目的国快递单号:</label>
<input type="text" name="destResultNu"/>
</li>-->
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="bps:expsubspushresp:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="bps:expsubspushresp:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="bps:expsubspushresp:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="bps:expsubspushresp: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:expsubspushresp:edit')}]];
var removeFlag = [[${@permission.hasPermi('bps:expsubspushresp:remove')}]];
var companyDatas = [[${@dict.getType('express_company')}]];
var statsDatas = [[${@dict.getType('express_stats')}]];
var prefix = ctx + "bps/expsubspushresp";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "快递订阅推送信息",
columns: [{
checkbox: true
},
{
field: 'sid',
title: 'SID',
visible: false
},
/*{
field: 'status',
title: '监控状态'
},
{
field: 'billStatus',
title: '状态'
},
{
field: 'message',
title: '监控状态消息'
},
{
field: 'autoCheck',
title: '快递公司编码是否出错'
},
{
field: 'comOld',
title: '原始快递公司编码'
},
{
field: 'comNew',
title: '修正快递公司编码'
},
{
field: 'lastResultMessage',
title: '当前快递消息'
},*/
{
field: 'lastResultState',
title: '当前状态',
formatter: function(value, row, index) {
return $.table.selectDictLabel(statsDatas, value);
}
},
{
field: 'lastResulStatus',
title: '通讯状态'
},
/*{
field: 'lastResultCondition',
title: '快递单明细状态'
},*/
{
field: 'lastResultIsCheck',
title: '是否签收'
},
{
field: 'lastResultCom',
title: '快递公司',
formatter: function(value, row, index) {
return $.table.selectDictLabel(companyDatas, value);
}
},
{
field: 'lastResultNu',
title: '快递单号'
},
{
field: 'lastResultData',
title: '快递流转信息'
},/*
{
field: 'destResultMessage',
title: '目的国快递消息'
},
{
field: 'destResultState',
title: '目的国快递单状态'
},
{
field: 'destResultStatus',
title: '目的国通讯状态'
},
{
field: 'destResultCondition',
title: '目的国快递单明细状态'
},
{
field: 'destResultIsCheck',
title: '目的国是否签收'
},
{
field: 'destResultCom',
title: '目的国快递公司编码'
},
{
field: 'destResultNu',
title: '目的国快递单号'
},
{
field: 'destResultData',
title: '目的国快递流转信息'
},*/
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
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('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增快递订阅')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-subscribe-add">
<div class="form-group">
<label class="col-sm-3 control-label">快递公司编码:</label>
<div class="col-sm-8">
<select name="company" class="form-control m-b" th:with="type=${@dict.getType('express_company')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递单号:</label>
<div class="col-sm-8">
<input name="number" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收/寄件人电话:</label>
<div class="col-sm-8">
<input name="phone" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">盐:</label>
<div class="col-sm-8">
<input name="salt" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订阅时间:</label>
<div class="col-sm-8">
<input name="subscribeTime" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订阅结果:</label>
<div class="col-sm-8">
<input name="result" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">返回码:</label>
<div class="col-sm-8">
<input name="returnCode" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">返回消息:</label>
<div class="col-sm-8">
<input name="message" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "bps/subscribe"
$("#form-subscribe-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-subscribe-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改快递订阅')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-subscribe-edit" th:object="${expSubscribe}">
<input name="sid" th:field="*{sid}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">快递公司编码:</label>
<div class="col-sm-8">
<select name="company" class="form-control m-b" th:with="type=${@dict.getType('express_company')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{company}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">快递单号:</label>
<div class="col-sm-8">
<input name="number" th:field="*{number}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">收/寄件人电话:</label>
<div class="col-sm-8">
<input name="phone" th:field="*{phone}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">盐:</label>
<div class="col-sm-8">
<input name="salt" th:field="*{salt}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订阅时间:</label>
<div class="col-sm-8">
<input name="subscribeTime" th:field="*{subscribeTime}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">订阅结果:</label>
<div class="col-sm-8">
<input name="result" th:field="*{result}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">返回码:</label>
<div class="col-sm-8">
<input name="returnCode" th:field="*{returnCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">返回消息:</label>
<div class="col-sm-8">
<input name="message" th:field="*{message}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "bps/subscribe";
$("#form-subscribe-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-subscribe-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,169 @@
<!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('快递订阅列表')" />
<th:block th:include="include :: select2-css" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label class="font-noraml">快递公司:</label>
<select class="form-control" name="company" th:with="type=${@dict.getType('express_company')}">
<option value="">---所有---</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>快递单号:</label>
<input type="text" name="number"/>
</li>
<li>
<label>收/寄件人电话:</label>
<input type="text" name="phone"/>
</li>
<li>
<label>订阅时间:</label>
<input type="text" name="subscribeTime"/>
</li>
<li>
<label>订阅结果:</label>
<input type="text" name="result"/>
</li>
<li>
<label>返回码:</label>
<input type="text" name="returnCode"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="sendForm()"><i class="fa fa-check"></i>&nbsp;订阅</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="bps:subscribe:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="bps:subscribe:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="bps:subscribe:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="bps:subscribe: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" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('bps:subscribe:edit')}]];
var removeFlag = [[${@permission.hasPermi('bps:subscribe:remove')}]];
var companyDatas = [[${@dict.getType('express_company')}]];
var prefix = ctx + "bps/subscribe";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "快递订阅",
columns: [{
checkbox: true
},
{
field: 'sid',
title: 'SID',
visible: false
},
{
field: 'company',
title: '快递公司编码',
formatter: function(value, row, index) {
return $.table.selectDictLabel(companyDatas, value);
}
},
{
field: 'number',
title: '快递单号'
},
{
field: 'phone',
title: '收/寄件人电话'
},
{
field: 'salt',
title: '盐'
},
{
field: 'subscribeTime',
title: '订阅时间'
},
{
field: 'result',
title: '订阅结果'
},
{
field: 'returnCode',
title: '返回码'
},
{
field: 'message',
title: '返回消息'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
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('');
}
}]
};
$.table.init(options);
});
function sendForm() {
var formObject = {};
var formArray =$("#formId").serializeArray();
$.each(formArray,function(i,item){
formObject[item.name] = item.value;
});
$.ajax({
url:ctx+"/bps/subscribe/subscribe",
type:"POST",
contentType: "application/json",
data: JSON.stringify(formObject),
dataType: "json",
success:function(data){
alert(JSON.stringify(data));
$.table.search();
},
error:function(e){
alert("错误!!");
}
});
};
</script>
</body>
</html>

View File

@ -0,0 +1,98 @@
<!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">
<div class="select-list">
<ul>
<li>
<label> 快递单号:</label>
<input type="text" name="num"/>
</li>
<li>
<label> 快递公司:</label>
<input type="text" name="com"/>
</li>
<li>
<label>电话号码:</label>
<input type="text" name="phone"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="sendForm()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</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:express:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<div id="testdiv"></div>
<table id="bootstrap-table"></table>
<div id="test"></div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var ctx = [[@{/}]];
function sendForm() {
var formObject = {};
var formArray =$("#formId").serializeArray();
$.each(formArray,function(i,item){
formObject[item.name] = item.value;
});
$.ajax({
url:ctx+"/bps/express/queryExpress/list1",
type:"POST",
contentType: "application/json",
data: JSON.stringify(formObject),
dataType: "json",
success:function(data){
//alert(data.msg);
alert(JSON.stringify(data));
// document.getElementById("testdiv").innerHTML=JSON.stringify(data);
showData(data);
},
error:function(e){
alert("错误!!");
}
});
};
function showData(data){
var inf ="<table class='table'>";
inf += "<tr><th>快递单号</th><th>快递公司</th><th>快递状态</th><th>快递信息</th></tr>";
inf+="<tr><td>"+data.nu+"</td><td>"+data.com+"</td><td>"+getContext(data.info)+"</td><td>"+data.state+"</td></tr>";
inf += "</table>";
$("#test").html(inf);
};
function getContext(info){
var contextinfo="";
for(var i=0;i<info.length;i++){
contextinfo += "【"+info[i].time +"】 "+ info[i].context;
if(i != info.length-1)
{contextinfo+="<br/>";}
}
return contextinfo;
}
</script>
</body>
</html>

28
box-test/pom.xml Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ruoyi</artifactId>
<groupId>com.ruoyi</groupId>
<version>4.6.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>box-test</artifactId>
<description>
test系统模块
</description>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-common</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,61 @@
package com.ruoyi.test.conrtroller;
import com.ruoyi.common.core.domain.AjaxResult;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
*
* 测试权限登录访问请求
*
* 登录访问返回token POST / http://localhost:80/jwt/login?username=ry&password=admin123
*
* 测试任意权限header携带token GET / http://localhost:80/api/list
*
* 测试菜单权限header携带token GET / http://localhost:80/api/user/list
*
* 测试角色权限header携带token GET / http://localhost:80/api/role/list
*
*/
@RestController
@RequestMapping("/api")
public class ApiController
{
/**
* 无权限访问
*
* @return
*/
@GetMapping("/list")
public AjaxResult list()
{
return AjaxResult.success("list success");
}
/**
* 菜单权限 system:user:list
*/
@GetMapping("/user/list")
@RequiresPermissions("system:user:list")
public AjaxResult userlist()
{
return AjaxResult.success("user list success");
}
/**
* 角色权限 admin
*/
@GetMapping("/role/list")
@RequiresRoles("admin")
public AjaxResult rolelist()
{
return AjaxResult.success("role list success");
}
}

View File

@ -0,0 +1,18 @@
package com.ruoyi.test.conrtroller;
import com.ruoyi.test.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/test")
public class BoxTestController {
@Autowired
private TestService testService;
@RequestMapping("test")
public String test(){
testService.test();
return testService.test();
}
}

View File

@ -0,0 +1,45 @@
package com.ruoyi.test.conrtroller;
import com.ruoyi.test.service.OracleDdlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalTime;
import java.util.Map;
@RestController
public class FrForCrController {
@Autowired
private OracleDdlService oracleDdlService;
@CrossOrigin
@RequestMapping("/test/frforcr")
public void frforcr(@RequestBody Map<String,Object> map){
for(Object value:map.values()){
String dbName="ds7";
String tableName=value.toString();
String tableNameWithDb=dbName+"."+tableName;
int isTableInDb=oracleDdlService.isTableInDb(dbName,tableName);
if(isTableInDb>0){
try{
oracleDdlService.dropTable(tableNameWithDb);
System.out.println(LocalTime.now()+""+tableNameWithDb+"】已被删除!");
}catch (Exception e){
System.out.println(LocalTime.now()+""+tableNameWithDb+"】删除异常!");
}
}
else{
System.out.println(LocalTime.now()+""+tableNameWithDb+"】不存在!");
}
}
}
}

View File

@ -0,0 +1,67 @@
package com.ruoyi.test.conrtroller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.test.domain.Beauty;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/test")
public class GetJsonReqController {
@CrossOrigin
@RequestMapping(value = "simple")
// json的结构和内部字段名称可以与POJO/DTO/javabean完全对应
public Map<String, String> getJsonBean(@RequestBody Beauty beauty) {
Map<String, String> result = null;
if (beauty != null) {
System.out.println("姓名:" + beauty.getName());
System.out.println("年龄:" + beauty.getAge());
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println("出生日期:" + sdf.format(beauty.getDate()));
System.out.println("年收入:" + beauty.getSalary());
result = new HashMap<>();
result.put("code", "1");
result.put("msg", "ok");
}
return result;
}
@CrossOrigin
@RequestMapping(value = "complex")
//json的结构较为复杂不直接与POJO/DTO/javabean对应
public Map<String, String> getJsonComplex(@RequestBody JSONObject param) {
Map<String, String> result = null;
if (param != null) {
JSONObject master = param.getJSONObject("master");
Beauty beauty = (Beauty) JSONObject.toJavaObject(master, Beauty.class);
System.out.println(beauty);
JSONArray mm = param.getJSONArray("MM");
for (int i = 0; i < mm.size(); i++) {
// 这里不能使用get(i)因为get(i)只会得到键值对
JSONObject json = mm.getJSONObject(i);
Beauty bt = (Beauty) JSONObject.toJavaObject(json, Beauty.class);
System.out.println(bt);
}
result = new HashMap<>();
result.put("code", "1");
result.put("msg", "ok");
}
return result;
}
}

View File

@ -0,0 +1,55 @@
package com.ruoyi.test.conrtroller;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.test.service.OracleDdlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/test")
@DataSource(value = DataSourceType.SLAVE)
public class OracleDdlController {
@Autowired
private OracleDdlService oracleDdlService;
//查询表录数
@RequestMapping("getRecordCount")
public String getRecordCount() {
String tableName = "tc_user";
int result = oracleDdlService.getRecordCount(tableName);
return result + "";
}
//检查表是否存在
@RequestMapping("isTableInDb")
public String isTableInDb() {
String dbName = "ds7";
String tableName = "tc_user";
return (oracleDdlService.isTableInDb(dbName, tableName)>0?"实例ds7中存在表tc_user":"实例ds7中不存在表tc_user");
}
//复制表
@RequestMapping("copyTable")
public String copyTable() {
String originalTalble = "tc_user";
String newTable = "new_tc_user";
if (oracleDdlService.isTableInDb("ds7", originalTalble) > 0) {
try {
oracleDdlService.copyTable(newTable, originalTalble);
return "复制" + originalTalble + "成功!新表名:" + newTable;
} catch (Exception e) {
System.out.println(e);
return "复制" + originalTalble + "失败!";
}
} else {
return ""+originalTalble+"不存在";
}
}
}

View File

@ -0,0 +1,15 @@
package com.ruoyi.test.conrtroller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class SendJsonController {
@RequestMapping("/test/sendjson")
public String ajaxSend(){
return ("test/sendJson");
}
}

View File

@ -0,0 +1,123 @@
package com.ruoyi.test.conrtroller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.test.domain.SysCustomer;
import com.ruoyi.test.service.ISysCustomerService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 客户Controller
*
* @author box
* @date 2021-02-13
*/
@Controller
@RequestMapping("/test/customer")
public class SysCustomerController extends BaseController
{
private String prefix = "test/customer";
@Autowired
private ISysCustomerService sysCustomerService;
@RequiresPermissions("test:customer:view")
@GetMapping()
public String customer()
{
return prefix + "/customer";
}
/**
* 查询客户列表
*/
@RequiresPermissions("test:customer:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(SysCustomer sysCustomer)
{
startPage();
List<SysCustomer> list = sysCustomerService.selectSysCustomerList(sysCustomer);
return getDataTable(list);
}
/**
* 导出客户列表
*/
@RequiresPermissions("test:customer:export")
@Log(title = "客户", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysCustomer sysCustomer)
{
List<SysCustomer> list = sysCustomerService.selectSysCustomerList(sysCustomer);
ExcelUtil<SysCustomer> util = new ExcelUtil<SysCustomer>(SysCustomer.class);
return util.exportExcel(list, "customer");
}
/**
* 新增客户
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存客户
*/
@RequiresPermissions("test:customer:add")
@Log(title = "客户", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(SysCustomer sysCustomer)
{
return toAjax(sysCustomerService.insertSysCustomer(sysCustomer));
}
/**
* 修改客户
*/
@GetMapping("/edit/{customerId}")
public String edit(@PathVariable("customerId") Long customerId, ModelMap mmap)
{
SysCustomer sysCustomer = sysCustomerService.selectSysCustomerById(customerId);
mmap.put("sysCustomer", sysCustomer);
return prefix + "/edit";
}
/**
* 修改保存客户
*/
@RequiresPermissions("test:customer:edit")
@Log(title = "客户", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysCustomer sysCustomer)
{
return toAjax(sysCustomerService.updateSysCustomer(sysCustomer));
}
/**
* 删除客户
*/
@RequiresPermissions("test:customer:remove")
@Log(title = "客户", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(sysCustomerService.deleteSysCustomerByIds(ids));
}
}

View File

@ -0,0 +1,123 @@
package com.ruoyi.test.conrtroller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.test.domain.SysFileInfo;
import com.ruoyi.test.service.ISysFileInfoService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 文件信息Controller
*
* @author box
* @date 2021-05-06
*/
@Controller
@RequestMapping("/test/fileinfo")
public class SysFileInfoController extends BaseController
{
private String prefix = "test/fileinfo";
@Autowired
private ISysFileInfoService sysFileInfoService;
@RequiresPermissions("test:fileinfo:view")
@GetMapping()
public String fileinfo()
{
return prefix + "/fileinfo";
}
/**
* 查询文件信息列表
*/
@RequiresPermissions("test:fileinfo:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(SysFileInfo sysFileInfo)
{
startPage();
List<SysFileInfo> list = sysFileInfoService.selectSysFileInfoList(sysFileInfo);
return getDataTable(list);
}
/**
* 导出文件信息列表
*/
@RequiresPermissions("test:fileinfo:export")
@Log(title = "文件信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysFileInfo sysFileInfo)
{
List<SysFileInfo> list = sysFileInfoService.selectSysFileInfoList(sysFileInfo);
ExcelUtil<SysFileInfo> util = new ExcelUtil<SysFileInfo>(SysFileInfo.class);
return util.exportExcel(list, "文件信息数据");
}
/**
* 新增文件信息
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存文件信息
*/
@RequiresPermissions("test:fileinfo:add")
@Log(title = "文件信息", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(SysFileInfo sysFileInfo)
{
return toAjax(sysFileInfoService.insertSysFileInfo(sysFileInfo));
}
/**
* 修改文件信息
*/
@GetMapping("/edit/{fileId}")
public String edit(@PathVariable("fileId") Long fileId, ModelMap mmap)
{
SysFileInfo sysFileInfo = sysFileInfoService.selectSysFileInfoById(fileId);
mmap.put("sysFileInfo", sysFileInfo);
return prefix + "/edit";
}
/**
* 修改保存文件信息
*/
@RequiresPermissions("test:fileinfo:edit")
@Log(title = "文件信息", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysFileInfo sysFileInfo)
{
return toAjax(sysFileInfoService.updateSysFileInfo(sysFileInfo));
}
/**
* 删除文件信息
*/
@RequiresPermissions("test:fileinfo:remove")
@Log(title = "文件信息", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(sysFileInfoService.deleteSysFileInfoByIds(ids));
}
}

View File

@ -0,0 +1,64 @@
package com.ruoyi.test.conrtroller;
import com.ruoyi.test.domain.TcUser;
import com.ruoyi.test.service.TcUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/test")
public class TcUserController {
@Autowired
private TcUserService tcUserService;
//查询所有
// http://localhost/test/selectall
@RequestMapping("selectAll")
@ResponseBody
public String selectAll(){
List<TcUser> users=tcUserService.selectAll();
users.forEach(System.out::println);
return users.toString()+"";
}
//查询 by id
// http://localhost/test/selectById/1(此处1为要获取的id
@RequestMapping(value = "selectById/{id}", method = RequestMethod.GET)
public String selectById(@PathVariable int id) {
return tcUserService.selectById(id).toString();
}
//插入新用户
// http://localhost/test/insert?id=100&name=张三&password=20
@RequestMapping(value = "/insert", method = RequestMethod.GET)
public TcUser insert(TcUser tcUser) {
return tcUserService.insert(tcUser);
}
//通过用户id删除用户
// http://localhost/test/deleteById?id=1(此处1为要删除的id
@RequestMapping(value = "/deleteById", method = RequestMethod.GET)
public String delete(int id) {
int result = tcUserService.deleteById(id);
if (result >= 1) {
return "删除成功";
} else {
return "删除失败";
}
}
//更新 by id
// http://localhost/test/updateById?id=2&name=波波&password=12
@RequestMapping(value = "/updateById", method = RequestMethod.GET)
public String update(TcUser tcUser) {
int result = tcUserService.updateById(tcUser);
if (result >= 1) {
return "修改成功";
} else {
return "修改失败";
}
}
}

View File

@ -0,0 +1,16 @@
package com.ruoyi.test.conrtroller;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import java.time.LocalDateTime;
@Controller
public class TestIndexController {
@RequestMapping("/test")
public String index(ModelMap modelMap){
modelMap.put("date", LocalDateTime.now());
return ("test/index");
}
}

View File

@ -0,0 +1,34 @@
package com.ruoyi.test.conrtroller;
import com.ruoyi.test.service.TestVerifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class TestVerifyController {
@Autowired
private TestVerifyService testVerifyService;
@RequestMapping("/test/testVerify")
public String testVerify(){
return "/test/testVerify";
}
/**
* 校验用户名
*/
@PostMapping("/test/testVerifyName")
@ResponseBody
public int testVerifyName(String name)
{
return testVerifyService.isNameUnique(name);
}
}

View File

@ -0,0 +1,55 @@
package com.ruoyi.test.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
public class Beauty {
private String name;
private int age;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date date;
private double salary;
public Beauty() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public double getSalary() {
return salary;
}
public void setSalary(double salary) {
this.salary = salary;
}
@Override
public String toString() {
return "Beauty [name=" + name + ", age=" + age + ", date=" + date + ", salary=" + salary + "]";
}
}

View File

@ -0,0 +1,113 @@
package com.ruoyi.test.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
import java.util.List;
/**
* 客户对象 sys_customer
*
* @author box
* @date 2021-02-13
*/
public class SysCustomer extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 客户id */
private Long customerId;
/** 客户姓名 */
@Excel(name = "客户姓名")
private String customerName;
/** 手机号码 */
@Excel(name = "手机号码")
private String phonenumber;
/** 客户性别 */
@Excel(name = "客户性别")
private String sex;
/** 客户生日 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "客户生日", width = 30, dateFormat = "yyyy-MM-dd")
private Date birthday;
/** 商品信息 */
private List<SysGoods> sysGoodsList;
public void setCustomerId(Long customerId)
{
this.customerId = customerId;
}
public Long getCustomerId()
{
return customerId;
}
public void setCustomerName(String customerName)
{
this.customerName = customerName;
}
public String getCustomerName()
{
return customerName;
}
public void setPhonenumber(String phonenumber)
{
this.phonenumber = phonenumber;
}
public String getPhonenumber()
{
return phonenumber;
}
public void setSex(String sex)
{
this.sex = sex;
}
public String getSex()
{
return sex;
}
public void setBirthday(Date birthday)
{
this.birthday = birthday;
}
public Date getBirthday()
{
return birthday;
}
public List<SysGoods> getSysGoodsList()
{
return sysGoodsList;
}
public void setSysGoodsList(List<SysGoods> sysGoodsList)
{
this.sysGoodsList = sysGoodsList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("customerId", getCustomerId())
.append("customerName", getCustomerName())
.append("phonenumber", getPhonenumber())
.append("sex", getSex())
.append("birthday", getBirthday())
.append("remark", getRemark())
.append("sysGoodsList", getSysGoodsList())
.toString();
}
}

View File

@ -0,0 +1,65 @@
package com.ruoyi.test.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 文件信息对象 sys_file_info
*
* @author box
* @date 2021-05-06
*/
public class SysFileInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 文件id */
private Long fileId;
/** 文件名称 */
@Excel(name = "文件名称")
private String fileName;
/** 文件路径 */
@Excel(name = "文件路径")
private String filePath;
public void setFileId(Long fileId)
{
this.fileId = fileId;
}
public Long getFileId()
{
return fileId;
}
public void setFileName(String fileName)
{
this.fileName = fileName;
}
public String getFileName()
{
return fileName;
}
public void setFilePath(String filePath)
{
this.filePath = filePath;
}
public String getFilePath()
{
return filePath;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("fileId", getFileId())
.append("fileName", getFileName())
.append("filePath", getFilePath())
.toString();
}
}

View File

@ -0,0 +1,124 @@
package com.ruoyi.test.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
/**
* 商品对象 sys_goods
*
* @author box
* @date 2021-02-13
*/
public class SysGoods extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 商品id */
private Long goodsId;
/** 客户id */
@Excel(name = "客户id")
private Long customerId;
/** 商品名称 */
@Excel(name = "商品名称")
private String name;
/** 商品重量 */
@Excel(name = "商品重量")
private Integer weight;
/** 商品价格 */
@Excel(name = "商品价格")
private BigDecimal price;
/** 商品时间 */
@Excel(name = "商品时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date date;
/** 商品种类 */
@Excel(name = "商品种类")
private String type;
public void setGoodsId(Long goodsId)
{
this.goodsId = goodsId;
}
public Long getGoodsId()
{
return goodsId;
}
public void setCustomerId(Long customerId)
{
this.customerId = customerId;
}
public Long getCustomerId()
{
return customerId;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setWeight(Integer weight)
{
this.weight = weight;
}
public Integer getWeight()
{
return weight;
}
public void setPrice(BigDecimal price)
{
this.price = price;
}
public BigDecimal getPrice()
{
return price;
}
public void setDate(Date date)
{
this.date = date;
}
public Date getDate()
{
return date;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("goodsId", getGoodsId())
.append("customerId", getCustomerId())
.append("name", getName())
.append("weight", getWeight())
.append("price", getPrice())
.append("date", getDate())
.append("type", getType())
.toString();
}
}

View File

@ -0,0 +1,40 @@
package com.ruoyi.test.domain;
public class TcUser {
private int id;
private String name;
private String password;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "TcUser{" +
"id=" + id +
", name='" + name + '\'' +
", age='" + password + '\'' +
'}';
}
}

View File

@ -0,0 +1,32 @@
package com.ruoyi.test.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
@Mapper
@Component("OracleDdlMapper")
public interface OracleDdlMapper {
// alter table
int alterTableName(@Param("originalTableName") String originalTableName,
@Param("newTableName") String newTableName);
//truncate table
int truncateTable(@Param("tableName") String tableName);
//drop table
int dropTable(@Param("tableName") String tableName);
//copy table
void copyTable(@Param("newTableName") String newTableName,
@Param("originalTableName") String originalTableName);
//获取表记录数
int getRecordCount(@Param("tableName") String tableName);
//查询数据库中表是否存在
int isTableInDb(@Param("dataBaseName") String dataBaseName,
@Param("tableName") String tableName);
}

View File

@ -0,0 +1,88 @@
package com.ruoyi.test.mapper;
import com.ruoyi.test.domain.SysCustomer;
import com.ruoyi.test.domain.SysGoods;
import java.util.List;
/**
* 客户Mapper接口
*
* @author box
* @date 2021-02-13
*/
public interface SysCustomerMapper
{
/**
* 查询客户
*
* @param customerId 客户ID
* @return 客户
*/
public SysCustomer selectSysCustomerById(Long customerId);
/**
* 查询客户列表
*
* @param sysCustomer 客户
* @return 客户集合
*/
public List<SysCustomer> selectSysCustomerList(SysCustomer sysCustomer);
/**
* 新增客户
*
* @param sysCustomer 客户
* @return 结果
*/
public int insertSysCustomer(SysCustomer sysCustomer);
/**
* 修改客户
*
* @param sysCustomer 客户
* @return 结果
*/
public int updateSysCustomer(SysCustomer sysCustomer);
/**
* 删除客户
*
* @param customerId 客户ID
* @return 结果
*/
public int deleteSysCustomerById(Long customerId);
/**
* 批量删除客户
*
* @param customerIds 需要删除的数据ID
* @return 结果
*/
public int deleteSysCustomerByIds(String[] customerIds);
/**
* 批量删除商品
*
* @param customerIds 需要删除的数据ID
* @return 结果
*/
public int deleteSysGoodsByCustomerIds(String[] customerIds);
/**
* 批量新增商品
*
* @param sysGoodsList 商品列表
* @return 结果
*/
public int batchSysGoods(List<SysGoods> sysGoodsList);
/**
* 通过客户ID删除商品信息
*
* @param roleId 角色ID
* @return 结果
*/
public int deleteSysGoodsByCustomerId(Long customerId);
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.test.mapper;
import com.ruoyi.test.domain.SysFileInfo;
import java.util.List;
/**
* 文件信息Mapper接口
*
* @author box
* @date 2021-05-06
*/
public interface SysFileInfoMapper
{
/**
* 查询文件信息
*
* @param fileId 文件信息ID
* @return 文件信息
*/
public SysFileInfo selectSysFileInfoById(Long fileId);
/**
* 查询文件信息列表
*
* @param sysFileInfo 文件信息
* @return 文件信息集合
*/
public List<SysFileInfo> selectSysFileInfoList(SysFileInfo sysFileInfo);
/**
* 新增文件信息
*
* @param sysFileInfo 文件信息
* @return 结果
*/
public int insertSysFileInfo(SysFileInfo sysFileInfo);
/**
* 修改文件信息
*
* @param sysFileInfo 文件信息
* @return 结果
*/
public int updateSysFileInfo(SysFileInfo sysFileInfo);
/**
* 删除文件信息
*
* @param fileId 文件信息ID
* @return 结果
*/
public int deleteSysFileInfoById(Long fileId);
/**
* 批量删除文件信息
*
* @param fileIds 需要删除的数据ID
* @return 结果
*/
public int deleteSysFileInfoByIds(String[] fileIds);
}

View File

@ -0,0 +1,26 @@
package com.ruoyi.test.mapper;
import com.ruoyi.test.domain.TcUser;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import java.util.List;
@Mapper
@Component("TCUserMapper")
public interface TcUserMapper {
//查询所有
List<TcUser> selectAll();
//查询 by id
TcUser selectById(int id);
//增加
int insert(TcUser tcUser);
//删除 by id
int deleteById(int id);
//更新 by id
int updateById(TcUser tcUser);
}

View File

@ -0,0 +1,11 @@
package com.ruoyi.test.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Mapper
@Component("TestVerifyMapper")
public interface TestVerifyMapper {
//检查姓名是否唯一
int isNameUnique(String name);
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.test.service;
import com.ruoyi.test.domain.SysCustomer;
import java.util.List;
/**
* 客户Service接口
*
* @author box
* @date 2021-02-13
*/
public interface ISysCustomerService
{
/**
* 查询客户
*
* @param customerId 客户ID
* @return 客户
*/
public SysCustomer selectSysCustomerById(Long customerId);
/**
* 查询客户列表
*
* @param sysCustomer 客户
* @return 客户集合
*/
public List<SysCustomer> selectSysCustomerList(SysCustomer sysCustomer);
/**
* 新增客户
*
* @param sysCustomer 客户
* @return 结果
*/
public int insertSysCustomer(SysCustomer sysCustomer);
/**
* 修改客户
*
* @param sysCustomer 客户
* @return 结果
*/
public int updateSysCustomer(SysCustomer sysCustomer);
/**
* 批量删除客户
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysCustomerByIds(String ids);
/**
* 删除客户信息
*
* @param customerId 客户ID
* @return 结果
*/
public int deleteSysCustomerById(Long customerId);
}

View File

@ -0,0 +1,62 @@
package com.ruoyi.test.service;
import com.ruoyi.test.domain.SysFileInfo;
import java.util.List;
/**
* 文件信息Service接口
*
* @author box
* @date 2021-05-06
*/
public interface ISysFileInfoService
{
/**
* 查询文件信息
*
* @param fileId 文件信息ID
* @return 文件信息
*/
public SysFileInfo selectSysFileInfoById(Long fileId);
/**
* 查询文件信息列表
*
* @param sysFileInfo 文件信息
* @return 文件信息集合
*/
public List<SysFileInfo> selectSysFileInfoList(SysFileInfo sysFileInfo);
/**
* 新增文件信息
*
* @param sysFileInfo 文件信息
* @return 结果
*/
public int insertSysFileInfo(SysFileInfo sysFileInfo);
/**
* 修改文件信息
*
* @param sysFileInfo 文件信息
* @return 结果
*/
public int updateSysFileInfo(SysFileInfo sysFileInfo);
/**
* 批量删除文件信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteSysFileInfoByIds(String ids);
/**
* 删除文件信息信息
*
* @param fileId 文件信息ID
* @return 结果
*/
public int deleteSysFileInfoById(Long fileId);
}

View File

@ -0,0 +1,22 @@
package com.ruoyi.test.service;
public interface OracleDdlService {
//修改表名
int alterTableName(String originalTableName, String newTableName);
// truncate指定数据库表的数据
int truncateTable(String tableName);
//drop 指定定数据库表
int dropTable(String tableName);
//根据传入的表明创建新的表并且将原表的数据插入到新的Occur表中
void copyTable(String newTableName,String originalTableName);
//统计某张表中的总数据条数
int getRecordCount(String tableName);
//从指定数据库中查询是否存在某张表
int isTableInDb(String dataBaseName, String tableName);
}

View File

@ -0,0 +1,22 @@
package com.ruoyi.test.service;
import com.ruoyi.test.domain.TcUser;
import java.util.List;
public interface TcUserService {
//查询所有用户
List<TcUser> selectAll();
//根据id查询用户信息
TcUser selectById(int id);
//新增用户
TcUser insert (TcUser tcUser);
// 根据id删除
int deleteById (int id);
//更新用户信息
int updateById(TcUser tcUser);
}

View File

@ -0,0 +1,10 @@
package com.ruoyi.test.service;
import org.springframework.stereotype.Service;
@Service
public class TestService {
public String test(){
return "hello,box-test.test";
}
}

View File

@ -0,0 +1,9 @@
package com.ruoyi.test.service;
import org.springframework.stereotype.Service;
@Service
public interface TestVerifyService {
//检查姓名是否唯一
int isNameUnique(String name);
}

View File

@ -0,0 +1,45 @@
package com.ruoyi.test.service.impl;
import com.ruoyi.test.mapper.OracleDdlMapper;
import com.ruoyi.test.service.OracleDdlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
//@DataSource(value = DataSourceType.SLAVE)
public class OracleDdlServiceImpl implements OracleDdlService {
@Autowired
private OracleDdlMapper oracleDdlMapper;
//修改表名
public int alterTableName(String originalTableName, String newTableName)
{
return oracleDdlMapper.alterTableName(originalTableName,newTableName);
}
// truncate指定数据库表的数据
public int truncateTable(String tableName){
return oracleDdlMapper.truncateTable(tableName);
}
//drop 指定定数据库表
public int dropTable(String tableName){
return oracleDdlMapper.dropTable(tableName);
}
//根据传入的表明创建新的表并且将原表的数据插入到新的Occur表中
public void copyTable(String newTableName,String originalTableName){
return ;
}
//统计某张表中的总数据条数
public int getRecordCount(String tableName){
return oracleDdlMapper.getRecordCount(tableName);
}
//从指定数据库中查询是否存在某张表
public int isTableInDb(String dataBaseName, String tableName){
return oracleDdlMapper.isTableInDb(dataBaseName,tableName);
}
}

View File

@ -0,0 +1,132 @@
package com.ruoyi.test.service.impl;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.test.domain.SysCustomer;
import com.ruoyi.test.domain.SysGoods;
import com.ruoyi.test.mapper.SysCustomerMapper;
import com.ruoyi.test.service.ISysCustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* 客户Service业务层处理
*
* @author box
* @date 2021-02-13
*/
@Service
public class SysCustomerServiceImpl implements ISysCustomerService
{
@Autowired
private SysCustomerMapper sysCustomerMapper;
/**
* 查询客户
*
* @param customerId 客户ID
* @return 客户
*/
@Override
public SysCustomer selectSysCustomerById(Long customerId)
{
return sysCustomerMapper.selectSysCustomerById(customerId);
}
/**
* 查询客户列表
*
* @param sysCustomer 客户
* @return 客户
*/
@Override
public List<SysCustomer> selectSysCustomerList(SysCustomer sysCustomer)
{
return sysCustomerMapper.selectSysCustomerList(sysCustomer);
}
/**
* 新增客户
*
* @param sysCustomer 客户
* @return 结果
*/
@Transactional
@Override
public int insertSysCustomer(SysCustomer sysCustomer)
{
int rows = sysCustomerMapper.insertSysCustomer(sysCustomer);
insertSysGoods(sysCustomer);
return rows;
}
/**
* 修改客户
*
* @param sysCustomer 客户
* @return 结果
*/
@Transactional
@Override
public int updateSysCustomer(SysCustomer sysCustomer)
{
sysCustomerMapper.deleteSysGoodsByCustomerId(sysCustomer.getCustomerId());
insertSysGoods(sysCustomer);
return sysCustomerMapper.updateSysCustomer(sysCustomer);
}
/**
* 删除客户对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Transactional
@Override
public int deleteSysCustomerByIds(String ids)
{
sysCustomerMapper.deleteSysGoodsByCustomerIds(Convert.toStrArray(ids));
return sysCustomerMapper.deleteSysCustomerByIds(Convert.toStrArray(ids));
}
/**
* 删除客户信息
*
* @param customerId 客户ID
* @return 结果
*/
@Override
public int deleteSysCustomerById(Long customerId)
{
sysCustomerMapper.deleteSysGoodsByCustomerId(customerId);
return sysCustomerMapper.deleteSysCustomerById(customerId);
}
/**
* 新增商品信息
*
* @param sysCustomer 客户对象
*/
public void insertSysGoods(SysCustomer sysCustomer)
{
List<SysGoods> sysGoodsList = sysCustomer.getSysGoodsList();
Long customerId = sysCustomer.getCustomerId();
if (StringUtils.isNotNull(sysGoodsList))
{
List<SysGoods> list = new ArrayList<SysGoods>();
for (SysGoods sysGoods : sysGoodsList)
{
sysGoods.setCustomerId(customerId);
list.add(sysGoods);
}
if (list.size() > 0)
{
sysCustomerMapper.batchSysGoods(list);
}
}
}
}

View File

@ -0,0 +1,95 @@
package com.ruoyi.test.service.impl;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.test.domain.SysFileInfo;
import com.ruoyi.test.mapper.SysFileInfoMapper;
import com.ruoyi.test.service.ISysFileInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 文件信息Service业务层处理
*
* @author box
* @date 2021-05-06
*/
@Service
public class SysFileInfoServiceImpl implements ISysFileInfoService
{
@Autowired
private SysFileInfoMapper sysFileInfoMapper;
/**
* 查询文件信息
*
* @param fileId 文件信息ID
* @return 文件信息
*/
@Override
public SysFileInfo selectSysFileInfoById(Long fileId)
{
return sysFileInfoMapper.selectSysFileInfoById(fileId);
}
/**
* 查询文件信息列表
*
* @param sysFileInfo 文件信息
* @return 文件信息
*/
@Override
public List<SysFileInfo> selectSysFileInfoList(SysFileInfo sysFileInfo)
{
return sysFileInfoMapper.selectSysFileInfoList(sysFileInfo);
}
/**
* 新增文件信息
*
* @param sysFileInfo 文件信息
* @return 结果
*/
@Override
public int insertSysFileInfo(SysFileInfo sysFileInfo)
{
return sysFileInfoMapper.insertSysFileInfo(sysFileInfo);
}
/**
* 修改文件信息
*
* @param sysFileInfo 文件信息
* @return 结果
*/
@Override
public int updateSysFileInfo(SysFileInfo sysFileInfo)
{
return sysFileInfoMapper.updateSysFileInfo(sysFileInfo);
}
/**
* 删除文件信息对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteSysFileInfoByIds(String ids)
{
return sysFileInfoMapper.deleteSysFileInfoByIds(Convert.toStrArray(ids));
}
/**
* 删除文件信息信息
*
* @param fileId 文件信息ID
* @return 结果
*/
@Override
public int deleteSysFileInfoById(Long fileId)
{
return sysFileInfoMapper.deleteSysFileInfoById(fileId);
}
}

View File

@ -0,0 +1,48 @@
package com.ruoyi.test.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.test.domain.TcUser;
import com.ruoyi.test.mapper.TcUserMapper;
import com.ruoyi.test.service.TcUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@DataSource(value = DataSourceType.SQLSVR)
public class TcUserServiceImpl implements TcUserService {
@Autowired
private TcUserMapper tcUserMapper;
//查询所有用户
@Override
public List<TcUser> selectAll() {
return tcUserMapper.selectAll();
}
//查询 by id
@Override
public TcUser selectById(int id) {
return tcUserMapper.selectById(id);
}
//新增
@Override
public TcUser insert(TcUser tcUser) {
int user=tcUserMapper.insert(tcUser);
return tcUser;
}
//删除by id
@Override
public int deleteById(int id) {
return tcUserMapper.deleteById(id);
}
//更新 by id
@Override
public int updateById(TcUser tcUser) {
return tcUserMapper.updateById(tcUser);
}
}

View File

@ -0,0 +1,19 @@
package com.ruoyi.test.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.test.mapper.TestVerifyMapper;
import com.ruoyi.test.service.TestVerifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
@DataSource(value = DataSourceType.SQLSVR)
public class TestVerifyServiceImpl implements TestVerifyService {
@Autowired
private TestVerifyMapper testVerifyMapper;
@Override
public int isNameUnique(String name) {
return testVerifyMapper.isNameUnique(name);
}
}

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.test.mapper.OracleDdlMapper">
<update id="alterTableName">
alter table ${originalTableName} rename ${newTableName}
</update>
<update id="truncateTable">
truncate table ${tableName}
</update>
<update id="dropTable">
drop table ${tableName}
</update>
<update id="copyTable">
create table ${newTableName} as select * from ${originalTableName}
</update>
<select id="getRecordCount" resultType="int">
select count(1) from ${tableName}
</select>
<select id="isTableInDb" resultType="int">
SELECT COUNT(*) FROM ALL_TABLES WHERE OWNER = UPPER(#{dataBaseName}) AND TABLE_NAME = UPPER(#{tableName})
</select>
</mapper>

View File

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.test.mapper.SysCustomerMapper">
<resultMap type="SysCustomer" id="SysCustomerResult">
<result property="customerId" column="customer_id" />
<result property="customerName" column="customer_name" />
<result property="phonenumber" column="phonenumber" />
<result property="sex" column="sex" />
<result property="birthday" column="birthday" />
<result property="remark" column="remark" />
</resultMap>
<resultMap id="SysCustomerSysGoodsResult" type="SysCustomer" extends="SysCustomerResult">
<collection property="sysGoodsList" notNullColumn="goods_id" javaType="java.util.List" resultMap="SysGoodsResult" />
</resultMap>
<resultMap type="SysGoods" id="SysGoodsResult">
<result property="goodsId" column="goods_id" />
<result property="customerId" column="customer_id" />
<result property="name" column="name" />
<result property="weight" column="weight" />
<result property="price" column="price" />
<result property="date" column="date" />
<result property="type" column="type" />
</resultMap>
<sql id="selectSysCustomerVo">
select customer_id, customer_name, phonenumber, sex, birthday, remark from sys_customer
</sql>
<select id="selectSysCustomerList" parameterType="SysCustomer" resultMap="SysCustomerResult">
<include refid="selectSysCustomerVo"/>
<where>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="phonenumber != null and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
<if test="sex != null and sex != ''"> and sex = #{sex}</if>
<if test="birthday != null "> and birthday = #{birthday}</if>
</where>
</select>
<select id="selectSysCustomerById" parameterType="Long" resultMap="SysCustomerSysGoodsResult">
select a.customer_id, a.customer_name, a.phonenumber, a.sex, a.birthday, a.remark,
b.goods_id, b.customer_id, b.name, b.weight, b.price, b.date, b.type
from sys_customer a
left join sys_goods b on b.customer_id = a.customer_id
where a.customer_id = #{customerId}
</select>
<insert id="insertSysCustomer" parameterType="SysCustomer" useGeneratedKeys="true" keyProperty="customerId">
insert into sys_customer
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="customerName != null">customer_name,</if>
<if test="phonenumber != null">phonenumber,</if>
<if test="sex != null">sex,</if>
<if test="birthday != null">birthday,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="customerName != null">#{customerName},</if>
<if test="phonenumber != null">#{phonenumber},</if>
<if test="sex != null">#{sex},</if>
<if test="birthday != null">#{birthday},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateSysCustomer" parameterType="SysCustomer">
update sys_customer
<trim prefix="SET" suffixOverrides=",">
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="phonenumber != null">phonenumber = #{phonenumber},</if>
<if test="sex != null">sex = #{sex},</if>
<if test="birthday != null">birthday = #{birthday},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where customer_id = #{customerId}
</update>
<delete id="deleteSysCustomerById" parameterType="Long">
delete from sys_customer where customer_id = #{customerId}
</delete>
<delete id="deleteSysCustomerByIds" parameterType="String">
delete from sys_customer where customer_id in
<foreach item="customerId" collection="array" open="(" separator="," close=")">
#{customerId}
</foreach>
</delete>
<delete id="deleteSysGoodsByCustomerIds" parameterType="String">
delete from sys_goods where customer_id in
<foreach item="customerId" collection="array" open="(" separator="," close=")">
#{customerId}
</foreach>
</delete>
<delete id="deleteSysGoodsByCustomerId" parameterType="Long">
delete from sys_goods where customer_id = #{customerId}
</delete>
<insert id="batchSysGoods">
insert into sys_goods( goods_id, customer_id, name, weight, price, date, type) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.goodsId}, #{item.customerId}, #{item.name}, #{item.weight}, #{item.price}, #{item.date}, #{item.type})
</foreach>
</insert>
</mapper>

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.test.mapper.SysFileInfoMapper">
<resultMap type="SysFileInfo" id="SysFileInfoResult">
<result property="fileId" column="file_id" />
<result property="fileName" column="file_name" />
<result property="filePath" column="file_path" />
</resultMap>
<sql id="selectSysFileInfoVo">
select file_id, file_name, file_path from sys_file_info
</sql>
<select id="selectSysFileInfoList" parameterType="SysFileInfo" resultMap="SysFileInfoResult">
<include refid="selectSysFileInfoVo"/>
<where>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
</where>
</select>
<select id="selectSysFileInfoById" parameterType="Long" resultMap="SysFileInfoResult">
<include refid="selectSysFileInfoVo"/>
where file_id = #{fileId}
</select>
<insert id="insertSysFileInfo" parameterType="SysFileInfo" useGeneratedKeys="true" keyProperty="fileId">
insert into sys_file_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fileName != null">file_name,</if>
<if test="filePath != null">file_path,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fileName != null">#{fileName},</if>
<if test="filePath != null">#{filePath},</if>
</trim>
</insert>
<update id="updateSysFileInfo" parameterType="SysFileInfo">
update sys_file_info
<trim prefix="SET" suffixOverrides=",">
<if test="fileName != null">file_name = #{fileName},</if>
<if test="filePath != null">file_path = #{filePath},</if>
</trim>
where file_id = #{fileId}
</update>
<delete id="deleteSysFileInfoById" parameterType="Long">
delete from sys_file_info where file_id = #{fileId}
</delete>
<delete id="deleteSysFileInfoByIds" parameterType="String">
delete from sys_file_info where file_id in
<foreach item="fileId" collection="array" open="(" separator="," close=")">
#{fileId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.test.mapper.TcUserMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.test.domain.TcUser">
<result column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="password"/>
<result column="password" jdbcType="VARCHAR" property="password"/>
</resultMap>
<!--返回所有用户信息-->
<select id="selectAll" resultType="com.ruoyi.test.domain.TcUser">
select id, name, password
from tc_user
</select>
<!--查询用户信息 by id-->
<select id="selectById" resultType="com.ruoyi.test.domain.TcUser">
select id,name,password from tc_user where id = #{id}
</select>
<!--增加用户信息-->
<insert id="insert" parameterType="com.ruoyi.test.domain.TcUser" >
insert into tc_user
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null and id !=''" >
id,
</if>
<if test="name != null and name !=''" >
name,
</if>
<if test="password != null and password != ''" >
password,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null and id != ''" >
#{id,jdbcType=INTEGER},
</if>
<if test="name != null and name !=''" >
#{name,jdbcType=VARCHAR},
</if>
<if test="password != null and password != ''" >
#{password,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<!--删除用户信息 by id-->
<delete id="deleteById" parameterType="int">
delete from tc_user where id=#{id}
</delete>
<!--根据id更改用户信息-->
<update id="updateById" parameterType="com.ruoyi.test.domain.TcUser">
update tc_user
<set >
<if test="name != null and name != ''" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="password != null and password != ''" >
password = #{password,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.test.mapper.TestVerifyMapper">
<!--查询用户数量 -->
<select id="isNameUnique" resultType="int">
select count(1) from tc_user where name = #{name}
</select>
</mapper>

View File

@ -0,0 +1,167 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增客户')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-customer-add">
<h4 class="form-header h4">客户信息</h4>
<div class="form-group">
<label class="col-sm-3 control-label">客户姓名:</label>
<div class="col-sm-8">
<input name="customerName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">手机号码:</label>
<div class="col-sm-8">
<input name="phonenumber" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户性别:</label>
<div class="col-sm-8">
<select name="sex" class="form-control m-b">
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户生日:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="birthday" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户描述:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
<h4 class="form-header h4">商品信息</h4>
<div class="row">
<div class="col-sm-12">
<button type="button" class="btn btn-white btn-sm" onclick="addColumn()"><i class="fa fa-plus"> 增加</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus"> 删除</i></button>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "test/customer"
$("#form-customer-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-customer-add').serialize());
}
}
$("input[name='birthday']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(function() {
var options = {
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
columns: [{
checkbox: true
},
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{
field: 'name',
align: 'center',
title: '商品名称',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='sysGoodsList[%s].name' value='%s'>", index, value);
return html;
}
},
{
field: 'weight',
align: 'center',
title: '商品重量',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='sysGoodsList[%s].weight' value='%s'>", index, value);
return html;
}
},
{
field: 'price',
align: 'center',
title: '商品价格',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='sysGoodsList[%s].price' value='%s'>", index, value);
return html;
}
},
{
field: 'date',
align: 'center',
title: '商品时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='sysGoodsList[%s].date' value='%s'>", index, value);
return html;
}
},
{
field: 'type',
align: 'center',
title: '商品种类',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='sysGoodsList[%s].type' value='%s'>", index, value);
return html;
}
}]
};
$.table.init(options);
});
function addColumn() {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
sub.editColumn();
$("#" + table.options.id).bootstrapTable('insertRow', {
index: count,
row: {
index: $.table.serialNumber(count),
name: "",
weight: "",
price: "",
date: "",
type: ""
}
});
}
</script>
</body>
</html>

View File

@ -0,0 +1,117 @@
<!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">
<div class="select-list">
<ul>
<li>
<label>客户姓名:</label>
<input type="text" name="customerName"/>
</li>
<li>
<label>手机号码:</label>
<input type="text" name="phonenumber"/>
</li>
<li>
<label>客户性别:</label>
<select name="sex">
<option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
</select>
</li>
<li>
<label>客户生日:</label>
<input type="text" class="time-input" placeholder="请选择客户生日" name="birthday"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="test:customer:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="test:customer:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="test:customer:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="test:customer: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('test:customer:edit')}]];
var removeFlag = [[${@permission.hasPermi('test:customer:remove')}]];
var prefix = ctx + "test/customer";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "客户",
columns: [{
checkbox: true
},
{
field: 'customerId',
title: '客户id',
visible: false
},
{
field: 'customerName',
title: '客户姓名'
},
{
field: 'phonenumber',
title: '手机号码'
},
{
field: 'sex',
title: '客户性别'
},
{
field: 'birthday',
title: '客户生日'
},
{
field: 'remark',
title: '客户描述'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.customerId + '\')"><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.customerId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,186 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改客户')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<!--<div class="ibox-content">
<form role="form" class="form-inline">
<div class="form-group">
<label for="exampleInputEmail2" class="sr-only">用户名</label>
<input type="email" placeholder="请输入用户名" id="exampleInputEmail2" class="form-control">
</div>
<div class="form-group">
<label for="exampleInputPassword2" class="sr-only">密码</label>
<input type="password" placeholder="请输入密码" id="exampleInputPassword2" class="form-control">
</div>
<div class="checkbox m-l m-r-xs">
<label>
<input type="checkbox"><i></i> 自动登录</label>
</div>
<button class="btn btn-white" type="submit">登录</button>
</form>
</div> -->
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-customer-edit" th:object="${sysCustomer}">
<h4 class="form-header h4">客户信息</h4>
<input name="customerId" th:field="*{customerId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">客户姓名:</label>
<div class="col-sm-8">
<input name="customerName" th:field="*{customerName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">手机号码:</label>
<div class="col-sm-8">
<input name="phonenumber" th:field="*{phonenumber}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户性别:</label>
<div class="col-sm-8">
<select name="sex" class="form-control m-b">
<option value="">所有</option>
</select>
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户生日:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="birthday" th:value="${#dates.format(sysCustomer.birthday, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">客户描述:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
<h4 class="form-header h4">商品信息</h4>
<div class="row">
<div class="col-sm-12">
<button type="button" class="btn btn-white btn-sm" onclick="addColumn()"><i class="fa fa-plus"> 增加</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus"> 删除</i></button>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "test/customer";
$("#form-customer-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-customer-edit').serialize());
}
}
$("input[name='birthday']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(function() {
var options = {
data: [[${sysCustomer.sysGoodsList}]],
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
columns: [{
checkbox: true
},
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{
field: 'name',
align: 'center',
title: '商品名称',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='sysGoodsList[%s].name' value='%s'>", index, value);
return html;
}
},
{
field: 'weight',
align: 'center',
title: '商品重量',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='sysGoodsList[%s].weight' value='%s'>", index, value);
return html;
}
},
{
field: 'price',
align: 'center',
title: '商品价格',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='sysGoodsList[%s].price' value='%s'>", index, value);
return html;
}
},
{
field: 'date',
align: 'center',
title: '商品时间',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='sysGoodsList[%s].date' value='%s'>", index, value);
return html;
}
},
{
field: 'type',
align: 'center',
title: '商品种类',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='sysGoodsList[%s].type' value='%s'>", index, value);
return html;
}
}]
};
$.table.init(options);
});
function addColumn() {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
sub.editColumn();
$("#" + table.options.id).bootstrapTable('insertRow', {
index: count,
row: {
index: $.table.serialNumber(count),
name: "",
weight: "",
price: "",
date: "",
type: ""
}
});
}
</script>
</body>
</html>

View File

@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增文件信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-fileinfo-add">
<div class="form-group">
<label class="col-sm-3 control-label">文件名称:</label>
<div class="col-sm-8">
<input name="fileName" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">文件路径:</label>
<div class="col-sm-8">
<input name="filePath" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "test/fileinfo"
$("#form-fileinfo-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-fileinfo-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改文件信息')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-fileinfo-edit" th:object="${sysFileInfo}">
<input name="fileId" th:field="*{fileId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">文件名称:</label>
<div class="col-sm-8">
<input name="fileName" th:field="*{fileName}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">文件路径:</label>
<div class="col-sm-8">
<input name="filePath" th:field="*{filePath}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "test/fileinfo";
$("#form-fileinfo-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-fileinfo-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,94 @@
<!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">
<div class="select-list">
<ul>
<li>
<label>文件名称:</label>
<input type="text" name="fileName"/>
</li>
<li>
<label>文件路径:</label>
<input type="text" name="filePath"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="test:fileinfo:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="test:fileinfo:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="test:fileinfo:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="test:fileinfo: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('test:fileinfo:edit')}]];
var removeFlag = [[${@permission.hasPermi('test:fileinfo:remove')}]];
var prefix = ctx + "test/fileinfo";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "文件信息",
columns: [{
checkbox: true
},
{
field: 'fileId',
title: '文件id',
visible: false
},
{
field: 'fileName',
title: '文件名称'
},
{
field: 'filePath',
title: '文件路径'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.fileId + '\')"><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.fileId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>BPS后台管理系统-测试首页</title>
</head>
<body>
<h1>BPS后台管理系统-测试首页</h1><br><br>
一、Mybaits配置DML测试-Oracle第二数据源
<li><a th:href="@{/test/selectAll}">查询所有用户</a></li>
<li><a th:href="@{/test/insert?id=1000&name=bo&password=12}">新增ID为1000的用户</a></li>
<li><a th:href="@{/test/selectById/1000}">根据ID查询用户,查询id=1000的用户</a></li>
<li><a th:href="@{/test/updateById?id=1000&name=Xia&password=20}">修改用户为1000的用户姓名为Xia</a></li>
<li><a th:href="@{/test/deleteById?id=1000}">删除ID为1000的用户</a></li>
<p></p>
二、Mybaits配置DDL测试-Oracle
<li><a th:href="@{/test/getRecordCount}">查询表中的记录数</a></li>
<li><a th:href="@{/test/isTableInDb}">查询tc_user是否存在</a></li>
<p />
<a th:href="@{/test/sendjson}">Ajax发送获取Json配置测试 </a>
<p />
二、输入后验证测试
<li><a th:href="@{/test/testVerify}">验证数据表中是否有记录</a></li>
<p />
三、当前系统时间<span th:text="${date}"></span>
</body>
</html>

View File

@ -0,0 +1,99 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>发送json</title>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<script type="text/javascript">
var ctx = [[@{/}]];
function send1() {
var beauty = JSON.stringify({ //将JSON对象转换为字符串
"name": "小王",
"age": 26,
"salary": 200000,
"date": "2019-08-05 08:04:13"
});
$.ajax({
type: 'POST',
url: ctx+"/test/simple",
data: beauty, //beauty是字符串
contentType: "application/json",
dataType: "json",
success: function(message) {
alert(JSON.stringify(message)); //将JSON对象转换为字符串
}
});
};
function send2() {
var beauty = JSON.stringify({
"MM": [{
"name": "张三",
"age": 27,
"salary": 20000,
"date": "2017-05-19 09:33:14"
}, {
"name": "李四",
"age": 30,
"salary": 30000,
"date": "2019-10-21 17:04:33"
}],
"master": {
"name": "小甜甜",
"age": 26,
"salary": 200000,
"date": "2019-08-05 08:04:13"
}
});
$.ajax({
type: "POST",
url: ctx+"/test/complex",
contentType: "application/json; charset=utf-8",
data: beauty,
dataType: "json",
success: function(message) {
alert("提交成功" + JSON.stringify(message));
},
error: function(message) {
alert("提交失败" + JSON.stringify(message));
}
});
};
function send3() {
//var jsonObj = {'t_head': "${t_head}", 't_detail': "${t_detail}"};
var jsonObj = {"t_head": "CSFR412_15175TOPGPAP", "t_detail": "CSFR4125175TOPGPAP"};
$.ajax(
{
type: 'POST',
url: ctx+"/anon/bps/frforcr/toptest",
dataType: "json",
data: JSON.stringify(jsonObj),
contentType : "application/json",
callback: "callback",
success: function (data)
{
alert(data.msg);
},
error: function ()
{
alert(data.msg);
}
}
);
}
</script>
<input type="button" name="btn1" id="s1" onclick="send1()" value="发送简单json" />
<br />
<hr />
<input type="button" name="btn2" id="s2" onclick="send2()" value="发送复杂json" />
<br />
<hr />
<input type="button" name="btn3" id="s3" onclick="send3()" value="发送json到FrForCr" />
</body>
</html>

View File

@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('验证测试')" />
</head>
<body>
<div class="col-sm-8">
<div>
<form role="form" class="form-inline" id="form-user-add">
<div class="form-group">用户名:
<label for="name" class="sr-only">用户名</label>
<input id="name" name="name" placeholder="请输入用户名" class="form-control">
</div>
<button class="btn btn-white" type="submit" onclick="submitHandler()">登录</button>
</form>
</div>
</div>
<th:block th:include="include :: footer" />
<script>
var ctx = [[@{/}]];
$("#form-user-add").validate({
onkeyup: false,
rules:{
name:{
minlength: 1,
maxlength: 20,
remote: {
url: ctx+"/test/testVerifyName",
type: "post",
dataType: "json",
data: {
"name": function() {
return $.common.trim($("#name").val());
}
},
dataFilter: function(data, type) {
return $.validate.unique(data);
}
}
},
},
messages: {
"name": {
remote: "用户已经存在"
}
},
focusCleanup: true
});
function submitHandler() {
var user=$.common.trim($("#name").val());
if ($.validate.form()) {
alert("用户【"+user+"】不存在!");
}
else{
alert( "用户【"+user+"】已存在!");
}
}
</script>
</body>
</html>

16
pom.xml
View File

@ -229,6 +229,20 @@
<version>${ruoyi.version}</version> <version>${ruoyi.version}</version>
</dependency> </dependency>
<!-- test模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>box-test</artifactId>
<version>${ruoyi.version}</version>
</dependency>
<!-- bps模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>box-bps</artifactId>
<version>${ruoyi.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
@ -239,6 +253,8 @@
<module>ruoyi-quartz</module> <module>ruoyi-quartz</module>
<module>ruoyi-generator</module> <module>ruoyi-generator</module>
<module>ruoyi-common</module> <module>ruoyi-common</module>
<module>box-test</module>
<module>box-bps</module>
</modules> </modules>
<packaging>pom</packaging> <packaging>pom</packaging>

View File

@ -8,7 +8,7 @@
<version>4.6.1</version> <version>4.6.1</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging> <packaging>war</packaging>
<artifactId>ruoyi-admin</artifactId> <artifactId>ruoyi-admin</artifactId>
<description> <description>
@ -61,6 +61,21 @@
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
</dependency> </dependency>
<!-- Oracle驱动-->
<!-- https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc6 -->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.4</version>
</dependency>
<!--SQLServer驱动-->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>8.4.1.jre8</version>
</dependency>
<!-- 核心模块--> <!-- 核心模块-->
<dependency> <dependency>
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
@ -79,6 +94,18 @@
<artifactId>ruoyi-generator</artifactId> <artifactId>ruoyi-generator</artifactId>
</dependency> </dependency>
<!-- test模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>box-test</artifactId>
</dependency>
<!-- bps模块-->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>box-bps</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -2,20 +2,48 @@
spring: spring:
datasource: datasource:
type: com.alibaba.druid.pool.DruidDataSource type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.cj.jdbc.Driver #driverClassName: com.mysql.cj.jdbc.Driver
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://192.168.2.18:3306/bps?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: password password: abc.123
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: false enabled: true
url: url: jdbc:oracle:thin:@192.168.2.91:1521/toptest
username: username: ds7
password: password: ds7
driverClassName: oracle.jdbc.driver.OracleDriver
#SQlServer数据源
sqlsvr:
# 从数据源开关/默认关闭
enabled: true
url: jdbc:sqlserver://192.168.2.84:1433;SelectMethod=cursor;DatabaseName=ITDemo
username: sa
password: abc.123
driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
# Topprod_ds_report
topproddsreport:
# 从数据源开关/默认关闭
enabled: true
url: jdbc:oracle:thin:@192.168.2.91:1521/topprod
username: ds_report
password: ds_report
driverClassName: oracle.jdbc.driver.OracleDriver
# Toptest_ds_report
toptestdsreport:
# 从数据源开关/默认关闭
enabled: true
url: jdbc:oracle:thin:@192.168.2.91:1521/toptest
username: ds_report
password: ds_report
driverClassName: oracle.jdbc.driver.OracleDriver
# 初始连接数 # 初始连接数
initialSize: 5 initialSize: 5
# 最小连接池数量 # 最小连接池数量

View File

@ -9,7 +9,7 @@ ruoyi:
# 实例演示开关 # 实例演示开关
demoEnabled: true demoEnabled: true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath # 文件路径 示例( Windows配置D:/ruoyi/uploadPathLinux配置 /home/ruoyi/uploadPath
profile: D:/ruoyi/uploadPath profile: C:/bps-it/uploadPath
# 获取ip地址开关 # 获取ip地址开关
addressEnabled: false addressEnabled: false
@ -19,7 +19,7 @@ server:
port: 80 port: 80
servlet: servlet:
# 应用的访问路径 # 应用的访问路径
context-path: / context-path: /it_war
tomcat: tomcat:
# tomcat的URI编码 # tomcat的URI编码
uri-encoding: UTF-8 uri-encoding: UTF-8
@ -96,7 +96,7 @@ shiro:
# 首页地址 # 首页地址
indexUrl: /index indexUrl: /index
# 验证码开关 # 验证码开关
captchaEnabled: true captchaEnabled: false
# 验证码类型 math 数组计算 char 字符 # 验证码类型 math 数组计算 char 字符
captchaType: math captchaType: math
cookie: cookie:

View File

@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<title>若依系统首页</title> <title>BPS管理系统首页</title>
<!-- 避免IE使用兼容模式 --> <!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link th:href="@{favicon.ico}" rel="shortcut icon"/> <link th:href="@{favicon.ico}" rel="shortcut icon"/>

View File

@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit"> <meta name="renderer" content="webkit">
<title>若依系统首页</title> <title>BPS管理系统首页</title>
<!-- 避免IE使用兼容模式 --> <!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link th:href="@{favicon.ico}" rel="shortcut icon"/> <link th:href="@{favicon.ico}" rel="shortcut icon"/>
@ -26,7 +26,7 @@
</div> </div>
<a th:href="@{/index}"> <a th:href="@{/index}">
<li class="logo hidden-xs"> <li class="logo hidden-xs">
<span class="logo-lg">RuoYi</span> <span class="logo-lg">BPS后台管理系统</span>
</li> </li>
</a> </a>
<div class="sidebar-collapse"> <div class="sidebar-collapse">

View File

@ -3,8 +3,8 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title>登录若依系统</title> <title>登录BPS后台管理系统</title>
<meta name="description" content="若依后台管理框架"> <meta name="description" content="BPS后台管理框架">
<link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/> <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
<link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/> <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
<link href="../static/css/style.min.css" th:href="@{/css/style.min.css}" rel="stylesheet"/> <link href="../static/css/style.min.css" th:href="@{/css/style.min.css}" rel="stylesheet"/>

File diff suppressed because it is too large Load Diff

View File

@ -56,4 +56,9 @@ public enum BusinessType
* 清空 * 清空
*/ */
CLEAN, CLEAN,
/**
* 清空
*/
DROP,
} }

View File

@ -15,5 +15,20 @@ public enum DataSourceType
/** /**
* 从库 * 从库
*/ */
SLAVE SLAVE,
/**
* SQLSERVER数据库
*/
SQLSVR,
/**
* TOPPROD_DS_REPORT数据库
*/
TOPPRODDSREPORT,
/**
* TOPTEST_DS_REPORT数据库
*/
TOPTESTDSREPORT
} }

View File

@ -49,6 +49,39 @@ public class DruidConfig
return druidProperties.dataSource(dataSource); return druidProperties.dataSource(dataSource);
} }
//add yangbo 新增SQLSERVER数据源 Begin
@Bean
@ConfigurationProperties("spring.datasource.druid.sqlsvr")
@ConditionalOnProperty(prefix = "spring.datasource.druid.sqlsvr", name = "enabled", havingValue = "true")
public DataSource sqlsvrDataSource(DruidProperties druidProperties)
{
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
return druidProperties.dataSource(dataSource);
}
//add yangbo 新增SQLSERVER数据源 End
//add yangbo 新增topprod ds_report数据源 Begin
@Bean
@ConfigurationProperties("spring.datasource.druid.topproddsreport")
@ConditionalOnProperty(prefix = "spring.datasource.druid.topproddsreport", name = "enabled", havingValue = "true")
public DataSource topproddsreportDataSource(DruidProperties druidProperties)
{
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
return druidProperties.dataSource(dataSource);
}
//add yangbo 新增topprod ds_report数据源 End
//add yangbo 新增toptest ds_report数据源 Begin
@Bean
@ConfigurationProperties("spring.datasource.druid.toptestdsreport")
@ConditionalOnProperty(prefix = "spring.datasource.druid.toptestdsreport", name = "enabled", havingValue = "true")
public DataSource toptestdsreportDataSource(DruidProperties druidProperties)
{
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
return druidProperties.dataSource(dataSource);
}
//add yangbo 新增toptest ds_report数据源 End
@Bean(name = "dynamicDataSource") @Bean(name = "dynamicDataSource")
@Primary @Primary
public DynamicDataSource dataSource(DataSource masterDataSource) public DynamicDataSource dataSource(DataSource masterDataSource)
@ -56,6 +89,11 @@ public class DruidConfig
Map<Object, Object> targetDataSources = new HashMap<>(); Map<Object, Object> targetDataSources = new HashMap<>();
targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource); targetDataSources.put(DataSourceType.MASTER.name(), masterDataSource);
setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource"); setDataSource(targetDataSources, DataSourceType.SLAVE.name(), "slaveDataSource");
//add yangbo 新增SQLSERVERtopproddsreporttoptestdsreport数据源 --Begin
setDataSource(targetDataSources, DataSourceType.SQLSVR.name(), "sqlsvrDataSource");
setDataSource(targetDataSources, DataSourceType.TOPPRODDSREPORT.name(), "topproddsreportDataSource");
setDataSource(targetDataSources, DataSourceType.TOPTESTDSREPORT.name(), "toptestdsreportDataSource");
//add yangbo 新增SQLSERVERtopproddsreporttoptestdsreport数据源 End
return new DynamicDataSource(masterDataSource, targetDataSources); return new DynamicDataSource(masterDataSource, targetDataSources);
} }

Some files were not shown because too many files have changed in this diff Show More