模块拆分
This commit is contained in:
1 parent
b2e3706553
commit
c035263bc6
758 files changed
-91085
No files matched your search
@@ -1,38 +0,0 @@
|
||||
<?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>3.4.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>luqj-baidu-ai</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.baidubce</groupId>
|
||||
<artifactId>qianfan</artifactId>
|
||||
<version>0.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>luqj-common</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.luqj.bdai.service;
|
||||
|
||||
public interface IBaiduAiService {
|
||||
String getPl(String content);
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.luqj.bdai.service.impl;
|
||||
|
||||
import com.baidubce.qianfan.Qianfan;
|
||||
import com.baidubce.qianfan.core.auth.Auth;
|
||||
import com.baidubce.qianfan.model.chat.ChatResponse;
|
||||
import com.luqj.bdai.service.IBaiduAiService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class BaiduAiServiceImpl implements IBaiduAiService {
|
||||
Qianfan qianfan = new Qianfan(Auth.TYPE_OAUTH,"mcxmebDP4a3UU0ELLOYEN3rx", "cJcRakEzVDfcCEABl2jmvd5rnWViMhFP");
|
||||
public String getPl(String content){
|
||||
ChatResponse response = qianfan
|
||||
.chatCompletion()
|
||||
// .model("ERNIE-3.5-8K")
|
||||
.model("ERNIE-Speed-128K")
|
||||
.temperature(0.95)
|
||||
.topP(0.7)
|
||||
.penaltyScore(1.0)
|
||||
// .stop()
|
||||
// 与Chat类似,但通过prompt传入指令
|
||||
.addMessage("user",content)
|
||||
.execute();
|
||||
System.out.println(response.getResult());
|
||||
return response.getResult();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
BaiduAiServiceImpl baiduAiService = new BaiduAiServiceImpl();
|
||||
baiduAiService.getPl("一个驱逐舰05的车主论坛上发布了一条标题为:不知道是不是没有设置对,亏点油耗这么高,我是强制保电50% 的文章,写一条字数大于20字,小于35字的评论");
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
<?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>3.4.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>luqj-common</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>19970182</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
</dependency>
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
<version>1.5.22</version>
|
||||
</dependency>
|
||||
<!--七牛云上传相关-->
|
||||
<dependency>
|
||||
<groupId>com.qiniu</groupId>
|
||||
<artifactId>qiniu-java-sdk</artifactId>
|
||||
<version>7.2.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>3.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.6.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.qiniu</groupId>
|
||||
<artifactId>happy-dns-java</artifactId>
|
||||
<version>0.1.4</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -1,64 +0,0 @@
|
||||
package com.luqj.common.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 邮件系统属性信息
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "lu.admin.mail")
|
||||
public class EmailProperties {
|
||||
|
||||
/**
|
||||
* 是否smtp授权
|
||||
*/
|
||||
private Boolean smtpAuth = true;
|
||||
|
||||
/**
|
||||
* 邮件系统smtp
|
||||
*/
|
||||
private String smtpHost = "smtp.163.com";
|
||||
|
||||
/**
|
||||
* 默认用户
|
||||
*/
|
||||
private String user;
|
||||
|
||||
/**
|
||||
* 用户密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
public Boolean getSmtpAuth() {
|
||||
return smtpAuth;
|
||||
}
|
||||
|
||||
public void setSmtpAuth(Boolean smtpAuth) {
|
||||
this.smtpAuth = smtpAuth;
|
||||
}
|
||||
|
||||
public String getSmtpHost() {
|
||||
return smtpHost;
|
||||
}
|
||||
|
||||
public void setSmtpHost(String smtpHost) {
|
||||
this.smtpHost = smtpHost;
|
||||
}
|
||||
|
||||
public String getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(String user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package com.luqj.common.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.luqj.common.domain.ComCategory;
|
||||
import com.luqj.common.service.IComCategoryService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 类别Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-07-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/common/category")
|
||||
public class ComCategoryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IComCategoryService comCategoryService;
|
||||
|
||||
@GetMapping("/treeselect")
|
||||
public AjaxResult treeselect(ComCategory comCategory)
|
||||
{
|
||||
List<ComCategory> depts = comCategoryService.selectComCategoryList(comCategory);
|
||||
return AjaxResult.success(comCategoryService.buildCategoryTreeSelect(depts));
|
||||
}
|
||||
/**
|
||||
* 查询类别列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:category:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ComCategory comCategory)
|
||||
{
|
||||
startPage();
|
||||
List<ComCategory> list = comCategoryService.selectComCategoryList(comCategory);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出类别列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:category:export')")
|
||||
@Log(title = "类别", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(ComCategory comCategory)
|
||||
{
|
||||
List<ComCategory> list = comCategoryService.selectComCategoryList(comCategory);
|
||||
ExcelUtil<ComCategory> util = new ExcelUtil<ComCategory>(ComCategory.class);
|
||||
return util.exportExcel(list, "category");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类别详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:category:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(comCategoryService.selectComCategoryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增类别
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:category:add')")
|
||||
@Log(title = "类别", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ComCategory comCategory)
|
||||
{
|
||||
return toAjax(comCategoryService.insertComCategory(comCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改类别
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:category:edit')")
|
||||
@Log(title = "类别", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ComCategory comCategory)
|
||||
{
|
||||
return toAjax(comCategoryService.updateComCategory(comCategory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除类别
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('common:category:remove')")
|
||||
@Log(title = "类别", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(comCategoryService.deleteComCategoryByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.luqj.common.controller;
|
||||
|
||||
import com.luqj.common.domain.SelectItem;
|
||||
import com.luqj.common.service.ICommonService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/common")
|
||||
public class SelectCommonController extends BaseController {
|
||||
@Autowired
|
||||
private ICommonService comCategory;
|
||||
|
||||
@GetMapping("/select/search")
|
||||
public AjaxResult selectSearch(String tableName, String keyword, String fieldId, String fieldName) {
|
||||
if(tableName.contains(" ") || fieldId.contains(" ") || fieldName.contains(" ")){
|
||||
return AjaxResult.error("注入嫌疑");
|
||||
}
|
||||
List<SelectItem> searchs = comCategory.search(tableName, fieldId, fieldName, keyword);
|
||||
return AjaxResult.success(searchs);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.luqj.common.domain;
|
||||
|
||||
import com.ruoyi.common.core.domain.TreeSelect;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CategoryTreeSelect extends TreeSelect {
|
||||
public CategoryTreeSelect(ComCategory comCategory)
|
||||
{
|
||||
this.id = comCategory.getId();
|
||||
this.label = comCategory.getName();
|
||||
this.children = comCategory.getChildren().stream().map(CategoryTreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -1,233 +0,0 @@
|
||||
package com.luqj.common.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 类别对象 com_category
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-07-24
|
||||
*/
|
||||
public class ComCategory extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
/** 父id */
|
||||
@Excel(name = "父id")
|
||||
private Long parentId;
|
||||
|
||||
/** 所有父级id组合,以逗号隔开 */
|
||||
@Excel(name = "所有父级id组合,以逗号隔开")
|
||||
private String parentIds;
|
||||
|
||||
/** 系统层级类目 */
|
||||
@Excel(name = "系统层级类目")
|
||||
private Long projectType;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private Long sortNum;
|
||||
|
||||
/** 图标地址 */
|
||||
@Excel(name = "图标地址")
|
||||
private String iconUrl;
|
||||
|
||||
/** 图片地址 */
|
||||
@Excel(name = "图片地址")
|
||||
private String picUrl;
|
||||
|
||||
/** 是否叶子节点(0否,1是) */
|
||||
@Excel(name = "是否叶子节点(0否,1是)")
|
||||
private Integer hasLeaf;
|
||||
|
||||
/** 是否前台首页展示(0否,1是) */
|
||||
@Excel(name = "是否前台首页展示(0否,1是)")
|
||||
private Integer homeShow;
|
||||
|
||||
/** 类目级别,1:一级类目;2:二级类目;3:三级类目,目前只支持三级类目 */
|
||||
@Excel(name = "类目级别,1:一级类目;2:二级类目;3:三级类目,目前只支持三级类目")
|
||||
private Integer level;
|
||||
|
||||
/** 标示位:例如热门分类等 */
|
||||
@Excel(name = "标示位:例如热门分类等")
|
||||
private Long flag;
|
||||
|
||||
/** 描述 */
|
||||
@Excel(name = "描述")
|
||||
private String description;
|
||||
|
||||
/** 状态 0-禁用,1-启用,2-删除 */
|
||||
@Excel(name = "状态 0-禁用,1-启用,2-删除")
|
||||
private Integer status;
|
||||
|
||||
private List<ComCategory> children = new ArrayList<>();
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public List<ComCategory> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<ComCategory> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
public void setParentIds(String parentIds)
|
||||
{
|
||||
this.parentIds = parentIds;
|
||||
}
|
||||
|
||||
public String getParentIds()
|
||||
{
|
||||
return parentIds;
|
||||
}
|
||||
public void setProjectType(Long projectType)
|
||||
{
|
||||
this.projectType = projectType;
|
||||
}
|
||||
|
||||
public Long getProjectType()
|
||||
{
|
||||
return projectType;
|
||||
}
|
||||
public void setSortNum(Long sortNum)
|
||||
{
|
||||
this.sortNum = sortNum;
|
||||
}
|
||||
|
||||
public Long getSortNum()
|
||||
{
|
||||
return sortNum;
|
||||
}
|
||||
public void setIconUrl(String iconUrl)
|
||||
{
|
||||
this.iconUrl = iconUrl;
|
||||
}
|
||||
|
||||
public String getIconUrl()
|
||||
{
|
||||
return iconUrl;
|
||||
}
|
||||
public void setPicUrl(String picUrl)
|
||||
{
|
||||
this.picUrl = picUrl;
|
||||
}
|
||||
|
||||
public String getPicUrl()
|
||||
{
|
||||
return picUrl;
|
||||
}
|
||||
public void setHasLeaf(Integer hasLeaf)
|
||||
{
|
||||
this.hasLeaf = hasLeaf;
|
||||
}
|
||||
|
||||
public Integer getHasLeaf()
|
||||
{
|
||||
return hasLeaf;
|
||||
}
|
||||
public void setHomeShow(Integer homeShow)
|
||||
{
|
||||
this.homeShow = homeShow;
|
||||
}
|
||||
|
||||
public Integer getHomeShow()
|
||||
{
|
||||
return homeShow;
|
||||
}
|
||||
public void setLevel(Integer level)
|
||||
{
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public Integer getLevel()
|
||||
{
|
||||
return level;
|
||||
}
|
||||
public void setFlag(Long flag)
|
||||
{
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public Long getFlag()
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("parentId", getParentId())
|
||||
.append("parentIds", getParentIds())
|
||||
.append("projectType", getProjectType())
|
||||
.append("sortNum", getSortNum())
|
||||
.append("iconUrl", getIconUrl())
|
||||
.append("picUrl", getPicUrl())
|
||||
.append("hasLeaf", getHasLeaf())
|
||||
.append("homeShow", getHomeShow())
|
||||
.append("level", getLevel())
|
||||
.append("flag", getFlag())
|
||||
.append("description", getDescription())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("status", getStatus())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,232 +0,0 @@
|
||||
package com.luqj.common.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* 类别对象 com_category
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-07-24
|
||||
*/
|
||||
@TableName(value = "com_category")
|
||||
public class ComCategoryPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private Long id;
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
/** 父id */
|
||||
@Excel(name = "父id")
|
||||
private Long parentId;
|
||||
/** 所有父级id组合,以逗号隔开 */
|
||||
@Excel(name = "所有父级id组合,以逗号隔开")
|
||||
private String parentIds;
|
||||
/** 系统层级类目 */
|
||||
@Excel(name = "系统层级类目")
|
||||
private Long projectType;
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
private Long sortNum;
|
||||
/** 图标地址 */
|
||||
@Excel(name = "图标地址")
|
||||
private String iconUrl;
|
||||
/** 图片地址 */
|
||||
@Excel(name = "图片地址")
|
||||
private String picUrl;
|
||||
/** 是否叶子节点(0否,1是) */
|
||||
@Excel(name = "是否叶子节点(0否,1是)")
|
||||
private Integer hasLeaf;
|
||||
/** 是否前台首页展示(0否,1是) */
|
||||
@Excel(name = "是否前台首页展示(0否,1是)")
|
||||
private Integer homeShow;
|
||||
/** 类目级别,1:一级类目;2:二级类目;3:三级类目,目前只支持三级类目 */
|
||||
@Excel(name = "类目级别,1:一级类目;2:二级类目;3:三级类目,目前只支持三级类目")
|
||||
private Integer level;
|
||||
/** 标示位:例如热门分类等 */
|
||||
@Excel(name = "标示位:例如热门分类等")
|
||||
private Long flag;
|
||||
/** 描述 */
|
||||
@Excel(name = "描述")
|
||||
private String description;
|
||||
/** 创建时间 */
|
||||
private Date createTime;
|
||||
/** 修改时间 */
|
||||
private Date updateTime;
|
||||
/** 状态 0-禁用,1-启用,2-删除 */
|
||||
@Excel(name = "状态 0-禁用,1-启用,2-删除")
|
||||
private Integer status;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setParentId(Long parentId)
|
||||
{
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public Long getParentId()
|
||||
{
|
||||
return parentId;
|
||||
}
|
||||
public void setParentIds(String parentIds)
|
||||
{
|
||||
this.parentIds = parentIds;
|
||||
}
|
||||
|
||||
public String getParentIds()
|
||||
{
|
||||
return parentIds;
|
||||
}
|
||||
public void setProjectType(Long projectType)
|
||||
{
|
||||
this.projectType = projectType;
|
||||
}
|
||||
|
||||
public Long getProjectType()
|
||||
{
|
||||
return projectType;
|
||||
}
|
||||
public void setSortNum(Long sortNum)
|
||||
{
|
||||
this.sortNum = sortNum;
|
||||
}
|
||||
|
||||
public Long getSortNum()
|
||||
{
|
||||
return sortNum;
|
||||
}
|
||||
public void setIconUrl(String iconUrl)
|
||||
{
|
||||
this.iconUrl = iconUrl;
|
||||
}
|
||||
|
||||
public String getIconUrl()
|
||||
{
|
||||
return iconUrl;
|
||||
}
|
||||
public void setPicUrl(String picUrl)
|
||||
{
|
||||
this.picUrl = picUrl;
|
||||
}
|
||||
|
||||
public String getPicUrl()
|
||||
{
|
||||
return picUrl;
|
||||
}
|
||||
public void setHasLeaf(Integer hasLeaf)
|
||||
{
|
||||
this.hasLeaf = hasLeaf;
|
||||
}
|
||||
|
||||
public Integer getHasLeaf()
|
||||
{
|
||||
return hasLeaf;
|
||||
}
|
||||
public void setHomeShow(Integer homeShow)
|
||||
{
|
||||
this.homeShow = homeShow;
|
||||
}
|
||||
|
||||
public Integer getHomeShow()
|
||||
{
|
||||
return homeShow;
|
||||
}
|
||||
public void setLevel(Integer level)
|
||||
{
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public Integer getLevel()
|
||||
{
|
||||
return level;
|
||||
}
|
||||
public void setFlag(Long flag)
|
||||
{
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public Long getFlag()
|
||||
{
|
||||
return flag;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
public void setCreateTime(Date createTime)
|
||||
{
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getCreateTime()
|
||||
{
|
||||
return createTime;
|
||||
}
|
||||
public void setUpdateTime(Date updateTime)
|
||||
{
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime()
|
||||
{
|
||||
return updateTime;
|
||||
}
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("parentId", getParentId())
|
||||
.append("parentIds", getParentIds())
|
||||
.append("projectType", getProjectType())
|
||||
.append("sortNum", getSortNum())
|
||||
.append("iconUrl", getIconUrl())
|
||||
.append("picUrl", getPicUrl())
|
||||
.append("hasLeaf", getHasLeaf())
|
||||
.append("homeShow", getHomeShow())
|
||||
.append("level", getLevel())
|
||||
.append("flag", getFlag())
|
||||
.append("description", getDescription())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("status", getStatus())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.luqj.common.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ContactItem<T> implements Serializable,Comparable<ContactItem> {
|
||||
private String letter;
|
||||
private List<T> data;
|
||||
|
||||
@Override
|
||||
public int compareTo(ContactItem o) {
|
||||
return this.getLetter().compareTo(o.getLetter());
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
package com.luqj.common.domain;
|
||||
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class RedisKey {
|
||||
private StringBuffer stringBuffer = new StringBuffer("");
|
||||
|
||||
public RedisKey() {
|
||||
}
|
||||
|
||||
public RedisKey(String key) {
|
||||
stringBuffer = new StringBuffer(key);
|
||||
}
|
||||
|
||||
public RedisKey add(String key) {
|
||||
if (StringUtils.isNotBlank(key)) {
|
||||
stringBuffer.append(key).append("_");
|
||||
} else {
|
||||
stringBuffer.append("NULL_");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public RedisKey add(BigDecimal key) {
|
||||
if (key != null) {
|
||||
stringBuffer.append(key).append("_");
|
||||
} else {
|
||||
stringBuffer.append("NULL_");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public RedisKey add(Boolean key) {
|
||||
if (key != null) {
|
||||
stringBuffer.append(key).append("_");
|
||||
} else {
|
||||
stringBuffer.append("NULL_");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public RedisKey add(Long key) {
|
||||
if (key != null) {
|
||||
stringBuffer.append(key).append("_");
|
||||
} else {
|
||||
stringBuffer.append("NULL_");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public RedisKey add(Date key) {
|
||||
if (key != null) {
|
||||
stringBuffer.append(key.getTime()).append("_");
|
||||
} else {
|
||||
stringBuffer.append("_NULL");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public RedisKey add(Integer key) {
|
||||
if (key != null) {
|
||||
stringBuffer.append(key).append("_");
|
||||
} else {
|
||||
stringBuffer.append("_NULL");
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public String key() {
|
||||
return this.stringBuffer.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.luqj.common.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class SelectItem implements Serializable {
|
||||
private String id;
|
||||
private String name;
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.luqj.common.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.luqj.common.domain.ComCategory;
|
||||
import com.luqj.common.domain.ComCategoryPlus;
|
||||
|
||||
/**
|
||||
* 类别Mapper接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-07-24
|
||||
*/
|
||||
public interface ComCategoryMapper extends BaseMapper<ComCategoryPlus>
|
||||
{
|
||||
/**
|
||||
* 查询类别
|
||||
*
|
||||
* @param id 类别ID
|
||||
* @return 类别
|
||||
*/
|
||||
public ComCategory selectComCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询类别列表
|
||||
*
|
||||
* @param comCategory 类别
|
||||
* @return 类别集合
|
||||
*/
|
||||
public List<ComCategory> selectComCategoryList(ComCategory comCategory);
|
||||
|
||||
/**
|
||||
* 新增类别
|
||||
*
|
||||
* @param comCategory 类别
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertComCategory(ComCategory comCategory);
|
||||
|
||||
/**
|
||||
* 修改类别
|
||||
*
|
||||
* @param comCategory 类别
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateComCategory(ComCategory comCategory);
|
||||
|
||||
/**
|
||||
* 删除类别
|
||||
*
|
||||
* @param id 类别ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteComCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除类别
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteComCategoryByIds(Long[] ids);
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
package com.luqj.common.service;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
|
||||
import com.luqj.common.domain.CategoryTreeSelect;
|
||||
import com.luqj.common.domain.ComCategory;
|
||||
import com.luqj.common.domain.ComCategoryPlus;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
/**
|
||||
* 类别Service接口
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-07-24
|
||||
*/
|
||||
public interface IComCategoryService extends IService<ComCategoryPlus>
|
||||
{
|
||||
/**
|
||||
* 查询类别
|
||||
*
|
||||
* @param id 类别ID
|
||||
* @return 类别
|
||||
*/
|
||||
public ComCategory selectComCategoryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询类别列表
|
||||
*
|
||||
* @param comCategory 类别
|
||||
* @return 类别集合
|
||||
*/
|
||||
public List<ComCategory> selectComCategoryList(ComCategory comCategory);
|
||||
|
||||
/**
|
||||
* 新增类别
|
||||
*
|
||||
* @param comCategory 类别
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertComCategory(ComCategory comCategory);
|
||||
|
||||
/**
|
||||
* 修改类别
|
||||
*
|
||||
* @param comCategory 类别
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateComCategory(ComCategory comCategory);
|
||||
|
||||
/**
|
||||
* 批量删除类别
|
||||
*
|
||||
* @param ids 需要删除的类别ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteComCategoryByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除类别信息
|
||||
*
|
||||
* @param id 类别ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteComCategoryById(Long id);
|
||||
|
||||
List<ComCategoryPlus> getByIds(List<Long> ids, SFunction<ComCategoryPlus, ?>... columns);
|
||||
|
||||
ComCategoryPlus getById(Long id, SFunction<ComCategoryPlus, ?>... columns);
|
||||
|
||||
Map<Long, ComCategoryPlus> getMapByIds(List<Long> ids, SFunction<ComCategoryPlus, ?>... columns);
|
||||
|
||||
List<CategoryTreeSelect> buildCategoryTreeSelect(List<ComCategory> comCategory);
|
||||
|
||||
List<ComCategoryPlus> getByIds(List<Long> ids);
|
||||
|
||||
Map<Long, ComCategoryPlus> getMapByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* @param field sum 字段
|
||||
* @param where 条件
|
||||
* @param tClass 返回类型
|
||||
* @param <T>
|
||||
* @return
|
||||
*/
|
||||
<T> T sum(String field, String where, Class<T> tClass);
|
||||
|
||||
Long count(String where);
|
||||
|
||||
<T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.luqj.common.service;
|
||||
|
||||
import com.luqj.common.domain.SelectItem;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ICommonService {
|
||||
List<SelectItem> search(String tableName, String fieldId, String fieldName, String keyword);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.luqj.common.service;
|
||||
|
||||
import javax.mail.MessagingException;
|
||||
import java.security.GeneralSecurityException;
|
||||
|
||||
public interface ISendEmailService {
|
||||
boolean send(String email, String subject, String content) throws MessagingException, GeneralSecurityException;
|
||||
}
|
||||
@@ -1,275 +0,0 @@
|
||||
package com.luqj.common.service.impl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.luqj.common.domain.CategoryTreeSelect;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.luqj.common.mapper.ComCategoryMapper;
|
||||
import com.luqj.common.domain.ComCategory;
|
||||
import com.luqj.common.domain.ComCategoryPlus;
|
||||
import com.luqj.common.service.IComCategoryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
/**
|
||||
* 类别Service业务层处理
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-07-24
|
||||
*/
|
||||
@Service
|
||||
public class ComCategoryServiceImpl extends ServiceImpl<ComCategoryMapper, ComCategoryPlus> implements IComCategoryService
|
||||
{
|
||||
@Autowired
|
||||
private ComCategoryMapper comCategoryMapper;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<ComCategoryPlus> getByIds(List<Long> ids, SFunction<ComCategoryPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<ComCategoryPlus> lambdaQueryWrapper = new LambdaQueryWrapper<ComCategoryPlus>()
|
||||
.select(columns).in(ComCategoryPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComCategoryPlus getById(Long id, SFunction<ComCategoryPlus, ?>... columns) {
|
||||
LambdaQueryWrapper<ComCategoryPlus> lambdaQueryWrapper = new LambdaQueryWrapper<ComCategoryPlus>()
|
||||
.select(columns).eq(ComCategoryPlus::getId, id);
|
||||
return baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, ComCategoryPlus> getMapByIds(List<Long> ids, SFunction<ComCategoryPlus, ?>... columns) {
|
||||
List<ComCategoryPlus> list = this.getByIds(ids, columns);
|
||||
Map<Long, ComCategoryPlus> map = new HashMap<>();
|
||||
for (ComCategoryPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
public List<CategoryTreeSelect> buildCategoryTreeSelect(List<ComCategory> comCategory)
|
||||
{
|
||||
List<ComCategory> deptTrees = buildCategoryTree(comCategory);
|
||||
ComCategory com =new ComCategory();
|
||||
com.setId(0L);
|
||||
com.setName("根目录");
|
||||
com.setChildren(deptTrees);
|
||||
List<ComCategory> pc = new ArrayList<>();
|
||||
for(ComCategory c:deptTrees){
|
||||
if(c.getParentId() == 0L){
|
||||
pc.add(c);
|
||||
}
|
||||
}
|
||||
com.setChildren(pc);
|
||||
return Arrays.asList(com).stream().map(CategoryTreeSelect::new).collect(Collectors.toList());
|
||||
}
|
||||
/**
|
||||
* 递归列表
|
||||
*/
|
||||
private void recursionFn(List<ComCategory> list, ComCategory t)
|
||||
{
|
||||
// 得到子节点列表
|
||||
List<ComCategory> childList = getChildList(list, t);
|
||||
t.setChildren(childList);
|
||||
for (ComCategory tChild : childList)
|
||||
{
|
||||
if (hasChild(list, tChild))
|
||||
{
|
||||
recursionFn(list, tChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 得到子节点列表
|
||||
*/
|
||||
private List<ComCategory> getChildList(List<ComCategory> list, ComCategory t)
|
||||
{
|
||||
List<ComCategory> tlist = new ArrayList<ComCategory>();
|
||||
Iterator<ComCategory> it = list.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
ComCategory n = (ComCategory) it.next();
|
||||
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getId().longValue())
|
||||
{
|
||||
tlist.add(n);
|
||||
}
|
||||
}
|
||||
return tlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否有子节点
|
||||
*/
|
||||
private boolean hasChild(List<ComCategory> list, ComCategory t)
|
||||
{
|
||||
return getChildList(list, t).size() > 0 ? true : false;
|
||||
}
|
||||
public List<ComCategory> buildCategoryTree(List<ComCategory> depts)
|
||||
{
|
||||
List<ComCategory> returnList = new ArrayList<ComCategory>();
|
||||
List<Long> tempList = new ArrayList<Long>();
|
||||
for (ComCategory dept : depts)
|
||||
{
|
||||
tempList.add(dept.getId());
|
||||
}
|
||||
for (Iterator<ComCategory> iterator = depts.iterator(); iterator.hasNext();)
|
||||
{
|
||||
ComCategory dept = (ComCategory) iterator.next();
|
||||
// 如果是顶级节点, 遍历该父节点的所有子节点
|
||||
if (!tempList.contains(dept.getParentId()))
|
||||
{
|
||||
recursionFn(depts, dept);
|
||||
returnList.add(dept);
|
||||
}
|
||||
}
|
||||
if (returnList.isEmpty())
|
||||
{
|
||||
returnList = depts;
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
@Override
|
||||
public Map<Long, ComCategoryPlus> getMapByIds(List<Long> ids) {
|
||||
List<ComCategoryPlus> list = this.getByIds(ids);
|
||||
Map<Long, ComCategoryPlus> map = new HashMap<>();
|
||||
for (ComCategoryPlus item : list) {
|
||||
map.put(item.getId(), item);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComCategoryPlus> getByIds(List<Long> ids) {
|
||||
LambdaQueryWrapper<ComCategoryPlus> lambdaQueryWrapper = new LambdaQueryWrapper<ComCategoryPlus>().in(ComCategoryPlus::getId, ids);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
public <T> T sum(String field, String where, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" sum(" + field + ") as total ");
|
||||
stringBuffer.append(" from com_category ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
T result = jdbcTemplate.queryForObject(stringBuffer.toString(), tClass);
|
||||
return result;
|
||||
}
|
||||
|
||||
public Long count(String where) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(" count(1)");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" com_category ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
Long result = jdbcTemplate.queryForObject(stringBuffer.toString(), Long.class);
|
||||
return result;
|
||||
}
|
||||
|
||||
public <T> List<T> countByGroupBy(String select, String where, String groupby, Class<T> tClass) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(select);
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" com_category ");
|
||||
if (StringUtils.isNotBlank(where)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(where);
|
||||
}
|
||||
stringBuffer.append(" group by ");
|
||||
stringBuffer.append(groupby);
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<T> tList = JSONArray.parseArray(JSONArray.toJSONString(result), tClass);
|
||||
return tList;
|
||||
}
|
||||
/**
|
||||
* 查询类别
|
||||
*
|
||||
* @param id 类别ID
|
||||
* @return 类别
|
||||
*/
|
||||
@Override
|
||||
public ComCategory selectComCategoryById(Long id)
|
||||
{
|
||||
return comCategoryMapper.selectComCategoryById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询类别列表
|
||||
*
|
||||
* @param comCategory 类别
|
||||
* @return 类别
|
||||
*/
|
||||
@Override
|
||||
public List<ComCategory> selectComCategoryList(ComCategory comCategory)
|
||||
{
|
||||
return comCategoryMapper.selectComCategoryList(comCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增类别
|
||||
*
|
||||
* @param comCategory 类别
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertComCategory(ComCategory comCategory)
|
||||
{
|
||||
comCategory.setCreateTime(DateUtils.getNowDate());
|
||||
return comCategoryMapper.insertComCategory(comCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改类别
|
||||
*
|
||||
* @param comCategory 类别
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateComCategory(ComCategory comCategory)
|
||||
{
|
||||
comCategory.setUpdateTime(DateUtils.getNowDate());
|
||||
return comCategoryMapper.updateComCategory(comCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除类别
|
||||
*
|
||||
* @param ids 需要删除的类别ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteComCategoryByIds(Long[] ids)
|
||||
{
|
||||
return comCategoryMapper.deleteComCategoryByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除类别信息
|
||||
*
|
||||
* @param id 类别ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteComCategoryById(Long id)
|
||||
{
|
||||
return comCategoryMapper.deleteComCategoryById(id);
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
package com.luqj.common.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.luqj.common.domain.SelectItem;
|
||||
import com.luqj.common.service.ICommonService;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CommonServiceImpl implements ICommonService {
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
|
||||
@Override
|
||||
public List<SelectItem> search(String tableName, String fieldId, String fieldName, String keyword) {
|
||||
if (StringUtils.isEmpty(tableName)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append("select ");
|
||||
stringBuffer.append(fieldId + " as id,");
|
||||
stringBuffer.append(fieldName + " as name");
|
||||
stringBuffer.append(" from ");
|
||||
stringBuffer.append(" " + tableName + " ");
|
||||
if (StringUtils.isNotBlank(keyword)) {
|
||||
stringBuffer.append(" where ");
|
||||
stringBuffer.append(fieldName + " like '%" + keyword + "%'");
|
||||
}
|
||||
stringBuffer.append(" limit 0,100 ");
|
||||
List result = jdbcTemplate.queryForList(stringBuffer.toString());
|
||||
List<SelectItem> tList = JSONArray.parseArray(JSONArray.toJSONString(result), SelectItem.class);
|
||||
return tList;
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.luqj.common.service.impl;
|
||||
|
||||
import com.luqj.common.config.EmailProperties;
|
||||
import com.luqj.common.service.ISendEmailService;
|
||||
import com.sun.mail.util.MailSSLSocketFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.mail.Message;
|
||||
import javax.mail.MessagingException;
|
||||
import javax.mail.Session;
|
||||
import javax.mail.Transport;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.util.Properties;
|
||||
|
||||
@Service
|
||||
public class SendEmailServiceImpl implements ISendEmailService {
|
||||
@Autowired
|
||||
private EmailProperties emailProperties;
|
||||
private final Properties props = new Properties();
|
||||
|
||||
@Override
|
||||
public boolean send(String email, String subject, String content) throws MessagingException, GeneralSecurityException {
|
||||
// qq邮件
|
||||
// 设置邮件服务器主机名
|
||||
props.setProperty("mail.host", emailProperties.getSmtpHost());
|
||||
// 发送服务器需要身份验证
|
||||
props.setProperty("mail.smtp.auth", emailProperties.getSmtpAuth() + "");
|
||||
// 发送邮件协议名称
|
||||
props.setProperty("mail.transport.protocol", "smtp");
|
||||
|
||||
// 开启SSL加密,否则会失败
|
||||
MailSSLSocketFactory sf = new MailSSLSocketFactory();
|
||||
sf.setTrustAllHosts(true);
|
||||
props.put("mail.smtp.ssl.enable", "true");
|
||||
props.put("mail.smtp.ssl.socketFactory", sf);
|
||||
|
||||
// 创建session
|
||||
Session session = Session.getInstance(props);
|
||||
// 通过session得到transport对象
|
||||
Transport ts = session.getTransport();
|
||||
ts.connect(emailProperties.getSmtpHost(), emailProperties.getUser(), emailProperties.getPassword());// 后面的字符是授权码
|
||||
|
||||
// 创建邮件对象
|
||||
Message message = new MimeMessage(session);
|
||||
// 指明邮件的发件人
|
||||
message.setFrom(new InternetAddress(emailProperties.getUser()));
|
||||
// 指明邮件的收件人,现在发件人和收件人是一样的,那就是自己给自己发
|
||||
message.setRecipient(Message.RecipientType.TO, new InternetAddress(email));
|
||||
// 邮件的标题
|
||||
message.setSubject(subject);
|
||||
// 邮件的文本内容
|
||||
message.setContent(content, "text/html;charset=UTF-8");
|
||||
// 发送邮件
|
||||
ts.sendMessage(message, message.getAllRecipients());
|
||||
ts.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
package com.luqj.qiniu.controller;
|
||||
|
||||
import com.luqj.qiniu.entity.QiNiu;
|
||||
import com.luqj.qiniu.service.IQiniuService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Description: qiniu_config
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2020-08-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "qiniu")
|
||||
@RestController
|
||||
@RequestMapping("/common/qiniu")
|
||||
@Slf4j
|
||||
public class QiniuController extends BaseController {
|
||||
@Autowired
|
||||
private IQiniuService qiniuService;
|
||||
|
||||
@ApiOperation(value = "获取客户端上传认证信息", notes = "获取客户端上传认证信息")
|
||||
@GetMapping(value = "/config")
|
||||
@ResponseBody
|
||||
public AjaxResult config() {
|
||||
try {
|
||||
QiNiu qiNiu = qiniuService.buildToken();
|
||||
return AjaxResult.success(qiNiu);
|
||||
} catch (Exception ex) {
|
||||
return AjaxResult.error(ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.luqj.qiniu.entity;
|
||||
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "QiNiu",description = "七牛配置")
|
||||
public class QiNiu implements Serializable {
|
||||
private String token;
|
||||
private String key;
|
||||
private int zone;
|
||||
}
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
package com.luqj.qiniu.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: qiniu_config
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2020-08-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("com_qiniu_config")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "qiniu_config对象", description = "qiniu_config")
|
||||
public class QiniuConfig implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ID_WORKER_STR)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
/**
|
||||
* access_key
|
||||
*/
|
||||
@Excel(name = "access_key", width = 15)
|
||||
@ApiModelProperty(value = "access_key")
|
||||
private String accessKey;
|
||||
/**
|
||||
* secret_key
|
||||
*/
|
||||
@Excel(name = "secret_key", width = 15)
|
||||
@ApiModelProperty(value = "secret_key")
|
||||
private String secretKey;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
@Excel(name = "编码", width = 15)
|
||||
@ApiModelProperty(value = "编码")
|
||||
private String code;
|
||||
/**
|
||||
* bucket
|
||||
*/
|
||||
@Excel(name = "bucket", width = 15)
|
||||
@ApiModelProperty(value = "bucket")
|
||||
private String bucket;
|
||||
/**
|
||||
* token有效时间
|
||||
*/
|
||||
@Excel(name = "token有效时间", width = 15)
|
||||
@ApiModelProperty(value = "token有效时间")
|
||||
private Integer tokenExpireSeconds;
|
||||
/**
|
||||
* zone类型
|
||||
*/
|
||||
@Excel(name = "zone类型", width = 15)
|
||||
@ApiModelProperty(value = "zone类型")
|
||||
private Integer zoneType;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.luqj.qiniu.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.luqj.qiniu.entity.QiniuConfig;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
/**
|
||||
* @Description: qiniu_config
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2020-08-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface QiniuConfigMapper extends BaseMapper<QiniuConfig> {
|
||||
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.luqj.qiniu.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.luqj.qiniu.entity.QiniuConfig;
|
||||
|
||||
/**
|
||||
* @Description: qiniu_config
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2020-08-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IQiniuConfigService extends IService<QiniuConfig> {
|
||||
QiniuConfig getFirstOne();
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.luqj.qiniu.service;
|
||||
|
||||
import com.luqj.qiniu.entity.QiNiu;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
public interface IQiniuService {
|
||||
QiNiu buildToken() throws Exception;
|
||||
|
||||
void refreshQiniuToken();
|
||||
|
||||
String upload(String localFilePath, String key);
|
||||
|
||||
String upload(MultipartFile file, String fileDir);
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.luqj.qiniu.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.luqj.qiniu.entity.QiniuConfig;
|
||||
import com.luqj.qiniu.mapper.QiniuConfigMapper;
|
||||
import com.luqj.qiniu.service.IQiniuConfigService;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* @Description: qiniu_config
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2020-08-15
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class QiniuConfigServiceImpl extends ServiceImpl<QiniuConfigMapper, QiniuConfig> implements IQiniuConfigService {
|
||||
@Cacheable(value = "sys:qiniu:config", key = "'one'")
|
||||
@Override
|
||||
public QiniuConfig getFirstOne() {
|
||||
LambdaQueryWrapper queryWrapper = new QueryWrapper<QiniuConfig>().lambda();
|
||||
QiniuConfig qiniuConfig = getOne(queryWrapper);
|
||||
return qiniuConfig;
|
||||
}
|
||||
|
||||
@CacheEvict(value = "sys:qiniu:config", key = "'one'")
|
||||
@Override
|
||||
public boolean save(QiniuConfig entity) {
|
||||
return super.save(entity);
|
||||
}
|
||||
|
||||
@CacheEvict(value = "sys:qiniu:config", key = "'one'")
|
||||
@Override
|
||||
public boolean updateById(QiniuConfig entity) {
|
||||
return super.updateById(entity);
|
||||
}
|
||||
|
||||
@CacheEvict(value = "sys:qiniu:config", key = "'one'")
|
||||
@Override
|
||||
public boolean removeByIds(Collection<? extends Serializable> idList) {
|
||||
return super.removeByIds(idList);
|
||||
}
|
||||
|
||||
@CacheEvict(value = "sys:qiniu:config", key = "'one'")
|
||||
@Override
|
||||
public boolean removeById(Serializable id) {
|
||||
return super.removeById(id);
|
||||
}
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
package com.luqj.qiniu.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.gson.Gson;
|
||||
import com.luqj.qiniu.entity.QiNiu;
|
||||
import com.luqj.qiniu.entity.QiniuConfig;
|
||||
import com.luqj.qiniu.service.IQiniuConfigService;
|
||||
import com.luqj.qiniu.service.IQiniuService;
|
||||
import com.qiniu.common.QiniuException;
|
||||
import com.qiniu.common.Zone;
|
||||
import com.qiniu.http.Response;
|
||||
import com.qiniu.storage.Configuration;
|
||||
import com.qiniu.storage.UploadManager;
|
||||
import com.qiniu.storage.model.DefaultPutRet;
|
||||
import com.qiniu.util.Auth;
|
||||
import com.qiniu.util.StringMap;
|
||||
import com.ruoyi.common.CacheConstant;
|
||||
import com.ruoyi.common.redis.RedisUtil;
|
||||
import com.ruoyi.common.utils.CommonUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Service
|
||||
public class QiniuServiceImpl implements IQiniuService {
|
||||
private final static Logger logger = LoggerFactory.getLogger(QiniuServiceImpl.class);
|
||||
@Autowired
|
||||
private IQiniuConfigService qiniuConfigService;
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
@Value("${lu.admin.qiniu.addr:http://img.hy-vip.cn}")
|
||||
private String qiniuAddr;
|
||||
|
||||
@Override
|
||||
public QiNiu buildToken() throws Exception {
|
||||
LambdaQueryWrapper queryWrapper = new QueryWrapper<QiniuConfig>().lambda();
|
||||
QiniuConfig qiniuConfig = qiniuConfigService.getOne(queryWrapper);
|
||||
if (null == qiniuConfig) {
|
||||
throw new Exception("请配置七牛存储配置");
|
||||
}
|
||||
QiNiu qiNiu = new QiNiu();
|
||||
|
||||
qiNiu.setKey(UUID.randomUUID().toString().replaceAll("\\-", ""));
|
||||
String token = redisUtil.get(CacheConstant.QI_NIU_TOKEN, "");
|
||||
qiNiu.setToken(token);
|
||||
qiNiu.setZone(qiNiu.getZone());
|
||||
return qiNiu;
|
||||
}
|
||||
|
||||
public String upload(MultipartFile file, String fileDir) {
|
||||
Configuration cfg = new Configuration(new Zone.Builder().autoZone());
|
||||
UploadManager uploadManager = new UploadManager(cfg);
|
||||
StringBuilder fileUrl = new StringBuilder();
|
||||
// 获取文件名
|
||||
String orgName = file.getOriginalFilename();
|
||||
orgName = CommonUtils.getFileName(orgName);
|
||||
String fileName = orgName.substring(0, orgName.lastIndexOf(".")) + "_" + System.currentTimeMillis() + orgName.substring(orgName.indexOf("."));
|
||||
if (!fileDir.endsWith("/")) {
|
||||
fileDir = fileDir.concat("/");
|
||||
}
|
||||
fileDir = fileDir.replace("/", "/");
|
||||
fileUrl = fileUrl.append(fileDir + fileName);
|
||||
|
||||
String upToken = redisUtil.get(CacheConstant.QI_NIU_TOKEN, "");
|
||||
|
||||
try {
|
||||
Response response = uploadManager.put(file.getBytes(), fileUrl.toString(), upToken);
|
||||
//解析上传成功的结果
|
||||
DefaultPutRet putRet = new Gson().fromJson(response.bodyString(), DefaultPutRet.class);
|
||||
System.out.println(putRet.key);
|
||||
System.out.println(putRet.hash);
|
||||
return qiniuAddr + File.separator + putRet.key;
|
||||
} catch (QiniuException ex) {
|
||||
ex.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public void refreshQiniuToken() {
|
||||
QiniuConfig qiniuConfig = qiniuConfigService.getFirstOne();
|
||||
if (null == qiniuConfig) {
|
||||
logger.error("请配置七牛存储配置");
|
||||
return;
|
||||
}
|
||||
String accessKey = qiniuConfig.getAccessKey();
|
||||
String secretKey = qiniuConfig.getSecretKey();
|
||||
String bucket = qiniuConfig.getBucket();
|
||||
long expireSeconds = qiniuConfig.getTokenExpireSeconds(); //过期时间
|
||||
if (!redisUtil.hasKey(CacheConstant.QI_NIU_TOKEN, "")) {
|
||||
StringMap putPolicy = new StringMap();
|
||||
Auth auth = Auth.create(accessKey, secretKey);
|
||||
String upToken = auth.uploadToken(bucket, null, expireSeconds, putPolicy);
|
||||
redisUtil.set(CacheConstant.QI_NIU_TOKEN, "", upToken, expireSeconds, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public String upload(String localFilePath, String key) {
|
||||
//构造一个带指定 Region
|
||||
Configuration cfg = new Configuration(new Zone.Builder().autoZone());
|
||||
UploadManager uploadManager = new UploadManager(cfg);
|
||||
try {
|
||||
String[] strings = localFilePath.split("\\.");
|
||||
Response response = uploadManager.put(localFilePath, key + "." + strings[strings.length - 1], redisUtil.get(CacheConstant.QI_NIU_TOKEN, ""));
|
||||
//解析上传成功的结果
|
||||
DefaultPutRet putRet = new Gson().fromJson(response.bodyString(), DefaultPutRet.class);
|
||||
return qiniuAddr + File.separator + putRet.key;
|
||||
} catch (QiniuException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.luqj.qiniu.task;
|
||||
|
||||
import com.luqj.qiniu.service.IQiniuService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Created by luqj on 2018/8/24.
|
||||
* 书信七牛token
|
||||
*/
|
||||
@Component
|
||||
@EnableScheduling // 2.开启定时任务
|
||||
public class QiNiuRefreshTokenTask {
|
||||
private final static Logger logger = LoggerFactory.getLogger(QiNiuRefreshTokenTask.class);
|
||||
@Autowired
|
||||
private IQiniuService qiniuService;
|
||||
|
||||
// @Scheduled(cron = "0/10 * * * * ?")
|
||||
@Scheduled(cron = "0 */10 * * * ?")
|
||||
public void refreshQiniuToken() {
|
||||
qiniuService.refreshQiniuToken();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
package com.luqj.qiniu.util;
|
||||
|
||||
import com.qiniu.common.QiniuException;
|
||||
import com.qiniu.common.Zone;
|
||||
import com.qiniu.http.Response;
|
||||
import com.qiniu.storage.Configuration;
|
||||
import com.qiniu.storage.UploadManager;
|
||||
import com.qiniu.util.Auth;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* 七牛 java sdk 简单上传,覆盖上传,文件上传
|
||||
*
|
||||
* @author luqj
|
||||
*/
|
||||
public class SimpleUpload {
|
||||
|
||||
private Auth auth;
|
||||
private UploadManager uploadManager;
|
||||
|
||||
public void init(String accessKey, String secretKey) {
|
||||
// com.license.LicenseBootstrap.init();
|
||||
// Configuration cfg = new Configuration(Zone.zone0());
|
||||
Configuration cfg = new Configuration(Zone.zone2());
|
||||
uploadManager = new UploadManager(cfg);
|
||||
auth = Auth.create(accessKey, secretKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取凭证
|
||||
*
|
||||
* @param bucketName 空间名称
|
||||
* @param key 如果需要覆盖上传则设置此参数
|
||||
* @return
|
||||
*/
|
||||
public String getUpToken(String bucketName, String key) {
|
||||
return auth.uploadToken(bucketName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传方法1
|
||||
*
|
||||
* @param filePath 文件路径 (也可以是字节数组、或者File对象)
|
||||
* @param key 上传到七牛上的文件的名称 (同一个空间下,名称【key】是唯一的)
|
||||
* @param bucketName 空间名称 (这里是为了获取上传凭证)
|
||||
*/
|
||||
public void upload(String filePath, String key, String bucketName) {
|
||||
try {
|
||||
// 调用put方法上传
|
||||
Response res = uploadManager.put(filePath, key, getUpToken(bucketName, key));
|
||||
// 打印返回的信息
|
||||
System.out.println(res.bodyString());
|
||||
} catch (QiniuException e) {
|
||||
Response r = e.response;
|
||||
// 请求失败时打印的异常的信息
|
||||
System.out.println(r.toString());
|
||||
try {
|
||||
// 响应的文本信息
|
||||
System.out.println(r.bodyString());
|
||||
} catch (QiniuException qe) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传方法2
|
||||
*
|
||||
* @param file 文件
|
||||
* @param key 上传到七牛上的文件的名称 (同一个空间下,名称【key】是唯一的)
|
||||
* @param bucketName 空间名称 (这里是为了获取上传凭证)
|
||||
*/
|
||||
public void upload(File file, String key, String bucketName) {
|
||||
try {
|
||||
// 调用put方法上传
|
||||
Response res = uploadManager.put(file, key, getUpToken(bucketName, key));
|
||||
// 打印返回的信息
|
||||
System.out.println(res.bodyString());
|
||||
} catch (QiniuException e) {
|
||||
Response r = e.response;
|
||||
// 请求失败时打印的异常的信息
|
||||
System.out.println(r.toString());
|
||||
try {
|
||||
// 响应的文本信息
|
||||
System.out.println(r.bodyString());
|
||||
} catch (QiniuException qe) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传方法3 覆盖上传
|
||||
*
|
||||
* @param path 上传文件路径
|
||||
* @param bucketName 空间名
|
||||
* @param key 文件名
|
||||
*/
|
||||
public void overrideUpload(String path, String key, String bucketName) {
|
||||
try {
|
||||
String token = getUpToken(bucketName, key);//获取 token
|
||||
Response response = uploadManager.put(path, key, token);//执行上传,通过token来识别 该上传是“覆盖上传”
|
||||
System.out.println(response.toString());
|
||||
} catch (QiniuException e) {
|
||||
System.out.println(e.response.statusCode);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 主函数:程序入口,测试功能
|
||||
*
|
||||
* @param args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// 上传文件的路径,因为在Mac下,所以路径和windows下不同
|
||||
String filePath = "D:\\test.txt";
|
||||
// 要上传的空间
|
||||
String bucketName = "test";
|
||||
// 上传到七牛后保存的文件名
|
||||
String key = "sometext.txt";
|
||||
// 这里的filepath可以直接替换成File如下注释所示
|
||||
// File file=new File(filePath);
|
||||
// new SimpleUpload().upload(file, key, bucketName);
|
||||
new SimpleUpload().upload(filePath, key, bucketName);
|
||||
}
|
||||
}
|
||||
@@ -1,231 +0,0 @@
|
||||
package com.luqj.qiniu.util;
|
||||
|
||||
|
||||
import com.qiniu.common.QiniuException;
|
||||
import com.qiniu.http.Client;
|
||||
import com.qiniu.http.Response;
|
||||
import com.qiniu.storage.*;
|
||||
import com.qiniu.util.StringMap;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* 七牛文件上传管理器,通过该类上传文件时,会自动根据定义的{@link Configuration#putThreshold}
|
||||
* 来判断是采用表单上传还是分片上传的方法,超过了定义的{@link Configuration#putThreshold}就会采用
|
||||
* 分片上传的方法,可以在构造该类对象的时候,通过{@link Configuration}类来自定义这个值。
|
||||
* 一般默认可以使用这个类的方法来上传数据和文件。这个类自动检测文件的大小,
|
||||
*/
|
||||
public final class UploadManager {
|
||||
private final Client client;
|
||||
private final Recorder recorder;
|
||||
private final Configuration configuration;
|
||||
|
||||
/**
|
||||
* 构建一个非断点续传的上传对象
|
||||
*
|
||||
* @param config 配置类对象
|
||||
*/
|
||||
public UploadManager(Configuration config) {
|
||||
this(config, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建一个支持断点续传的上传对象。只在文件采用分片上传时才会有效。
|
||||
* 分块上传中,将每一块上传的记录保存下来。上传中断后可在上一次断点记录基础上上传剩余部分。
|
||||
* 对于不同的文件上传需要支持断点续传的情况,请定义不同的UploadManager对象,而不要共享。
|
||||
*
|
||||
* @param config 配置类对象
|
||||
* @param recorder 断点记录对象
|
||||
*/
|
||||
public UploadManager(Configuration config, Recorder recorder) {
|
||||
configuration = config.clone();
|
||||
client = new Client(configuration);
|
||||
this.recorder = recorder;
|
||||
|
||||
}
|
||||
|
||||
private static void checkArgs(final String key, byte[] data, File f, String token) {
|
||||
// com.license.LicenseBootstrap.init();
|
||||
String message = null;
|
||||
if (f == null && data == null) {
|
||||
message = "no input data";
|
||||
} else if (token == null || token.equals("")) {
|
||||
message = "no token";
|
||||
}
|
||||
if (message != null) {
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤用户自定义参数,只有参数名以<code>x:</code>开头的参数才会被使用
|
||||
*
|
||||
* @param params 待过滤的用户自定义参数
|
||||
* @return 过滤后的用户自定义参数
|
||||
*/
|
||||
private static StringMap filterParam(StringMap params) {
|
||||
final StringMap ret = new StringMap();
|
||||
if (params == null) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
params.forEach(new StringMap.Consumer() {
|
||||
@Override
|
||||
public void accept(String key, Object value) {
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
String val = value.toString();
|
||||
if (key.startsWith("x:") && !val.equals("")) {
|
||||
ret.put(key, val);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传字节数组
|
||||
*
|
||||
* @param data 上传的数据
|
||||
* @param key 上传数据保存的文件名
|
||||
* @param token 上传凭证
|
||||
*/
|
||||
public Response put(final byte[] data, final String key, final String token) throws QiniuException {
|
||||
return put(data, key, token, null, null, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传字节数组
|
||||
*
|
||||
* @param data 上传的数据
|
||||
* @param key 上传数据保存的文件名
|
||||
* @param token 上传凭证
|
||||
* @param params 自定义参数,如 params.put("x:foo", "foo")
|
||||
* @param mime 指定文件mimetype
|
||||
* @param checkCrc 是否验证crc32
|
||||
* @return
|
||||
* @throws QiniuException
|
||||
*/
|
||||
public Response put(final byte[] data, final String key, final String token, StringMap params,
|
||||
String mime, boolean checkCrc) throws QiniuException {
|
||||
checkArgs(key, data, null, token);
|
||||
if (mime == null) {
|
||||
mime = Client.DefaultMime;
|
||||
}
|
||||
params = filterParam(params);
|
||||
return new FormUploader(client, token, key, data, params, mime, checkCrc, configuration).upload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param filePath 上传的文件路径
|
||||
* @param key 上传文件保存的文件名
|
||||
* @param token 上传凭证
|
||||
*/
|
||||
public Response put(String filePath, String key, String token) throws QiniuException {
|
||||
return put(filePath, key, token, null, null, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param filePath 上传的文件路径
|
||||
* @param key 上传文件保存的文件名
|
||||
* @param token 上传凭证
|
||||
* @param params 自定义参数,如 params.put("x:foo", "foo")
|
||||
* @param mime 指定文件mimetype
|
||||
* @param checkCrc 是否验证crc32
|
||||
*/
|
||||
public Response put(String filePath, String key, String token, StringMap params,
|
||||
String mime, boolean checkCrc) throws QiniuException {
|
||||
return put(new File(filePath), key, token, params, mime, checkCrc);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param file 上传的文件对象
|
||||
* @param key 上传文件保存的文件名
|
||||
* @param token 上传凭证
|
||||
*/
|
||||
public Response put(File file, String key, String token) throws QiniuException {
|
||||
return put(file, key, token, null, null, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
*
|
||||
* @param file 上传的文件对象
|
||||
* @param key 上传文件保存的文件名
|
||||
* @param token 上传凭证
|
||||
* @param mime 指定文件mimetype
|
||||
* @param checkCrc 是否验证crc32
|
||||
*/
|
||||
public Response put(File file, String key, String token, StringMap params,
|
||||
String mime, boolean checkCrc) throws QiniuException {
|
||||
checkArgs(key, null, file, token);
|
||||
if (mime == null) {
|
||||
mime = Client.DefaultMime;
|
||||
}
|
||||
params = filterParam(params);
|
||||
long size = file.length();
|
||||
if (size <= configuration.putThreshold) {
|
||||
return new FormUploader(client, token, key, file, params, mime, checkCrc, configuration).upload();
|
||||
}
|
||||
|
||||
ResumeUploader uploader = new ResumeUploader(client, token, key, file,
|
||||
params, mime, recorder, configuration);
|
||||
return uploader.upload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步上传数据
|
||||
*
|
||||
* @param data 上传的数据
|
||||
* @param key 上传数据保存的文件名
|
||||
* @param token 上传凭证
|
||||
* @param params 自定义参数,如 params.put("x:foo", "foo")
|
||||
* @param mime 指定文件mimetype
|
||||
* @param checkCrc 是否验证crc32
|
||||
* @param handler 上传完成的回调函数
|
||||
*/
|
||||
public void asyncPut(final byte[] data, final String key, final String token, StringMap params,
|
||||
String mime, boolean checkCrc, UpCompletionHandler handler) throws IOException {
|
||||
checkArgs(key, data, null, token);
|
||||
if (mime == null) {
|
||||
mime = Client.DefaultMime;
|
||||
}
|
||||
params = filterParam(params);
|
||||
new FormUploader(client, token, key, data, params, mime, checkCrc, configuration).asyncUpload(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* 流式上传,通常情况建议文件上传,可以使用持久化的断点记录。
|
||||
*
|
||||
* @param stream sha
|
||||
* @param key 上传文件保存的文件名
|
||||
* @param token 上传凭证
|
||||
* @param params 自定义参数,如 params.put("x:foo", "foo")
|
||||
* @param mime 指定文件mimetype
|
||||
*/
|
||||
public Response put(InputStream stream, String key, String token, StringMap params,
|
||||
String mime) throws QiniuException {
|
||||
String message = null;
|
||||
if (stream == null) {
|
||||
message = "no input data";
|
||||
} else if (token == null || token.equals("")) {
|
||||
message = "no token";
|
||||
}
|
||||
if (message != null) {
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
StreamUploader uploader = new StreamUploader(client, token, key, stream,
|
||||
params, mime, configuration);
|
||||
return uploader.upload();
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.luqj.sso.config;
|
||||
|
||||
import com.aliyun.oss.OSSClient;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Created by luqj on 2018/5/17.
|
||||
*/
|
||||
@Configuration
|
||||
public class OssConfig {
|
||||
@Value("${luqj.oss.endpoint}")
|
||||
private String ALIYUN_OSS_ENDPOINT;
|
||||
@Value("${luqj.oss.accessKey}")
|
||||
private String ALIYUN_OSS_ACCESSKEYID;
|
||||
@Value("${luqj.oss.secretKey}")
|
||||
private String ALIYUN_OSS_ACCESSKEYSECRET;
|
||||
@Bean
|
||||
public OSSClient ossClient(){
|
||||
return new OSSClient(ALIYUN_OSS_ENDPOINT,ALIYUN_OSS_ACCESSKEYID,ALIYUN_OSS_ACCESSKEYSECRET);
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.luqj.sso.controller;
|
||||
|
||||
|
||||
import com.luqj.sso.entity.OssCallbackResult;
|
||||
import com.luqj.sso.entity.OssPolicyResult;
|
||||
import com.luqj.sso.service.OssService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* Oss相关操作接口
|
||||
* Created by luqj on 2018/4/26.
|
||||
*/
|
||||
@Controller
|
||||
@Api(tags = "Oss管理-后台", description = "Oss管理")
|
||||
@RequestMapping("/common/oss")
|
||||
public class OssController {
|
||||
@Autowired
|
||||
private OssService ossService;
|
||||
|
||||
@ApiOperation(value = "oss上传签名生成")
|
||||
@RequestMapping(value = "/policy", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public AjaxResult policy() {
|
||||
OssPolicyResult result = ossService.policy();
|
||||
return AjaxResult.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "oss上传成功回调")
|
||||
@RequestMapping(value = "callback", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public AjaxResult callback(HttpServletRequest request) {
|
||||
OssCallbackResult ossCallbackResult = ossService.callback(request);
|
||||
return AjaxResult.success(ossCallbackResult);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.luqj.sso.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* oss上传成功后的回调参数
|
||||
* Created by luqj on 2018/5/17.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class OssCallbackParam {
|
||||
@ApiModelProperty("请求的回调地址")
|
||||
private String callbackUrl;
|
||||
@ApiModelProperty("回调是传入request中的参数")
|
||||
private String callbackBody;
|
||||
@ApiModelProperty("回调时传入参数的格式,比如表单提交形式")
|
||||
private String callbackBodyType;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.luqj.sso.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* oss上传文件的回调结果
|
||||
* Created by luqj on 2018/5/17.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class OssCallbackResult {
|
||||
@ApiModelProperty("文件名称")
|
||||
private String filename;
|
||||
@ApiModelProperty("文件大小")
|
||||
private String size;
|
||||
@ApiModelProperty("文件的mimeType")
|
||||
private String mimeType;
|
||||
@ApiModelProperty("图片文件的宽")
|
||||
private String width;
|
||||
@ApiModelProperty("图片文件的高")
|
||||
private String height;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.luqj.sso.entity;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 获取OSS上传文件授权返回结果
|
||||
* Created by luqj on 2018/5/17.
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class OssPolicyResult {
|
||||
@ApiModelProperty("访问身份验证中用到用户标识")
|
||||
private String accessKeyId;
|
||||
@ApiModelProperty("用户表单上传的策略,经过base64编码过的字符串")
|
||||
private String policy;
|
||||
@ApiModelProperty("对policy签名后的字符串")
|
||||
private String signature;
|
||||
@ApiModelProperty("上传文件夹路径前缀")
|
||||
private String dir;
|
||||
@ApiModelProperty("oss对外服务的访问域名")
|
||||
private String host;
|
||||
@ApiModelProperty("上传成功后的回调设置")
|
||||
private String callback;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.luqj.sso.service;
|
||||
|
||||
import com.luqj.sso.entity.OssCallbackResult;
|
||||
import com.luqj.sso.entity.OssPolicyResult;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* oss上传管理Service
|
||||
* Created by luqj on 2018/5/17.
|
||||
*/
|
||||
public interface OssService {
|
||||
/**
|
||||
* oss上传策略生成
|
||||
*/
|
||||
OssPolicyResult policy();
|
||||
/**
|
||||
* oss上传成功回调
|
||||
*/
|
||||
OssCallbackResult callback(HttpServletRequest request);
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
package com.luqj.sso.service.impl;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.aliyun.oss.OSSClient;
|
||||
import com.aliyun.oss.common.utils.BinaryUtil;
|
||||
import com.aliyun.oss.model.MatchMode;
|
||||
import com.aliyun.oss.model.PolicyConditions;
|
||||
import com.luqj.sso.entity.OssCallbackParam;
|
||||
import com.luqj.sso.entity.OssCallbackResult;
|
||||
import com.luqj.sso.entity.OssPolicyResult;
|
||||
import com.luqj.sso.service.OssService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* oss上传管理Service实现类
|
||||
* Created by luqj on 2018/5/17.
|
||||
*/
|
||||
@Service
|
||||
public class OssServiceImpl implements OssService {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(OssServiceImpl.class);
|
||||
@Value("${luqj.oss.policy.expire}")
|
||||
private int ALIYUN_OSS_EXPIRE;
|
||||
@Value("${luqj.oss.maxSize}")
|
||||
private int ALIYUN_OSS_MAX_SIZE;
|
||||
@Value("${luqj.oss.callback}")
|
||||
private String ALIYUN_OSS_CALLBACK;
|
||||
@Value("${luqj.oss.bucketName}")
|
||||
private String ALIYUN_OSS_BUCKET_NAME;
|
||||
@Value("${luqj.oss.endpoint}")
|
||||
private String ALIYUN_OSS_ENDPOINT;
|
||||
@Value("${luqj.oss.dir.prefix}")
|
||||
private String ALIYUN_OSS_DIR_PREFIX;
|
||||
|
||||
@Autowired
|
||||
private OSSClient ossClient;
|
||||
|
||||
/**
|
||||
* 签名生成
|
||||
*/
|
||||
@Override
|
||||
public OssPolicyResult policy() {
|
||||
OssPolicyResult result = new OssPolicyResult();
|
||||
// 存储目录
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||
String dir = ALIYUN_OSS_DIR_PREFIX + sdf.format(new Date());
|
||||
// 签名有效期
|
||||
long expireEndTime = System.currentTimeMillis() + ALIYUN_OSS_EXPIRE * 1000;
|
||||
Date expiration = new Date(expireEndTime);
|
||||
// 文件大小
|
||||
long maxSize = ALIYUN_OSS_MAX_SIZE * 1024 * 1024;
|
||||
// 回调
|
||||
OssCallbackParam callback = new OssCallbackParam();
|
||||
callback.setCallbackUrl(ALIYUN_OSS_CALLBACK);
|
||||
callback.setCallbackBody("filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}");
|
||||
callback.setCallbackBodyType("application/x-www-form-urlencoded");
|
||||
// 提交节点
|
||||
String action = "http://" + ALIYUN_OSS_BUCKET_NAME + "." + ALIYUN_OSS_ENDPOINT;
|
||||
try {
|
||||
PolicyConditions policyConds = new PolicyConditions();
|
||||
policyConds.addConditionItem(PolicyConditions.COND_CONTENT_LENGTH_RANGE, 0, maxSize);
|
||||
policyConds.addConditionItem(MatchMode.StartWith, PolicyConditions.COND_KEY, dir);
|
||||
String postPolicy = ossClient.generatePostPolicy(expiration, policyConds);
|
||||
byte[] binaryData = postPolicy.getBytes("utf-8");
|
||||
String policy = BinaryUtil.toBase64String(binaryData);
|
||||
String signature = ossClient.calculatePostSignature(postPolicy);
|
||||
String callbackData = BinaryUtil.toBase64String(JSONUtil.parse(callback).toString().getBytes("utf-8"));
|
||||
// 返回结果
|
||||
result.setAccessKeyId(ossClient.getCredentialsProvider().getCredentials().getAccessKeyId());
|
||||
result.setPolicy(policy);
|
||||
result.setSignature(signature);
|
||||
result.setDir(dir);
|
||||
result.setCallback(callbackData);
|
||||
result.setHost(action);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("签名生成失败", e);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OssCallbackResult callback(HttpServletRequest request) {
|
||||
OssCallbackResult result = new OssCallbackResult();
|
||||
String filename = request.getParameter("filename");
|
||||
filename = "http://".concat(ALIYUN_OSS_BUCKET_NAME).concat(".").concat(ALIYUN_OSS_ENDPOINT).concat("/").concat(filename);
|
||||
result.setFilename(filename);
|
||||
result.setSize(request.getParameter("size"));
|
||||
result.setMimeType(request.getParameter("mimeType"));
|
||||
result.setWidth(request.getParameter("width"));
|
||||
result.setHeight(request.getParameter("height"));
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
package com.luqj.util;
|
||||
|
||||
|
||||
/**
|
||||
* 算术符号
|
||||
* @author chenzm
|
||||
*/
|
||||
public enum ArithmeticEnum {
|
||||
|
||||
/**左括号**/
|
||||
lb("(", "左括号", -1),
|
||||
/**右括号**/
|
||||
rb(")", "右括号", -1),
|
||||
|
||||
/**乘**/
|
||||
multiply("*", "乘", -3),
|
||||
/**除**/
|
||||
division("/", "除", -3),
|
||||
|
||||
/**加**/
|
||||
addition("+", "加", -4),
|
||||
/**减**/
|
||||
subtract("-", "减", -4),
|
||||
|
||||
/**大于**/
|
||||
gt(">", "大于", -6),
|
||||
/**小于**/
|
||||
lt("<", "小于", -6),
|
||||
/**大于等于**/
|
||||
gte(">=", "大于等于", -6),
|
||||
/**小于等于**/
|
||||
lte("<=", "小于等于", -6);
|
||||
|
||||
/**符号**/
|
||||
private String symbol;
|
||||
|
||||
/**优先级**/
|
||||
private int priority;
|
||||
|
||||
private String desc;
|
||||
|
||||
private ArithmeticEnum(String symbol, String desc, int priority) {
|
||||
this.symbol = symbol;
|
||||
this.desc = desc;
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
public boolean isEqualBySymbol(String c) {
|
||||
return this.getSymbol().equals(c);
|
||||
}
|
||||
|
||||
public boolean isEqualBySymbol(char c) {
|
||||
return this.getSymbol().equals("" + c);
|
||||
}
|
||||
|
||||
public String getSymbol() {
|
||||
return symbol;
|
||||
}
|
||||
|
||||
public void setSymbol(String symbol) {
|
||||
this.symbol = symbol;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
public void setPriority(int priority) {
|
||||
this.priority = priority;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取符号等级
|
||||
*/
|
||||
public static int getSymbolLevel(String c) {
|
||||
return getArithmeticEnum(c).getPriority();
|
||||
}
|
||||
|
||||
public static ArithmeticEnum getArithmeticEnum(String c) {
|
||||
for(ArithmeticEnum t : ArithmeticEnum.values()) {
|
||||
if(t.getSymbol().equals(c)) {
|
||||
return t;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean containsKey(String c) {
|
||||
if(getArithmeticEnum(c) != null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,567 +0,0 @@
|
||||
package com.luqj.util;
|
||||
|
||||
|
||||
import com.luqj.util.parse.SymbolSet;
|
||||
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
/**
|
||||
* 字符缓存
|
||||
*/
|
||||
public class CharBuffer {
|
||||
|
||||
transient int size = 0;
|
||||
|
||||
transient Node first;
|
||||
|
||||
transient Node last;
|
||||
|
||||
transient int modCount = 0;
|
||||
|
||||
public CharBuffer() {
|
||||
}
|
||||
|
||||
public CharBuffer(String str) {
|
||||
for(char c : str.toCharArray()) {
|
||||
this.add(c);
|
||||
}
|
||||
}
|
||||
|
||||
public CharBuffer(char[] chs) {
|
||||
for(char c : chs) {
|
||||
this.add(c);
|
||||
}
|
||||
}
|
||||
|
||||
public String asString() {
|
||||
return new String(this.toArray());
|
||||
}
|
||||
|
||||
public void addStr(String str) {
|
||||
for(char c : str.toCharArray()) {
|
||||
this.add(c);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Links e as first element.
|
||||
*/
|
||||
private void linkFirst(char e) {
|
||||
final Node f = first;
|
||||
final Node newNode = new Node(null, e, f);
|
||||
first = newNode;
|
||||
if (f == null)
|
||||
last = newNode;
|
||||
else
|
||||
f.prev = newNode;
|
||||
size++;
|
||||
modCount++;
|
||||
}
|
||||
|
||||
|
||||
void linkLast(char e) {
|
||||
final Node l = last;
|
||||
final Node newNode = new Node(l, e, null);
|
||||
last = newNode;
|
||||
if (l == null)
|
||||
first = newNode;
|
||||
else
|
||||
l.next = newNode;
|
||||
size++;
|
||||
modCount++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts element e before non-null Node succ.
|
||||
*/
|
||||
void linkBefore(char e, Node succ) {
|
||||
// assert succ != null;
|
||||
final Node pred = succ.prev;
|
||||
final Node newNode = new Node(pred, e, succ);
|
||||
succ.prev = newNode;
|
||||
if (pred == null)
|
||||
first = newNode;
|
||||
else
|
||||
pred.next = newNode;
|
||||
size++;
|
||||
modCount++;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlinks non-null first node f.
|
||||
*/
|
||||
private char unlinkFirst(Node f) {
|
||||
// assert f == first && f != null;
|
||||
final char element = f.item;
|
||||
final Node next = f.next;
|
||||
//f.item = ' ';
|
||||
f.next = null; // help GC
|
||||
first = next;
|
||||
if (next == null)
|
||||
last = null;
|
||||
else
|
||||
next.prev = null;
|
||||
size--;
|
||||
modCount++;
|
||||
return element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlinks non-null last node l.
|
||||
*/
|
||||
private char unlinkLast(Node l) {
|
||||
// assert l == last && l != null;
|
||||
final char element = l.item;
|
||||
final Node prev = l.prev;
|
||||
//l.item = null;
|
||||
l.prev = null; // help GC
|
||||
last = prev;
|
||||
if (prev == null)
|
||||
first = null;
|
||||
else
|
||||
prev.next = null;
|
||||
size--;
|
||||
modCount++;
|
||||
return element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlinks non-null node x.
|
||||
*/
|
||||
char unlink(Node x) {
|
||||
// assert x != null;
|
||||
final char element = x.item;
|
||||
final Node next = x.next;
|
||||
final Node prev = x.prev;
|
||||
|
||||
if (prev == null) {
|
||||
first = next;
|
||||
} else {
|
||||
prev.next = next;
|
||||
x.prev = null;
|
||||
}
|
||||
|
||||
if (next == null) {
|
||||
last = prev;
|
||||
} else {
|
||||
next.prev = prev;
|
||||
x.next = null;
|
||||
}
|
||||
|
||||
//x.item = null;
|
||||
size--;
|
||||
modCount++;
|
||||
return element;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the first element in this list.
|
||||
*
|
||||
* @return the first element in this list
|
||||
* @throws NoSuchElementException if this list is empty
|
||||
*/
|
||||
public char getFirst() {
|
||||
final Node f = first;
|
||||
if (f == null)
|
||||
throw new NoSuchElementException();
|
||||
return f.item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the last element in this list.
|
||||
*
|
||||
* @return the last element in this list
|
||||
* @throws NoSuchElementException if this list is empty
|
||||
*/
|
||||
public char getLast() {
|
||||
final Node l = last;
|
||||
if (l == null)
|
||||
throw new NoSuchElementException();
|
||||
return l.item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes and returns the first element from this list.
|
||||
*
|
||||
* @return the first element from this list
|
||||
* @throws NoSuchElementException if this list is empty
|
||||
*/
|
||||
public char removeFirst() {
|
||||
final Node f = first;
|
||||
if (f == null)
|
||||
throw new NoSuchElementException();
|
||||
return unlinkFirst(f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes and returns the last element from this list.
|
||||
*
|
||||
* @return the last element from this list
|
||||
* @throws NoSuchElementException if this list is empty
|
||||
*/
|
||||
public char removeLast() {
|
||||
final Node l = last;
|
||||
if (l == null)
|
||||
throw new NoSuchElementException();
|
||||
return unlinkLast(l);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts the specified element at the beginning of this list.
|
||||
*
|
||||
* @param e the element to add
|
||||
*/
|
||||
public void addFirst(char e) {
|
||||
linkFirst(e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the specified element to the end of this list.
|
||||
*
|
||||
* <p>This method is equivalent to {@link #add}.
|
||||
*
|
||||
* @param e the element to add
|
||||
*/
|
||||
public void addLast(char e) {
|
||||
linkLast(e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of elements in this list.
|
||||
*
|
||||
* @return the number of elements in this list
|
||||
*/
|
||||
public int size() {
|
||||
return size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends the specified element to the end of this list.
|
||||
*
|
||||
* <p>This method is equivalent to {@link #addLast}.
|
||||
*
|
||||
* @param e element to be appended to this list
|
||||
* @return {@code true} (as specified by
|
||||
*/
|
||||
public boolean add(char e) {
|
||||
linkLast(e);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Removes all of the elements from this list.
|
||||
* The list will be empty after this call returns.
|
||||
*/
|
||||
public void clear() {
|
||||
// Clearing all of the links between nodes is "unnecessary", but:
|
||||
// - helps a generational GC if the discarded nodes inhabit
|
||||
// more than one generation
|
||||
// - is sure to free memory even if there is a reachable Iterator
|
||||
for (Node x = first; x != null; ) {
|
||||
Node next = x.next;
|
||||
//x.item = null;
|
||||
x.next = null;
|
||||
x.prev = null;
|
||||
x = next;
|
||||
}
|
||||
first = last = null;
|
||||
size = 0;
|
||||
modCount++;
|
||||
}
|
||||
|
||||
|
||||
// Positional Access Operations
|
||||
|
||||
/**
|
||||
* Returns the element at the specified position in this list.
|
||||
*
|
||||
* @param index index of the element to return
|
||||
* @return the element at the specified position in this list
|
||||
* @throws IndexOutOfBoundsException {@inheritDoc}
|
||||
*/
|
||||
public char get(int index) {
|
||||
//checkElementIndex(index);
|
||||
return node(index).item;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Tells if the argument is the index of an existing element.
|
||||
*/
|
||||
private boolean isElementIndex(int index) {
|
||||
return index >= 0 && index < size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells if the argument is the index of a valid position for an
|
||||
* iterator or an add operation.
|
||||
*/
|
||||
private boolean isPositionIndex(int index) {
|
||||
return index >= 0 && index <= size;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an IndexOutOfBoundsException detail message.
|
||||
* Of the many possible refactorings of the error handling code,
|
||||
* this "outlining" performs best with both server and client VMs.
|
||||
*/
|
||||
private String outOfBoundsMsg(int index) {
|
||||
return "Index: "+index+", Size: "+size;
|
||||
}
|
||||
|
||||
/*private void checkElementIndex(int index) {
|
||||
if (!isElementIndex(index))
|
||||
throw new IndexOutOfBoundsException(outOfBoundsMsg(index));
|
||||
}*/
|
||||
|
||||
/* private void checkPositionIndex(int index) {
|
||||
if (!isPositionIndex(index))
|
||||
throw new IndexOutOfBoundsException(outOfBoundsMsg(index));
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Returns the (non-null) Node at the specified element index.
|
||||
*/
|
||||
Node node(int index) {
|
||||
// assert isElementIndex(index);
|
||||
|
||||
if (index < (size >> 1)) {
|
||||
Node x = first;
|
||||
for (int i = 0; i < index; i++)
|
||||
x = x.next;
|
||||
return x;
|
||||
} else {
|
||||
Node x = last;
|
||||
for (int i = size - 1; i > index; i--)
|
||||
x = x.prev;
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves and removes the head (first element) of this list.
|
||||
*
|
||||
* @return the head of this list, or {@code null} if this list is empty
|
||||
* @since 1.5
|
||||
*/
|
||||
public char poll() {
|
||||
final Node f = first;
|
||||
return (f == null) ? null : unlinkFirst(f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves and removes the head (first element) of this list.
|
||||
*
|
||||
* @return the head of this list
|
||||
* @throws NoSuchElementException if this list is empty
|
||||
* @since 1.5
|
||||
*/
|
||||
public char remove() {
|
||||
return removeFirst();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the specified element as the tail (last element) of this list.
|
||||
*
|
||||
* @param e the element to add
|
||||
* @since 1.5
|
||||
*/
|
||||
public boolean offer(char e) {
|
||||
return add(e);
|
||||
}
|
||||
|
||||
// Deque operations
|
||||
/**
|
||||
* Inserts the specified element at the front of this list.
|
||||
*
|
||||
* @param e the element to insert
|
||||
* @since 1.6
|
||||
*/
|
||||
public boolean offerFirst(char e) {
|
||||
addFirst(e);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inserts the specified element at the end of this list.
|
||||
*
|
||||
* @param e the element to insert
|
||||
* @since 1.6
|
||||
*/
|
||||
public boolean offerLast(char e) {
|
||||
addLast(e);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves, but does not remove, the first element of this list,
|
||||
* or returns {@code null} if this list is empty.
|
||||
*
|
||||
* @return the first element of this list, or {@code null}
|
||||
* if this list is empty
|
||||
* @since 1.6
|
||||
*/
|
||||
public char peekFirst() {
|
||||
final Node f = first;
|
||||
return (f == null) ? null : f.item;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves, but does not remove, the last element of this list,
|
||||
* or returns {@code null} if this list is empty.
|
||||
*
|
||||
* @return the last element of this list, or {@code null}
|
||||
* if this list is empty
|
||||
* @since 1.6
|
||||
*/
|
||||
public char peekLast() {
|
||||
final Node l = last;
|
||||
return (l == null) ? null : l.item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves and removes the first element of this list,
|
||||
* or returns {@code null} if this list is empty.
|
||||
*
|
||||
* @return the first element of this list, or {@code null} if
|
||||
* this list is empty
|
||||
* @since 1.6
|
||||
*/
|
||||
public char pollFirst() {
|
||||
final Node f = first;
|
||||
return (f == null) ? null : unlinkFirst(f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves and removes the last element of this list,
|
||||
* or returns {@code null} if this list is empty.
|
||||
*
|
||||
* @return the last element of this list, or {@code null} if
|
||||
* this list is empty
|
||||
* @since 1.6
|
||||
*/
|
||||
public char pollLast() {
|
||||
final Node l = last;
|
||||
return (l == null) ? null : unlinkLast(l);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pushes an element onto the stack represented by this list. In other
|
||||
* words, inserts the element at the front of this list.
|
||||
*
|
||||
* <p>This method is equivalent to {@link #addFirst}.
|
||||
*
|
||||
* @param e the element to push
|
||||
* @since 1.6
|
||||
*/
|
||||
public void push(char e) {
|
||||
addFirst(e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pops an element from the stack represented by this list. In other
|
||||
* words, removes and returns the first element of this list.
|
||||
*
|
||||
* <p>This method is equivalent to {@link #removeFirst()}.
|
||||
*
|
||||
* @return the element at the front of this list (which is the top
|
||||
* of the stack represented by this list)
|
||||
* @throws NoSuchElementException if this list is empty
|
||||
* @since 1.6
|
||||
*/
|
||||
public char pop() {
|
||||
return removeFirst();
|
||||
}
|
||||
|
||||
private static class Node {
|
||||
char item;
|
||||
Node next;
|
||||
Node prev;
|
||||
|
||||
Node(Node prev, char element, Node next) {
|
||||
this.item = element;
|
||||
this.next = next;
|
||||
this.prev = prev;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns an array containing all of the elements in this list
|
||||
* in proper sequence (from first to last element).
|
||||
*
|
||||
* <p>The returned array will be "safe" in that no references to it are
|
||||
* maintained by this list. (In other words, this method must allocate
|
||||
* a new array). The caller is thus free to modify the returned array.
|
||||
*
|
||||
* <p>This method acts as bridge between array-based and collection-based
|
||||
* APIs.
|
||||
*
|
||||
* @return an array containing all of the elements in this list
|
||||
* in proper sequence
|
||||
*/
|
||||
public char[] toArray() {
|
||||
char[] result = new char[size];
|
||||
int i = 0;
|
||||
for (Node x = first; x != null; x = x.next)
|
||||
result[i++] = x.item;
|
||||
return result;
|
||||
}
|
||||
|
||||
public char[] subArray(int start,int end){
|
||||
if (start < 0)
|
||||
throw new ArrayIndexOutOfBoundsException(start);
|
||||
if (end > size)
|
||||
throw new StringIndexOutOfBoundsException(end);
|
||||
if (start > end)
|
||||
throw new ArrayIndexOutOfBoundsException(end - start);
|
||||
int size = end-start;
|
||||
char[] result = new char[size];
|
||||
int iStart = 0;
|
||||
for (Node x = first; x != null && iStart < end; x = x.next){
|
||||
if(iStart >= start){
|
||||
result[iStart - start] = x.item;
|
||||
}
|
||||
iStart++;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (Node x = first; x != null; x = x.next)
|
||||
sb.append(x.item+",");
|
||||
return "["+sb.toString()+"]";
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是文本
|
||||
* @return
|
||||
*/
|
||||
public boolean isText() {
|
||||
boolean isNull = true;
|
||||
for(char c : this.toArray()) {
|
||||
if(c != SymbolSet.SYMBOL_NULL) {
|
||||
isNull = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this.size() > 0 && !isNull;
|
||||
}
|
||||
|
||||
|
||||
private static final long serialVersionUID = 876323262645176354L;
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
package com.luqj.util;
|
||||
|
||||
|
||||
import com.luqj.util.assertion.Assert;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class FileSystemUtil {
|
||||
|
||||
private static final char SYSTEM_SEPARATOR = File.separatorChar;
|
||||
|
||||
private static final char WINDOWS_SEPARATOR = '\\';
|
||||
|
||||
/**
|
||||
* 递归获取指定目录下的所有文件
|
||||
* @param dir
|
||||
* @param filterDir 子目录是否返回在集合中
|
||||
* @return
|
||||
*/
|
||||
public static final List<File> getAllFiles(File dir,boolean filterDir,FileFilter filter){
|
||||
Assert.logic(dir.isDirectory() && dir.canRead(),dir+"必须是目录且可读");
|
||||
List<File> result = new ArrayList<File>();
|
||||
File[] files = null;
|
||||
if(filter != null){
|
||||
files = dir.listFiles(filter);
|
||||
}else{
|
||||
files = dir.listFiles();
|
||||
}
|
||||
for (File file : files) {
|
||||
if(file.isDirectory()){
|
||||
if(filterDir){
|
||||
result.add(file);
|
||||
}
|
||||
result.addAll(getAllFiles(file, filterDir, filter));
|
||||
}else{
|
||||
result.add(file);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 强制删除文件
|
||||
* 引用org.apache.commons.io.FileUtils代码
|
||||
* @param file
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void forceDelete(File file) throws IOException {
|
||||
if (file.isDirectory()) {
|
||||
deleteDirectory(file);
|
||||
} else {
|
||||
boolean filePresent = file.exists();
|
||||
if (!file.delete()) {
|
||||
if (!filePresent){
|
||||
throw new FileNotFoundException("File does not exist: " + file);
|
||||
}
|
||||
String message =
|
||||
"Unable to delete file: " + file;
|
||||
throw new IOException(message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void deleteDirectory(File directory) throws IOException {
|
||||
if (!directory.exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isSymlink(directory)) {
|
||||
cleanDirectory(directory);
|
||||
}
|
||||
|
||||
if (!directory.delete()) {
|
||||
String message =
|
||||
"Unable to delete directory " + directory + ".";
|
||||
throw new IOException(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isSymlink(File file) throws IOException {
|
||||
if (file == null) {
|
||||
throw new NullPointerException("File must not be null");
|
||||
}
|
||||
if (SYSTEM_SEPARATOR == WINDOWS_SEPARATOR) {
|
||||
return false;
|
||||
}
|
||||
File fileInCanonicalDir = null;
|
||||
if (file.getParent() == null) {
|
||||
fileInCanonicalDir = file;
|
||||
} else {
|
||||
File canonicalDir = file.getParentFile().getCanonicalFile();
|
||||
fileInCanonicalDir = new File(canonicalDir, file.getName());
|
||||
}
|
||||
|
||||
if (fileInCanonicalDir.getCanonicalFile().equals(fileInCanonicalDir.getAbsoluteFile())) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void cleanDirectory(File directory) throws IOException {
|
||||
if (!directory.exists()) {
|
||||
String message = directory + " does not exist";
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
|
||||
if (!directory.isDirectory()) {
|
||||
String message = directory + " is not a directory";
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
|
||||
File[] files = directory.listFiles();
|
||||
if (files == null) { // null if security restricted
|
||||
throw new IOException("Failed to list contents of " + directory);
|
||||
}
|
||||
|
||||
IOException exception = null;
|
||||
for (File file : files) {
|
||||
try {
|
||||
forceDelete(file);
|
||||
} catch (IOException ioe) {
|
||||
exception = ioe;
|
||||
}
|
||||
}
|
||||
|
||||
if (null != exception) {
|
||||
throw exception;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,635 +0,0 @@
|
||||
package com.luqj.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.config.RequestConfig;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.*;
|
||||
import org.apache.http.client.utils.URIBuilder;
|
||||
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
|
||||
import org.apache.http.conn.ssl.SSLContexts;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URI;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.security.*;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
@Slf4j
|
||||
public class HttpHelper {
|
||||
/**
|
||||
* 复用公共模块实现:JSON 字段为 ip 和 ips,排除回环及链路本地地址,
|
||||
* 使用默认 HTTPS 证书校验和 5 秒连接、读取超时,仅显式调用时发送。
|
||||
* 本方法为同步调用,耗时操作应由调用方安排在后台线程执行。
|
||||
*
|
||||
* @return 接口成功响应的原始正文
|
||||
* @throws IOException 无可用地址、网络异常或接口返回非 2xx 状态
|
||||
*/
|
||||
public static String pushLocalIpInfo() throws IOException {
|
||||
return com.ruoyi.common.utils.http.HttpHelper.pushLocalIpInfo();
|
||||
}
|
||||
|
||||
private String proxyHost;
|
||||
private Integer proxyPort;
|
||||
private CloseableHttpClient httpsClient = null;
|
||||
|
||||
private CloseableHttpClient httpClient = null;
|
||||
public String getProxyHost() {
|
||||
return proxyHost;
|
||||
}
|
||||
|
||||
public void setProxyHost(String proxyHost) {
|
||||
this.proxyHost = proxyHost;
|
||||
}
|
||||
|
||||
public Integer getProxyPort() {
|
||||
return proxyPort;
|
||||
}
|
||||
|
||||
public void setProxyPort(Integer proxyPort) {
|
||||
this.proxyPort = proxyPort;
|
||||
}
|
||||
public synchronized void closeClient(){
|
||||
try {
|
||||
if (httpsClient != null) {
|
||||
httpsClient.close();
|
||||
httpsClient = null;
|
||||
}
|
||||
if (httpClient != null) {
|
||||
httpClient.close();
|
||||
httpClient = null;
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
if (cm != null) {
|
||||
cm.close();
|
||||
}
|
||||
cm = new PoolingHttpClientConnectionManager();
|
||||
cm.setMaxTotal(500);
|
||||
cm.setDefaultMaxPerRoute(5);
|
||||
}
|
||||
public static void main(String[] args) throws Exception {
|
||||
BigDecimal decimal = new BigDecimal("1").divide(new BigDecimal(100));
|
||||
|
||||
esListense();
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取网络文本
|
||||
*
|
||||
* @param sourcePath
|
||||
* @return
|
||||
*/
|
||||
public List<String> readHttpFile(String sourcePath) {
|
||||
String line;
|
||||
int lineNum = 0;
|
||||
List<String> list = new ArrayList<>();
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
URL url = new URL(sourcePath);
|
||||
reader = new BufferedReader(new InputStreamReader(url.openStream(), "gbk"));
|
||||
while ((line = reader.readLine()) != null) {
|
||||
lineNum++;
|
||||
list.add(line);
|
||||
}
|
||||
} catch (Exception ie) {
|
||||
ie.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (reader != null)
|
||||
reader.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<String> readGzFile(String url) throws IOException {
|
||||
InputStream in = new GZIPInputStream(new FileInputStream(url));
|
||||
List<String> list = IOUtils.readLines(in, "UTF-8");
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<String> readHttpGzFile(String sourcePath) {
|
||||
List<String> list = new ArrayList<>();
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
URL url = new URL(sourcePath);
|
||||
InputStream in = new GZIPInputStream(url.openStream());
|
||||
list = IOUtils.readLines(in, "UTF-8");
|
||||
} catch (Exception ie) {
|
||||
ie.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (reader != null)
|
||||
reader.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public CloseableHttpClient getHttpsClient() throws Exception {
|
||||
SSLContext sslcontext = SSLContexts.custom().useSSL().build();
|
||||
sslcontext.init(null, new X509TrustManager[]{new HttpsTrustManager()}, new SecureRandom());
|
||||
SSLConnectionSocketFactory factory = new SSLConnectionSocketFactory(sslcontext,
|
||||
SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER);
|
||||
RequestConfig defaultRequestConfig = RequestConfig.custom()
|
||||
.setSocketTimeout(5000)
|
||||
.setConnectTimeout(5000)
|
||||
.setConnectionRequestTimeout(500000)
|
||||
.setStaleConnectionCheckEnabled(true)
|
||||
.build();
|
||||
RequestConfig requestConfig = null;
|
||||
if (StringUtils.isNotBlank(proxyHost) && null != proxyPort) {
|
||||
// setProxy(new HttpHost("lu7213.6655.la", 57301))
|
||||
// setProxy(new HttpHost("127.0.0.1", 19180))
|
||||
requestConfig = RequestConfig.copy(defaultRequestConfig).setProxy(new HttpHost(proxyHost, proxyPort))
|
||||
.build();
|
||||
} else {
|
||||
requestConfig = RequestConfig.copy(defaultRequestConfig).build();
|
||||
}
|
||||
CloseableHttpClient client = HttpClients.custom().setSSLSocketFactory(factory).setDefaultRequestConfig(requestConfig).build();
|
||||
return client;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入证书
|
||||
*
|
||||
* @return
|
||||
* @throws KeyStoreException
|
||||
* @throws NoSuchAlgorithmException
|
||||
* @throws CertificateException
|
||||
* @throws IOException
|
||||
* @throws KeyManagementException
|
||||
*/
|
||||
private SSLContext getSSLContext() throws KeyStoreException,
|
||||
NoSuchAlgorithmException, CertificateException, IOException, KeyManagementException {
|
||||
KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
|
||||
FileInputStream instream = new FileInputStream(new File("my.keystore"));
|
||||
try {
|
||||
trustStore.load(instream, "nopassword".toCharArray());
|
||||
} finally {
|
||||
instream.close();
|
||||
}
|
||||
return SSLContexts.custom()
|
||||
.loadTrustMaterial(trustStore)
|
||||
.build();
|
||||
}
|
||||
|
||||
// es 7.4 白嫖命令
|
||||
private static boolean esListense() throws Exception {
|
||||
HttpHelper httpHelper = new HttpHelper();
|
||||
HashMap<String, Object> headers = new HashMap<>();
|
||||
// headers.put("Content-Type", "application/json");
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("access_token", "1278491352545154|4fa79654c00caab794a70afee2d769c2");
|
||||
map.put("input_token", "EAASKxZCbqt4IBAOwxuyFEZCynraaVQtOrMnwkj301sxydRYZBiZBUe1REIV1zcrXvSC6nsnPVMG1YpB645OsRACOjQ9C9T4lFJxQI1rPon2p2Ww8onXsKytaOcqaKFf2f4EZAA4doPxGcJoBiCnKh0g7EdhjZBQrfpC1Q05N87fLUlKHE3ZAQddLeZAIKBaXcoyDVhqTSWVGoKlghLQvMpnJNeXmRyQTSIAZD");
|
||||
// ResponseWrapper result = httpHelper.sendGet("https://graph.facebook.com/debug_token", map);
|
||||
// httpHelper.setProxyHost("192.168.2.4");
|
||||
// httpHelper.setProxyPort(29180);
|
||||
// String result = httpHelper.getlHttpResult("https://graph.facebook.com/debug_token", "GET", headers, map);
|
||||
// System.out.println(result);
|
||||
// HashMap headers = new HashMap<>();
|
||||
//// headers.put("Content-Type", "application/json");
|
||||
String data = "{\"license\":{\"uid\":\"64311a78-1da8-4242-801d-1919b2ee6373\",\"type\":\"platinum\",\"issue_date_in_millis\":1591660800000,\"expiry_date_in_millis\":2516630400000,\"max_nodes\":100,\"issued_to\":\"qungjie lu (dragon)\",\"issuer\":\"Web Form\",\"signature\":\"AAAAAwAAAA3TbuzQUBHKydhRaMl8AAABmC9ZN0hjZDBGYnVyRXpCOW5Bb3FjZDAxOWpSbTVoMVZwUzRxVk1PSmkxaktJRVl5MUYvUWh3bHZVUTllbXNPbzBUemtnbWpBbmlWRmRZb25KNFlBR2x0TXc2K2p1Y1VtMG1UQU9TRGZVSGRwaEJGUjE3bXd3LzRqZ05iLzRteWFNekdxRGpIYlFwYkJiNUs0U1hTVlJKNVlXekMrSlVUdFIvV0FNeWdOYnlESDc3MWhlY3hSQmdKSjJ2ZTcvYlBFOHhPQlV3ZHdDQ0tHcG5uOElCaDJ4K1hob29xSG85N0kvTWV3THhlQk9NL01VMFRjNDZpZEVXeUtUMXIyMlIveFpJUkk2WUdveEZaME9XWitGUi9WNTZVQW1FMG1DenhZU0ZmeXlZakVEMjZFT2NvOWxpZGlqVmlHNC8rWVVUYzMwRGVySHpIdURzKzFiRDl4TmM1TUp2VTBOUlJZUlAyV0ZVL2kvVk10L0NsbXNFYVZwT3NSU082dFNNa2prQ0ZsclZ4NTltbU1CVE5lR09Bck93V2J1Y3c9PQAAAQBCUpzI7WOa8sBex3uA0Ag2ELeK9+bTX/GPpqKFEoEU6tdWyxxXsfwC1a8+FTkDmm/96jAm7x86wlgu3vimq7nK2ddMjNub3zZd4TAa3pRZfyNnJrlWzDIzyKwHI1N13YB4cEnrSgf+Hj/czIcLcFjTr7IEgXIuc1kfeEmghGLWVKZkHaoeTStWt5+3w/xwzs0ieacWp+FFkJv06ywEf96HusMSc1ExrRL/4JRY+zJiMjupxvrNSm3VP6K2I1RhR+XLXM/9d71jxPXFtFbY1IyAjHOviie7baszbR+eD3F1uHFOoR7WpKNYkXxVF+002HYtoKI4OEN2t6PXx12yAlXM\",\"start_date_in_millis\":1591660800000}}";
|
||||
String result = httpHelper.playLoad("put", "http://192.168.2.176:9200/_xpack/license", headers, data, "application/json", "utf-8");
|
||||
System.out.println(result);
|
||||
return true;
|
||||
}
|
||||
|
||||
private PoolingHttpClientConnectionManager cm;
|
||||
|
||||
public HttpHelper() {
|
||||
cm = new PoolingHttpClientConnectionManager();
|
||||
cm.setMaxTotal(500); // 整个连接池最大连接数
|
||||
cm.setDefaultMaxPerRoute(5); // 每路由最大连接数,默认值是2
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过连接池获取HttpClient
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private CloseableHttpClient getHttpClient() {
|
||||
RequestConfig defaultRequestConfig = RequestConfig.custom()
|
||||
.setSocketTimeout(5000)
|
||||
.setConnectTimeout(5000)
|
||||
.setConnectionRequestTimeout(5000000)
|
||||
.setStaleConnectionCheckEnabled(true)
|
||||
.build();
|
||||
RequestConfig requestConfig = null;
|
||||
if (StringUtils.isNotBlank(proxyHost) && null != proxyPort) {
|
||||
// setProxy(new HttpHost("lu7213.6655.la", 57301))
|
||||
// setProxy(new HttpHost("127.0.0.1", 19180))
|
||||
requestConfig = RequestConfig.copy(defaultRequestConfig).setProxy(new HttpHost(proxyHost, proxyPort))
|
||||
.build();
|
||||
} else {
|
||||
requestConfig = RequestConfig.copy(defaultRequestConfig).build();
|
||||
}
|
||||
return HttpClients.custom().setConnectionManager(cm).setDefaultRequestConfig(requestConfig).build();
|
||||
}
|
||||
|
||||
private ArrayList<NameValuePair> covertParams2NVPS(Map<String, Object> params) {
|
||||
ArrayList<NameValuePair> pairs = new ArrayList<NameValuePair>();
|
||||
for (Map.Entry<String, Object> param : params.entrySet()) {
|
||||
pairs.add(new BasicNameValuePair(param.getKey(), String.valueOf(param.getValue())));
|
||||
}
|
||||
return pairs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送http
|
||||
*
|
||||
* @param url
|
||||
* @param method
|
||||
* @param headers
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public CloseableHttpResponse send(CloseableHttpClient httpClient, String url, String method, Map<String, Object> headers) throws Exception {
|
||||
URIBuilder ub = new URIBuilder();
|
||||
ub.setPath(url);
|
||||
HttpRequestBase http = null;
|
||||
if (method.toLowerCase().equals("put")) {
|
||||
http = new HttpPut(ub.build());
|
||||
}
|
||||
if (method.toLowerCase().equals("post")) {
|
||||
http = new HttpPost(ub.build());
|
||||
}
|
||||
if (method.toLowerCase().equals("get")) {
|
||||
http = new HttpGet(ub.build());
|
||||
}
|
||||
if (method.toLowerCase().equals("delete")) {
|
||||
http = new HttpDelete(ub.build());
|
||||
}
|
||||
for (Map.Entry<String, Object> param : headers.entrySet()) {
|
||||
http.addHeader(param.getKey(), String.valueOf(param.getValue()));
|
||||
}
|
||||
try {
|
||||
return httpClient.execute(http);
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public CloseableHttpResponse send(CloseableHttpClient httpClient, String url, String method) throws Exception {
|
||||
URIBuilder ub = new URIBuilder();
|
||||
ub.setPath(url);
|
||||
HttpRequestBase http = null;
|
||||
if (method.toLowerCase().equals("put")) {
|
||||
http = new HttpPut(ub.build());
|
||||
}
|
||||
if (method.toLowerCase().equals("post")) {
|
||||
http = new HttpPost(ub.build());
|
||||
}
|
||||
if (method.toLowerCase().equals("get")) {
|
||||
http = new HttpGet(ub.build());
|
||||
}
|
||||
if (method.toLowerCase().equals("delete")) {
|
||||
http = new HttpDelete(ub.build());
|
||||
}
|
||||
try {
|
||||
return httpClient.execute(http);
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送http
|
||||
*
|
||||
* @param url
|
||||
* @param method
|
||||
* @param headers
|
||||
* @param params
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public CloseableHttpResponse send(CloseableHttpClient httpClient, String url, String method, Map<String, Object> headers, Map<String, Object> params) throws Exception {
|
||||
URIBuilder ub = new URIBuilder();
|
||||
ub.setPath(url);
|
||||
ArrayList<NameValuePair> pairs = covertParams2NVPS(params);
|
||||
if (method.toLowerCase().equals("put")) {
|
||||
ub.setParameters(pairs);
|
||||
HttpPut http = null;
|
||||
if (pairs.size() > 0) {
|
||||
http = new HttpPut(ub.build());
|
||||
} else {
|
||||
http = new HttpPut(url);
|
||||
}
|
||||
for (Map.Entry<String, Object> param : headers.entrySet()) {
|
||||
http.addHeader(param.getKey(), String.valueOf(param.getValue()));
|
||||
}
|
||||
return httpClient.execute(http);
|
||||
}
|
||||
if (method.toLowerCase().equals("post")) {
|
||||
ub.setParameters(pairs);
|
||||
HttpPost http = null;
|
||||
if (pairs.size() > 0) {
|
||||
http = new HttpPost(ub.build());
|
||||
} else {
|
||||
http = new HttpPost(url);
|
||||
}
|
||||
for (Map.Entry<String, Object> param : headers.entrySet()) {
|
||||
http.addHeader(param.getKey(), String.valueOf(param.getValue()));
|
||||
}
|
||||
http.setEntity(new UrlEncodedFormEntity(pairs, "UTF-8"));
|
||||
return httpClient.execute(http);
|
||||
}
|
||||
if (method.toLowerCase().equals("get")) {
|
||||
HttpGet http = null;
|
||||
if (pairs.size() > 0) {
|
||||
ub.setParameters(pairs);
|
||||
String path = ub.toString();
|
||||
if(path.startsWith("/")) {
|
||||
http = new HttpGet(path.substring(1));
|
||||
}else{
|
||||
http = new HttpGet(ub.build());
|
||||
}
|
||||
|
||||
} else {
|
||||
http = new HttpGet(url);
|
||||
}
|
||||
for (Map.Entry<String, Object> param : headers.entrySet()) {
|
||||
http.addHeader(param.getKey(), String.valueOf(param.getValue()));
|
||||
}
|
||||
// HttpHost target = new HttpHost(InetAddress.,ub.getHost(),ub.getPort(),ub.getScheme());
|
||||
return httpClient.execute(http);
|
||||
}
|
||||
if (method.toLowerCase().equals("delete")) {
|
||||
ub.setParameters(pairs);
|
||||
HttpDelete http = null;
|
||||
if (pairs.size() > 0) {
|
||||
http = new HttpDelete(ub.build());
|
||||
} else {
|
||||
http = new HttpDelete(url);
|
||||
}
|
||||
for (Map.Entry<String, Object> param : headers.entrySet()) {
|
||||
http.addHeader(param.getKey(), String.valueOf(param.getValue()));
|
||||
}
|
||||
return httpClient.execute(http);
|
||||
}
|
||||
if (method.toLowerCase().equals("options")) {
|
||||
ub.setParameters(pairs);
|
||||
HttpOptions http = null;
|
||||
if (pairs.size() > 0) {
|
||||
http = new HttpOptions(ub.build());
|
||||
} else {
|
||||
http = new HttpOptions(url);
|
||||
}
|
||||
for (Map.Entry<String, Object> param : headers.entrySet()) {
|
||||
http.addHeader(param.getKey(), String.valueOf(param.getValue()));
|
||||
}
|
||||
return httpClient.execute(http);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ResponseWrapper sendGet(String apiUrl, Map<String, Object> allParams) throws Exception {
|
||||
URL url = new URL(RequestHelper.constructUrlString(apiUrl, allParams));
|
||||
HttpsURLConnection con = (HttpsURLConnection) url.openConnection();
|
||||
|
||||
con.setRequestMethod("GET");
|
||||
con.setRequestProperty("User-Agent", "fbbizsdk-java-v3.3");
|
||||
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
|
||||
return readResponse(con);
|
||||
}
|
||||
|
||||
private ResponseWrapper readResponse(HttpsURLConnection con) throws Exception {
|
||||
try {
|
||||
int responseCode = con.getResponseCode();
|
||||
|
||||
String header = convertToString(con.getHeaderFields());
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
|
||||
String inputLine;
|
||||
StringBuilder response = new StringBuilder();
|
||||
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
in.close();
|
||||
return new ResponseWrapper(response.toString(), header);
|
||||
} catch (Exception e) {
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(con.getErrorStream()));
|
||||
String inputLine;
|
||||
StringBuilder response = new StringBuilder();
|
||||
|
||||
while ((inputLine = in.readLine()) != null) {
|
||||
response.append(inputLine);
|
||||
}
|
||||
in.close();
|
||||
throw new Exception(response.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
private String convertToString(Object input) {
|
||||
if (input == null) {
|
||||
return "null";
|
||||
} else if (input instanceof Map) {
|
||||
Gson gson = new GsonBuilder()
|
||||
.excludeFieldsWithModifiers(Modifier.STATIC)
|
||||
.excludeFieldsWithModifiers(Modifier.PROTECTED)
|
||||
.disableHtmlEscaping()
|
||||
.create();
|
||||
return gson.toJson((Map) input);
|
||||
} else if (input instanceof List) {
|
||||
Gson gson = new GsonBuilder()
|
||||
.excludeFieldsWithModifiers(Modifier.STATIC)
|
||||
.excludeFieldsWithModifiers(Modifier.PROTECTED)
|
||||
.disableHtmlEscaping()
|
||||
.create();
|
||||
return gson.toJson((List) input);
|
||||
} else {
|
||||
return input.toString();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理Http请求
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getlHttpResult(String url, String method, Map<String, Object> headers, Map<String, Object> params) throws Exception {
|
||||
CloseableHttpClient tempClient = null;
|
||||
if (url.startsWith("https")) {
|
||||
if(httpsClient == null){
|
||||
httpsClient = getHttpsClient();
|
||||
}
|
||||
tempClient = httpsClient;
|
||||
} else {
|
||||
if(httpClient == null) {
|
||||
httpClient = getHttpClient();
|
||||
}
|
||||
tempClient = httpClient;
|
||||
}
|
||||
CloseableHttpResponse response = this.send(tempClient, url, method, headers, params);
|
||||
if (method.toLowerCase().equals("options")) {
|
||||
return response.getStatusLine().getStatusCode() + "";
|
||||
} else {
|
||||
HttpEntity entity = response.getEntity();
|
||||
if (entity != null) {
|
||||
String result = EntityUtils.toString(entity, Charset.forName("UTF-8"));
|
||||
// httpClient.close();
|
||||
response.close();
|
||||
return result;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
public String getlHttpResultCode(String url, String method, Map<String, Object> headers, Map<String, Object> params) throws Exception {
|
||||
CloseableHttpClient tempClient = null;
|
||||
if (url.startsWith("https")) {
|
||||
if(httpsClient == null){
|
||||
httpsClient = getHttpsClient();
|
||||
}
|
||||
tempClient = httpsClient;
|
||||
} else {
|
||||
if(httpClient == null) {
|
||||
httpClient = getHttpClient();
|
||||
}
|
||||
tempClient = httpClient;
|
||||
}
|
||||
CloseableHttpResponse response = this.send(tempClient, url, method, headers, params);
|
||||
return response.getStatusLine().getStatusCode() + "";
|
||||
}
|
||||
|
||||
public Boolean testHttp(String url, String method, Map<String, Object> headers, Map<String, Object> params) throws Exception {
|
||||
CloseableHttpClient tempClient = null;
|
||||
if (url.startsWith("https")) {
|
||||
if(httpsClient == null){
|
||||
httpsClient = getHttpsClient();
|
||||
}
|
||||
tempClient = httpsClient;
|
||||
} else {
|
||||
if(httpClient == null) {
|
||||
httpClient = getHttpClient();
|
||||
}
|
||||
tempClient = httpClient;
|
||||
}
|
||||
CloseableHttpResponse response = this.send(tempClient, url, method, headers, params);
|
||||
boolean result = response.getStatusLine().getStatusCode() == 200;
|
||||
response.close();
|
||||
return result;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
cm.close();
|
||||
}
|
||||
|
||||
public String playLoad(String method, String url, Map<String, Object> headersMap, Object data, String contentType, String charset) throws Exception {
|
||||
CloseableHttpClient tempClient = null;
|
||||
if (url.startsWith("https")) {
|
||||
if(httpsClient == null){
|
||||
httpsClient = getHttpsClient();
|
||||
}
|
||||
tempClient = httpsClient;
|
||||
} else {
|
||||
if(httpClient == null) {
|
||||
httpClient = getHttpClient();
|
||||
}
|
||||
tempClient = httpClient;
|
||||
}
|
||||
String result = null;
|
||||
HttpEntityEnclosingRequestBase httpEntityEnclosingRequestBase = null;
|
||||
if ("post".equalsIgnoreCase(method)) {
|
||||
httpEntityEnclosingRequestBase = new HttpPost(url);
|
||||
} else if ("put".equalsIgnoreCase(method)) {
|
||||
httpEntityEnclosingRequestBase = new HttpPut(url);
|
||||
} else if ("get".equalsIgnoreCase(method)) {
|
||||
httpEntityEnclosingRequestBase = new HttpEntityEnclosingRequestBase() {
|
||||
@Override
|
||||
public String getMethod() {
|
||||
return "GET";
|
||||
}
|
||||
};
|
||||
httpEntityEnclosingRequestBase.setURI(new URI(url));
|
||||
}
|
||||
for (Map.Entry<String, Object> param : headersMap.entrySet()) {
|
||||
httpEntityEnclosingRequestBase.addHeader(param.getKey(), String.valueOf(param.getValue()));
|
||||
}
|
||||
httpEntityEnclosingRequestBase.addHeader("Content-Type", contentType);
|
||||
String json = "";
|
||||
if (data instanceof String) {
|
||||
json = String.valueOf(data);
|
||||
} else {
|
||||
json = JSONObject.toJSONString(data);
|
||||
}
|
||||
StringEntity entity = new StringEntity(json, charset);
|
||||
// post请求是将参数放在请求体里面传过去的;这里将entity放入post请求体中
|
||||
httpEntityEnclosingRequestBase.setEntity(entity);
|
||||
// 响应模型
|
||||
CloseableHttpResponse response = null;
|
||||
try {
|
||||
// 由客户端执行(发送)Post请求
|
||||
response = (CloseableHttpResponse) tempClient.execute(httpEntityEnclosingRequestBase);
|
||||
// 从响应模型中获取响应实体
|
||||
HttpEntity responseEntity = response.getEntity();
|
||||
System.out.println("响应状态为:" + response.getStatusLine());
|
||||
if (responseEntity != null) {
|
||||
result = EntityUtils.toString(responseEntity);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
if (response != null) {
|
||||
response.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换指定格式的日期
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public String replaceCurDate(String value) {
|
||||
String cur = formatDate(new Date(), "yyyyMMddHHmm");
|
||||
String result = value.replaceAll("\\$\\{yyyyMMddHHmm\\}", cur);
|
||||
cur = formatDate(new Date(), "yyyyMMddHH");
|
||||
result = result.replaceAll("\\$\\{yyyyMMddHH\\}", cur);
|
||||
cur = formatDate(new Date(), "yyyyMMdd");
|
||||
result = result.replaceAll("\\$\\{yyyyMMdd\\}", cur);
|
||||
cur = formatDate(new Date(), "yyyyMM");
|
||||
result = result.replaceAll("\\$\\{yyyyMM\\}", cur);
|
||||
return result;
|
||||
}
|
||||
|
||||
public String formatDate(final Date date, final String pattern) {
|
||||
SimpleDateFormat formatter = new SimpleDateFormat(pattern);
|
||||
return formatter.format(date);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.luqj.util;
|
||||
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
public class HttpsTrustManager implements X509TrustManager {
|
||||
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] arg0, String arg1)
|
||||
throws CertificateException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] arg0, String arg1)
|
||||
throws CertificateException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new X509Certificate[]{};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,322 +0,0 @@
|
||||
package com.luqj.util;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Created: 2016/7/5.
|
||||
* Author: Qiannan Lu
|
||||
*/
|
||||
public class IdentificationNumberUtils {
|
||||
private final static Logger logger = LoggerFactory.getLogger(IdentificationNumberUtils.class);
|
||||
|
||||
/**
|
||||
* 获取身份证号的出生日期字符串
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @return 出生日期字符串
|
||||
*/
|
||||
public static String birthday(String idCard) {
|
||||
if (StringUtils.isBlank(idCard)
|
||||
|| idCard.length() <= 14) {
|
||||
logger.error("传入身份证号{}位数不对!", idCard);
|
||||
return null;
|
||||
}
|
||||
|
||||
return id15ToId18(idCard).substring(6, 14);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取身份证号的出生日期
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @return 出生日期
|
||||
*/
|
||||
public static Date birthDate(String idCard) {
|
||||
|
||||
String birthDay = birthday(idCard);
|
||||
|
||||
if (birthDay == null) return null;
|
||||
try {
|
||||
return new SimpleDateFormat("yyyyMMdd").parse(birthDay);
|
||||
} catch (Exception e) {
|
||||
logger.error("提取身份证号{}出生日期出错", idCard, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取身份证号的年份信息
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @return 年份信息
|
||||
*/
|
||||
public static String year(String idCard) {
|
||||
Calendar calendar = getBirthDateCalendar(idCard);
|
||||
|
||||
return calendar == null ? null : Integer.toString(calendar.get(Calendar.YEAR));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取身份证号的月份信息 从1月开始
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @return 月份信息
|
||||
*/
|
||||
public static String month(String idCard) {
|
||||
Calendar calendar = getBirthDateCalendar(idCard);
|
||||
|
||||
return calendar == null ? null : Integer.toString(calendar.get(Calendar.MONTH) + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取身份证号的日期信息 月份中的日期
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @return 日期信息
|
||||
*/
|
||||
public static String day(String idCard) {
|
||||
Calendar calendar = getBirthDateCalendar(idCard);
|
||||
|
||||
return calendar == null ? null : Integer.toString(calendar.get(Calendar.DATE));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取身份证号的日期信息 一年中的日期
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @return 日期信息
|
||||
*/
|
||||
public static String dayOfYear(String idCard) {
|
||||
|
||||
Calendar calendar = getBirthDateCalendar(idCard);
|
||||
|
||||
return calendar == null ? null : Integer.toString(calendar.get(Calendar.DAY_OF_YEAR));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取身份证号的出生日期信息
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @return 出生日期
|
||||
*/
|
||||
private static Calendar getBirthDateCalendar(String idCard) {
|
||||
Date birthDate = birthDate(idCard);
|
||||
|
||||
if (birthDate == null) return null;
|
||||
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(birthDate);
|
||||
return calendar;
|
||||
}
|
||||
|
||||
/**
|
||||
* 18位身份证转15位.
|
||||
*
|
||||
* @param id18 18为身份证号
|
||||
* @return 15位身份证号
|
||||
*/
|
||||
public static String id18ToId15(String id18) {
|
||||
return id18.substring(0, 6) + id18.substring(8, 17);
|
||||
}
|
||||
|
||||
/**
|
||||
* 15位身份证转18位.
|
||||
*
|
||||
* @param id15 15位身份证号
|
||||
* @return 18位身份证号
|
||||
*/
|
||||
public static String id15ToId18(String id15) {
|
||||
int IdLength = id15.length();
|
||||
String id18;
|
||||
switch (IdLength) {
|
||||
case 15:
|
||||
String serial = id15.substring(IdLength - 3);
|
||||
if (serial.equals("996") || serial.equals("997") || serial.equals("998") || serial.equals("999")) {
|
||||
id18 = id15.substring(0, 6) + "18" + id15.substring(IdLength - 9);
|
||||
} else {
|
||||
id18 = id15.substring(0, 6) + "19" + id15.substring(IdLength - 9);
|
||||
}
|
||||
id18 = id18 + getIdCheckBit(id18);
|
||||
break;
|
||||
case 17:
|
||||
id18 = id15 + getIdCheckBit(id15);
|
||||
break;
|
||||
case 18:
|
||||
id18 = id15;
|
||||
break;
|
||||
default:
|
||||
id18 = id15;
|
||||
}
|
||||
return id18;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断传入的字符串是否是身份证号,如果是18位 会判断最后一位标志位
|
||||
* 如果是15位则返回false
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @return 是否是真是身份证号
|
||||
*/
|
||||
public static boolean isValid(String idCard) {
|
||||
|
||||
boolean isLooksLike = isLooksLike(idCard);
|
||||
|
||||
if (isLooksLike && idCard.length() == 18) {
|
||||
String x = getIdCheckBit(idCard);
|
||||
if (x.equals("" + idCard.charAt(17)))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断传入的字符串(15位或者18位)是否是身份证号,其他直接返回false
|
||||
* @param idCard 身份证号
|
||||
* @return 是否是真是身份证号
|
||||
*/
|
||||
public static boolean checkIsIdCard(String idCard) {
|
||||
boolean isLooksLike = isLooksLike(idCard);
|
||||
if (isLooksLike && idCard.length() == 18) {
|
||||
String x = getIdCheckBit(idCard);
|
||||
if (x.equals("" + idCard.charAt(17)))
|
||||
return true;
|
||||
}
|
||||
if (isLooksLike && idCard.length() == 15) {
|
||||
String x = getIdCheckBit(id15ToId18(idCard));
|
||||
if (x.equals("" + id15ToId18(idCard).charAt(17)))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断传入的字符串是否像是身份证号,只会判断出身年月信息
|
||||
*
|
||||
* @param idCard 身份证号
|
||||
* @return 是否像身份证号
|
||||
*/
|
||||
public static boolean isLooksLike(String idCard) {
|
||||
if (idCard.length() == 15) {
|
||||
|
||||
String birthday = idCard.substring(6, 12);
|
||||
|
||||
return isYear(birthday.substring(0, 2)) && isMonth(birthday.substring(2, 4)) && isDay(birthday.substring(4, 6));
|
||||
} else if (idCard.length() == 18) {
|
||||
String birthday = idCard.substring(6, 14);
|
||||
return isYear(birthday.substring(0, 4)) && isMonth(birthday.substring(4, 6)) && isDay(birthday.substring(6, 8));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断数字是否符合年份
|
||||
*
|
||||
* @param year 数字
|
||||
*/
|
||||
private static boolean isYear(String year) {
|
||||
if (year.length() == 4) {
|
||||
try {
|
||||
int y = Integer.parseInt(year);
|
||||
if (y < 1900 || y > 2100) {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断数字是否符合月份
|
||||
*
|
||||
* @param month 数字
|
||||
*/
|
||||
private static boolean isMonth(String month) {
|
||||
try {
|
||||
int m = Integer.parseInt(month);
|
||||
if (m < 1 || m > 12) {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断数字是否符合日期
|
||||
*
|
||||
* @param day 数字
|
||||
*/
|
||||
private static boolean isDay(String day) {
|
||||
try {
|
||||
int d = Integer.parseInt(day);
|
||||
if (d < 1 || d > 31) {
|
||||
return false;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取18位身份证号的校验位
|
||||
*
|
||||
* @param id18 18位身份证号
|
||||
* @return 校验位
|
||||
*/
|
||||
public static String getIdCheckBit(String id18) {
|
||||
String[] strCheckChar = new String[11];
|
||||
int[] nWeight = new int[18];
|
||||
strCheckChar[0] = "1";
|
||||
strCheckChar[1] = "0";
|
||||
strCheckChar[2] = "X";
|
||||
strCheckChar[3] = "9";
|
||||
strCheckChar[4] = "8";
|
||||
strCheckChar[5] = "7";
|
||||
strCheckChar[6] = "6";
|
||||
strCheckChar[7] = "5";
|
||||
strCheckChar[8] = "4";
|
||||
strCheckChar[9] = "3";
|
||||
strCheckChar[10] = "2";
|
||||
|
||||
nWeight[0] = 7;
|
||||
nWeight[1] = 9;
|
||||
nWeight[2] = 10;
|
||||
nWeight[3] = 5;
|
||||
nWeight[4] = 8;
|
||||
nWeight[5] = 4;
|
||||
nWeight[6] = 2;
|
||||
nWeight[7] = 1;
|
||||
nWeight[8] = 6;
|
||||
nWeight[9] = 3;
|
||||
nWeight[10] = 7;
|
||||
nWeight[11] = 9;
|
||||
nWeight[12] = 10;
|
||||
nWeight[13] = 5;
|
||||
nWeight[14] = 8;
|
||||
nWeight[15] = 4;
|
||||
nWeight[16] = 2;
|
||||
nWeight[17] = 1;
|
||||
|
||||
int sumMulti = 0;
|
||||
for (int i = 0; i <= 16; i++) {
|
||||
String ch = id18.substring(i, i + 1);
|
||||
sumMulti = sumMulti + (Integer.parseInt(ch) * nWeight[i]);
|
||||
}
|
||||
int resultMod = sumMulti % 11;
|
||||
return strCheckChar[resultMod];
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,169 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.luqj.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Simple implementation of {@link MultiValueMap} that wraps a {@link LinkedHashMap},
|
||||
* storing multiple values in a {@link LinkedList}.
|
||||
*
|
||||
* <p>This Map implementation is generally not thread-safe. It is primarily designed
|
||||
* for data structures exposed from request objects, for use in a single thread only.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
*/
|
||||
public class LinkedMultiValueMap<K, V> implements MultiValueMap<K, V>, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3801124242820219131L;
|
||||
|
||||
private final Map<K, List<V>> targetMap;
|
||||
|
||||
|
||||
/**
|
||||
* Create a new LinkedMultiValueMap that wraps a {@link LinkedHashMap}.
|
||||
*/
|
||||
public LinkedMultiValueMap() {
|
||||
this.targetMap = new LinkedHashMap<K, List<V>>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new LinkedMultiValueMap that wraps a {@link LinkedHashMap}
|
||||
* with the given initial capacity.
|
||||
* @param initialCapacity the initial capacity
|
||||
*/
|
||||
public LinkedMultiValueMap(int initialCapacity) {
|
||||
this.targetMap = new LinkedHashMap<K, List<V>>(initialCapacity);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy constructor: Create a new LinkedMultiValueMap with the same mappings
|
||||
* as the specified Map.
|
||||
* @param otherMap the Map whose mappings are to be placed in this Map
|
||||
*/
|
||||
public LinkedMultiValueMap(Map<K, List<V>> otherMap) {
|
||||
this.targetMap = new LinkedHashMap<K, List<V>>(otherMap);
|
||||
}
|
||||
|
||||
|
||||
// MultiValueMap implementation
|
||||
|
||||
public void add(K key, V value) {
|
||||
List<V> values = this.targetMap.get(key);
|
||||
if (values == null) {
|
||||
values = new LinkedList<V>();
|
||||
this.targetMap.put(key, values);
|
||||
}
|
||||
values.add(value);
|
||||
}
|
||||
|
||||
public V getFirst(K key) {
|
||||
List<V> values = this.targetMap.get(key);
|
||||
return (values != null ? values.get(0) : null);
|
||||
}
|
||||
|
||||
public void set(K key, V value) {
|
||||
List<V> values = new LinkedList<V>();
|
||||
values.add(value);
|
||||
this.targetMap.put(key, values);
|
||||
}
|
||||
|
||||
public void setAll(Map<K, V> values) {
|
||||
for (Entry<K, V> entry : values.entrySet()) {
|
||||
set(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
public Map<K, V> toSingleValueMap() {
|
||||
LinkedHashMap<K, V> singleValueMap = new LinkedHashMap<K,V>(this.targetMap.size());
|
||||
for (Entry<K, List<V>> entry : targetMap.entrySet()) {
|
||||
singleValueMap.put(entry.getKey(), entry.getValue().get(0));
|
||||
}
|
||||
return singleValueMap;
|
||||
}
|
||||
|
||||
|
||||
// Map implementation
|
||||
|
||||
public int size() {
|
||||
return this.targetMap.size();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return this.targetMap.isEmpty();
|
||||
}
|
||||
|
||||
public boolean containsKey(Object key) {
|
||||
return this.targetMap.containsKey(key);
|
||||
}
|
||||
|
||||
public boolean containsValue(Object value) {
|
||||
return this.targetMap.containsValue(value);
|
||||
}
|
||||
|
||||
public List<V> get(Object key) {
|
||||
return this.targetMap.get(key);
|
||||
}
|
||||
|
||||
public List<V> put(K key, List<V> value) {
|
||||
return this.targetMap.put(key, value);
|
||||
}
|
||||
|
||||
public List<V> remove(Object key) {
|
||||
return this.targetMap.remove(key);
|
||||
}
|
||||
|
||||
public void putAll(Map<? extends K, ? extends List<V>> m) {
|
||||
this.targetMap.putAll(m);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
this.targetMap.clear();
|
||||
}
|
||||
|
||||
public Set<K> keySet() {
|
||||
return this.targetMap.keySet();
|
||||
}
|
||||
|
||||
public Collection<List<V>> values() {
|
||||
return this.targetMap.values();
|
||||
}
|
||||
|
||||
public Set<Entry<K, List<V>>> entrySet() {
|
||||
return this.targetMap.entrySet();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
return this.targetMap.equals(obj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.targetMap.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.targetMap.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,153 +0,0 @@
|
||||
package com.luqj.util;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Created by lucheng on 2017/8/23.
|
||||
*/
|
||||
public class MapSortUtil {
|
||||
/**
|
||||
* 使用 Map按key进行排序
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
public static TreeMap<Double, Integer> sortMapByKey(Map<Double, Integer> map, String direction) {
|
||||
if (map == null || map.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
TreeMap<Double, Integer> sortMap = new TreeMap<Double, Integer>(
|
||||
new MapKeyComparator(direction));
|
||||
|
||||
sortMap.putAll(map);
|
||||
|
||||
return sortMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 使用 Map按value进行排序
|
||||
* @param oriMap
|
||||
* @param direction
|
||||
* @return
|
||||
*/
|
||||
public static Map<Double, Integer> sortMapByValue(Map<Double, Integer> oriMap, String direction) {
|
||||
if (oriMap == null || oriMap.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
Map<Double, Integer> sortedMap = new LinkedHashMap<Double, Integer>();
|
||||
List<Map.Entry<Double, Integer>> entryList = new ArrayList<Map.Entry<Double, Integer>>(
|
||||
oriMap.entrySet());
|
||||
Collections.sort(entryList, new MapValueComparator(direction));
|
||||
|
||||
Iterator<Map.Entry<Double, Integer>> iter = entryList.iterator();
|
||||
Map.Entry<Double, Integer> tmpEntry = null;
|
||||
while (iter.hasNext()) {
|
||||
tmpEntry = iter.next();
|
||||
sortedMap.put(tmpEntry.getKey(), tmpEntry.getValue());
|
||||
}
|
||||
return sortedMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回某个index对应的值
|
||||
*
|
||||
* @param map
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
public static Double getKeyByIndex(Map<Double, Integer> map, int index) {
|
||||
int sumCount = 0;
|
||||
Double result = null;
|
||||
for (Map.Entry<Double, Integer> newEntry : map.entrySet()) {
|
||||
Double number = newEntry.getKey();
|
||||
Integer count = newEntry.getValue();
|
||||
sumCount += count;
|
||||
if (index <= sumCount) {
|
||||
result = number;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static class MapKeyComparator implements Comparator<Double> {
|
||||
|
||||
private String direction;
|
||||
|
||||
public MapKeyComparator(String direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(Double o1, Double o2) {
|
||||
if ("DESC".equals(direction))
|
||||
return o2.compareTo(o1); // 降序
|
||||
else
|
||||
return o1.compareTo(o2);
|
||||
}
|
||||
|
||||
public String getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(String direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
}
|
||||
|
||||
public static class MapValueComparator implements Comparator<Map.Entry<Double, Integer>> {
|
||||
|
||||
private String direction;
|
||||
|
||||
public MapValueComparator(String direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compare(Map.Entry<Double, Integer> o1, Map.Entry<Double, Integer> o2) {
|
||||
if ("DESC".equals(direction))
|
||||
return o2.getValue().compareTo(o1.getValue()); // 降序
|
||||
else
|
||||
return o1.getValue().compareTo(o2.getValue());
|
||||
}
|
||||
|
||||
public String getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(String direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void main(String args[]) {
|
||||
Map<Double, Integer> map = new HashMap<>();
|
||||
map.put(100.21, 10);
|
||||
map.put(120.21, 20);
|
||||
map.put(104.21, 30);
|
||||
map.put(99.32, 70);
|
||||
map.put(114.22, 45);
|
||||
|
||||
TreeMap<Double, Integer> newMap = sortMapByKey(map, "DESC");
|
||||
System.out.println("after sortByKey:");
|
||||
for (Map.Entry<Double, Integer> entry : newMap.entrySet()) {
|
||||
System.out.println("key:" + entry.getKey() + ",value:" + entry.getValue());
|
||||
}
|
||||
System.out.println("lastKey:" + newMap.lastKey());
|
||||
System.out.println("lastEntry:" + newMap.lastEntry().getValue());
|
||||
|
||||
Map<Double, Integer> valueMap = sortMapByValue(map, "DESC");
|
||||
System.out.println("---------------------------");
|
||||
System.out.println("after sortByValue:");
|
||||
for (Map.Entry<Double, Integer> entry : valueMap.entrySet()) {
|
||||
System.out.println("key:" + entry.getKey() + ",value:" + entry.getValue());
|
||||
}
|
||||
System.out.println("firstKey:" + valueMap.entrySet().iterator().next().getKey());
|
||||
System.out.println("firstValue:" + valueMap.entrySet().iterator().next().getValue());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
/*
|
||||
* Copyright 2002-2009 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.luqj.util;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Extension of the {@code Map} interface that stores multiple values.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @since 3.0
|
||||
*/
|
||||
public interface MultiValueMap<K, V> extends Map<K, List<V>> {
|
||||
|
||||
/**
|
||||
* Return the first value for the given key.
|
||||
* @param key the key
|
||||
* @return the first value for the specified key, or <code>null</code>
|
||||
*/
|
||||
V getFirst(K key);
|
||||
|
||||
/**
|
||||
* Add the given single value to the current list of values for the given key.
|
||||
* @param key the key
|
||||
* @param value the value to be added
|
||||
*/
|
||||
void add(K key, V value);
|
||||
|
||||
/**
|
||||
* Set the given single value under the given key.
|
||||
* @param key the key
|
||||
* @param value the value to set
|
||||
*/
|
||||
void set(K key, V value);
|
||||
|
||||
/**
|
||||
* Set the given values under.
|
||||
* @param values the values.
|
||||
*/
|
||||
void setAll(Map<K, V> values);
|
||||
|
||||
/**
|
||||
* Returns the first values contained in this {@code MultiValueMap}.
|
||||
* @return a single value representation of this map
|
||||
*/
|
||||
Map<K, V> toSingleValueMap();
|
||||
|
||||
}
|
||||
@@ -1,460 +0,0 @@
|
||||
package com.luqj.util;
|
||||
|
||||
|
||||
|
||||
import com.luqj.util.assertion.Assert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.sql.Date;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public abstract class NumFormat {
|
||||
|
||||
/**
|
||||
* 设置double类型的精确度
|
||||
* @param scale 小数点后保留的位数
|
||||
* @param number 要精确度的值
|
||||
* @return
|
||||
*/
|
||||
public static double setScale(double number,int scale){
|
||||
if(Double.isNaN(number)){
|
||||
return 0;
|
||||
}
|
||||
if(Double.isInfinite(number)){
|
||||
return 0;
|
||||
}
|
||||
return new BigDecimal(number).setScale(scale,BigDecimal.ROUND_HALF_UP).doubleValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将NUMBER转换成String如果value为Null则返回空字符串
|
||||
* @param value
|
||||
* @return
|
||||
* @author:lwei
|
||||
*/
|
||||
public static String toString(Number value){
|
||||
return value == null ? "" : value.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 将Date转换成Long
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static long $Date(Object value) {
|
||||
if(value == null){
|
||||
return 0;
|
||||
}
|
||||
if(value instanceof Date) {
|
||||
return ((Date) value).getTime();
|
||||
}
|
||||
return $Long(value.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 将Timestamp转换成Long
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static long $Timestamp(Object value) {
|
||||
if(value == null){
|
||||
return 0;
|
||||
}
|
||||
if(value instanceof Timestamp) {
|
||||
return ((Timestamp) value).getTime();
|
||||
}
|
||||
return $Long(value.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 将类型转换为LONG
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static long $Long(Long value){
|
||||
return value != null ? value.longValue() : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将类型转换为LONG
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static long $Long(String value){
|
||||
return Validator.hasText(value) ? Long.valueOf(value.trim()) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将类型转换为LONG
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static long $Long(Object value){
|
||||
if(value == null){
|
||||
return 0;
|
||||
}
|
||||
if(value instanceof Long) {
|
||||
return (Long)value;
|
||||
}
|
||||
return $Long(value.toString());
|
||||
}
|
||||
|
||||
public static long $Long(BigDecimal value){
|
||||
return value != null ? value.longValue() : 0;
|
||||
}
|
||||
|
||||
public static long $Long(BigInteger value){
|
||||
return value != null ? value.longValue() : 0;
|
||||
}
|
||||
|
||||
|
||||
public static long $Long(Double value){
|
||||
return value != null ? value.longValue() : 0;
|
||||
}
|
||||
|
||||
public static int $Intger(Integer value){
|
||||
return value != null ? value.intValue() : 0;
|
||||
}
|
||||
|
||||
public static int $Intger(Double value){
|
||||
return value != null ? value.intValue() : 0;
|
||||
}
|
||||
|
||||
public static int $Intger(String value){
|
||||
return Validator.hasText(value) ? Integer.valueOf(value.trim()) : 0;
|
||||
}
|
||||
|
||||
public static int $Intger(Object value){
|
||||
if(value == null){
|
||||
return 0;
|
||||
}
|
||||
if(value instanceof Integer) {
|
||||
return (Integer)value;
|
||||
}
|
||||
return $Intger(value.toString());
|
||||
}
|
||||
|
||||
public static int $Intger(BigDecimal value){
|
||||
return value != null ? value.intValue() : 0;
|
||||
}
|
||||
|
||||
public static int $Intger(BigInteger value){
|
||||
return value != null ? value.intValue() : 0;
|
||||
}
|
||||
|
||||
|
||||
public static double $Double(Double value){
|
||||
return value != null ? value.doubleValue() : 0;
|
||||
}
|
||||
|
||||
public static double $Double(String value){
|
||||
return Validator.hasText(value) ? Double.valueOf(value.trim()) : 0;
|
||||
}
|
||||
|
||||
public static double $Double(BigDecimal value){
|
||||
return value != null ? value.doubleValue() : 0;
|
||||
}
|
||||
|
||||
public static double $Double(BigInteger value){
|
||||
return value != null ? value.doubleValue() : 0;
|
||||
}
|
||||
|
||||
public static double $Double(Object value){
|
||||
if(value == null){
|
||||
return 0;
|
||||
}
|
||||
if(value instanceof Double) {
|
||||
return (Double)value;
|
||||
}
|
||||
return $Double(value.toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static float $Float(Float value){
|
||||
return value != null ? value.floatValue() : 0;
|
||||
}
|
||||
|
||||
public static double $Float(String value){
|
||||
return Validator.hasText(value) ? Float.valueOf(value.trim()) : 0;
|
||||
}
|
||||
|
||||
public static double $Float(BigDecimal value){
|
||||
return value != null ? value.floatValue() : 0;
|
||||
}
|
||||
|
||||
public static double $Float(BigInteger value){
|
||||
return value != null ? value.floatValue() : 0;
|
||||
}
|
||||
|
||||
public static double $Float(Object value){
|
||||
if(value == null){
|
||||
return 0;
|
||||
}
|
||||
if(value instanceof Float) {
|
||||
return (Float)value;
|
||||
}
|
||||
return $Float(value.toString());
|
||||
}
|
||||
|
||||
public static short $Short(Short value){
|
||||
return value != null ? value.shortValue() : 0;
|
||||
}
|
||||
|
||||
public static short $Short(String value){
|
||||
return Validator.hasText(value) ? Short.valueOf(value.trim()) : 0;
|
||||
}
|
||||
|
||||
public static short $Short(BigDecimal value){
|
||||
return value != null ? value.shortValue() : 0;
|
||||
}
|
||||
|
||||
public static short $Short(BigInteger value){
|
||||
return value != null ? value.shortValue() : 0;
|
||||
}
|
||||
|
||||
public static short $Short(Object value){
|
||||
if(value == null){
|
||||
return 0;
|
||||
}
|
||||
if(value instanceof Short) {
|
||||
return (Short)value;
|
||||
}
|
||||
return $Short(value.toString());
|
||||
}
|
||||
|
||||
public static byte $Byte(Byte value){
|
||||
return value != null ? value.byteValue() : 0;
|
||||
}
|
||||
|
||||
public static byte $Byte(BigDecimal value){
|
||||
return value != null ? value.byteValue() : 0;
|
||||
}
|
||||
|
||||
public static byte $Byte(BigInteger value){
|
||||
return value != null ? value.byteValue() : 0;
|
||||
}
|
||||
|
||||
public static byte $Byte(String value){
|
||||
return Validator.hasText(value) ? Byte.valueOf(value.trim()) : 0;
|
||||
}
|
||||
|
||||
public static byte $Byte(Object value){
|
||||
return Validator.notNull(value) ? $Byte(value.toString()) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将指定的<code>Number</code>对象转换为指定的类型对象
|
||||
*
|
||||
* @param number the number to convert
|
||||
* @return 目标类型的对象
|
||||
*/
|
||||
public static Number convertNumber(Number number, Class targetClass)
|
||||
throws IllegalArgumentException {
|
||||
Assert.notNull(number, "Number对象不可以为null");
|
||||
Assert.notNull(targetClass, "Number目标类对象参数不可以为null");
|
||||
if (targetClass.isInstance(number)) {
|
||||
return number;
|
||||
}else if (targetClass.equals(Byte.class)) {
|
||||
long value = number.longValue();
|
||||
if (value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) {
|
||||
raiseOverflowException(number, targetClass);
|
||||
}
|
||||
return new Byte(number.byteValue());
|
||||
}else if (targetClass.equals(Short.class)) {
|
||||
long value = number.longValue();
|
||||
if (value < Short.MIN_VALUE || value > Short.MAX_VALUE) {
|
||||
raiseOverflowException(number, targetClass);
|
||||
}
|
||||
return new Short(number.shortValue());
|
||||
}else if (targetClass.equals(Integer.class)) {
|
||||
long value = number.longValue();
|
||||
if (value < Integer.MIN_VALUE || value > Integer.MAX_VALUE) {
|
||||
raiseOverflowException(number, targetClass);
|
||||
}
|
||||
return new Integer(number.intValue());
|
||||
}else if (targetClass.equals(Long.class)) {
|
||||
return new Long(number.longValue());
|
||||
}else if (targetClass.equals(Float.class)) {
|
||||
return new Float(number.floatValue());
|
||||
}else if (targetClass.equals(Double.class)) {
|
||||
return new Double(number.doubleValue());
|
||||
}else if (targetClass.equals(BigInteger.class)) {
|
||||
return BigInteger.valueOf(number.longValue());
|
||||
}else if (targetClass.equals(BigDecimal.class)) {
|
||||
// using BigDecimal(String) here, to avoid unpredictability of BigDecimal(double)
|
||||
// (see BigDecimal javadoc for details)
|
||||
return new BigDecimal(number.toString());
|
||||
}else {
|
||||
throw new IllegalArgumentException("无法将值为 [" + number + "] 类型为 [" +
|
||||
number.getClass().getName() + "] 的对象转换为 [" + targetClass.getName() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 如果指定的值超过了指定的类型的值所能容纳的最大或最小值将抛该异常
|
||||
* @param number 需要转换的值
|
||||
* @param targetClass 目标对象的类型
|
||||
*/
|
||||
private static void raiseOverflowException(Number number, Class targetClass) {
|
||||
throw new IllegalArgumentException("无法将值为 [" + number + "] 类型为 [" +
|
||||
number.getClass().getName() + "] 的对象转换为 [" + targetClass.getName() + "]: 值超过了目标对象的值得范围");
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串格式转换为指定的目标类的Number对象
|
||||
* @param text 需要转换的字符串
|
||||
* @param targetClass 目标类型
|
||||
* @return 目标类型的对象
|
||||
* @throws IllegalArgumentException 如果不支持指定的目标类型的话将抛该异常
|
||||
*/
|
||||
public static Number parseNumber(String text,Class targetClass) {
|
||||
Assert.notNull(text, "字符串参数不可以为null");
|
||||
Assert.notNull(targetClass, "Number目标类对象参数不可以为null");
|
||||
String trimmed = text.trim();
|
||||
if (targetClass.equals(Byte.class)) {
|
||||
return Byte.decode(trimmed);
|
||||
}
|
||||
else if (targetClass.equals(Short.class)) {
|
||||
return Short.decode(trimmed);
|
||||
}
|
||||
else if (targetClass.equals(Integer.class)) {
|
||||
return Integer.decode(trimmed);
|
||||
}
|
||||
else if (targetClass.equals(Long.class)) {
|
||||
return Long.decode(trimmed);
|
||||
}
|
||||
else if (targetClass.equals(Float.class)) {
|
||||
return Float.valueOf(trimmed);
|
||||
}
|
||||
else if (targetClass.equals(Double.class)) {
|
||||
return Double.valueOf(trimmed);
|
||||
}
|
||||
else if (targetClass.equals(BigInteger.class)) {
|
||||
return decodeBigInteger(trimmed);
|
||||
}
|
||||
else if (targetClass.equals(BigDecimal.class) || targetClass.equals(Number.class)) {
|
||||
return new BigDecimal(trimmed);
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException(
|
||||
"转换失败! String [" + text + "] to target class [" + targetClass.getName() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将字符串转换为<code>BigInteger</code>
|
||||
*
|
||||
* <p>指定的字符串如果是可以是负数表示或者十六进制,八进制表示
|
||||
* 负数表示前面加-,十六进制表示前面加0x 0X #,八进制表示前面加0<p>
|
||||
* @param value 要转换的字符串
|
||||
* @return 返回<code>BigInteger</code>对象
|
||||
* @see BigInteger#BigInteger(String, int)
|
||||
*/
|
||||
private static BigInteger decodeBigInteger(String value) {
|
||||
int radix = 10;//基数
|
||||
int index = 0;//串索引
|
||||
boolean negative = false;//判断是否为负数
|
||||
if (value.startsWith("-")) {
|
||||
negative = true;
|
||||
index++;
|
||||
}
|
||||
if (value.startsWith("0x", index) || value.startsWith("0X", index)) {
|
||||
index += 2;
|
||||
radix = 16;
|
||||
}
|
||||
else if (value.startsWith("#", index)) {
|
||||
index++;
|
||||
radix = 16;
|
||||
}
|
||||
else if (value.startsWith("0", index) && value.length() > 1 + index) {
|
||||
index++;
|
||||
radix = 8;
|
||||
}
|
||||
BigInteger result = new BigInteger(value.substring(index), radix);
|
||||
return (negative ? result.negate() : result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
public static String setString(double number){
|
||||
return number==0?" ":String.valueOf(number);
|
||||
}
|
||||
|
||||
/**
|
||||
* 两个Double类型相加后返回Double类型(如果其中一个为NULL则视为0)
|
||||
* @param value1
|
||||
* @param value2
|
||||
* @return
|
||||
*/
|
||||
public static Double addValue(Double value1,Double value2){
|
||||
return $Double(value1)+$Double(value2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 两个Long类型相加后返回Long类型(如果其中一个为NULL则视为0)
|
||||
* @param value1
|
||||
* @param value2
|
||||
* @return
|
||||
*/
|
||||
public static Long addValue(Long value1,Long value2){
|
||||
return $Long(value1)+$Long(value2);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将double类型的数据改为非科学记数法表示
|
||||
* @param unFormatedNumber
|
||||
* @return
|
||||
*/
|
||||
public static String formateNonScience(double unFormatedNumber){
|
||||
DecimalFormat format = new DecimalFormat("#0.000");
|
||||
return format.format(unFormatedNumber);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static Number parseNum(Class targetClass,Number v){
|
||||
|
||||
if(targetClass.equals(Byte.class)){
|
||||
return Byte.valueOf(v.byteValue());
|
||||
}
|
||||
else if (targetClass.equals(Short.class)) {
|
||||
return Short.valueOf(v.shortValue());
|
||||
}
|
||||
else if (targetClass.equals(Integer.class)) {
|
||||
return Integer.valueOf(v.intValue());
|
||||
}
|
||||
else if (targetClass.equals(Long.class)) {
|
||||
return Long.valueOf(v.longValue());
|
||||
}
|
||||
else if (targetClass.equals(Float.class)) {
|
||||
return Float.valueOf(0);
|
||||
}
|
||||
else if (targetClass.equals(Double.class)) {
|
||||
return Double.valueOf(v.doubleValue());
|
||||
}
|
||||
else if (targetClass.equals(BigInteger.class)) {
|
||||
return new BigInteger(String.valueOf(v.longValue()));
|
||||
}
|
||||
else if (targetClass.equals(BigDecimal.class) || targetClass.equals(Number.class)) {
|
||||
return new BigDecimal(v.doubleValue());
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException(
|
||||
"类型[" + targetClass.getName() + "],无法初始化0值");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,129 +0,0 @@
|
||||
package com.luqj.util;
|
||||
|
||||
import com.google.common.util.concurrent.ListenableFuture;
|
||||
import com.google.common.util.concurrent.SettableFuture;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.file.Files;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class RequestHelper {
|
||||
private static final String DEFAULT_CONTENT_TYPE = "application/octet-stream";
|
||||
public static Map<String, String> fileToContentTypeMap = new HashMap<String, String>();
|
||||
static {
|
||||
fileToContentTypeMap.put(".atom", "application/atom+xml");
|
||||
fileToContentTypeMap.put(".rss", "application/rss+xml");
|
||||
fileToContentTypeMap.put(".xml", "application/xml");
|
||||
fileToContentTypeMap.put(".csv", "text/csv");
|
||||
fileToContentTypeMap.put(".txt", "text/plain");
|
||||
}
|
||||
|
||||
public static String getContentTypeForFile(File file) {
|
||||
String contentType = fileToContentTypeMap.get(getFileExtension(file));
|
||||
|
||||
if (contentType != null) return contentType;
|
||||
|
||||
try {
|
||||
contentType = Files.probeContentType(file.toPath());
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
|
||||
return contentType != null ? contentType : DEFAULT_CONTENT_TYPE;
|
||||
}
|
||||
|
||||
private static String getFileExtension(File file) {
|
||||
String fileName = file.getName();
|
||||
int index = fileName.lastIndexOf('.');
|
||||
if (index == -1) return "";
|
||||
return fileName.substring(index, fileName.length());
|
||||
}
|
||||
private static String convertToString(Object input) {
|
||||
if (input == null) {
|
||||
return "null";
|
||||
} else if (input instanceof Map) {
|
||||
Gson gson = new GsonBuilder()
|
||||
.excludeFieldsWithModifiers(Modifier.STATIC)
|
||||
.excludeFieldsWithModifiers(Modifier.PROTECTED)
|
||||
.disableHtmlEscaping()
|
||||
.create();
|
||||
return gson.toJson((Map) input);
|
||||
} else if (input instanceof List) {
|
||||
Gson gson = new GsonBuilder()
|
||||
.excludeFieldsWithModifiers(Modifier.STATIC)
|
||||
.excludeFieldsWithModifiers(Modifier.PROTECTED)
|
||||
.disableHtmlEscaping()
|
||||
.create();
|
||||
return gson.toJson((List) input);
|
||||
} else {
|
||||
return input.toString();
|
||||
}
|
||||
}
|
||||
public static int getContentLength(Map<String, Object> allParams, String boundary) throws IOException {
|
||||
int contentLength = 0;
|
||||
for (Map.Entry entry : allParams.entrySet()) {
|
||||
contentLength += ("--" + boundary + "\r\n").length();
|
||||
if (entry.getValue() instanceof File) {
|
||||
File file = (File) entry.getValue();
|
||||
String contentType = getContentTypeForFile(file);
|
||||
contentLength += getLengthAndLog( "Content-Disposition: form-data; name=\"" + entry.getKey() + "\"; filename=\"" + file.getName() + "\"\r\n");
|
||||
if (contentType != null) {
|
||||
contentLength += getLengthAndLog( "Content-Type: " + contentType + "\r\n");
|
||||
}
|
||||
contentLength += getLengthAndLog( "\r\n");
|
||||
contentLength += file.length();
|
||||
contentLength += getLengthAndLog( "\r\n");
|
||||
} else if (entry.getValue() instanceof byte[]) {
|
||||
byte[] bytes = (byte[]) entry.getValue();
|
||||
contentLength += getLengthAndLog( "Content-Disposition: form-data; name=\"" + entry.getKey() + "\"; filename=\"" + "chunkfile" + "\"\r\n");
|
||||
contentLength += bytes.length;
|
||||
contentLength += getLengthAndLog( "\r\n");
|
||||
} else {
|
||||
contentLength += getLengthAndLog( "Content-Disposition: form-data; name=\"" + entry.getKey() + "\"\r\n\r\n");
|
||||
contentLength += getLengthAndLog( convertToString(entry.getValue()));
|
||||
contentLength += getLengthAndLog( "\r\n");
|
||||
}
|
||||
}
|
||||
contentLength += getLengthAndLog( "--" + boundary + "--\r\n");
|
||||
return contentLength;
|
||||
}
|
||||
|
||||
private static int getLengthAndLog(String input) throws IOException {
|
||||
return input.getBytes("UTF-8").length;
|
||||
}
|
||||
|
||||
public static String constructUrlString(String apiUrl, Map<String, Object> allParams) throws IOException {
|
||||
StringBuilder urlString = new StringBuilder(apiUrl);
|
||||
boolean firstEntry = true;
|
||||
for (Map.Entry entry : allParams.entrySet()) {
|
||||
urlString.append((firstEntry ? "?" : "&") + URLEncoder.encode(entry.getKey().toString(), "UTF-8") + "=" + URLEncoder.encode(convertToString(entry.getValue()), "UTF-8"));
|
||||
firstEntry = false;
|
||||
}
|
||||
return urlString.toString();
|
||||
}
|
||||
|
||||
public static ListenableFuture<ResponseWrapper> invoke(okhttp3.OkHttpClient client, okhttp3.Request request) {
|
||||
final SettableFuture<ResponseWrapper> future = SettableFuture.create();
|
||||
client.newCall(request).enqueue(
|
||||
new okhttp3.Callback() {
|
||||
@Override
|
||||
public void onFailure(final okhttp3.Call call, IOException e) {
|
||||
future.setException(
|
||||
new Exception(e)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(okhttp3.Call call, final okhttp3.Response response) throws IOException {
|
||||
future.set(new ResponseWrapper(response.body().string(), convertToString(response.headers())));
|
||||
}
|
||||
});
|
||||
return future;
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.luqj.util;
|
||||
|
||||
public class ResponseWrapper {
|
||||
private String body;
|
||||
private String header;
|
||||
|
||||
public ResponseWrapper(String body, String header) {
|
||||
this.body = body;
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return this.body;
|
||||
}
|
||||
|
||||
public String getHeader() {
|
||||
return this.header;
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
package com.luqj.util;
|
||||
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.SortedMap;
|
||||
import java.util.TreeMap;
|
||||
|
||||
public class SignatureUtil {
|
||||
|
||||
/**
|
||||
* 生成签名
|
||||
* @param params 业务参数(不包含signature)
|
||||
* @param apiToken API认证密钥(例如 epusdt_password_xasddawqe)
|
||||
* @return 生成的MD5签名(32位小写)
|
||||
*/
|
||||
public static String generateSignature(Map<String, Object> params, String apiToken) {
|
||||
// 1. 按 ASCII 排序
|
||||
SortedMap<String, Object> sortedParams = new TreeMap<>(params);
|
||||
|
||||
// 2. 拼接成 key=value&key=value
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Map.Entry<String, Object> entry : sortedParams.entrySet()) {
|
||||
// if(entry.getValue() instanceof Double){
|
||||
// Double val = (Double) entry.getValue();
|
||||
// BigDecimal amount = new BigDecimal(val);
|
||||
// if (entry.getValue() != null) {
|
||||
// sb.append(entry.getKey()).append("=").append( amount.setScale(2, RoundingMode.DOWN).toPlainString()).append("&");
|
||||
// }
|
||||
// }else if(entry.getValue() instanceof BigDecimal){
|
||||
// BigDecimal amount = (BigDecimal) entry.getValue();
|
||||
// if (entry.getValue() != null) {
|
||||
// sb.append(entry.getKey()).append("=").append( amount.setScale(2, RoundingMode.DOWN).toPlainString()).append("&");
|
||||
// }
|
||||
// }else {
|
||||
// if (entry.getValue() != null && !entry.getValue().toString().isEmpty()) {
|
||||
// sb.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
|
||||
// }
|
||||
// }
|
||||
if (entry.getValue() != null && !entry.getValue().toString().isEmpty()) {
|
||||
sb.append(entry.getKey()).append("=").append(entry.getValue()).append("&");
|
||||
}
|
||||
}
|
||||
|
||||
// 去掉最后一个 & 符号
|
||||
sb.setLength(sb.length() - 1);
|
||||
|
||||
// 3. 拼接密钥
|
||||
sb.append(apiToken); // 注意:不是加 &,是直接拼接密钥!!!
|
||||
|
||||
// 4. MD5加密
|
||||
return md5(sb.toString()).toLowerCase();
|
||||
}
|
||||
|
||||
// MD5算法实现
|
||||
private static String md5(String text) {
|
||||
try {
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
byte[] digest = md.digest(text.getBytes("UTF-8"));
|
||||
StringBuilder hexString = new StringBuilder();
|
||||
for (byte b : digest) {
|
||||
hexString.append(String.format("%02x", b & 0xff));
|
||||
}
|
||||
return hexString.toString();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("MD5 error: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
// 测试方法
|
||||
public static void main(String[] args) throws Exception {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("order_id", System.currentTimeMillis()+"");
|
||||
params.put("app_id", "1");
|
||||
params.put("amount", "64.01");
|
||||
params.put("notify_url", "http://127.0.0.1:5005/transfer/trc/notify");
|
||||
params.put("redirect_url", "http://example.com/redirect"); //pay/checkout-counter/xxx 支付成功后得回调地址
|
||||
|
||||
String token = "lqj";
|
||||
String signature = generateSignature(params, token);
|
||||
//c50576484554b282f6c2b53097217464
|
||||
System.out.println("Signature = " + signature);
|
||||
HttpHelper httpHelper = new HttpHelper();
|
||||
HashMap<String, Object> headers = new HashMap<>();
|
||||
// headers.put("Content-Type", "application/json");
|
||||
params.put("signature", signature);
|
||||
String result =httpHelper.playLoad("post","https://yougc.com/usdt/api/v1/order/create-transaction"
|
||||
,headers,params,"application/json","utf-8");
|
||||
System.out.println(result);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,248 +0,0 @@
|
||||
/**
|
||||
* 版权所有:厦门市巨龙软件工程有限公司
|
||||
* Copyright 2010 Xiamen Dragon Software Eng. Co. Ltd.
|
||||
* All right reserved.
|
||||
*====================================================
|
||||
* 文件名称: Assert.java
|
||||
* 修订记录:
|
||||
* No 日期 作者(操作:具体内容)
|
||||
* 1. 2010-8-6 李炜(创建:创建文件)
|
||||
*====================================================
|
||||
* 类描述:(说明未实现或其它不应生成javadoc的内容)
|
||||
*
|
||||
*/
|
||||
package com.luqj.util;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*<pre><b><font color="blue">Assert</font></b></pre>
|
||||
*
|
||||
*<pre><b> --描述说明--</b></pre>
|
||||
* <pre></pre>
|
||||
* <pre>
|
||||
* <b>--样例--</b>
|
||||
* Assert obj = new Assert();
|
||||
* obj.method();
|
||||
* </pre>
|
||||
* JDK版本:JDK1.4
|
||||
* @author <b>李炜</b>
|
||||
*/
|
||||
public abstract class Validator {
|
||||
/**
|
||||
* 判断表达式是否为true
|
||||
* @param expression 要判断的表达式
|
||||
*/
|
||||
public static boolean isTrue(boolean expression) {
|
||||
return expression;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断表达式是否为0
|
||||
* @param expression 要判断的表达式
|
||||
*/
|
||||
public static boolean isZero(int num) {
|
||||
return num == 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断表达式是否为非空
|
||||
* @param expression 要判断的表达式
|
||||
*/
|
||||
public static boolean notZero(int num, String message) {
|
||||
return num == 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 判断表达式是否为空
|
||||
* @param expression 要判断的表达式
|
||||
*/
|
||||
public static boolean isNull(Object object) {
|
||||
return object == null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 判断表达式是否为非空
|
||||
* @param expression 要判断的表达式
|
||||
*/
|
||||
public static boolean notNull(Object object) {
|
||||
return object != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断字符串长度是否大于指定长度
|
||||
* @param text 字符串
|
||||
* @param size 指定长度
|
||||
*/
|
||||
public static boolean gtLength(String text,int size){
|
||||
return notNull(text) && text.length() > size;
|
||||
}
|
||||
|
||||
|
||||
public static boolean gtLength(Collection collection,int size){
|
||||
return notNull(collection) && collection.size() > size;
|
||||
}
|
||||
|
||||
public static boolean gtLength(Map collection,int size){
|
||||
return notNull(collection) && collection.size() > size;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断字符串长度是否小于指定长度
|
||||
* @param text 字符串
|
||||
* @param size 指定长度
|
||||
*/
|
||||
public static boolean ltLength(String text,int size){
|
||||
return notNull(text) && text.length() < size;
|
||||
}
|
||||
|
||||
public static boolean ltLength(Collection collection,int size){
|
||||
return notNull(collection) && collection.size()< size;
|
||||
}
|
||||
|
||||
public static boolean ltLength(Map collection,int size){
|
||||
return notNull(collection) && collection.size()< size;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断text是否为有内容字符串
|
||||
* @param text 要判断的字符串
|
||||
*/
|
||||
public static boolean hasLength(String text) {
|
||||
return notNull(text) && gtLength(text, 0);
|
||||
}
|
||||
|
||||
public static boolean hasLength(Object[] arrays){
|
||||
return notNull(arrays) && arrays.length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断text是否为有内容字符串
|
||||
* @param text 要判断的字符串
|
||||
*/
|
||||
public static boolean hasLength(StringBuffer text) {
|
||||
return notNull(text) && gtLength(text.toString(), 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断text是否为有内容,如果都是空白字符也将抛异常
|
||||
* @param text 要判断的字符串
|
||||
*/
|
||||
public static boolean hasText(String text) {
|
||||
return notNull(text) && gtLength(text.trim(), 0);
|
||||
}
|
||||
|
||||
public static boolean hasText(StringBuffer sb){
|
||||
return notNull(sb) && gtLength(sb.toString().trim(), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断数组是否大于指定长度
|
||||
* @param array 数组
|
||||
* @param size 长度
|
||||
*/
|
||||
public static boolean gtSize(Object[] array,int size){
|
||||
return notNull(array) && array.length > size;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断数组是否小于指定长度
|
||||
* @param array 数组
|
||||
* @param size 长度
|
||||
*/
|
||||
public static boolean ltSize(Object[] array,int size){
|
||||
return notNull(array) && array.length < size;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断数组是否为空数组
|
||||
* @param array 要判断的数租
|
||||
*/
|
||||
public static boolean notEmpty(Object[] array) {
|
||||
return notNull(array) && gtSize(array, 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断集合是否为空集合对象
|
||||
* @param array 要判断的集合对象
|
||||
*/
|
||||
public static boolean notEmpty(Collection collection) {
|
||||
return notNull(collection) && !collection.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 判断Map是否为空对象,有默认消息
|
||||
* @param array 要判断的Map
|
||||
* @throws IllegalArgumentException 如果是空集合对象或者null
|
||||
*/
|
||||
public static boolean notEmpty(Map map) {
|
||||
return notNull(map) && !map.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*判断指定的 Object 是否与此 type 所表示的对象赋值兼容
|
||||
* @param 用于检查的Class对象
|
||||
* @param obj 用于检查的对象
|
||||
*/
|
||||
public static boolean isInstanceOf(Class type, Object obj, String message) {
|
||||
return notNull(type) && type.isInstance(obj);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断两个类型是否相同
|
||||
* @param type1
|
||||
* @param type2
|
||||
*/
|
||||
public static boolean isSameType(Class type1,Class type2,String message){
|
||||
return notNull(type1) && notNull(type2) && type1.equals(type2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断一个class对象调用newInstance,是否成功
|
||||
* @param type
|
||||
*/
|
||||
public static boolean isNewInstanceOf(Class type){
|
||||
if(notNull(type)){
|
||||
try {
|
||||
type.newInstance();
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断superType.isAssignableFrom(subType)是否为true
|
||||
* @param superType 超类
|
||||
* @param subType 子类
|
||||
*/
|
||||
public static boolean isAssignable(Class superType, Class subType) {
|
||||
return notNull(superType) && notNull(subType) && superType.isAssignableFrom(subType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,396 +0,0 @@
|
||||
/**
|
||||
* 版权所有:厦门市巨龙软件工程有限公司
|
||||
* Copyright 2010 Xiamen Dragon Software Eng. Co. Ltd.
|
||||
* All right reserved.
|
||||
*====================================================
|
||||
* 文件名称: Assert.java
|
||||
* 修订记录:
|
||||
* No 日期 作者(操作:具体内容)
|
||||
* 1. 2010-8-6 李炜(创建:创建文件)
|
||||
*====================================================
|
||||
* 类描述:(说明未实现或其它不应生成javadoc的内容)
|
||||
*
|
||||
*/
|
||||
package com.luqj.util.assertion;
|
||||
|
||||
|
||||
import com.luqj.util.log.LogUtil;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*<pre><b><font color="blue">Assert</font></b></pre>
|
||||
*
|
||||
*<pre><b> --描述说明--</b></pre>
|
||||
* <pre></pre>
|
||||
* <pre>
|
||||
* <b>--样例--</b>
|
||||
* Assert obj = new Assert();
|
||||
* obj.method();
|
||||
* </pre>
|
||||
* JDK版本:JDK1.4
|
||||
* @author <b>李炜</b>
|
||||
*/
|
||||
public abstract class Assert {
|
||||
/**
|
||||
* 断言表达式是否为true
|
||||
* @param expression 要断言的表达式
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果不是true
|
||||
*/
|
||||
public static void isTrue(boolean expression, String message) {
|
||||
|
||||
if (!expression) {
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言表达式是否为true,有默认消息
|
||||
* @param expression 要断言的表达式
|
||||
* @throws IllegalArgumentException 如果不是true
|
||||
*/
|
||||
public static void isTrue(boolean expression) {
|
||||
isTrue(expression, "[断言失败] - 参数必须是 true");
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言表达式是否为0
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果不是空
|
||||
*/
|
||||
public static void isZero(long num, String message) {
|
||||
if (num != 0) {
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言表达式是否为空,有默认消息
|
||||
* @throws IllegalArgumentException 如果不是空
|
||||
*/
|
||||
public static void isZero(long num) {
|
||||
isZero(num, "[断言失败] - 参数值必须是0");
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言表达式是否为非空
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果不是非空
|
||||
*/
|
||||
public static void notZero(long num, String message) {
|
||||
if (num == 0) {
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言表达式是否为非空,有默认消息
|
||||
* @throws IllegalArgumentException 如果不是非空
|
||||
*/
|
||||
public static void notZero(long num) {
|
||||
notZero(num, "[断言失败] - 参数必须非0");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 断言表达式是否为空
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果不是空
|
||||
*/
|
||||
public static void isNull(Object object, String message) {
|
||||
if (object != null) {
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言表达式是否为空,有默认消息
|
||||
* @throws IllegalArgumentException 如果不是空
|
||||
*/
|
||||
public static void isNull(Object object) {
|
||||
isNull(object, "[断言失败] - 参数必须是 null");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 断言表达式是否为非空
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果不是非空
|
||||
*/
|
||||
public static void notNull(Object object, String message) {
|
||||
if (object == null) {
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言表达式是否为非空,有默认消息
|
||||
* @throws IllegalArgumentException 如果不是非空
|
||||
*/
|
||||
public static void notNull(Object object) {
|
||||
notNull(object, "[断言失败] - 参数必须是非空对象");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 断言表达式是否为非空,有默认消息
|
||||
* @throws IllegalArgumentException 如果不是非空
|
||||
*/
|
||||
public static void notNull(Object... objects) {
|
||||
for (int i = 0; i < objects.length; i++) {
|
||||
notNull(objects[i], "[断言失败] - 参数["+i+"]必须是非空对象");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言text是否为有内容字符串
|
||||
* @param text 要断言的字符串
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果是空串或null对象
|
||||
*/
|
||||
public static void hasLength(String text, String message) {
|
||||
if (text == null || text.length() == 0) {
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言text是否为有内容字符串,有默认消息
|
||||
* @param text 要断言的字符串
|
||||
* @throws IllegalArgumentException 如果是空串或null对象
|
||||
*/
|
||||
public static void hasLength(String text) {
|
||||
hasLength(text,
|
||||
"[断言失败] - 参数必须是非空字符串");
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言text是否为有内容,如果都是空白字符也将抛异常
|
||||
* @param text 要断言的字符串
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果是空串或null对象,或所有内容为空白字符
|
||||
*/
|
||||
public static void hasText(String text, String message) {
|
||||
if (text == null || text.trim().length() == 0) {
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言text是否为有内容,如果都是空白字符也将抛异常,有默认消息
|
||||
* @param text 要断言的字符串
|
||||
* @throws IllegalArgumentException 如果是空串或null对象,或所有内容为空白字符
|
||||
*/
|
||||
public static void hasText(String text) {
|
||||
hasText(text,
|
||||
"[断言失败] - text必须是有内容的,有内容指不是全部为空白字符的字符串");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 断言数组是否为空数组
|
||||
* @param array 要断言的数租
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果是空数组或者null
|
||||
*/
|
||||
public static void notEmpty(Object[] array, String message) {
|
||||
if (array == null || array.length == 0) {
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言数组是否为空数组,有默认消息
|
||||
* @param array 要断言的数租
|
||||
* @throws IllegalArgumentException 如果是空数组或者null
|
||||
*/
|
||||
public static void notEmpty(Object[] array) {
|
||||
notEmpty(array, "[断言失败] - 参数数组必须是非空数组");
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言集合是否为空集合对象
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果是空集合对象或者null
|
||||
*/
|
||||
public static void notEmpty(Collection collection, String message) {
|
||||
if (collection == null || collection.isEmpty()) {
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言集合是否为空集合对象,有默认消息
|
||||
* @throws IllegalArgumentException 如果是空集合对象或者null
|
||||
*/
|
||||
public static void notEmpty(Collection collection) {
|
||||
notEmpty(collection,
|
||||
"[断言失败] - 集合参数必须是有内容的");
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言Map是否为空对象
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果是空集合对象或者null
|
||||
*/
|
||||
public static void notEmpty(Map map, String message) {
|
||||
if (map == null || map.isEmpty()) {
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言Map是否为空对象,有默认消息
|
||||
* @throws IllegalArgumentException 如果是空集合对象或者null
|
||||
*/
|
||||
public static void notEmpty(Map map) {
|
||||
notEmpty(map, "[断言失败] - Map参数必须是有内容的");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*断言指定的 Object 是否与此 type 所表示的对象赋值兼容
|
||||
* @param obj 用于检查的对象
|
||||
* @throws IllegalArgumentException 如果不兼容
|
||||
*/
|
||||
public static void isInstanceOf(Class clazz, Object obj) {
|
||||
isInstanceOf(clazz, obj, "");
|
||||
}
|
||||
|
||||
/**
|
||||
*断言指定的 Object 是否与此 type 所表示的对象赋值兼容
|
||||
* @param obj 用于检查的对象
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果不兼容
|
||||
*/
|
||||
public static void isInstanceOf(Class type, Object obj, String message) {
|
||||
notNull(type, "类型对象不可为空");
|
||||
if (!type.isInstance(obj)) {
|
||||
throw new IllegalArgumentException(message +
|
||||
"Object of class [" + (obj != null ? obj.getClass().getName() : "null") +
|
||||
"] must be an instance of " + type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 断言一个class对象调用newInstance,是否成功
|
||||
* @param type
|
||||
* @throws IllegalArgumentException 如果不成功
|
||||
*/
|
||||
public static void isNewInstanceOf(Class type){
|
||||
isNewInstanceOf(type,"");
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言两个类型是否相同
|
||||
* @param type1
|
||||
* @param type2
|
||||
*/
|
||||
public static void isSameType(Class type1,Class type2,String message){
|
||||
notNull(type1,"类型对象不可为空");
|
||||
notNull(type2,"类型对象不可为空");
|
||||
if(!type1.equals(type2)){
|
||||
throw new IllegalArgumentException(message);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言两个类型是否相同
|
||||
* @param type1
|
||||
* @param type2
|
||||
*/
|
||||
public static void isSameType(Class type1,Class type2){
|
||||
isSameType(type1, type2, "必须是相同类型");
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言一个class对象调用newInstance,是否成功
|
||||
* @param type
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果不成功
|
||||
*/
|
||||
public static void isNewInstanceOf(Class type,String message){
|
||||
notNull(type,"类型对象不可为空");
|
||||
try {
|
||||
type.newInstance();
|
||||
} catch (InstantiationException e) {
|
||||
|
||||
throw new IllegalArgumentException(message +
|
||||
"Class [" + type +"] must be can new instance ");
|
||||
} catch (IllegalAccessException e) {
|
||||
|
||||
throw new IllegalArgumentException(message +
|
||||
"Class [" + type +"] must be can new instance ");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言superType.isAssignableFrom(subType)是否为true
|
||||
* @param superType 超类
|
||||
* @param subType 子类
|
||||
* @throws IllegalArgumentException 如果调用该方法为false
|
||||
*/
|
||||
public static void isAssignable(Class superType, Class subType) {
|
||||
isAssignable(superType, subType, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 断言superType.isAssignableFrom(subType)是否为true
|
||||
* @param superType 超类
|
||||
* @param subType 子类
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalArgumentException 如果调用该方法为false
|
||||
*/
|
||||
public static void isAssignable(Class superType, Class subType, String message) {
|
||||
notNull(superType, "超类的类对象必须为非空");
|
||||
if (subType == null || !superType.isAssignableFrom(subType)) {
|
||||
throw new IllegalArgumentException(message + subType + " is not assignable to " + superType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 断言一个对象所属状态值是否为true
|
||||
* @param expression 要断言的状态表达式
|
||||
* @param message 抛异常以后的消息
|
||||
* @throws IllegalStateException 如果表达式为false
|
||||
*/
|
||||
public static void state(boolean expression, String message) {
|
||||
if (!expression) {
|
||||
throw new IllegalStateException(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 断言一个对象所属状态值是否为true,有默认消息
|
||||
* @param expression 要断言的状态表达式
|
||||
* @throws IllegalStateException 如果表达式为false
|
||||
*/
|
||||
public static void state(boolean expression) {
|
||||
state(expression, "[断言失败] - 状态表达式必须式true");
|
||||
}
|
||||
|
||||
public static void logic(boolean expression,String message){
|
||||
if (!expression) {
|
||||
throw new IllegalLogicException(message);
|
||||
}
|
||||
}
|
||||
|
||||
public static void logic(boolean expression){
|
||||
logic(expression, "[断言失败] - 逻辑表达式必须是true");
|
||||
}
|
||||
|
||||
public static void fail(String message){
|
||||
throw new IllegalLogicException(message);
|
||||
}
|
||||
|
||||
public static void fail(String message,Throwable e){
|
||||
throw new IllegalLogicException(LogUtil.exceptionMsg(message,e),e);
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.luqj.util.assertion;
|
||||
|
||||
public class IllegalLogicException extends RuntimeException {
|
||||
|
||||
public IllegalLogicException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public IllegalLogicException(String arg0, Throwable arg1) {
|
||||
super(arg0, arg1);
|
||||
}
|
||||
|
||||
public IllegalLogicException(String arg0) {
|
||||
super(arg0);
|
||||
}
|
||||
|
||||
public IllegalLogicException(Throwable arg0) {
|
||||
super(arg0);
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,174 +0,0 @@
|
||||
package com.luqj.util.log;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
public abstract class LogUtil {
|
||||
|
||||
private static String getStackTrace(Throwable t) {
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
try {
|
||||
t.printStackTrace(pw);
|
||||
return sw.toString();
|
||||
} finally {
|
||||
pw.close();
|
||||
}
|
||||
}
|
||||
|
||||
public static String exceptionMsg(String msg, Throwable e) {
|
||||
return msg + ",异常消息[" + getStackTrace(e) + "]";
|
||||
}
|
||||
|
||||
public static String exceptionSimpleMsg(String msg, Throwable e) {
|
||||
return msg + ",异常消息[" + e.getLocalizedMessage() + "]";
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计算程序运行的时钟
|
||||
*
|
||||
* @return clock
|
||||
*/
|
||||
public static Clock getClock() {
|
||||
return new Clock() {
|
||||
/**开始时间*/
|
||||
private long startTime = System.nanoTime();
|
||||
|
||||
/**
|
||||
* 消耗时间[毫秒]
|
||||
* @return 消耗时间
|
||||
*/
|
||||
public long consume() {
|
||||
return LogUtil.consume(startTime, System.nanoTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
public long getEnd() {
|
||||
return System.nanoTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
public long getStart() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public long consumeSecond() {
|
||||
return LogUtil.consumeSecond(startTime, System.nanoTime());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 消耗时间[纳秒]
|
||||
*
|
||||
* @return 消耗时间 秒
|
||||
*/
|
||||
public static long consumeNano(long startTime, long endTime) {
|
||||
return (endTime - startTime) / 1000000000 + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗时间[微秒]
|
||||
*
|
||||
* @return 消耗时间 秒
|
||||
*/
|
||||
public static long consume(long startTime, long endTime) {
|
||||
return (endTime - startTime) / 1000000 + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 消耗时间[耗秒]
|
||||
*
|
||||
* @return 消耗时间 秒
|
||||
*/
|
||||
public static long consumeSecond(long startTime, long endTime) {
|
||||
return (endTime - startTime) / 1000 + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* getRootCause
|
||||
* 获取异常的原始异常,用于反馈异常的真实原因。
|
||||
*
|
||||
* @param ex 异常信息
|
||||
* @return 原始异常,最底层异常
|
||||
* @author 林小松
|
||||
*/
|
||||
public static Throwable getRootCause(Throwable ex) {
|
||||
Throwable cause = ex;
|
||||
while (cause.getCause() != null) {
|
||||
cause = cause.getCause();
|
||||
}
|
||||
return cause;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归寻找根异常异常信息
|
||||
*
|
||||
* @param ex 异常
|
||||
* @return 异常信息
|
||||
*/
|
||||
public static String traceRootExceptionInfo(Throwable ex) {
|
||||
Throwable cause = ex;
|
||||
while (cause.getCause() != null) {
|
||||
cause = cause.getCause();
|
||||
}
|
||||
return cause.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归寻找引起异常的所有异常信息
|
||||
*
|
||||
* @param ex 异常
|
||||
* @return 异常信息
|
||||
*/
|
||||
public static String tarceExceptionInfo(Throwable ex) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
Throwable cause = ex;
|
||||
sb.insert(0, cause);
|
||||
while (cause.getCause() != null) {
|
||||
cause = cause.getCause();
|
||||
sb.insert(0, cause.toString());
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static interface Clock {
|
||||
|
||||
|
||||
/**
|
||||
* 返回程序消耗的毫秒数
|
||||
*
|
||||
* @return 消耗毫秒数
|
||||
*/
|
||||
long consume();
|
||||
|
||||
/**
|
||||
* 返回程序消耗的秒数
|
||||
*
|
||||
* @return 消耗秒数
|
||||
*/
|
||||
long consumeSecond();
|
||||
|
||||
/**
|
||||
* 返回开始时间
|
||||
*
|
||||
* @return 开始时间
|
||||
* @author:lwei
|
||||
*/
|
||||
long getStart();
|
||||
|
||||
/**
|
||||
* 返回结束时间
|
||||
*
|
||||
* @return 结束时间
|
||||
* @author:lwei
|
||||
*/
|
||||
long getEnd();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.luqj.util.parse;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 符号集
|
||||
* @author chenzm
|
||||
*/
|
||||
public class SymbolSet {
|
||||
/**等号*/
|
||||
public final static String SYMBOL_EQ = "=";
|
||||
|
||||
/**空字符*/
|
||||
public final static Character SYMBOL_NULL = ' ';
|
||||
|
||||
/**逗号*/
|
||||
public final static String SYMBOL_COMMA = ",";
|
||||
|
||||
/**双引号*/
|
||||
public final static String SYMBOL_DQM = "\"";
|
||||
|
||||
/**单引号*/
|
||||
public final static String SYMBOL_SQM = "\'";
|
||||
|
||||
public static String chr2Str(char chr) {
|
||||
return "" + chr;
|
||||
}
|
||||
|
||||
static boolean isInSymbol(Map<String, List<Integer>> symBolPos, int charPos, String ...symbols){
|
||||
for(String symbol : symbols) {
|
||||
if(!symBolPos.containsKey(symbol)) {
|
||||
return false;
|
||||
}
|
||||
List<Integer> posInfo = symBolPos.get(symbol);
|
||||
for(int i = 0; i < posInfo.size(); ) {
|
||||
if(charPos > posInfo.get(i) && charPos < posInfo.get(i + 1)) {
|
||||
return true;
|
||||
}
|
||||
i+=2;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static Map<String, List<Integer>> getSymBolPos(String exp) {
|
||||
Map<String, List<Integer>> map = new HashMap<String, List<Integer>>();
|
||||
String[] symbols = new String[]{
|
||||
SYMBOL_SQM, SYMBOL_DQM
|
||||
};
|
||||
for(String symbol : symbols) {
|
||||
map.put(symbol, new ArrayList<Integer>(exp.length()));
|
||||
int charPos = 0;
|
||||
for(char c : exp.toCharArray()) {
|
||||
if(c == symbol.charAt(0)) {
|
||||
map.get(symbol).add(charPos);
|
||||
}
|
||||
charPos++;
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@@ -1,762 +0,0 @@
|
||||
package com.luqj.util.reflect;
|
||||
|
||||
import com.luqj.util.NumFormat;
|
||||
import com.luqj.util.assertion.Assert;
|
||||
import javassist.*;
|
||||
import javassist.bytecode.CodeAttribute;
|
||||
import javassist.bytecode.LocalVariableAttribute;
|
||||
import javassist.bytecode.MethodInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileFilter;
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.lang.reflect.*;
|
||||
import java.net.URL;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.*;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
public class ClassUtils {
|
||||
private static Logger LOGGER = LoggerFactory.getLogger(ClassUtils.class);
|
||||
|
||||
private static ClassPool pool = ClassPool.getDefault();
|
||||
|
||||
static {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static Annotation[] getAnnotation(Class type, Class annotation) {
|
||||
|
||||
List<Annotation> list = new ArrayList<Annotation>();
|
||||
Class<?> clazz = type;
|
||||
for (; clazz != Object.class; clazz = clazz.getSuperclass()) {
|
||||
try {
|
||||
if (clazz.getAnnotation(annotation) != null) {
|
||||
list.add(clazz.getAnnotation(annotation));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 这里甚么都不要做!并且这里的异常必须这样写,不能抛出去。
|
||||
// 如果这里的异常打印或者往外抛,则就不会执行clazz =
|
||||
// clazz.getSuperclass(),最后就不会进入到父类中了
|
||||
|
||||
}
|
||||
}
|
||||
return list.toArray(new Annotation[]{});
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过反射,获得定义Class时声明的父类的范型参数的类型.
|
||||
* 如public BookManager extends GenricManager<Book>
|
||||
*
|
||||
* @param clazz clazz The class to introspect
|
||||
* @param index the Index of the generic ddeclaration,start from 0.
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public static Class getSuperClassGenericity(Class clazz, int index) throws IndexOutOfBoundsException {
|
||||
Type genType = clazz.getGenericSuperclass();
|
||||
if (!(genType instanceof ParameterizedType)) {
|
||||
return Object.class;
|
||||
}
|
||||
Type[] params = ((ParameterizedType) genType).getActualTypeArguments();
|
||||
if (index >= params.length || index < 0) {
|
||||
return Object.class;
|
||||
}
|
||||
if (!(params[index] instanceof Class)) {
|
||||
return Object.class;
|
||||
}
|
||||
return (Class) params[index];
|
||||
}
|
||||
|
||||
public static String getDefBeanName(Class<?> classType) {
|
||||
String name = classType.getSimpleName();
|
||||
String firstChat = name.substring(0, 1).toLowerCase();
|
||||
return firstChat + name.subSequence(1, name.length());
|
||||
}
|
||||
|
||||
public static<T> T instanceByConstructor(Class<T> tClass,Object... constructorParams) throws Throwable{
|
||||
Class[] constructorTypes = new Class[constructorParams.length];
|
||||
for (int i = 0; i < constructorParams.length; i++) {
|
||||
constructorTypes[i] = constructorParams[i].getClass();
|
||||
}
|
||||
Constructor cla = tClass.getDeclaredConstructor(constructorTypes);
|
||||
return (T) cla.newInstance(constructorParams);
|
||||
}
|
||||
|
||||
public static String classPackageAsResourcePath(Class<?> clazz) {
|
||||
if (clazz == null) {
|
||||
return "";
|
||||
}
|
||||
String className = clazz.getName();
|
||||
int packageEndIndex = className.lastIndexOf('.');
|
||||
if (packageEndIndex == -1) {
|
||||
return "";
|
||||
}
|
||||
String packageName = className.substring(0, packageEndIndex);
|
||||
return packageName.replace('.', '/');
|
||||
}
|
||||
|
||||
|
||||
public static ClassLoader getDefaultClassLoader() {
|
||||
ClassLoader cl = null;
|
||||
try {
|
||||
cl = Thread.currentThread().getContextClassLoader();
|
||||
} catch (Throwable ex) {
|
||||
// Cannot access thread context ClassLoader - falling back to system class loader...
|
||||
}
|
||||
if (cl == null) {
|
||||
// No thread context class loader -> use class loader of this class.
|
||||
cl = ClassUtils.class.getClassLoader();
|
||||
}
|
||||
return cl;
|
||||
}
|
||||
|
||||
public static Map<String, MethodParam> getMethodParams(Class<?> clas, Method m) throws NotFoundException {
|
||||
Map<String, MethodParam> params = new LinkedHashMap<String, MethodParam>();
|
||||
pool.insertClassPath(new ClassClassPath(clas));
|
||||
CtClass ctClass = pool.get(clas.getName());
|
||||
CtMethod cm = ctClass.getDeclaredMethod(m.getName());
|
||||
MethodInfo methodInfo = cm.getMethodInfo();
|
||||
Class<?>[] parameterTypes = m.getParameterTypes();
|
||||
Type[] parameterGTypes = m.getGenericParameterTypes();
|
||||
CodeAttribute codeAttribute = methodInfo.getCodeAttribute();
|
||||
LocalVariableAttribute attr = (LocalVariableAttribute) codeAttribute
|
||||
.getAttribute(LocalVariableAttribute.tag);
|
||||
if (attr == null) {
|
||||
throw new NotFoundException(codeAttribute.toString());
|
||||
}
|
||||
String[] paramNames = new String[cm.getParameterTypes().length];
|
||||
int pos = Modifier.isStatic(cm.getModifiers()) ? 0 : 1;
|
||||
for (int j = 0; j < paramNames.length; j++) {
|
||||
MethodParam mp = new MethodParam(j, attr.variableName(j + pos), parameterTypes[j]);
|
||||
mp.setT(getTypeGenericity(parameterGTypes[j]));
|
||||
params.put(mp.getName(), mp);
|
||||
}
|
||||
LOGGER.trace("方法[" + m.getName() + "]参数为" + params);
|
||||
return params;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型属性的泛型类型
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Class<?>[] getTypeGenericity(Type fc) {
|
||||
if (fc == null) {
|
||||
return new Class<?>[]{};
|
||||
}
|
||||
// 【3】如果是泛型参数的类型
|
||||
if (fc instanceof ParameterizedType) {
|
||||
ParameterizedType pt = (ParameterizedType) fc;
|
||||
Type[] ts = pt.getActualTypeArguments();
|
||||
List<Class<?>> t = new ArrayList<Class<?>>();
|
||||
for (int i = 0; i < ts.length; i++) {
|
||||
if (ts[i] instanceof WildcardType) {
|
||||
//泛型可能是 <?>
|
||||
} else {
|
||||
t.add((Class<?>) ts[i]);
|
||||
}
|
||||
|
||||
}
|
||||
return t.toArray(new Class<?>[]{});
|
||||
} else {
|
||||
return new Class<?>[]{};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static boolean isListType(Field field) {
|
||||
return isListType(field.getType());
|
||||
}
|
||||
|
||||
public static boolean isListType(Class<?> objType) {
|
||||
Class<?>[] interfaces = objType.getInterfaces();
|
||||
for (Class<?> i : interfaces) {
|
||||
if (i.equals(List.class)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return objType.isAssignableFrom(List.class);
|
||||
}
|
||||
|
||||
public static boolean isMapType(Field field) {
|
||||
Class<?> fieldClazz = field.getType();
|
||||
return isMapType(fieldClazz);
|
||||
}
|
||||
|
||||
public static boolean isMapType(Class<?> objType) {
|
||||
return isType(objType, Map.class);
|
||||
}
|
||||
|
||||
public static boolean isSetType(Field field) {
|
||||
Class<?> fieldClazz = field.getType();
|
||||
return isSetType(fieldClazz);
|
||||
}
|
||||
|
||||
public static boolean isSetType(Class<?> objType) {
|
||||
return isType(objType, Set.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
*/
|
||||
public static boolean isType(Class<?> parentType, Class<?> child) {
|
||||
return parentType.isAssignableFrom(child);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取List类型属性的泛型类型
|
||||
*
|
||||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static Type getSetFieldGenericity(Field field) {
|
||||
Class<?> fieldClazz = field.getType();
|
||||
Assert.logic(isSetType(fieldClazz), "属性类型必须为Set类型");
|
||||
Type fc = field.getGenericType(); // 关键的地方,如果是List类型,得到其Generic的类型
|
||||
if (fc == null) {
|
||||
return null;
|
||||
}
|
||||
// 【3】如果是泛型参数的类型
|
||||
if (fc instanceof ParameterizedType) {
|
||||
ParameterizedType pt = (ParameterizedType) fc;
|
||||
return pt.getActualTypeArguments()[0]; // 【4】
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取List类型属性的泛型类型
|
||||
*
|
||||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static Type[] getMapFieldGenericity(Field field) {
|
||||
Class<?> fieldClazz = field.getType();
|
||||
Assert.logic(isMapType(fieldClazz), "属性类型必须为Map类型");
|
||||
Type fc = field.getGenericType(); // 关键的地方,如果是List类型,得到其Generic的类型
|
||||
if (fc == null) {
|
||||
return null;
|
||||
}
|
||||
// 【3】如果是泛型参数的类型
|
||||
if (fc instanceof ParameterizedType) {
|
||||
ParameterizedType pt = (ParameterizedType) fc;
|
||||
return pt.getActualTypeArguments(); // 【4】
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取List类型属性的泛型类型
|
||||
*
|
||||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static Class<?> getListGenericity(Field field) {
|
||||
Class<?> fieldClazz = field.getType();
|
||||
Assert.logic(isListType(fieldClazz), "属性类型必须为List类型");
|
||||
Type fc = field.getGenericType(); // 关键的地方,如果是List类型,得到其Generic的类型
|
||||
if (fc == null) {
|
||||
return null;
|
||||
}
|
||||
// 【3】如果是泛型参数的类型
|
||||
if (fc instanceof ParameterizedType) {
|
||||
ParameterizedType pt = (ParameterizedType) fc;
|
||||
return (Class<?>) pt.getActualTypeArguments()[0]; // 【4】
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取List类型属性的泛型类型
|
||||
*
|
||||
* @param field
|
||||
* @return
|
||||
*/
|
||||
public static Class<?> getListFieldGenericity(Field field) {
|
||||
Class<?> fieldClazz = field.getType();
|
||||
Assert.logic(fieldClazz.isAssignableFrom(List.class), "属性类型必须为List类型");
|
||||
Type fc = field.getGenericType(); // 关键的地方,如果是List类型,得到其Generic的类型
|
||||
if (fc == null) {
|
||||
return null;
|
||||
}
|
||||
// 【3】如果是泛型参数的类型
|
||||
if (fc instanceof ParameterizedType) {
|
||||
ParameterizedType pt = (ParameterizedType) fc;
|
||||
return (Class<?>) pt.getActualTypeArguments()[0]; // 【4】
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断属性名是否存在避免调用 getField(String name) 抛异常
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public static boolean existField(Class<?> type, Class<?> fieldType) {
|
||||
if (fieldType == null) {
|
||||
return false;
|
||||
}
|
||||
Field[] fs = getDeclaredFields(type);
|
||||
for (Field field : fs) {
|
||||
if (field.getType().equals(fieldType)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static Method getDeclaredMethod(Object object, String methodName, Class<?>... parameterTypes) {
|
||||
Method method = null;
|
||||
for (Class<?> clazz = object.getClass(); clazz != Object.class; clazz = clazz.getSuperclass()) {
|
||||
try {
|
||||
clazz.getMethods();
|
||||
method = clazz.getMethod(methodName, parameterTypes);
|
||||
return method;
|
||||
} catch (Exception e) {
|
||||
//这里甚么都不要做!并且这里的异常必须这样写,不能抛出去。
|
||||
//如果这里的异常打印或者往外抛,则就不会执行clazz = clazz.getSuperclass(),最后就不会进入到父类中了
|
||||
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Method[] getDeclaredMethods(Object object) {
|
||||
List<Method> list = new ArrayList<Method>();
|
||||
for (Class<?> clazz = object.getClass(); clazz != Object.class; clazz = clazz.getSuperclass()) {
|
||||
try {
|
||||
for (Method method : clazz.getDeclaredMethods()) {
|
||||
if (!Modifier.isStatic(method.getModifiers())) {
|
||||
list.add(method);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
//这里甚么都不要做!并且这里的异常必须这样写,不能抛出去。
|
||||
//如果这里的异常打印或者往外抛,则就不会执行clazz = clazz.getSuperclass(),最后就不会进入到父类中了
|
||||
|
||||
}
|
||||
}
|
||||
return list.toArray(new Method[]{});
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归获取所有的接口
|
||||
*
|
||||
* @param clazz
|
||||
* @return
|
||||
*/
|
||||
public static Class<?>[] getInterfaces(Class<?> clazz) {
|
||||
List<Class<?>> list = new LinkedList<Class<?>>();
|
||||
Class<?>[] interfaces = clazz.getInterfaces();
|
||||
for (int i = 0; i < interfaces.length; i++) {
|
||||
Class ifs = interfaces[i];
|
||||
list.add(ifs);
|
||||
list.addAll(Arrays.asList(getInterfaces(ifs)));
|
||||
}
|
||||
return list.toArray(new Class[list.size()]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 直接调用对象方法, 而忽略修饰符(private, protected, default)
|
||||
*
|
||||
* @param object : 子类对象
|
||||
* @param methodName : 父类中的方法名
|
||||
* @param parameterTypes : 父类中的方法参数类型
|
||||
* @param parameters : 父类中的方法参数
|
||||
* @return 父类中方法的执行结果
|
||||
*/
|
||||
|
||||
public static Object invokeMethod(Object object, String methodName, Class<?>[] parameterTypes,
|
||||
Object[] parameters) {
|
||||
//根据 对象、方法名和对应的方法参数 通过反射 调用上面的方法获取 Method 对象
|
||||
Method method = getDeclaredMethod(object, methodName, parameterTypes);
|
||||
Assert.notNull(method, "方法[" + methodName + "]不允许为空");
|
||||
//抑制Java对方法进行检查,主要是针对私有方法而言
|
||||
method.setAccessible(true);
|
||||
try {
|
||||
if (null != method) {
|
||||
// 调用object 的 method 所代表的方法,其方法的参数是 parameters
|
||||
return method.invoke(object, parameters);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
throw new IllegalArgumentException("方法执行异常,异常消息[" + e.getMessage() + "]", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 包括父类的属性
|
||||
*
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public static Field[] getDeclaredFields(Class<?> type) {
|
||||
List<Field> list = new ArrayList<Field>();
|
||||
Class<?> clazz = type;
|
||||
for (; clazz != Object.class; clazz = clazz.getSuperclass()) {
|
||||
try {
|
||||
for (Field field : clazz.getDeclaredFields()) {
|
||||
if (!Modifier.isStatic(field.getModifiers())) {
|
||||
list.add(field);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 这里甚么都不要做!并且这里的异常必须这样写,不能抛出去。
|
||||
// 如果这里的异常打印或者往外抛,则就不会执行clazz =
|
||||
// clazz.getSuperclass(),最后就不会进入到父类中了
|
||||
|
||||
}
|
||||
}
|
||||
return list.toArray(new Field[]{});
|
||||
}
|
||||
|
||||
|
||||
public static Field[] getDeclaredFields(Class<?> type, Class a) {
|
||||
List<Field> fs = new ArrayList<>();
|
||||
Field[] fields = getDeclaredFields(type);
|
||||
for (Field field : fields) {
|
||||
if (field.getType().getAnnotation(a) != null) {
|
||||
fs.add(field);
|
||||
}
|
||||
}
|
||||
return fs.toArray(new Field[]{});
|
||||
}
|
||||
|
||||
/**
|
||||
* 包括父类的属性
|
||||
*
|
||||
* @param type
|
||||
* @param fieldName
|
||||
* @return
|
||||
*/
|
||||
public static Field getDeclaredFields(Class<?> type, String fieldName) {
|
||||
Field field = null;
|
||||
Class<?> clazz = type;
|
||||
for (; clazz != Object.class; clazz = clazz.getSuperclass()) {
|
||||
try {
|
||||
field = clazz.getDeclaredField(fieldName);
|
||||
return field;
|
||||
} catch (Exception e) {
|
||||
// 这里甚么都不要做!并且这里的异常必须这样写,不能抛出去。
|
||||
// 如果这里的异常打印或者往外抛,则就不会执行clazz =
|
||||
// clazz.getSuperclass(),最后就不会进入到父类中了
|
||||
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断属性名是否存在避免调用 getField(String name) 抛异常
|
||||
*
|
||||
* @param type
|
||||
* @param fieldName
|
||||
* @return
|
||||
*/
|
||||
public static boolean existField(Class<?> type, String fieldName) {
|
||||
if (fieldName == null) {
|
||||
return false;
|
||||
}
|
||||
return getDeclaredFields(type, fieldName) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归寻找属性的类型
|
||||
*
|
||||
* @param beanType 根类型
|
||||
* @param fieldStr 如bean.field.field
|
||||
* @return
|
||||
*/
|
||||
public static final Class<?>[] getTypes(Class<?> beanType, String fieldStr) {
|
||||
Assert.notNull(beanType, "根类型不允许为空");
|
||||
Assert.hasText(fieldStr, "属性串不允许为空");
|
||||
String[] fieldNames = fieldStr.split("\\.");
|
||||
List<Class<?>> returnTypes = new ArrayList<Class<?>>();
|
||||
|
||||
Class<?> returnType = beanType;
|
||||
for (String fn : fieldNames) {
|
||||
if (ClassUtils.existField(returnType, fn)) {
|
||||
Field f;
|
||||
f = getDeclaredFields(returnType, fn);
|
||||
returnTypes.add(f.getType());
|
||||
returnType = f.getType();
|
||||
} else {
|
||||
return returnTypes.toArray(new Class<?>[0]);
|
||||
}
|
||||
}
|
||||
return returnTypes.toArray(new Class<?>[0]);
|
||||
}
|
||||
|
||||
|
||||
public static final boolean isBaseType(Field field) {
|
||||
Assert.notNull(field, "属性不允许为空!");
|
||||
return isBaseType(field.getType());
|
||||
}
|
||||
|
||||
public static final Object initBaseValue(Class<?> objType) {
|
||||
return parseBaseValue(objType, "");
|
||||
}
|
||||
|
||||
|
||||
public static final Object parseBaseValue(Class<?> objType, Object value) {
|
||||
Assert.logic(isBaseType(objType), "需要转换的必须是基本类型");
|
||||
if (Short.class.equals(objType) || short.class.equals(objType)) {
|
||||
return NumFormat.$Long(value);
|
||||
} else if (Integer.class.equals(objType) || int.class.equals(objType)) {
|
||||
return NumFormat.$Intger(value);
|
||||
} else if (Long.class.equals(objType) || long.class.equals(objType)) {
|
||||
return NumFormat.$Long(value);
|
||||
} else if (Float.class.equals(objType) || float.class.equals(objType)) {
|
||||
return NumFormat.$Float(value);
|
||||
} else if (Double.class.equals(objType) || double.class.equals(objType)) {
|
||||
return NumFormat.$Double(value);
|
||||
} else if (String.class.equals(objType)) {
|
||||
return value;
|
||||
} else if (Boolean.class.equals(objType) || boolean.class.equals(objType)) {
|
||||
if (value == null) {
|
||||
return Boolean.FALSE;
|
||||
} else {
|
||||
return Boolean.getBoolean(value.toString());
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static final Object parseBaseValue(Class<?> objType, String value) {
|
||||
Assert.logic(isBaseType(objType), "需要转换的必须是基本类型");
|
||||
if (Short.class.equals(objType) || short.class.equals(objType)) {
|
||||
return NumFormat.$Short(value.trim());
|
||||
} else if (Integer.class.equals(objType) || int.class.equals(objType)) {
|
||||
return NumFormat.$Intger(value.trim());
|
||||
} else if (Long.class.equals(objType) || long.class.equals(objType)) {
|
||||
return NumFormat.$Long(value.trim());
|
||||
} else if (Float.class.equals(objType) || float.class.equals(objType)) {
|
||||
return NumFormat.$Float(value.trim());
|
||||
} else if (Double.class.equals(objType) || double.class.equals(objType)) {
|
||||
return NumFormat.$Double(value.trim());
|
||||
} else if (String.class.equals(objType)) {
|
||||
return value;
|
||||
} else if (Boolean.class.equals(objType) || boolean.class.equals(objType)) {
|
||||
return Boolean.parseBoolean(value.trim());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static final boolean isBaseType(Class<?> beanType) {
|
||||
Assert.notNull(beanType, "类型不允许为空!");
|
||||
return beanType.isPrimitive()
|
||||
|| String.class.equals(beanType)
|
||||
|| Long.class.equals(beanType)
|
||||
|| Short.class.equals(beanType)
|
||||
|| Character.class.equals(beanType)
|
||||
|| Integer.class.equals(beanType)
|
||||
|| Double.class.equals(beanType)
|
||||
|| Boolean.class.equals(beanType)
|
||||
|| Float.class.equals(beanType);
|
||||
}
|
||||
|
||||
public static final Object newInstance(Class<?> beanType, String fieldStr)
|
||||
throws InstantiationException,
|
||||
IllegalAccessException, SecurityException, NoSuchFieldException {
|
||||
Assert.notNull(beanType, "根类型不允许为空");
|
||||
Assert.hasText(fieldStr, "属性串不允许为空");
|
||||
|
||||
Class<?>[] types = getTypes(beanType, fieldStr);
|
||||
if (types.length == 0) {
|
||||
return null;
|
||||
}
|
||||
String[] fieldNames = fieldStr.split("\\.");
|
||||
Object root = beanType.newInstance();
|
||||
Object obj = root;
|
||||
Class<?> tmpType = beanType;
|
||||
int i = 0;
|
||||
for (Class<?> type : types) {
|
||||
Object objTmp = type.newInstance();
|
||||
GSetterUtil.setValueBySetter(obj, tmpType.getDeclaredField(fieldNames[i]), objTmp);
|
||||
obj = objTmp;
|
||||
tmpType = type;
|
||||
i++;
|
||||
}
|
||||
return GSetterUtil.getValueByGetter(root, beanType.getDeclaredField(fieldNames[0]));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 递归寻找属性的类型
|
||||
*
|
||||
* @param beanType 根类型
|
||||
* @param fieldStr 如bean.field.field
|
||||
* @return
|
||||
*/
|
||||
public static final Class<?> getType(Class<?> beanType, String fieldStr) {
|
||||
Assert.notNull(beanType, "根类型不允许为空");
|
||||
Assert.hasText(fieldStr, "属性串不允许为空");
|
||||
String[] fieldNames = fieldStr.split("\\.");
|
||||
Class<?> returnType = beanType;
|
||||
for (String fn : fieldNames) {
|
||||
if (ClassUtils.existField(returnType, fn)) {
|
||||
Field f;
|
||||
try {
|
||||
f = getDeclaredFields(returnType, fn);
|
||||
returnType = f.getType();
|
||||
} catch (NullPointerException e) {
|
||||
//找不到字段返回NULL
|
||||
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return returnType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某个包下面的class
|
||||
*
|
||||
* @param pack
|
||||
* @return
|
||||
*/
|
||||
public static List<String> getClasssFromPackage(String pack) {
|
||||
List<String> classNames = new ArrayList<String>();
|
||||
// 是否循环搜索子包
|
||||
boolean recursive = true;
|
||||
// 包名字
|
||||
String packageName = pack;
|
||||
// 包名对应的路径名称
|
||||
String packageDirName = packageName.replace('.', '/');
|
||||
Enumeration<URL> dirs;
|
||||
try {
|
||||
dirs = Thread.currentThread().getContextClassLoader().getResources(packageDirName);
|
||||
while (dirs.hasMoreElements()) {
|
||||
URL url = dirs.nextElement();
|
||||
String protocol = url.getProtocol();
|
||||
if ("file".equals(protocol)) {
|
||||
System.out.println("file类型的扫描");
|
||||
String filePath = URLDecoder.decode(url.getFile(), "UTF-8");
|
||||
findClassInPackageByFile(packageName, filePath, recursive, classNames);
|
||||
} else if ("jar".equals(protocol)) {
|
||||
System.out.println("jar类型的扫描");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
return classNames;
|
||||
}
|
||||
|
||||
private static void findClassInPackageByFile(String packageName, String filePath, final boolean recursive, List<String> clazzNames) {
|
||||
File dir = new File(filePath);
|
||||
if (!dir.exists() || !dir.isDirectory()) {
|
||||
return;
|
||||
}
|
||||
// 在给定的目录下找到所有的文件,并且进行条件过滤
|
||||
File[] dirFiles = dir.listFiles(new FileFilter() {
|
||||
@Override
|
||||
public boolean accept(File file) {
|
||||
boolean acceptDir = recursive && file.isDirectory();// 接受dir目录
|
||||
boolean acceptClass = file.getName().endsWith("class");// 接受class文件
|
||||
return acceptDir || acceptClass;
|
||||
}
|
||||
});
|
||||
|
||||
for (File file : dirFiles) {
|
||||
if (file.isDirectory()) {
|
||||
findClassInPackageByFile(packageName + "." + file.getName(), file.getAbsolutePath(), recursive, clazzNames);
|
||||
} else {
|
||||
String className = file.getName().substring(0, file.getName().length() - 6);
|
||||
try {
|
||||
clazzNames.add(packageName + "." + className);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从jar文件中读取指定目录下面的所有的class文件
|
||||
*
|
||||
* @param jarPath jar文件存放的位置
|
||||
* @param jarPath 指定的文件目录
|
||||
* @return 所有的的class的对象
|
||||
*/
|
||||
public static List<String> getClasssFromJarFile(String jarPath) {
|
||||
List<String> classNameList = new ArrayList<>();
|
||||
JarFile jarFile = null;
|
||||
try {
|
||||
jarFile = new JarFile(jarPath);
|
||||
} catch (IOException e1) {
|
||||
|
||||
}
|
||||
List<JarEntry> jarEntryList = new ArrayList<>();
|
||||
Enumeration<JarEntry> ee = jarFile.entries();
|
||||
while (ee.hasMoreElements()) {
|
||||
JarEntry entry = ee.nextElement();
|
||||
// entry.getName().startsWith(filePath) &&
|
||||
if (entry.getName().endsWith(".class")) {
|
||||
jarEntryList.add(entry);
|
||||
}
|
||||
}
|
||||
for (JarEntry entry : jarEntryList) {
|
||||
String className = entry.getName().replace('/', '.');
|
||||
className = className.substring(0, className.length() - 6);
|
||||
classNameList.add(className);
|
||||
}
|
||||
return classNameList;
|
||||
}
|
||||
|
||||
public static Class[] getMethodParamTypes(Object classInstance, String methodName) {
|
||||
Class[] paramTypes = null;
|
||||
try {
|
||||
Method[] methods = classInstance.getClass().getMethods();//全部方法
|
||||
for (int i = 0; i < methods.length; i++) {
|
||||
if (methodName.equals(methods[i].getName())) {//和传入方法名匹配
|
||||
Class[] params = methods[i].getParameterTypes();
|
||||
paramTypes = new Class[params.length];
|
||||
for (int j = 0; j < params.length; j++) {
|
||||
paramTypes[j] = Class.forName(params[j].getName());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}catch (Throwable e) {
|
||||
throw new IllegalStateException("获取方法参数类型失败", e);
|
||||
}
|
||||
return paramTypes;
|
||||
}
|
||||
|
||||
public static Method findDeclaredMethod(Object object, String methodName) {
|
||||
Method execMethod = null;
|
||||
for (Method method : object.getClass().getDeclaredMethods()) {
|
||||
if (method.getName().equals(methodName)) {
|
||||
execMethod = method;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return execMethod;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(Arrays.asList(getDeclaredFields(ClassUtils.class)));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,196 +0,0 @@
|
||||
package com.luqj.util.reflect;
|
||||
|
||||
import com.luqj.util.assertion.Assert;
|
||||
import com.luqj.util.log.LogUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
|
||||
public abstract class GSetterUtil {
|
||||
private static Logger _log = LoggerFactory.getLogger(GSetterUtil.class);
|
||||
|
||||
public static final String PREFIX_GETTER = "get";
|
||||
|
||||
public static final String PREFIX_SETTER = "set";
|
||||
|
||||
|
||||
public static Object getValueByGetter(Object obj,String fieldName){
|
||||
Field f = ClassUtils.getDeclaredFields(obj.getClass(), fieldName);
|
||||
Assert.notNull(f, obj.getClass()+",找不到指定的属性["+fieldName+"]");
|
||||
return getValueByGetter(obj, f);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断属性是否可操作,是否有公共getter,setter方法
|
||||
* @return
|
||||
*/
|
||||
public static boolean isOpAbleField(Class<?> type,Field f){
|
||||
return getGetter(type, f) != null && getSetter(type, f) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断指定的对象属性是否存在getter方法
|
||||
* @param f
|
||||
* @return
|
||||
*/
|
||||
public static boolean existGetter(Class<?> type,Field f){
|
||||
return getGetter(type, f) != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断指定的对象属性是否存在setter方法
|
||||
* @param f
|
||||
* @return
|
||||
*/
|
||||
public static boolean existSetter(Class<?> type,Field f){
|
||||
return getSetter(type, f) != null;
|
||||
}
|
||||
|
||||
public static void setValueBySetter(Object obj,Field f,Object paramValue){
|
||||
setValueBySetter(obj, f.getName(), paramValue,f.getType());
|
||||
}
|
||||
|
||||
public static void setValueBySetter(Object obj,String fieldName,Object paramValue,Class<?> paramType){
|
||||
Method m = getSetter(obj.getClass(),fieldName,paramType);
|
||||
Assert.notNull(m,obj.getClass().getSimpleName()+"属性["+fieldName+"]不存在setter方法");
|
||||
try {
|
||||
m.invoke(obj,paramValue);
|
||||
} catch (Throwable e) {
|
||||
|
||||
_log.error(LogUtil.exceptionMsg("["+fieldName+"]set方法"+m.getName()+"设置出现异常", e),e);
|
||||
}
|
||||
}
|
||||
|
||||
public static Object getValueByGetter(Object obj,Field f){
|
||||
Method m = getGetter(obj.getClass(), f);
|
||||
Assert.notNull(m,"属性["+f.getName()+"]不存在getter方法");
|
||||
try {
|
||||
return m.invoke(obj);
|
||||
} catch (Throwable e) {
|
||||
|
||||
_log.error(LogUtil.exceptionMsg(f+"set方法"+m.getName()+"设置出现异常", e));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getGetterMethodName(String fieldName){
|
||||
Assert.hasText(fieldName,"属性名必须有内容!");
|
||||
return PREFIX_GETTER + upperFirstChar(fieldName);
|
||||
}
|
||||
|
||||
public static String getSetterMethodName(String fieldName){
|
||||
Assert.hasText(fieldName,"属性名必须有内容!");
|
||||
return PREFIX_SETTER + upperFirstChar(fieldName);
|
||||
}
|
||||
|
||||
public static String upperFirstChar(String fieldName){
|
||||
return fieldName.substring(0,1).toUpperCase()
|
||||
+ fieldName.substring(1,fieldName.length());
|
||||
}
|
||||
|
||||
public static String lowerFirstChar(String fieldName){
|
||||
return fieldName.substring(0,1).toLowerCase()
|
||||
+ fieldName.substring(1,fieldName.length());
|
||||
}
|
||||
|
||||
|
||||
public static boolean isGetter(Method method){
|
||||
return method.getModifiers() == Modifier.PUBLIC
|
||||
&& method.getName().length() > PREFIX_GETTER.length()
|
||||
&& method.getName().startsWith(PREFIX_GETTER)
|
||||
&& method.getParameterTypes().length == 0;
|
||||
}
|
||||
|
||||
public static boolean isSetter(Method method){
|
||||
return (method.getModifiers() & Modifier.PUBLIC) == 1
|
||||
&& method.getName().length() > PREFIX_SETTER.length()
|
||||
&& method.getName().startsWith(PREFIX_SETTER)
|
||||
&& method.getParameterTypes().length == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取setter方法,如果找不到或达不到要求返回NULL
|
||||
* @param type
|
||||
* @param f
|
||||
* @return
|
||||
*/
|
||||
public static Method getSetter(Class<?> type,String fieldName,Class<?> fieldType){
|
||||
try {
|
||||
Method m = type.getMethod(getSetterMethodName(fieldName), fieldType);
|
||||
if(isSetter(m)){
|
||||
return m;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取setter方法,如果找不到或达不到要求返回NULL
|
||||
* @param type
|
||||
* @param f
|
||||
* @return
|
||||
*/
|
||||
public static Method getSetter(Class<?> type,Field f){
|
||||
return getSetter(type, f.getName(), f.getType());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取getter方法,如果找不到或达不到要求返回NULL
|
||||
* @param type
|
||||
* @param f
|
||||
* @return
|
||||
*/
|
||||
public static Method getGetter(Class<?> type,Field f){
|
||||
try {
|
||||
Method m = type.getMethod(getGetterMethodName(f.getName()));
|
||||
if(isGetter(m)){
|
||||
return m;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据setter方法获取属性名
|
||||
* @param method
|
||||
* @return
|
||||
*/
|
||||
public static String getFieldNameBySetter(Method method){
|
||||
//get开头且没有参数
|
||||
Assert.notNull(method,"方法不允许为NULL");
|
||||
Assert.logic(isSetter(method),
|
||||
method.getName()+"["+method.getParameterTypes().length+"]不是JAVA标准set方法");
|
||||
String fieldName = method.getName().substring(PREFIX_SETTER.length());
|
||||
fieldName = lowerFirstChar(fieldName);
|
||||
return fieldName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据getter方法获取属性名
|
||||
* @param method
|
||||
* @return
|
||||
*/
|
||||
public static String getFieldNameByGetter(Method method){
|
||||
//get开头且没有参数
|
||||
Assert.notNull(method,"方法不允许为NULL");
|
||||
Assert.logic(isGetter(method),
|
||||
method.getName()+"["+method.getParameterTypes().length+"]不是JAVA标准get方法");
|
||||
String fieldName = method.getName().substring(PREFIX_GETTER.length());
|
||||
fieldName = lowerFirstChar(fieldName);
|
||||
return fieldName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
package com.luqj.util.reflect;
|
||||
|
||||
|
||||
|
||||
import com.luqj.util.assertion.Assert;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
public class JarUtils {
|
||||
|
||||
|
||||
public static interface JarOperator {
|
||||
void operate(JarFile jar, String className, JarEntry entry);
|
||||
}
|
||||
|
||||
|
||||
public static class ClassLoaderOP implements JarOperator {
|
||||
|
||||
private ClassLoader loader;
|
||||
private Method md1;
|
||||
|
||||
public ClassLoaderOP(ClassLoader loader) {
|
||||
super();
|
||||
try {
|
||||
this.loader = loader;
|
||||
md1 = ClassLoader.class.getDeclaredMethod(
|
||||
"defineClass",
|
||||
String.class, byte[].class, int.class, int.class);
|
||||
md1.setAccessible(true);
|
||||
} catch (Exception e) {
|
||||
Assert.fail("jar文件加载初始化异常,异常消息[" + e.getMessage() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void operate(JarFile jar, String className, JarEntry entry) {
|
||||
try {
|
||||
InputStream is = jar.getInputStream(entry);
|
||||
ByteArrayOutputStream dataOut = new ByteArrayOutputStream();
|
||||
byte[] packData = new byte[2048];
|
||||
int readLen = 0;
|
||||
while (-1 != (readLen = is.read(packData))) {
|
||||
dataOut.write(packData, 0, readLen);
|
||||
}
|
||||
if (dataOut.size() <= 0) {
|
||||
throw new ClassNotFoundException(className);
|
||||
}
|
||||
byte[] classFile = dataOut.toByteArray();
|
||||
md1.invoke(loader, className, classFile, 0, classFile.length);
|
||||
} catch (Exception e) {
|
||||
|
||||
Assert.fail("类:" + className + "加载异常,异常消息[" + e.getMessage() + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void operateJar(String file, JarOperator op) {
|
||||
try {
|
||||
JarFile jar = new JarFile(file);
|
||||
Enumeration<JarEntry> d = jar.entries();
|
||||
while (d.hasMoreElements()) {
|
||||
JarEntry entry = (JarEntry) d.nextElement();
|
||||
if (entry.getName().endsWith(".class")) {
|
||||
String name = entry.getName();
|
||||
name = name.substring(0, name.length() - 6);
|
||||
name = name.replaceAll("/", ".");
|
||||
op.operate(jar, name, entry);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
||||
Assert.fail("解析JAR:" + file + "出现异常,异常消息[" + e.getMessage() + "]");
|
||||
}
|
||||
}
|
||||
|
||||
public static void loadClass(String file, ClassLoader loader) {
|
||||
ClassLoaderOP op = new ClassLoaderOP(loader);
|
||||
operateJar(file, op);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有的 JAVA类信息
|
||||
*
|
||||
* @param file
|
||||
* @return 返回全局类名
|
||||
*/
|
||||
public static Collection<String> getAllClassInfo(String file) {
|
||||
List<String> infos = new ArrayList<String>();
|
||||
try {
|
||||
JarFile jar = new JarFile(file);
|
||||
Enumeration<JarEntry> d = jar.entries();
|
||||
while (d.hasMoreElements()) {
|
||||
JarEntry entry = (JarEntry) d.nextElement();
|
||||
if (entry.getName().endsWith(".class")) {
|
||||
String name = entry.getName();
|
||||
name = name.substring(0, name.length() - 6);
|
||||
name = name.replaceAll("/", ".");
|
||||
infos.add(name);
|
||||
}
|
||||
}
|
||||
return infos;
|
||||
} catch (IOException e) {
|
||||
|
||||
Assert.fail("解析JAR:" + file + "出现异常,异常消息[" + e.getMessage() + "]");
|
||||
}
|
||||
return infos;
|
||||
}
|
||||
|
||||
public static Collection<String> getResources(String filePath, String dirPath) {
|
||||
List<String> infos = new ArrayList<String>();
|
||||
try {
|
||||
JarFile jar = new JarFile(filePath);
|
||||
Enumeration<JarEntry> d = jar.entries();
|
||||
while (d.hasMoreElements()) {
|
||||
JarEntry entry = (JarEntry) d.nextElement();
|
||||
if (entry.getName().startsWith(dirPath) && !entry.isDirectory()) {
|
||||
infos.add(entry.getName());
|
||||
}
|
||||
}
|
||||
return infos;
|
||||
} catch (IOException e) {
|
||||
|
||||
Assert.fail("解析JAR:" + filePath + "出现异常,异常消息[" + e.getMessage() + "]");
|
||||
}
|
||||
return infos;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
package com.luqj.util.reflect;
|
||||
|
||||
public class MethodParam {
|
||||
|
||||
private int index;
|
||||
|
||||
private String name;
|
||||
|
||||
private Class<?> type;
|
||||
|
||||
/**
|
||||
* 参数的泛型类型集合
|
||||
*/
|
||||
private Class<?>[] t;
|
||||
|
||||
private Object value;
|
||||
|
||||
|
||||
public MethodParam(int index, String name, Class<?> type) {
|
||||
super();
|
||||
this.index = index;
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Class<?>[] getT() {
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
public void setT(Class<?>[] ts) {
|
||||
t = ts;
|
||||
}
|
||||
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(Object value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MethodParam [index=" + index + ", name=" + name + ", type=" + type + "]";
|
||||
}
|
||||
|
||||
|
||||
public int getIndex() {
|
||||
return index;
|
||||
}
|
||||
|
||||
public void setIndex(int index) {
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Class<?> getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Class<?> type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
<?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.luqj.common.mapper.ComCategoryMapper">
|
||||
|
||||
<resultMap type="ComCategory" id="ComCategoryResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="parentIds" column="parent_ids" />
|
||||
<result property="projectType" column="project_type" />
|
||||
<result property="sortNum" column="sort_num" />
|
||||
<result property="iconUrl" column="icon_url" />
|
||||
<result property="picUrl" column="pic_url" />
|
||||
<result property="hasLeaf" column="has_leaf" />
|
||||
<result property="homeShow" column="home_show" />
|
||||
<result property="level" column="level" />
|
||||
<result property="flag" column="flag" />
|
||||
<result property="description" column="description" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectComCategoryVo">
|
||||
select id, name, parent_id, parent_ids, project_type, sort_num, icon_url, pic_url, has_leaf, home_show, level, flag, description, create_time, update_time, status from com_category
|
||||
</sql>
|
||||
|
||||
<select id="selectComCategoryList" parameterType="ComCategory" resultMap="ComCategoryResult">
|
||||
<include refid="selectComCategoryVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||
<if test="parentIds != null and parentIds != ''"> and parent_ids = #{parentIds}</if>
|
||||
<if test="projectType != null "> and project_type = #{projectType}</if>
|
||||
<if test="sortNum != null "> and sort_num = #{sortNum}</if>
|
||||
<if test="iconUrl != null and iconUrl != ''"> and icon_url = #{iconUrl}</if>
|
||||
<if test="picUrl != null and picUrl != ''"> and pic_url = #{picUrl}</if>
|
||||
<if test="hasLeaf != null "> and has_leaf = #{hasLeaf}</if>
|
||||
<if test="homeShow != null "> and home_show = #{homeShow}</if>
|
||||
<if test="level != null "> and level = #{level}</if>
|
||||
<if test="flag != null "> and flag = #{flag}</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectComCategoryById" parameterType="Long" resultMap="ComCategoryResult">
|
||||
<include refid="selectComCategoryVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertComCategory" parameterType="ComCategory" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into com_category
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="parentIds != null">parent_ids,</if>
|
||||
<if test="projectType != null">project_type,</if>
|
||||
<if test="sortNum != null">sort_num,</if>
|
||||
<if test="iconUrl != null">icon_url,</if>
|
||||
<if test="picUrl != null">pic_url,</if>
|
||||
<if test="hasLeaf != null">has_leaf,</if>
|
||||
<if test="homeShow != null">home_show,</if>
|
||||
<if test="level != null">level,</if>
|
||||
<if test="flag != null">flag,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="parentIds != null">#{parentIds},</if>
|
||||
<if test="projectType != null">#{projectType},</if>
|
||||
<if test="sortNum != null">#{sortNum},</if>
|
||||
<if test="iconUrl != null">#{iconUrl},</if>
|
||||
<if test="picUrl != null">#{picUrl},</if>
|
||||
<if test="hasLeaf != null">#{hasLeaf},</if>
|
||||
<if test="homeShow != null">#{homeShow},</if>
|
||||
<if test="level != null">#{level},</if>
|
||||
<if test="flag != null">#{flag},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateComCategory" parameterType="ComCategory">
|
||||
update com_category
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="parentIds != null">parent_ids = #{parentIds},</if>
|
||||
<if test="projectType != null">project_type = #{projectType},</if>
|
||||
<if test="sortNum != null">sort_num = #{sortNum},</if>
|
||||
<if test="iconUrl != null">icon_url = #{iconUrl},</if>
|
||||
<if test="picUrl != null">pic_url = #{picUrl},</if>
|
||||
<if test="hasLeaf != null">has_leaf = #{hasLeaf},</if>
|
||||
<if test="homeShow != null">home_show = #{homeShow},</if>
|
||||
<if test="level != null">level = #{level},</if>
|
||||
<if test="flag != null">flag = #{flag},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteComCategoryById" parameterType="Long">
|
||||
delete from com_category where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteComCategoryByIds" parameterType="String">
|
||||
delete from com_category where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -1,5 +0,0 @@
|
||||
<?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="org.code.modules.qiniu.mapper.QiniuConfigMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,35 +0,0 @@
|
||||
<?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>3.4.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>luqj-custom</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-extension</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-system</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>luqj-common</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomCallback;
|
||||
import com.ruoyi.custom.service.ICustomCallbackService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 海关回查Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/callback")
|
||||
public class CustomCallbackController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomCallbackService customCallbackService;
|
||||
|
||||
/**
|
||||
* 查询海关回查列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:callback:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomCallback customCallback)
|
||||
{
|
||||
startPage();
|
||||
List<CustomCallback> list = customCallbackService.selectCustomCallbackList(customCallback);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出海关回查列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:callback:export')")
|
||||
@Log(title = "海关回查", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomCallback customCallback)
|
||||
{
|
||||
List<CustomCallback> list = customCallbackService.selectCustomCallbackList(customCallback);
|
||||
ExcelUtil<CustomCallback> util = new ExcelUtil<CustomCallback>(CustomCallback.class);
|
||||
return util.exportExcel(list, "callback");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取海关回查详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:callback:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customCallbackService.selectCustomCallbackById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增海关回查
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:callback:add')")
|
||||
@Log(title = "海关回查", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomCallback customCallback)
|
||||
{
|
||||
return toAjax(customCallbackService.insertCustomCallback(customCallback));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改海关回查
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:callback:edit')")
|
||||
@Log(title = "海关回查", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomCallback customCallback)
|
||||
{
|
||||
return toAjax(customCallbackService.updateCustomCallback(customCallback));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除海关回查
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:callback:remove')")
|
||||
@Log(title = "海关回查", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customCallbackService.deleteCustomCallbackByIds(ids));
|
||||
}
|
||||
}
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomCountryCode;
|
||||
import com.ruoyi.custom.service.ICustomCountryCodeService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 国别代码Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/country")
|
||||
public class CustomCountryCodeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomCountryCodeService customCountryCodeService;
|
||||
|
||||
/**
|
||||
* 查询国别代码列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:country:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomCountryCode customCountryCode)
|
||||
{
|
||||
startPage();
|
||||
List<CustomCountryCode> list = customCountryCodeService.selectCustomCountryCodeList(customCountryCode);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出国别代码列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:country:export')")
|
||||
@Log(title = "国别代码", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomCountryCode customCountryCode)
|
||||
{
|
||||
List<CustomCountryCode> list = customCountryCodeService.selectCustomCountryCodeList(customCountryCode);
|
||||
ExcelUtil<CustomCountryCode> util = new ExcelUtil<CustomCountryCode>(CustomCountryCode.class);
|
||||
return util.exportExcel(list, "country");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取国别代码详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:country:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customCountryCodeService.selectCustomCountryCodeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增国别代码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:country:add')")
|
||||
@Log(title = "国别代码", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomCountryCode customCountryCode)
|
||||
{
|
||||
return toAjax(customCountryCodeService.insertCustomCountryCode(customCountryCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改国别代码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:country:edit')")
|
||||
@Log(title = "国别代码", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomCountryCode customCountryCode)
|
||||
{
|
||||
return toAjax(customCountryCodeService.updateCustomCountryCode(customCountryCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除国别代码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:country:remove')")
|
||||
@Log(title = "国别代码", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customCountryCodeService.deleteCustomCountryCodeByIds(ids));
|
||||
}
|
||||
}
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomDeclarePort;
|
||||
import com.ruoyi.custom.service.ICustomDeclarePortService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 申报口岸Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/declarePort")
|
||||
public class CustomDeclarePortController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomDeclarePortService customDeclarePortService;
|
||||
|
||||
/**
|
||||
* 查询申报口岸列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:declarePort:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomDeclarePort customDeclarePort)
|
||||
{
|
||||
startPage();
|
||||
List<CustomDeclarePort> list = customDeclarePortService.selectCustomDeclarePortList(customDeclarePort);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出申报口岸列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:declarePort:export')")
|
||||
@Log(title = "申报口岸", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomDeclarePort customDeclarePort)
|
||||
{
|
||||
List<CustomDeclarePort> list = customDeclarePortService.selectCustomDeclarePortList(customDeclarePort);
|
||||
ExcelUtil<CustomDeclarePort> util = new ExcelUtil<CustomDeclarePort>(CustomDeclarePort.class);
|
||||
return util.exportExcel(list, "declarePort");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取申报口岸详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:declarePort:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customDeclarePortService.selectCustomDeclarePortById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增申报口岸
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:declarePort:add')")
|
||||
@Log(title = "申报口岸", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomDeclarePort customDeclarePort)
|
||||
{
|
||||
return toAjax(customDeclarePortService.insertCustomDeclarePort(customDeclarePort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改申报口岸
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:declarePort:edit')")
|
||||
@Log(title = "申报口岸", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomDeclarePort customDeclarePort)
|
||||
{
|
||||
return toAjax(customDeclarePortService.updateCustomDeclarePort(customDeclarePort));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除申报口岸
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:declarePort:remove')")
|
||||
@Log(title = "申报口岸", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customDeclarePortService.deleteCustomDeclarePortByIds(ids));
|
||||
}
|
||||
}
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomEnterpriseRecord;
|
||||
import com.ruoyi.custom.service.ICustomEnterpriseRecordService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 企业备案Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/enterpriseRecord")
|
||||
public class CustomEnterpriseRecordController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomEnterpriseRecordService customEnterpriseRecordService;
|
||||
|
||||
/**
|
||||
* 查询企业备案列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:enterpriseRecord:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomEnterpriseRecord customEnterpriseRecord)
|
||||
{
|
||||
startPage();
|
||||
List<CustomEnterpriseRecord> list = customEnterpriseRecordService.selectCustomEnterpriseRecordList(customEnterpriseRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出企业备案列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:enterpriseRecord:export')")
|
||||
@Log(title = "企业备案", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomEnterpriseRecord customEnterpriseRecord)
|
||||
{
|
||||
List<CustomEnterpriseRecord> list = customEnterpriseRecordService.selectCustomEnterpriseRecordList(customEnterpriseRecord);
|
||||
ExcelUtil<CustomEnterpriseRecord> util = new ExcelUtil<CustomEnterpriseRecord>(CustomEnterpriseRecord.class);
|
||||
return util.exportExcel(list, "enterpriseRecord");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取企业备案详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:enterpriseRecord:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customEnterpriseRecordService.selectCustomEnterpriseRecordById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增企业备案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:enterpriseRecord:add')")
|
||||
@Log(title = "企业备案", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomEnterpriseRecord customEnterpriseRecord)
|
||||
{
|
||||
return toAjax(customEnterpriseRecordService.insertCustomEnterpriseRecord(customEnterpriseRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改企业备案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:enterpriseRecord:edit')")
|
||||
@Log(title = "企业备案", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomEnterpriseRecord customEnterpriseRecord)
|
||||
{
|
||||
return toAjax(customEnterpriseRecordService.updateCustomEnterpriseRecord(customEnterpriseRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除企业备案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:enterpriseRecord:remove')")
|
||||
@Log(title = "企业备案", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customEnterpriseRecordService.deleteCustomEnterpriseRecordByIds(ids));
|
||||
}
|
||||
}
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomFlightInfo;
|
||||
import com.ruoyi.custom.service.ICustomFlightInfoService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 航班信息Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/flightInfo")
|
||||
public class CustomFlightInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomFlightInfoService customFlightInfoService;
|
||||
|
||||
/**
|
||||
* 查询航班信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:flightInfo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomFlightInfo customFlightInfo)
|
||||
{
|
||||
startPage();
|
||||
List<CustomFlightInfo> list = customFlightInfoService.selectCustomFlightInfoList(customFlightInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出航班信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:flightInfo:export')")
|
||||
@Log(title = "航班信息", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomFlightInfo customFlightInfo)
|
||||
{
|
||||
List<CustomFlightInfo> list = customFlightInfoService.selectCustomFlightInfoList(customFlightInfo);
|
||||
ExcelUtil<CustomFlightInfo> util = new ExcelUtil<CustomFlightInfo>(CustomFlightInfo.class);
|
||||
return util.exportExcel(list, "flightInfo");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取航班信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:flightInfo:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customFlightInfoService.selectCustomFlightInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增航班信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:flightInfo:add')")
|
||||
@Log(title = "航班信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomFlightInfo customFlightInfo)
|
||||
{
|
||||
return toAjax(customFlightInfoService.insertCustomFlightInfo(customFlightInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改航班信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:flightInfo:edit')")
|
||||
@Log(title = "航班信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomFlightInfo customFlightInfo)
|
||||
{
|
||||
return toAjax(customFlightInfoService.updateCustomFlightInfo(customFlightInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除航班信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:flightInfo:remove')")
|
||||
@Log(title = "航班信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customFlightInfoService.deleteCustomFlightInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomHsCode;
|
||||
import com.ruoyi.custom.service.ICustomHsCodeService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* HS编码Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/hsCode")
|
||||
public class CustomHsCodeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomHsCodeService customHsCodeService;
|
||||
|
||||
/**
|
||||
* 查询HS编码列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:hsCode:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomHsCode customHsCode)
|
||||
{
|
||||
startPage();
|
||||
List<CustomHsCode> list = customHsCodeService.selectCustomHsCodeList(customHsCode);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出HS编码列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:hsCode:export')")
|
||||
@Log(title = "HS编码", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomHsCode customHsCode)
|
||||
{
|
||||
List<CustomHsCode> list = customHsCodeService.selectCustomHsCodeList(customHsCode);
|
||||
ExcelUtil<CustomHsCode> util = new ExcelUtil<CustomHsCode>(CustomHsCode.class);
|
||||
return util.exportExcel(list, "hsCode");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取HS编码详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:hsCode:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customHsCodeService.selectCustomHsCodeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增HS编码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:hsCode:add')")
|
||||
@Log(title = "HS编码", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomHsCode customHsCode)
|
||||
{
|
||||
return toAjax(customHsCodeService.insertCustomHsCode(customHsCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改HS编码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:hsCode:edit')")
|
||||
@Log(title = "HS编码", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomHsCode customHsCode)
|
||||
{
|
||||
return toAjax(customHsCodeService.updateCustomHsCode(customHsCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除HS编码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:hsCode:remove')")
|
||||
@Log(title = "HS编码", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customHsCodeService.deleteCustomHsCodeByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomInventory;
|
||||
import com.ruoyi.custom.service.ICustomInventoryService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 正面清单Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/inventory")
|
||||
public class CustomInventoryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomInventoryService customInventoryService;
|
||||
|
||||
/**
|
||||
* 查询正面清单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:inventory:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomInventory customInventory)
|
||||
{
|
||||
startPage();
|
||||
List<CustomInventory> list = customInventoryService.selectCustomInventoryList(customInventory);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出正面清单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:inventory:export')")
|
||||
@Log(title = "正面清单", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomInventory customInventory)
|
||||
{
|
||||
List<CustomInventory> list = customInventoryService.selectCustomInventoryList(customInventory);
|
||||
ExcelUtil<CustomInventory> util = new ExcelUtil<CustomInventory>(CustomInventory.class);
|
||||
return util.exportExcel(list, "inventory");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取正面清单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:inventory:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customInventoryService.selectCustomInventoryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增正面清单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:inventory:add')")
|
||||
@Log(title = "正面清单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomInventory customInventory)
|
||||
{
|
||||
return toAjax(customInventoryService.insertCustomInventory(customInventory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改正面清单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:inventory:edit')")
|
||||
@Log(title = "正面清单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomInventory customInventory)
|
||||
{
|
||||
return toAjax(customInventoryService.updateCustomInventory(customInventory));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除正面清单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:inventory:remove')")
|
||||
@Log(title = "正面清单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customInventoryService.deleteCustomInventoryByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomOrder;
|
||||
import com.ruoyi.custom.service.ICustomOrderService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 备案订单Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/order")
|
||||
public class CustomOrderController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomOrderService customOrderService;
|
||||
|
||||
/**
|
||||
* 查询备案订单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomOrder customOrder)
|
||||
{
|
||||
startPage();
|
||||
List<CustomOrder> list = customOrderService.selectCustomOrderList(customOrder);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出备案订单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:export')")
|
||||
@Log(title = "备案订单", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomOrder customOrder)
|
||||
{
|
||||
List<CustomOrder> list = customOrderService.selectCustomOrderList(customOrder);
|
||||
ExcelUtil<CustomOrder> util = new ExcelUtil<CustomOrder>(CustomOrder.class);
|
||||
return util.exportExcel(list, "order");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取备案订单详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customOrderService.selectCustomOrderById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增备案订单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:add')")
|
||||
@Log(title = "备案订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomOrder customOrder)
|
||||
{
|
||||
return toAjax(customOrderService.insertCustomOrder(customOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改备案订单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:edit')")
|
||||
@Log(title = "备案订单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomOrder customOrder)
|
||||
{
|
||||
return toAjax(customOrderService.updateCustomOrder(customOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除备案订单
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:remove')")
|
||||
@Log(title = "备案订单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customOrderService.deleteCustomOrderByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomOrderItem;
|
||||
import com.ruoyi.custom.service.ICustomOrderItemService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 备案订单项Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/orderItem")
|
||||
public class CustomOrderItemController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomOrderItemService customOrderItemService;
|
||||
|
||||
/**
|
||||
* 查询备案订单项列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:orderItem:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomOrderItem customOrderItem)
|
||||
{
|
||||
startPage();
|
||||
List<CustomOrderItem> list = customOrderItemService.selectCustomOrderItemList(customOrderItem);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出备案订单项列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:orderItem:export')")
|
||||
@Log(title = "备案订单项", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomOrderItem customOrderItem)
|
||||
{
|
||||
List<CustomOrderItem> list = customOrderItemService.selectCustomOrderItemList(customOrderItem);
|
||||
ExcelUtil<CustomOrderItem> util = new ExcelUtil<CustomOrderItem>(CustomOrderItem.class);
|
||||
return util.exportExcel(list, "orderItem");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取备案订单项详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:orderItem:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customOrderItemService.selectCustomOrderItemById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增备案订单项
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:orderItem:add')")
|
||||
@Log(title = "备案订单项", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomOrderItem customOrderItem)
|
||||
{
|
||||
return toAjax(customOrderItemService.insertCustomOrderItem(customOrderItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改备案订单项
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:orderItem:edit')")
|
||||
@Log(title = "备案订单项", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomOrderItem customOrderItem)
|
||||
{
|
||||
return toAjax(customOrderItemService.updateCustomOrderItem(customOrderItem));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除备案订单项
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:orderItem:remove')")
|
||||
@Log(title = "备案订单项", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customOrderItemService.deleteCustomOrderItemByIds(ids));
|
||||
}
|
||||
}
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomParcelNumber;
|
||||
import com.ruoyi.custom.service.ICustomParcelNumberService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 行邮税号Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/parcelNumber")
|
||||
public class CustomParcelNumberController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomParcelNumberService customParcelNumberService;
|
||||
|
||||
/**
|
||||
* 查询行邮税号列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:parcelNumber:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomParcelNumber customParcelNumber)
|
||||
{
|
||||
startPage();
|
||||
List<CustomParcelNumber> list = customParcelNumberService.selectCustomParcelNumberList(customParcelNumber);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出行邮税号列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:parcelNumber:export')")
|
||||
@Log(title = "行邮税号", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomParcelNumber customParcelNumber)
|
||||
{
|
||||
List<CustomParcelNumber> list = customParcelNumberService.selectCustomParcelNumberList(customParcelNumber);
|
||||
ExcelUtil<CustomParcelNumber> util = new ExcelUtil<CustomParcelNumber>(CustomParcelNumber.class);
|
||||
return util.exportExcel(list, "parcelNumber");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取行邮税号详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:parcelNumber:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customParcelNumberService.selectCustomParcelNumberById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增行邮税号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:parcelNumber:add')")
|
||||
@Log(title = "行邮税号", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomParcelNumber customParcelNumber)
|
||||
{
|
||||
return toAjax(customParcelNumberService.insertCustomParcelNumber(customParcelNumber));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改行邮税号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:parcelNumber:edit')")
|
||||
@Log(title = "行邮税号", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomParcelNumber customParcelNumber)
|
||||
{
|
||||
return toAjax(customParcelNumberService.updateCustomParcelNumber(customParcelNumber));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除行邮税号
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:parcelNumber:remove')")
|
||||
@Log(title = "行邮税号", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customParcelNumberService.deleteCustomParcelNumberByIds(ids));
|
||||
}
|
||||
}
|
||||
-103
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomProductRecord;
|
||||
import com.ruoyi.custom.service.ICustomProductRecordService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 商品备案Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/productRecord")
|
||||
public class CustomProductRecordController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomProductRecordService customProductRecordService;
|
||||
|
||||
/**
|
||||
* 查询商品备案列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:productRecord:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomProductRecord customProductRecord)
|
||||
{
|
||||
startPage();
|
||||
List<CustomProductRecord> list = customProductRecordService.selectCustomProductRecordList(customProductRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出商品备案列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:productRecord:export')")
|
||||
@Log(title = "商品备案", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomProductRecord customProductRecord)
|
||||
{
|
||||
List<CustomProductRecord> list = customProductRecordService.selectCustomProductRecordList(customProductRecord);
|
||||
ExcelUtil<CustomProductRecord> util = new ExcelUtil<CustomProductRecord>(CustomProductRecord.class);
|
||||
return util.exportExcel(list, "productRecord");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品备案详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:productRecord:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customProductRecordService.selectCustomProductRecordById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品备案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:productRecord:add')")
|
||||
@Log(title = "商品备案", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomProductRecord customProductRecord)
|
||||
{
|
||||
return toAjax(customProductRecordService.insertCustomProductRecord(customProductRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品备案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:productRecord:edit')")
|
||||
@Log(title = "商品备案", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomProductRecord customProductRecord)
|
||||
{
|
||||
return toAjax(customProductRecordService.updateCustomProductRecord(customProductRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品备案
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:productRecord:remove')")
|
||||
@Log(title = "商品备案", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customProductRecordService.deleteCustomProductRecordByIds(ids));
|
||||
}
|
||||
}
|
||||
-101
@@ -1,101 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomRegionCode;
|
||||
import com.ruoyi.custom.service.ICustomRegionCodeService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
|
||||
/**
|
||||
* 国家行政区划代码Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/regionCode")
|
||||
public class CustomRegionCodeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomRegionCodeService customRegionCodeService;
|
||||
|
||||
/**
|
||||
* 查询国家行政区划代码列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:regionCode:list')")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(CustomRegionCode customRegionCode)
|
||||
{
|
||||
List<CustomRegionCode> list = customRegionCodeService.selectCustomRegionCodeList(customRegionCode);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出国家行政区划代码列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:regionCode:export')")
|
||||
@Log(title = "国家行政区划代码", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomRegionCode customRegionCode)
|
||||
{
|
||||
List<CustomRegionCode> list = customRegionCodeService.selectCustomRegionCodeList(customRegionCode);
|
||||
ExcelUtil<CustomRegionCode> util = new ExcelUtil<CustomRegionCode>(CustomRegionCode.class);
|
||||
return util.exportExcel(list, "regionCode");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取国家行政区划代码详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:regionCode:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customRegionCodeService.selectCustomRegionCodeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增国家行政区划代码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:regionCode:add')")
|
||||
@Log(title = "国家行政区划代码", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomRegionCode customRegionCode)
|
||||
{
|
||||
return toAjax(customRegionCodeService.insertCustomRegionCode(customRegionCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改国家行政区划代码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:regionCode:edit')")
|
||||
@Log(title = "国家行政区划代码", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomRegionCode customRegionCode)
|
||||
{
|
||||
return toAjax(customRegionCodeService.updateCustomRegionCode(customRegionCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除国家行政区划代码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:regionCode:remove')")
|
||||
@Log(title = "国家行政区划代码", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customRegionCodeService.deleteCustomRegionCodeByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomUnitCode;
|
||||
import com.ruoyi.custom.service.ICustomUnitCodeService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 计量单位代码Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/unitCode")
|
||||
public class CustomUnitCodeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomUnitCodeService customUnitCodeService;
|
||||
|
||||
/**
|
||||
* 查询计量单位代码列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:unitCode:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomUnitCode customUnitCode)
|
||||
{
|
||||
startPage();
|
||||
List<CustomUnitCode> list = customUnitCodeService.selectCustomUnitCodeList(customUnitCode);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出计量单位代码列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:unitCode:export')")
|
||||
@Log(title = "计量单位代码", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomUnitCode customUnitCode)
|
||||
{
|
||||
List<CustomUnitCode> list = customUnitCodeService.selectCustomUnitCodeList(customUnitCode);
|
||||
ExcelUtil<CustomUnitCode> util = new ExcelUtil<CustomUnitCode>(CustomUnitCode.class);
|
||||
return util.exportExcel(list, "unitCode");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计量单位代码详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:unitCode:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customUnitCodeService.selectCustomUnitCodeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计量单位代码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:unitCode:add')")
|
||||
@Log(title = "计量单位代码", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomUnitCode customUnitCode)
|
||||
{
|
||||
return toAjax(customUnitCodeService.insertCustomUnitCode(customUnitCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计量单位代码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:unitCode:edit')")
|
||||
@Log(title = "计量单位代码", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomUnitCode customUnitCode)
|
||||
{
|
||||
return toAjax(customUnitCodeService.updateCustomUnitCode(customUnitCode));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计量单位代码
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:unitCode:remove')")
|
||||
@Log(title = "计量单位代码", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customUnitCodeService.deleteCustomUnitCodeByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,103 +0,0 @@
|
||||
package com.ruoyi.custom.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.custom.domain.CustomWarehouse;
|
||||
import com.ruoyi.custom.service.ICustomWarehouseService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 仓库Controller
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/warehouse")
|
||||
public class CustomWarehouseController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICustomWarehouseService customWarehouseService;
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:warehouse:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CustomWarehouse customWarehouse)
|
||||
{
|
||||
startPage();
|
||||
List<CustomWarehouse> list = customWarehouseService.selectCustomWarehouseList(customWarehouse);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出仓库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:warehouse:export')")
|
||||
@Log(title = "仓库", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(CustomWarehouse customWarehouse)
|
||||
{
|
||||
List<CustomWarehouse> list = customWarehouseService.selectCustomWarehouseList(customWarehouse);
|
||||
ExcelUtil<CustomWarehouse> util = new ExcelUtil<CustomWarehouse>(CustomWarehouse.class);
|
||||
return util.exportExcel(list, "warehouse");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取仓库详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:warehouse:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return AjaxResult.success(customWarehouseService.selectCustomWarehouseById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仓库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:warehouse:add')")
|
||||
@Log(title = "仓库", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CustomWarehouse customWarehouse)
|
||||
{
|
||||
return toAjax(customWarehouseService.insertCustomWarehouse(customWarehouse));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:warehouse:edit')")
|
||||
@Log(title = "仓库", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CustomWarehouse customWarehouse)
|
||||
{
|
||||
return toAjax(customWarehouseService.updateCustomWarehouse(customWarehouse));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:warehouse:remove')")
|
||||
@Log(title = "仓库", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(customWarehouseService.deleteCustomWarehouseByIds(ids));
|
||||
}
|
||||
}
|
||||
@@ -1,182 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 海关回查对象 custom_callback
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
public class CustomCallback extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 用户代码 */
|
||||
@Excel(name = "用户代码")
|
||||
private Long userId;
|
||||
|
||||
/** 海关备案代码 */
|
||||
@Excel(name = "海关备案代码")
|
||||
private String customsCode;
|
||||
|
||||
/** 申报订单号 */
|
||||
@Excel(name = "申报订单号")
|
||||
private String declareOrderNo;
|
||||
|
||||
/** 会话ID */
|
||||
@Excel(name = "会话ID")
|
||||
private String sessionId;
|
||||
|
||||
/** 会话时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "会话时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date serviceTime;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private Integer status;
|
||||
|
||||
/** 添加时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date addTime;
|
||||
|
||||
/** 上传结果 */
|
||||
@Excel(name = "上传结果")
|
||||
private String postResult;
|
||||
|
||||
/** 上传次数 */
|
||||
@Excel(name = "上传次数")
|
||||
private Long sendNumber;
|
||||
|
||||
/** 上传时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date sendTime;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setCustomsCode(String customsCode)
|
||||
{
|
||||
this.customsCode = customsCode;
|
||||
}
|
||||
|
||||
public String getCustomsCode()
|
||||
{
|
||||
return customsCode;
|
||||
}
|
||||
public void setDeclareOrderNo(String declareOrderNo)
|
||||
{
|
||||
this.declareOrderNo = declareOrderNo;
|
||||
}
|
||||
|
||||
public String getDeclareOrderNo()
|
||||
{
|
||||
return declareOrderNo;
|
||||
}
|
||||
public void setSessionId(String sessionId)
|
||||
{
|
||||
this.sessionId = sessionId;
|
||||
}
|
||||
|
||||
public String getSessionId()
|
||||
{
|
||||
return sessionId;
|
||||
}
|
||||
public void setServiceTime(Date serviceTime)
|
||||
{
|
||||
this.serviceTime = serviceTime;
|
||||
}
|
||||
|
||||
public Date getServiceTime()
|
||||
{
|
||||
return serviceTime;
|
||||
}
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setAddTime(Date addTime)
|
||||
{
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public Date getAddTime()
|
||||
{
|
||||
return addTime;
|
||||
}
|
||||
public void setPostResult(String postResult)
|
||||
{
|
||||
this.postResult = postResult;
|
||||
}
|
||||
|
||||
public String getPostResult()
|
||||
{
|
||||
return postResult;
|
||||
}
|
||||
public void setSendNumber(Long sendNumber)
|
||||
{
|
||||
this.sendNumber = sendNumber;
|
||||
}
|
||||
|
||||
public Long getSendNumber()
|
||||
{
|
||||
return sendNumber;
|
||||
}
|
||||
public void setSendTime(Date sendTime)
|
||||
{
|
||||
this.sendTime = sendTime;
|
||||
}
|
||||
|
||||
public Date getSendTime()
|
||||
{
|
||||
return sendTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("customsCode", getCustomsCode())
|
||||
.append("declareOrderNo", getDeclareOrderNo())
|
||||
.append("sessionId", getSessionId())
|
||||
.append("serviceTime", getServiceTime())
|
||||
.append("status", getStatus())
|
||||
.append("addTime", getAddTime())
|
||||
.append("postResult", getPostResult())
|
||||
.append("sendNumber", getSendNumber())
|
||||
.append("sendTime", getSendTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 海关回查对象 custom_callback
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@TableName(value = "custom_callback")
|
||||
public class CustomCallbackPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
/** 用户代码 */
|
||||
@Excel(name = "用户代码")
|
||||
private Long userId;
|
||||
/** 海关备案代码 */
|
||||
@Excel(name = "海关备案代码")
|
||||
private String customsCode;
|
||||
/** 申报订单号 */
|
||||
@Excel(name = "申报订单号")
|
||||
private String declareOrderNo;
|
||||
/** 会话ID */
|
||||
@Excel(name = "会话ID")
|
||||
private String sessionId;
|
||||
/** 会话时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "会话时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date serviceTime;
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private Integer status;
|
||||
/** 添加时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date addTime;
|
||||
/** 上传结果 */
|
||||
@Excel(name = "上传结果")
|
||||
private String postResult;
|
||||
/** 上传次数 */
|
||||
@Excel(name = "上传次数")
|
||||
private Long sendNumber;
|
||||
/** 上传时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date sendTime;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setCustomsCode(String customsCode)
|
||||
{
|
||||
this.customsCode = customsCode;
|
||||
}
|
||||
|
||||
public String getCustomsCode()
|
||||
{
|
||||
return customsCode;
|
||||
}
|
||||
public void setDeclareOrderNo(String declareOrderNo)
|
||||
{
|
||||
this.declareOrderNo = declareOrderNo;
|
||||
}
|
||||
|
||||
public String getDeclareOrderNo()
|
||||
{
|
||||
return declareOrderNo;
|
||||
}
|
||||
public void setSessionId(String sessionId)
|
||||
{
|
||||
this.sessionId = sessionId;
|
||||
}
|
||||
|
||||
public String getSessionId()
|
||||
{
|
||||
return sessionId;
|
||||
}
|
||||
public void setServiceTime(Date serviceTime)
|
||||
{
|
||||
this.serviceTime = serviceTime;
|
||||
}
|
||||
|
||||
public Date getServiceTime()
|
||||
{
|
||||
return serviceTime;
|
||||
}
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setAddTime(Date addTime)
|
||||
{
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public Date getAddTime()
|
||||
{
|
||||
return addTime;
|
||||
}
|
||||
public void setPostResult(String postResult)
|
||||
{
|
||||
this.postResult = postResult;
|
||||
}
|
||||
|
||||
public String getPostResult()
|
||||
{
|
||||
return postResult;
|
||||
}
|
||||
public void setSendNumber(Long sendNumber)
|
||||
{
|
||||
this.sendNumber = sendNumber;
|
||||
}
|
||||
|
||||
public Long getSendNumber()
|
||||
{
|
||||
return sendNumber;
|
||||
}
|
||||
public void setSendTime(Date sendTime)
|
||||
{
|
||||
this.sendTime = sendTime;
|
||||
}
|
||||
|
||||
public Date getSendTime()
|
||||
{
|
||||
return sendTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("customsCode", getCustomsCode())
|
||||
.append("declareOrderNo", getDeclareOrderNo())
|
||||
.append("sessionId", getSessionId())
|
||||
.append("serviceTime", getServiceTime())
|
||||
.append("status", getStatus())
|
||||
.append("addTime", getAddTime())
|
||||
.append("postResult", getPostResult())
|
||||
.append("sendNumber", getSendNumber())
|
||||
.append("sendTime", getSendTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 国别代码对象 custom_country_code
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
public class CustomCountryCode extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 代码 */
|
||||
@Excel(name = "代码")
|
||||
private String code;
|
||||
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("code", getCode())
|
||||
.append("name", getName())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 国别代码对象 custom_country_code
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@TableName(value = "custom_country_code")
|
||||
public class CustomCountryCodePlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
/** 代码 */
|
||||
@Excel(name = "代码")
|
||||
private String code;
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("code", getCode())
|
||||
.append("name", getName())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 申报口岸对象 custom_declare_port
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
public class CustomDeclarePort extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 关区名称 */
|
||||
@Excel(name = "关区名称")
|
||||
private String name;
|
||||
|
||||
/** 关区编码 */
|
||||
@Excel(name = "关区编码")
|
||||
private String code;
|
||||
|
||||
/** 描述 */
|
||||
@Excel(name = "描述")
|
||||
private String describe;
|
||||
|
||||
/** 直属关区 */
|
||||
@Excel(name = "直属关区")
|
||||
private String directlyName;
|
||||
|
||||
/** 简称 */
|
||||
@Excel(name = "简称")
|
||||
private String shortName;
|
||||
|
||||
/** 是否使用 */
|
||||
@Excel(name = "是否使用")
|
||||
private Integer isUse;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setDescribe(String describe)
|
||||
{
|
||||
this.describe = describe;
|
||||
}
|
||||
|
||||
public String getDescribe()
|
||||
{
|
||||
return describe;
|
||||
}
|
||||
public void setDirectlyName(String directlyName)
|
||||
{
|
||||
this.directlyName = directlyName;
|
||||
}
|
||||
|
||||
public String getDirectlyName()
|
||||
{
|
||||
return directlyName;
|
||||
}
|
||||
public void setShortName(String shortName)
|
||||
{
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
public String getShortName()
|
||||
{
|
||||
return shortName;
|
||||
}
|
||||
public void setIsUse(Integer isUse)
|
||||
{
|
||||
this.isUse = isUse;
|
||||
}
|
||||
|
||||
public Integer getIsUse()
|
||||
{
|
||||
return isUse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("code", getCode())
|
||||
.append("describe", getDescribe())
|
||||
.append("directlyName", getDirectlyName())
|
||||
.append("shortName", getShortName())
|
||||
.append("isUse", getIsUse())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 申报口岸对象 custom_declare_port
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@TableName(value = "custom_declare_port")
|
||||
public class CustomDeclarePortPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
/** 关区名称 */
|
||||
@Excel(name = "关区名称")
|
||||
private String name;
|
||||
/** 关区编码 */
|
||||
@Excel(name = "关区编码")
|
||||
private String code;
|
||||
/** 描述 */
|
||||
@Excel(name = "描述")
|
||||
private String describe;
|
||||
/** 直属关区 */
|
||||
@Excel(name = "直属关区")
|
||||
private String directlyName;
|
||||
/** 简称 */
|
||||
@Excel(name = "简称")
|
||||
private String shortName;
|
||||
/** 是否使用 */
|
||||
@Excel(name = "是否使用")
|
||||
private Integer isUse;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setDescribe(String describe)
|
||||
{
|
||||
this.describe = describe;
|
||||
}
|
||||
|
||||
public String getDescribe()
|
||||
{
|
||||
return describe;
|
||||
}
|
||||
public void setDirectlyName(String directlyName)
|
||||
{
|
||||
this.directlyName = directlyName;
|
||||
}
|
||||
|
||||
public String getDirectlyName()
|
||||
{
|
||||
return directlyName;
|
||||
}
|
||||
public void setShortName(String shortName)
|
||||
{
|
||||
this.shortName = shortName;
|
||||
}
|
||||
|
||||
public String getShortName()
|
||||
{
|
||||
return shortName;
|
||||
}
|
||||
public void setIsUse(Integer isUse)
|
||||
{
|
||||
this.isUse = isUse;
|
||||
}
|
||||
|
||||
public Integer getIsUse()
|
||||
{
|
||||
return isUse;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("code", getCode())
|
||||
.append("describe", getDescribe())
|
||||
.append("directlyName", getDirectlyName())
|
||||
.append("shortName", getShortName())
|
||||
.append("isUse", getIsUse())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,248 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 企业备案对象 custom_enterprise_record
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
public class CustomEnterpriseRecord extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 申报口岸Id */
|
||||
@Excel(name = "申报口岸Id")
|
||||
private Long declarePortId;
|
||||
|
||||
/** 用户id */
|
||||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/** 电商平台域名 */
|
||||
@Excel(name = "电商平台域名")
|
||||
private String domainName;
|
||||
|
||||
/** 备案企业名称 */
|
||||
@Excel(name = "备案企业名称")
|
||||
private String enterpriseName;
|
||||
|
||||
/** 电商平台简称 */
|
||||
@Excel(name = "电商平台简称")
|
||||
private String platformShort;
|
||||
|
||||
/** 商家简称 */
|
||||
@Excel(name = "商家简称")
|
||||
private String businessShort;
|
||||
|
||||
/** 统一信用代码 */
|
||||
@Excel(name = "统一信用代码")
|
||||
private String creditCode;
|
||||
|
||||
/** 海关备案编码 */
|
||||
@Excel(name = "海关备案编码")
|
||||
private String customsCode;
|
||||
|
||||
/** 国检备案编码 */
|
||||
@Excel(name = "国检备案编码")
|
||||
private String nationalCode;
|
||||
|
||||
/** 海关支付单查询加密URL */
|
||||
@Excel(name = "海关支付单查询加密URL")
|
||||
private String encryptUrl;
|
||||
|
||||
/** 担保企业代码 */
|
||||
@Excel(name = "担保企业代码")
|
||||
private String geCode;
|
||||
|
||||
/** 传输报文编码 */
|
||||
@Excel(name = "传输报文编码")
|
||||
private String messageCode;
|
||||
|
||||
/** 报文传输安全密钥 */
|
||||
@Excel(name = "报文传输安全密钥")
|
||||
private String kjdsKey;
|
||||
|
||||
/** FTP网址 */
|
||||
@Excel(name = "FTP网址")
|
||||
private String ftpServerIp;
|
||||
|
||||
/** FTP密码 */
|
||||
@Excel(name = "FTP密码")
|
||||
private String ftpPassword;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setDeclarePortId(Long declarePortId)
|
||||
{
|
||||
this.declarePortId = declarePortId;
|
||||
}
|
||||
|
||||
public Long getDeclarePortId()
|
||||
{
|
||||
return declarePortId;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setDomainName(String domainName)
|
||||
{
|
||||
this.domainName = domainName;
|
||||
}
|
||||
|
||||
public String getDomainName()
|
||||
{
|
||||
return domainName;
|
||||
}
|
||||
public void setEnterpriseName(String enterpriseName)
|
||||
{
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getEnterpriseName()
|
||||
{
|
||||
return enterpriseName;
|
||||
}
|
||||
public void setPlatformShort(String platformShort)
|
||||
{
|
||||
this.platformShort = platformShort;
|
||||
}
|
||||
|
||||
public String getPlatformShort()
|
||||
{
|
||||
return platformShort;
|
||||
}
|
||||
public void setBusinessShort(String businessShort)
|
||||
{
|
||||
this.businessShort = businessShort;
|
||||
}
|
||||
|
||||
public String getBusinessShort()
|
||||
{
|
||||
return businessShort;
|
||||
}
|
||||
public void setCreditCode(String creditCode)
|
||||
{
|
||||
this.creditCode = creditCode;
|
||||
}
|
||||
|
||||
public String getCreditCode()
|
||||
{
|
||||
return creditCode;
|
||||
}
|
||||
public void setCustomsCode(String customsCode)
|
||||
{
|
||||
this.customsCode = customsCode;
|
||||
}
|
||||
|
||||
public String getCustomsCode()
|
||||
{
|
||||
return customsCode;
|
||||
}
|
||||
public void setNationalCode(String nationalCode)
|
||||
{
|
||||
this.nationalCode = nationalCode;
|
||||
}
|
||||
|
||||
public String getNationalCode()
|
||||
{
|
||||
return nationalCode;
|
||||
}
|
||||
public void setEncryptUrl(String encryptUrl)
|
||||
{
|
||||
this.encryptUrl = encryptUrl;
|
||||
}
|
||||
|
||||
public String getEncryptUrl()
|
||||
{
|
||||
return encryptUrl;
|
||||
}
|
||||
public void setGeCode(String geCode)
|
||||
{
|
||||
this.geCode = geCode;
|
||||
}
|
||||
|
||||
public String getGeCode()
|
||||
{
|
||||
return geCode;
|
||||
}
|
||||
public void setMessageCode(String messageCode)
|
||||
{
|
||||
this.messageCode = messageCode;
|
||||
}
|
||||
|
||||
public String getMessageCode()
|
||||
{
|
||||
return messageCode;
|
||||
}
|
||||
public void setKjdsKey(String kjdsKey)
|
||||
{
|
||||
this.kjdsKey = kjdsKey;
|
||||
}
|
||||
|
||||
public String getKjdsKey()
|
||||
{
|
||||
return kjdsKey;
|
||||
}
|
||||
public void setFtpServerIp(String ftpServerIp)
|
||||
{
|
||||
this.ftpServerIp = ftpServerIp;
|
||||
}
|
||||
|
||||
public String getFtpServerIp()
|
||||
{
|
||||
return ftpServerIp;
|
||||
}
|
||||
public void setFtpPassword(String ftpPassword)
|
||||
{
|
||||
this.ftpPassword = ftpPassword;
|
||||
}
|
||||
|
||||
public String getFtpPassword()
|
||||
{
|
||||
return ftpPassword;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("declarePortId", getDeclarePortId())
|
||||
.append("userId", getUserId())
|
||||
.append("domainName", getDomainName())
|
||||
.append("enterpriseName", getEnterpriseName())
|
||||
.append("platformShort", getPlatformShort())
|
||||
.append("businessShort", getBusinessShort())
|
||||
.append("creditCode", getCreditCode())
|
||||
.append("customsCode", getCustomsCode())
|
||||
.append("nationalCode", getNationalCode())
|
||||
.append("encryptUrl", getEncryptUrl())
|
||||
.append("geCode", getGeCode())
|
||||
.append("messageCode", getMessageCode())
|
||||
.append("kjdsKey", getKjdsKey())
|
||||
.append("ftpServerIp", getFtpServerIp())
|
||||
.append("ftpPassword", getFtpPassword())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,247 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 企业备案对象 custom_enterprise_record
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@TableName(value = "custom_enterprise_record")
|
||||
public class CustomEnterpriseRecordPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
/** 申报口岸Id */
|
||||
@Excel(name = "申报口岸Id")
|
||||
private Long declarePortId;
|
||||
/** 用户id */
|
||||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
/** 电商平台域名 */
|
||||
@Excel(name = "电商平台域名")
|
||||
private String domainName;
|
||||
/** 备案企业名称 */
|
||||
@Excel(name = "备案企业名称")
|
||||
private String enterpriseName;
|
||||
/** 电商平台简称 */
|
||||
@Excel(name = "电商平台简称")
|
||||
private String platformShort;
|
||||
/** 商家简称 */
|
||||
@Excel(name = "商家简称")
|
||||
private String businessShort;
|
||||
/** 统一信用代码 */
|
||||
@Excel(name = "统一信用代码")
|
||||
private String creditCode;
|
||||
/** 海关备案编码 */
|
||||
@Excel(name = "海关备案编码")
|
||||
private String customsCode;
|
||||
/** 国检备案编码 */
|
||||
@Excel(name = "国检备案编码")
|
||||
private String nationalCode;
|
||||
/** 海关支付单查询加密URL */
|
||||
@Excel(name = "海关支付单查询加密URL")
|
||||
private String encryptUrl;
|
||||
/** 担保企业代码 */
|
||||
@Excel(name = "担保企业代码")
|
||||
private String geCode;
|
||||
/** 传输报文编码 */
|
||||
@Excel(name = "传输报文编码")
|
||||
private String messageCode;
|
||||
/** 报文传输安全密钥 */
|
||||
@Excel(name = "报文传输安全密钥")
|
||||
private String kjdsKey;
|
||||
/** FTP网址 */
|
||||
@Excel(name = "FTP网址")
|
||||
private String ftpServerIp;
|
||||
/** FTP密码 */
|
||||
@Excel(name = "FTP密码")
|
||||
private String ftpPassword;
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setDeclarePortId(Long declarePortId)
|
||||
{
|
||||
this.declarePortId = declarePortId;
|
||||
}
|
||||
|
||||
public Long getDeclarePortId()
|
||||
{
|
||||
return declarePortId;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setDomainName(String domainName)
|
||||
{
|
||||
this.domainName = domainName;
|
||||
}
|
||||
|
||||
public String getDomainName()
|
||||
{
|
||||
return domainName;
|
||||
}
|
||||
public void setEnterpriseName(String enterpriseName)
|
||||
{
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getEnterpriseName()
|
||||
{
|
||||
return enterpriseName;
|
||||
}
|
||||
public void setPlatformShort(String platformShort)
|
||||
{
|
||||
this.platformShort = platformShort;
|
||||
}
|
||||
|
||||
public String getPlatformShort()
|
||||
{
|
||||
return platformShort;
|
||||
}
|
||||
public void setBusinessShort(String businessShort)
|
||||
{
|
||||
this.businessShort = businessShort;
|
||||
}
|
||||
|
||||
public String getBusinessShort()
|
||||
{
|
||||
return businessShort;
|
||||
}
|
||||
public void setCreditCode(String creditCode)
|
||||
{
|
||||
this.creditCode = creditCode;
|
||||
}
|
||||
|
||||
public String getCreditCode()
|
||||
{
|
||||
return creditCode;
|
||||
}
|
||||
public void setCustomsCode(String customsCode)
|
||||
{
|
||||
this.customsCode = customsCode;
|
||||
}
|
||||
|
||||
public String getCustomsCode()
|
||||
{
|
||||
return customsCode;
|
||||
}
|
||||
public void setNationalCode(String nationalCode)
|
||||
{
|
||||
this.nationalCode = nationalCode;
|
||||
}
|
||||
|
||||
public String getNationalCode()
|
||||
{
|
||||
return nationalCode;
|
||||
}
|
||||
public void setEncryptUrl(String encryptUrl)
|
||||
{
|
||||
this.encryptUrl = encryptUrl;
|
||||
}
|
||||
|
||||
public String getEncryptUrl()
|
||||
{
|
||||
return encryptUrl;
|
||||
}
|
||||
public void setGeCode(String geCode)
|
||||
{
|
||||
this.geCode = geCode;
|
||||
}
|
||||
|
||||
public String getGeCode()
|
||||
{
|
||||
return geCode;
|
||||
}
|
||||
public void setMessageCode(String messageCode)
|
||||
{
|
||||
this.messageCode = messageCode;
|
||||
}
|
||||
|
||||
public String getMessageCode()
|
||||
{
|
||||
return messageCode;
|
||||
}
|
||||
public void setKjdsKey(String kjdsKey)
|
||||
{
|
||||
this.kjdsKey = kjdsKey;
|
||||
}
|
||||
|
||||
public String getKjdsKey()
|
||||
{
|
||||
return kjdsKey;
|
||||
}
|
||||
public void setFtpServerIp(String ftpServerIp)
|
||||
{
|
||||
this.ftpServerIp = ftpServerIp;
|
||||
}
|
||||
|
||||
public String getFtpServerIp()
|
||||
{
|
||||
return ftpServerIp;
|
||||
}
|
||||
public void setFtpPassword(String ftpPassword)
|
||||
{
|
||||
this.ftpPassword = ftpPassword;
|
||||
}
|
||||
|
||||
public String getFtpPassword()
|
||||
{
|
||||
return ftpPassword;
|
||||
}
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("declarePortId", getDeclarePortId())
|
||||
.append("userId", getUserId())
|
||||
.append("domainName", getDomainName())
|
||||
.append("enterpriseName", getEnterpriseName())
|
||||
.append("platformShort", getPlatformShort())
|
||||
.append("businessShort", getBusinessShort())
|
||||
.append("creditCode", getCreditCode())
|
||||
.append("customsCode", getCustomsCode())
|
||||
.append("nationalCode", getNationalCode())
|
||||
.append("encryptUrl", getEncryptUrl())
|
||||
.append("geCode", getGeCode())
|
||||
.append("messageCode", getMessageCode())
|
||||
.append("kjdsKey", getKjdsKey())
|
||||
.append("ftpServerIp", getFtpServerIp())
|
||||
.append("ftpPassword", getFtpPassword())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,407 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 航班信息对象 custom_flight_info
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
public class CustomFlightInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 用户id */
|
||||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/** 仓库Id */
|
||||
@Excel(name = "仓库Id")
|
||||
private Long warehouseId;
|
||||
|
||||
/** 申报口岸Id */
|
||||
@Excel(name = "申报口岸Id")
|
||||
private Long declarePortId;
|
||||
|
||||
/** 清关模式:1(BC);0(个人) */
|
||||
@Excel(name = "清关模式:1", readConverterExp = "B=C")
|
||||
private Integer mode;
|
||||
|
||||
/** 批次号 */
|
||||
@Excel(name = "批次号")
|
||||
private String batchNumber;
|
||||
|
||||
/** 提运单号 */
|
||||
@Excel(name = "提运单号")
|
||||
private String deliveryNumber;
|
||||
|
||||
/** 运输方式:2、水路运输;3、铁路运输;4、公路运输;5、航空运输;6、邮件运输;9、其它运输 */
|
||||
@Excel(name = "运输方式:2、水路运输;3、铁路运输;4、公路运输;5、航空运输;6、邮件运输;9、其它运输")
|
||||
private Integer trafMode;
|
||||
|
||||
/** 航空公司 */
|
||||
@Excel(name = "航空公司")
|
||||
private String airline;
|
||||
|
||||
/** 起运国 */
|
||||
@Excel(name = "起运国")
|
||||
private String departureCountry;
|
||||
|
||||
/** 始发城市 */
|
||||
@Excel(name = "始发城市")
|
||||
private String departureCity;
|
||||
|
||||
/** 始发机场 */
|
||||
@Excel(name = "始发机场")
|
||||
private String departureAirport;
|
||||
|
||||
/** 中转机场 */
|
||||
@Excel(name = "中转机场")
|
||||
private String transitAirport;
|
||||
|
||||
/** 到达机场 */
|
||||
@Excel(name = "到达机场")
|
||||
private String arriveAirport;
|
||||
|
||||
/** 航班号 */
|
||||
@Excel(name = "航班号")
|
||||
private String flightNumber;
|
||||
|
||||
/** 是否直航 */
|
||||
@Excel(name = "是否直航")
|
||||
private Integer isDirectFlight;
|
||||
|
||||
/** 是否我司订舱 */
|
||||
@Excel(name = "是否我司订舱")
|
||||
private Integer isOurBooking;
|
||||
|
||||
/** 出发时间(当地) */
|
||||
@Excel(name = "出发时间", readConverterExp = "当=地")
|
||||
private Date departureLocalTime;
|
||||
|
||||
/** 出发时间(北京) */
|
||||
@Excel(name = "出发时间", readConverterExp = "北=京")
|
||||
private Date departureTime;
|
||||
|
||||
/** 到达时间(北京) */
|
||||
@Excel(name = "到达时间", readConverterExp = "北=京")
|
||||
private Date arriveTime;
|
||||
|
||||
/** 实际到达时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "实际到达时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date actualArriveTime;
|
||||
|
||||
/** 托盘数 */
|
||||
@Excel(name = "托盘数")
|
||||
private Integer trayNumber;
|
||||
|
||||
/** 包裹数 */
|
||||
@Excel(name = "包裹数")
|
||||
private Integer packageNumber;
|
||||
|
||||
/** 总重量(KG) */
|
||||
@Excel(name = "总重量", readConverterExp = "K=G")
|
||||
private BigDecimal weight;
|
||||
|
||||
/** 计费重量(KG) */
|
||||
@Excel(name = "计费重量", readConverterExp = "K=G")
|
||||
private BigDecimal chargeableWeight;
|
||||
|
||||
/** 总体积(立方米) */
|
||||
@Excel(name = "总体积", readConverterExp = "立=方米")
|
||||
private BigDecimal volume;
|
||||
|
||||
/** 添加时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date addTime;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setWarehouseId(Long warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public Long getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
public void setDeclarePortId(Long declarePortId)
|
||||
{
|
||||
this.declarePortId = declarePortId;
|
||||
}
|
||||
|
||||
public Long getDeclarePortId()
|
||||
{
|
||||
return declarePortId;
|
||||
}
|
||||
public void setMode(Integer mode)
|
||||
{
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public Integer getMode()
|
||||
{
|
||||
return mode;
|
||||
}
|
||||
public void setBatchNumber(String batchNumber)
|
||||
{
|
||||
this.batchNumber = batchNumber;
|
||||
}
|
||||
|
||||
public String getBatchNumber()
|
||||
{
|
||||
return batchNumber;
|
||||
}
|
||||
public void setDeliveryNumber(String deliveryNumber)
|
||||
{
|
||||
this.deliveryNumber = deliveryNumber;
|
||||
}
|
||||
|
||||
public String getDeliveryNumber()
|
||||
{
|
||||
return deliveryNumber;
|
||||
}
|
||||
public void setTrafMode(Integer trafMode)
|
||||
{
|
||||
this.trafMode = trafMode;
|
||||
}
|
||||
|
||||
public Integer getTrafMode()
|
||||
{
|
||||
return trafMode;
|
||||
}
|
||||
public void setAirline(String airline)
|
||||
{
|
||||
this.airline = airline;
|
||||
}
|
||||
|
||||
public String getAirline()
|
||||
{
|
||||
return airline;
|
||||
}
|
||||
public void setDepartureCountry(String departureCountry)
|
||||
{
|
||||
this.departureCountry = departureCountry;
|
||||
}
|
||||
|
||||
public String getDepartureCountry()
|
||||
{
|
||||
return departureCountry;
|
||||
}
|
||||
public void setDepartureCity(String departureCity)
|
||||
{
|
||||
this.departureCity = departureCity;
|
||||
}
|
||||
|
||||
public String getDepartureCity()
|
||||
{
|
||||
return departureCity;
|
||||
}
|
||||
public void setDepartureAirport(String departureAirport)
|
||||
{
|
||||
this.departureAirport = departureAirport;
|
||||
}
|
||||
|
||||
public String getDepartureAirport()
|
||||
{
|
||||
return departureAirport;
|
||||
}
|
||||
public void setTransitAirport(String transitAirport)
|
||||
{
|
||||
this.transitAirport = transitAirport;
|
||||
}
|
||||
|
||||
public String getTransitAirport()
|
||||
{
|
||||
return transitAirport;
|
||||
}
|
||||
public void setArriveAirport(String arriveAirport)
|
||||
{
|
||||
this.arriveAirport = arriveAirport;
|
||||
}
|
||||
|
||||
public String getArriveAirport()
|
||||
{
|
||||
return arriveAirport;
|
||||
}
|
||||
public void setFlightNumber(String flightNumber)
|
||||
{
|
||||
this.flightNumber = flightNumber;
|
||||
}
|
||||
|
||||
public String getFlightNumber()
|
||||
{
|
||||
return flightNumber;
|
||||
}
|
||||
public void setIsDirectFlight(Integer isDirectFlight)
|
||||
{
|
||||
this.isDirectFlight = isDirectFlight;
|
||||
}
|
||||
|
||||
public Integer getIsDirectFlight()
|
||||
{
|
||||
return isDirectFlight;
|
||||
}
|
||||
public void setIsOurBooking(Integer isOurBooking)
|
||||
{
|
||||
this.isOurBooking = isOurBooking;
|
||||
}
|
||||
|
||||
public Integer getIsOurBooking()
|
||||
{
|
||||
return isOurBooking;
|
||||
}
|
||||
public void setDepartureLocalTime(Date departureLocalTime)
|
||||
{
|
||||
this.departureLocalTime = departureLocalTime;
|
||||
}
|
||||
|
||||
public Date getDepartureLocalTime()
|
||||
{
|
||||
return departureLocalTime;
|
||||
}
|
||||
public void setDepartureTime(Date departureTime)
|
||||
{
|
||||
this.departureTime = departureTime;
|
||||
}
|
||||
|
||||
public Date getDepartureTime()
|
||||
{
|
||||
return departureTime;
|
||||
}
|
||||
public void setArriveTime(Date arriveTime)
|
||||
{
|
||||
this.arriveTime = arriveTime;
|
||||
}
|
||||
|
||||
public Date getArriveTime()
|
||||
{
|
||||
return arriveTime;
|
||||
}
|
||||
public void setActualArriveTime(Date actualArriveTime)
|
||||
{
|
||||
this.actualArriveTime = actualArriveTime;
|
||||
}
|
||||
|
||||
public Date getActualArriveTime()
|
||||
{
|
||||
return actualArriveTime;
|
||||
}
|
||||
public void setTrayNumber(Integer trayNumber)
|
||||
{
|
||||
this.trayNumber = trayNumber;
|
||||
}
|
||||
|
||||
public Integer getTrayNumber()
|
||||
{
|
||||
return trayNumber;
|
||||
}
|
||||
public void setPackageNumber(Integer packageNumber)
|
||||
{
|
||||
this.packageNumber = packageNumber;
|
||||
}
|
||||
|
||||
public Integer getPackageNumber()
|
||||
{
|
||||
return packageNumber;
|
||||
}
|
||||
public void setWeight(BigDecimal weight)
|
||||
{
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public BigDecimal getWeight()
|
||||
{
|
||||
return weight;
|
||||
}
|
||||
public void setChargeableWeight(BigDecimal chargeableWeight)
|
||||
{
|
||||
this.chargeableWeight = chargeableWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getChargeableWeight()
|
||||
{
|
||||
return chargeableWeight;
|
||||
}
|
||||
public void setVolume(BigDecimal volume)
|
||||
{
|
||||
this.volume = volume;
|
||||
}
|
||||
|
||||
public BigDecimal getVolume()
|
||||
{
|
||||
return volume;
|
||||
}
|
||||
public void setAddTime(Date addTime)
|
||||
{
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public Date getAddTime()
|
||||
{
|
||||
return addTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("declarePortId", getDeclarePortId())
|
||||
.append("mode", getMode())
|
||||
.append("batchNumber", getBatchNumber())
|
||||
.append("deliveryNumber", getDeliveryNumber())
|
||||
.append("trafMode", getTrafMode())
|
||||
.append("airline", getAirline())
|
||||
.append("departureCountry", getDepartureCountry())
|
||||
.append("departureCity", getDepartureCity())
|
||||
.append("departureAirport", getDepartureAirport())
|
||||
.append("transitAirport", getTransitAirport())
|
||||
.append("arriveAirport", getArriveAirport())
|
||||
.append("flightNumber", getFlightNumber())
|
||||
.append("isDirectFlight", getIsDirectFlight())
|
||||
.append("isOurBooking", getIsOurBooking())
|
||||
.append("departureLocalTime", getDepartureLocalTime())
|
||||
.append("departureTime", getDepartureTime())
|
||||
.append("arriveTime", getArriveTime())
|
||||
.append("actualArriveTime", getActualArriveTime())
|
||||
.append("trayNumber", getTrayNumber())
|
||||
.append("packageNumber", getPackageNumber())
|
||||
.append("weight", getWeight())
|
||||
.append("chargeableWeight", getChargeableWeight())
|
||||
.append("volume", getVolume())
|
||||
.append("remark", getRemark())
|
||||
.append("addTime", getAddTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,395 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 航班信息对象 custom_flight_info
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@TableName(value = "custom_flight_info")
|
||||
public class CustomFlightInfoPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
/** 用户id */
|
||||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
/** 仓库Id */
|
||||
@Excel(name = "仓库Id")
|
||||
private Long warehouseId;
|
||||
/** 申报口岸Id */
|
||||
@Excel(name = "申报口岸Id")
|
||||
private Long declarePortId;
|
||||
/** 清关模式:1(BC);0(个人) */
|
||||
@Excel(name = "清关模式:1", readConverterExp = "B=C")
|
||||
private Integer mode;
|
||||
/** 批次号 */
|
||||
@Excel(name = "批次号")
|
||||
private String batchNumber;
|
||||
/** 提运单号 */
|
||||
@Excel(name = "提运单号")
|
||||
private String deliveryNumber;
|
||||
/** 运输方式:2、水路运输;3、铁路运输;4、公路运输;5、航空运输;6、邮件运输;9、其它运输 */
|
||||
@Excel(name = "运输方式:2、水路运输;3、铁路运输;4、公路运输;5、航空运输;6、邮件运输;9、其它运输")
|
||||
private Integer trafMode;
|
||||
/** 航空公司 */
|
||||
@Excel(name = "航空公司")
|
||||
private String airline;
|
||||
/** 起运国 */
|
||||
@Excel(name = "起运国")
|
||||
private String departureCountry;
|
||||
/** 始发城市 */
|
||||
@Excel(name = "始发城市")
|
||||
private String departureCity;
|
||||
/** 始发机场 */
|
||||
@Excel(name = "始发机场")
|
||||
private String departureAirport;
|
||||
/** 中转机场 */
|
||||
@Excel(name = "中转机场")
|
||||
private String transitAirport;
|
||||
/** 到达机场 */
|
||||
@Excel(name = "到达机场")
|
||||
private String arriveAirport;
|
||||
/** 航班号 */
|
||||
@Excel(name = "航班号")
|
||||
private String flightNumber;
|
||||
/** 是否直航 */
|
||||
@Excel(name = "是否直航")
|
||||
private Integer isDirectFlight;
|
||||
/** 是否我司订舱 */
|
||||
@Excel(name = "是否我司订舱")
|
||||
private Integer isOurBooking;
|
||||
/** 出发时间(当地) */
|
||||
@Excel(name = "出发时间", readConverterExp = "当=地")
|
||||
private Date departureLocalTime;
|
||||
/** 出发时间(北京) */
|
||||
@Excel(name = "出发时间", readConverterExp = "北=京")
|
||||
private Date departureTime;
|
||||
/** 到达时间(北京) */
|
||||
@Excel(name = "到达时间", readConverterExp = "北=京")
|
||||
private Date arriveTime;
|
||||
/** 实际到达时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "实际到达时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date actualArriveTime;
|
||||
/** 托盘数 */
|
||||
@Excel(name = "托盘数")
|
||||
private Integer trayNumber;
|
||||
/** 包裹数 */
|
||||
@Excel(name = "包裹数")
|
||||
private Integer packageNumber;
|
||||
/** 总重量(KG) */
|
||||
@Excel(name = "总重量", readConverterExp = "K=G")
|
||||
private BigDecimal weight;
|
||||
/** 计费重量(KG) */
|
||||
@Excel(name = "计费重量", readConverterExp = "K=G")
|
||||
private BigDecimal chargeableWeight;
|
||||
/** 总体积(立方米) */
|
||||
@Excel(name = "总体积", readConverterExp = "立=方米")
|
||||
private BigDecimal volume;
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
/** 添加时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date addTime;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setWarehouseId(Long warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public Long getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
public void setDeclarePortId(Long declarePortId)
|
||||
{
|
||||
this.declarePortId = declarePortId;
|
||||
}
|
||||
|
||||
public Long getDeclarePortId()
|
||||
{
|
||||
return declarePortId;
|
||||
}
|
||||
public void setMode(Integer mode)
|
||||
{
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public Integer getMode()
|
||||
{
|
||||
return mode;
|
||||
}
|
||||
public void setBatchNumber(String batchNumber)
|
||||
{
|
||||
this.batchNumber = batchNumber;
|
||||
}
|
||||
|
||||
public String getBatchNumber()
|
||||
{
|
||||
return batchNumber;
|
||||
}
|
||||
public void setDeliveryNumber(String deliveryNumber)
|
||||
{
|
||||
this.deliveryNumber = deliveryNumber;
|
||||
}
|
||||
|
||||
public String getDeliveryNumber()
|
||||
{
|
||||
return deliveryNumber;
|
||||
}
|
||||
public void setTrafMode(Integer trafMode)
|
||||
{
|
||||
this.trafMode = trafMode;
|
||||
}
|
||||
|
||||
public Integer getTrafMode()
|
||||
{
|
||||
return trafMode;
|
||||
}
|
||||
public void setAirline(String airline)
|
||||
{
|
||||
this.airline = airline;
|
||||
}
|
||||
|
||||
public String getAirline()
|
||||
{
|
||||
return airline;
|
||||
}
|
||||
public void setDepartureCountry(String departureCountry)
|
||||
{
|
||||
this.departureCountry = departureCountry;
|
||||
}
|
||||
|
||||
public String getDepartureCountry()
|
||||
{
|
||||
return departureCountry;
|
||||
}
|
||||
public void setDepartureCity(String departureCity)
|
||||
{
|
||||
this.departureCity = departureCity;
|
||||
}
|
||||
|
||||
public String getDepartureCity()
|
||||
{
|
||||
return departureCity;
|
||||
}
|
||||
public void setDepartureAirport(String departureAirport)
|
||||
{
|
||||
this.departureAirport = departureAirport;
|
||||
}
|
||||
|
||||
public String getDepartureAirport()
|
||||
{
|
||||
return departureAirport;
|
||||
}
|
||||
public void setTransitAirport(String transitAirport)
|
||||
{
|
||||
this.transitAirport = transitAirport;
|
||||
}
|
||||
|
||||
public String getTransitAirport()
|
||||
{
|
||||
return transitAirport;
|
||||
}
|
||||
public void setArriveAirport(String arriveAirport)
|
||||
{
|
||||
this.arriveAirport = arriveAirport;
|
||||
}
|
||||
|
||||
public String getArriveAirport()
|
||||
{
|
||||
return arriveAirport;
|
||||
}
|
||||
public void setFlightNumber(String flightNumber)
|
||||
{
|
||||
this.flightNumber = flightNumber;
|
||||
}
|
||||
|
||||
public String getFlightNumber()
|
||||
{
|
||||
return flightNumber;
|
||||
}
|
||||
public void setIsDirectFlight(Integer isDirectFlight)
|
||||
{
|
||||
this.isDirectFlight = isDirectFlight;
|
||||
}
|
||||
|
||||
public Integer getIsDirectFlight()
|
||||
{
|
||||
return isDirectFlight;
|
||||
}
|
||||
public void setIsOurBooking(Integer isOurBooking)
|
||||
{
|
||||
this.isOurBooking = isOurBooking;
|
||||
}
|
||||
|
||||
public Integer getIsOurBooking()
|
||||
{
|
||||
return isOurBooking;
|
||||
}
|
||||
public void setDepartureLocalTime(Date departureLocalTime)
|
||||
{
|
||||
this.departureLocalTime = departureLocalTime;
|
||||
}
|
||||
|
||||
public Date getDepartureLocalTime()
|
||||
{
|
||||
return departureLocalTime;
|
||||
}
|
||||
public void setDepartureTime(Date departureTime)
|
||||
{
|
||||
this.departureTime = departureTime;
|
||||
}
|
||||
|
||||
public Date getDepartureTime()
|
||||
{
|
||||
return departureTime;
|
||||
}
|
||||
public void setArriveTime(Date arriveTime)
|
||||
{
|
||||
this.arriveTime = arriveTime;
|
||||
}
|
||||
|
||||
public Date getArriveTime()
|
||||
{
|
||||
return arriveTime;
|
||||
}
|
||||
public void setActualArriveTime(Date actualArriveTime)
|
||||
{
|
||||
this.actualArriveTime = actualArriveTime;
|
||||
}
|
||||
|
||||
public Date getActualArriveTime()
|
||||
{
|
||||
return actualArriveTime;
|
||||
}
|
||||
public void setTrayNumber(Integer trayNumber)
|
||||
{
|
||||
this.trayNumber = trayNumber;
|
||||
}
|
||||
|
||||
public Integer getTrayNumber()
|
||||
{
|
||||
return trayNumber;
|
||||
}
|
||||
public void setPackageNumber(Integer packageNumber)
|
||||
{
|
||||
this.packageNumber = packageNumber;
|
||||
}
|
||||
|
||||
public Integer getPackageNumber()
|
||||
{
|
||||
return packageNumber;
|
||||
}
|
||||
public void setWeight(BigDecimal weight)
|
||||
{
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public BigDecimal getWeight()
|
||||
{
|
||||
return weight;
|
||||
}
|
||||
public void setChargeableWeight(BigDecimal chargeableWeight)
|
||||
{
|
||||
this.chargeableWeight = chargeableWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getChargeableWeight()
|
||||
{
|
||||
return chargeableWeight;
|
||||
}
|
||||
public void setVolume(BigDecimal volume)
|
||||
{
|
||||
this.volume = volume;
|
||||
}
|
||||
|
||||
public BigDecimal getVolume()
|
||||
{
|
||||
return volume;
|
||||
}
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
public void setAddTime(Date addTime)
|
||||
{
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public Date getAddTime()
|
||||
{
|
||||
return addTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("userId", getUserId())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("declarePortId", getDeclarePortId())
|
||||
.append("mode", getMode())
|
||||
.append("batchNumber", getBatchNumber())
|
||||
.append("deliveryNumber", getDeliveryNumber())
|
||||
.append("trafMode", getTrafMode())
|
||||
.append("airline", getAirline())
|
||||
.append("departureCountry", getDepartureCountry())
|
||||
.append("departureCity", getDepartureCity())
|
||||
.append("departureAirport", getDepartureAirport())
|
||||
.append("transitAirport", getTransitAirport())
|
||||
.append("arriveAirport", getArriveAirport())
|
||||
.append("flightNumber", getFlightNumber())
|
||||
.append("isDirectFlight", getIsDirectFlight())
|
||||
.append("isOurBooking", getIsOurBooking())
|
||||
.append("departureLocalTime", getDepartureLocalTime())
|
||||
.append("departureTime", getDepartureTime())
|
||||
.append("arriveTime", getArriveTime())
|
||||
.append("actualArriveTime", getActualArriveTime())
|
||||
.append("trayNumber", getTrayNumber())
|
||||
.append("packageNumber", getPackageNumber())
|
||||
.append("weight", getWeight())
|
||||
.append("chargeableWeight", getChargeableWeight())
|
||||
.append("volume", getVolume())
|
||||
.append("remark", getRemark())
|
||||
.append("addTime", getAddTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,207 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* HS编码对象 custom_hs_code
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
public class CustomHsCode extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 编码 */
|
||||
@Excel(name = "编码")
|
||||
private String code;
|
||||
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
/** 许可证代码 */
|
||||
@Excel(name = "许可证代码")
|
||||
private String licenseCode;
|
||||
|
||||
/** 普通税率 */
|
||||
@Excel(name = "普通税率")
|
||||
private BigDecimal generalTaxRate;
|
||||
|
||||
/** 优惠税率 */
|
||||
@Excel(name = "优惠税率")
|
||||
private BigDecimal preferentialTaxRate;
|
||||
|
||||
/** 出口税率 */
|
||||
@Excel(name = "出口税率")
|
||||
private BigDecimal exportTaxRate;
|
||||
|
||||
/** 消费税率 */
|
||||
@Excel(name = "消费税率")
|
||||
private BigDecimal consumptionTaxRate;
|
||||
|
||||
/** 增值税率 */
|
||||
@Excel(name = "增值税率")
|
||||
private BigDecimal vatRate;
|
||||
|
||||
/** 第一法定单位 */
|
||||
@Excel(name = "第一法定单位")
|
||||
private String firstLegalUnit;
|
||||
|
||||
/** 第二法定单位 */
|
||||
@Excel(name = "第二法定单位")
|
||||
private String secondLegalUnit;
|
||||
|
||||
/** 申报要素 */
|
||||
@Excel(name = "申报要素")
|
||||
private String declareReason;
|
||||
|
||||
/** 是否存在正面清单 */
|
||||
@Excel(name = "是否存在正面清单")
|
||||
private Integer isExistInventory;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setLicenseCode(String licenseCode)
|
||||
{
|
||||
this.licenseCode = licenseCode;
|
||||
}
|
||||
|
||||
public String getLicenseCode()
|
||||
{
|
||||
return licenseCode;
|
||||
}
|
||||
public void setGeneralTaxRate(BigDecimal generalTaxRate)
|
||||
{
|
||||
this.generalTaxRate = generalTaxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getGeneralTaxRate()
|
||||
{
|
||||
return generalTaxRate;
|
||||
}
|
||||
public void setPreferentialTaxRate(BigDecimal preferentialTaxRate)
|
||||
{
|
||||
this.preferentialTaxRate = preferentialTaxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getPreferentialTaxRate()
|
||||
{
|
||||
return preferentialTaxRate;
|
||||
}
|
||||
public void setExportTaxRate(BigDecimal exportTaxRate)
|
||||
{
|
||||
this.exportTaxRate = exportTaxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getExportTaxRate()
|
||||
{
|
||||
return exportTaxRate;
|
||||
}
|
||||
public void setConsumptionTaxRate(BigDecimal consumptionTaxRate)
|
||||
{
|
||||
this.consumptionTaxRate = consumptionTaxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getConsumptionTaxRate()
|
||||
{
|
||||
return consumptionTaxRate;
|
||||
}
|
||||
public void setVatRate(BigDecimal vatRate)
|
||||
{
|
||||
this.vatRate = vatRate;
|
||||
}
|
||||
|
||||
public BigDecimal getVatRate()
|
||||
{
|
||||
return vatRate;
|
||||
}
|
||||
public void setFirstLegalUnit(String firstLegalUnit)
|
||||
{
|
||||
this.firstLegalUnit = firstLegalUnit;
|
||||
}
|
||||
|
||||
public String getFirstLegalUnit()
|
||||
{
|
||||
return firstLegalUnit;
|
||||
}
|
||||
public void setSecondLegalUnit(String secondLegalUnit)
|
||||
{
|
||||
this.secondLegalUnit = secondLegalUnit;
|
||||
}
|
||||
|
||||
public String getSecondLegalUnit()
|
||||
{
|
||||
return secondLegalUnit;
|
||||
}
|
||||
public void setDeclareReason(String declareReason)
|
||||
{
|
||||
this.declareReason = declareReason;
|
||||
}
|
||||
|
||||
public String getDeclareReason()
|
||||
{
|
||||
return declareReason;
|
||||
}
|
||||
public void setIsExistInventory(Integer isExistInventory)
|
||||
{
|
||||
this.isExistInventory = isExistInventory;
|
||||
}
|
||||
|
||||
public Integer getIsExistInventory()
|
||||
{
|
||||
return isExistInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("code", getCode())
|
||||
.append("name", getName())
|
||||
.append("licenseCode", getLicenseCode())
|
||||
.append("generalTaxRate", getGeneralTaxRate())
|
||||
.append("preferentialTaxRate", getPreferentialTaxRate())
|
||||
.append("remark", getRemark())
|
||||
.append("exportTaxRate", getExportTaxRate())
|
||||
.append("consumptionTaxRate", getConsumptionTaxRate())
|
||||
.append("vatRate", getVatRate())
|
||||
.append("firstLegalUnit", getFirstLegalUnit())
|
||||
.append("secondLegalUnit", getSecondLegalUnit())
|
||||
.append("declareReason", getDeclareReason())
|
||||
.append("isExistInventory", getIsExistInventory())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,209 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* HS编码对象 custom_hs_code
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@TableName(value = "custom_hs_code")
|
||||
public class CustomHsCodePlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
/** 编码 */
|
||||
@Excel(name = "编码")
|
||||
private String code;
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
/** 许可证代码 */
|
||||
@Excel(name = "许可证代码")
|
||||
private String licenseCode;
|
||||
/** 普通税率 */
|
||||
@Excel(name = "普通税率")
|
||||
private BigDecimal generalTaxRate;
|
||||
/** 优惠税率 */
|
||||
@Excel(name = "优惠税率")
|
||||
private BigDecimal preferentialTaxRate;
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
/** 出口税率 */
|
||||
@Excel(name = "出口税率")
|
||||
private BigDecimal exportTaxRate;
|
||||
/** 消费税率 */
|
||||
@Excel(name = "消费税率")
|
||||
private BigDecimal consumptionTaxRate;
|
||||
/** 增值税率 */
|
||||
@Excel(name = "增值税率")
|
||||
private BigDecimal vatRate;
|
||||
/** 第一法定单位 */
|
||||
@Excel(name = "第一法定单位")
|
||||
private String firstLegalUnit;
|
||||
/** 第二法定单位 */
|
||||
@Excel(name = "第二法定单位")
|
||||
private String secondLegalUnit;
|
||||
/** 申报要素 */
|
||||
@Excel(name = "申报要素")
|
||||
private String declareReason;
|
||||
/** 是否存在正面清单 */
|
||||
@Excel(name = "是否存在正面清单")
|
||||
private Integer isExistInventory;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setLicenseCode(String licenseCode)
|
||||
{
|
||||
this.licenseCode = licenseCode;
|
||||
}
|
||||
|
||||
public String getLicenseCode()
|
||||
{
|
||||
return licenseCode;
|
||||
}
|
||||
public void setGeneralTaxRate(BigDecimal generalTaxRate)
|
||||
{
|
||||
this.generalTaxRate = generalTaxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getGeneralTaxRate()
|
||||
{
|
||||
return generalTaxRate;
|
||||
}
|
||||
public void setPreferentialTaxRate(BigDecimal preferentialTaxRate)
|
||||
{
|
||||
this.preferentialTaxRate = preferentialTaxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getPreferentialTaxRate()
|
||||
{
|
||||
return preferentialTaxRate;
|
||||
}
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
public void setExportTaxRate(BigDecimal exportTaxRate)
|
||||
{
|
||||
this.exportTaxRate = exportTaxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getExportTaxRate()
|
||||
{
|
||||
return exportTaxRate;
|
||||
}
|
||||
public void setConsumptionTaxRate(BigDecimal consumptionTaxRate)
|
||||
{
|
||||
this.consumptionTaxRate = consumptionTaxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getConsumptionTaxRate()
|
||||
{
|
||||
return consumptionTaxRate;
|
||||
}
|
||||
public void setVatRate(BigDecimal vatRate)
|
||||
{
|
||||
this.vatRate = vatRate;
|
||||
}
|
||||
|
||||
public BigDecimal getVatRate()
|
||||
{
|
||||
return vatRate;
|
||||
}
|
||||
public void setFirstLegalUnit(String firstLegalUnit)
|
||||
{
|
||||
this.firstLegalUnit = firstLegalUnit;
|
||||
}
|
||||
|
||||
public String getFirstLegalUnit()
|
||||
{
|
||||
return firstLegalUnit;
|
||||
}
|
||||
public void setSecondLegalUnit(String secondLegalUnit)
|
||||
{
|
||||
this.secondLegalUnit = secondLegalUnit;
|
||||
}
|
||||
|
||||
public String getSecondLegalUnit()
|
||||
{
|
||||
return secondLegalUnit;
|
||||
}
|
||||
public void setDeclareReason(String declareReason)
|
||||
{
|
||||
this.declareReason = declareReason;
|
||||
}
|
||||
|
||||
public String getDeclareReason()
|
||||
{
|
||||
return declareReason;
|
||||
}
|
||||
public void setIsExistInventory(Integer isExistInventory)
|
||||
{
|
||||
this.isExistInventory = isExistInventory;
|
||||
}
|
||||
|
||||
public Integer getIsExistInventory()
|
||||
{
|
||||
return isExistInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("code", getCode())
|
||||
.append("name", getName())
|
||||
.append("licenseCode", getLicenseCode())
|
||||
.append("generalTaxRate", getGeneralTaxRate())
|
||||
.append("preferentialTaxRate", getPreferentialTaxRate())
|
||||
.append("remark", getRemark())
|
||||
.append("exportTaxRate", getExportTaxRate())
|
||||
.append("consumptionTaxRate", getConsumptionTaxRate())
|
||||
.append("vatRate", getVatRate())
|
||||
.append("firstLegalUnit", getFirstLegalUnit())
|
||||
.append("secondLegalUnit", getSecondLegalUnit())
|
||||
.append("declareReason", getDeclareReason())
|
||||
.append("isExistInventory", getIsExistInventory())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 正面清单对象 custom_inventory
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
public class CustomInventory extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
/** 编码 */
|
||||
@Excel(name = "编码")
|
||||
private String code;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("code", getCode())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 正面清单对象 custom_inventory
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@TableName(value = "custom_inventory")
|
||||
public class CustomInventoryPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
/** 编码 */
|
||||
@Excel(name = "编码")
|
||||
private String code;
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setCode(String code)
|
||||
{
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCode()
|
||||
{
|
||||
return code;
|
||||
}
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("code", getCode())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,758 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 备案订单对象 custom_order
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
public class CustomOrder extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 口岸Id */
|
||||
@Excel(name = "口岸Id")
|
||||
private Long declarePortId;
|
||||
|
||||
/** 仓库Id */
|
||||
@Excel(name = "仓库Id")
|
||||
private Long warehouseId;
|
||||
|
||||
/** 清关方式:1、保税;2、直邮;3、个人 */
|
||||
@Excel(name = "清关方式:1、保税;2、直邮;3、个人")
|
||||
private Integer mode;
|
||||
|
||||
/** 用户id */
|
||||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/** 系统订单号 */
|
||||
@Excel(name = "系统订单号")
|
||||
private String sOrderNo;
|
||||
|
||||
/** 申报订单号(商城订单号) */
|
||||
@Excel(name = "申报订单号", readConverterExp = "商=城订单号")
|
||||
private String declareOrderNo;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private Integer status;
|
||||
|
||||
/** 快递公司 */
|
||||
@Excel(name = "快递公司")
|
||||
private String expressName;
|
||||
|
||||
/** 运单号 */
|
||||
@Excel(name = "运单号")
|
||||
private String shipOrderNumber;
|
||||
|
||||
/** 购买人注册号 */
|
||||
@Excel(name = "购买人注册号")
|
||||
private String buyerRegNo;
|
||||
|
||||
/** 购买人 */
|
||||
@Excel(name = "购买人")
|
||||
private String buyerName;
|
||||
|
||||
/** 购买人电话 */
|
||||
@Excel(name = "购买人电话")
|
||||
private String buyerTelephone;
|
||||
|
||||
/** 购买人身份证类型:1-身份证,2-其它,3-军官证,4-护照。 */
|
||||
@Excel(name = "购买人身份证类型:1-身份证,2-其它,3-军官证,4-护照。")
|
||||
private Integer buyerIdType;
|
||||
|
||||
/** 购买人身份证 */
|
||||
@Excel(name = "购买人身份证")
|
||||
private String buyerIdNumber;
|
||||
|
||||
/** 收件人 */
|
||||
@Excel(name = "收件人")
|
||||
private String consignee;
|
||||
|
||||
/** 收件人电话 */
|
||||
@Excel(name = "收件人电话")
|
||||
private String consigneeTelephone;
|
||||
|
||||
/** 收件人地址 */
|
||||
@Excel(name = "收件人地址")
|
||||
private String consigneeAddress;
|
||||
|
||||
/** 收件人省 */
|
||||
@Excel(name = "收件人省")
|
||||
private String consigneeProvince;
|
||||
|
||||
/** 收件人市 */
|
||||
@Excel(name = "收件人市")
|
||||
private String consigneeCity;
|
||||
|
||||
/** 收件人区 */
|
||||
@Excel(name = "收件人区")
|
||||
private String consigneeDistrict;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "收件人区")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/** 非现金抵扣金额 */
|
||||
@Excel(name = "非现金抵扣金额")
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/** 实际支付金额 */
|
||||
@Excel(name = "实际支付金额")
|
||||
private BigDecimal payTotalAmount;
|
||||
|
||||
/** 税费 */
|
||||
@Excel(name = "税费")
|
||||
private BigDecimal taxTotalAmount;
|
||||
|
||||
/** 商城税费 */
|
||||
@Excel(name = "商城税费")
|
||||
private BigDecimal shopTaxTotalAmount;
|
||||
|
||||
/** 运费 */
|
||||
@Excel(name = "运费")
|
||||
private BigDecimal freightAmount;
|
||||
|
||||
/** 总毛重 */
|
||||
@Excel(name = "总毛重")
|
||||
private BigDecimal totalGrossWeight;
|
||||
|
||||
/** 总净重 */
|
||||
@Excel(name = "总净重")
|
||||
private BigDecimal totalNetWeight;
|
||||
|
||||
/** 总数量 */
|
||||
@Excel(name = "总数量")
|
||||
private Integer totalQuantity;
|
||||
|
||||
/** 支付公司名称 */
|
||||
@Excel(name = "支付公司名称")
|
||||
private String payName;
|
||||
|
||||
/** 支付公司代码 */
|
||||
@Excel(name = "支付公司代码")
|
||||
private String payCode;
|
||||
|
||||
/** 支付时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date payTime;
|
||||
|
||||
/** 支付单号 */
|
||||
@Excel(name = "支付单号")
|
||||
private String gatewayOrderId;
|
||||
|
||||
/** 发件人 */
|
||||
@Excel(name = "发件人")
|
||||
private String consignor;
|
||||
|
||||
/** 发件人地址 */
|
||||
@Excel(name = "发件人地址")
|
||||
private String consignorAddress;
|
||||
|
||||
/** 发件人电话 */
|
||||
@Excel(name = "发件人电话")
|
||||
private String consignorTelephone;
|
||||
|
||||
/** 发件人所在国 */
|
||||
@Excel(name = "发件人所在国")
|
||||
private String consignorCountry;
|
||||
|
||||
/** 发件人省 */
|
||||
@Excel(name = "发件人省")
|
||||
private String consignorProvince;
|
||||
|
||||
/** 发件人市 */
|
||||
@Excel(name = "发件人市")
|
||||
private String consignorCity;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "发件人市")
|
||||
private String consignorDistrict;
|
||||
|
||||
/** 收款账户 */
|
||||
@Excel(name = "收款账户")
|
||||
private String receiptAccount;
|
||||
|
||||
/** 验核机构:1-银联 2-网联 3-其他 */
|
||||
@Excel(name = "验核机构:1-银联 2-网联 3-其他")
|
||||
private Integer verDept;
|
||||
|
||||
/** 支付类型:1-APP 2-PC 3-扫码 4-其他 */
|
||||
@Excel(name = "支付类型:1-APP 2-PC 3-扫码 4-其他")
|
||||
private Integer payType;
|
||||
|
||||
/** 支付原始请求 */
|
||||
@Excel(name = "支付原始请求")
|
||||
private String initalRequest;
|
||||
|
||||
/** 支付原始响应 */
|
||||
@Excel(name = "支付原始响应")
|
||||
private String initalResponse;
|
||||
|
||||
/** 接口信息返回结果 */
|
||||
@Excel(name = "接口信息返回结果")
|
||||
private String expressReturn;
|
||||
|
||||
/** 订单处理过程 */
|
||||
@Excel(name = "订单处理过程")
|
||||
private String process;
|
||||
|
||||
/** 添加时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date addTime;
|
||||
|
||||
/** 清单编号 */
|
||||
@Excel(name = "清单编号")
|
||||
private String inventoryNo;
|
||||
|
||||
/** 批次号 */
|
||||
@Excel(name = "批次号")
|
||||
private String batchNumber;
|
||||
|
||||
/** 备案订单项信息 */
|
||||
private List<CustomOrderItem> customOrderItemList;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setDeclarePortId(Long declarePortId)
|
||||
{
|
||||
this.declarePortId = declarePortId;
|
||||
}
|
||||
|
||||
public Long getDeclarePortId()
|
||||
{
|
||||
return declarePortId;
|
||||
}
|
||||
public void setWarehouseId(Long warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public Long getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
public void setMode(Integer mode)
|
||||
{
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public Integer getMode()
|
||||
{
|
||||
return mode;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setsOrderNo(String sOrderNo)
|
||||
{
|
||||
this.sOrderNo = sOrderNo;
|
||||
}
|
||||
|
||||
public String getsOrderNo()
|
||||
{
|
||||
return sOrderNo;
|
||||
}
|
||||
public void setDeclareOrderNo(String declareOrderNo)
|
||||
{
|
||||
this.declareOrderNo = declareOrderNo;
|
||||
}
|
||||
|
||||
public String getDeclareOrderNo()
|
||||
{
|
||||
return declareOrderNo;
|
||||
}
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setExpressName(String expressName)
|
||||
{
|
||||
this.expressName = expressName;
|
||||
}
|
||||
|
||||
public String getExpressName()
|
||||
{
|
||||
return expressName;
|
||||
}
|
||||
public void setShipOrderNumber(String shipOrderNumber)
|
||||
{
|
||||
this.shipOrderNumber = shipOrderNumber;
|
||||
}
|
||||
|
||||
public String getShipOrderNumber()
|
||||
{
|
||||
return shipOrderNumber;
|
||||
}
|
||||
public void setBuyerRegNo(String buyerRegNo)
|
||||
{
|
||||
this.buyerRegNo = buyerRegNo;
|
||||
}
|
||||
|
||||
public String getBuyerRegNo()
|
||||
{
|
||||
return buyerRegNo;
|
||||
}
|
||||
public void setBuyerName(String buyerName)
|
||||
{
|
||||
this.buyerName = buyerName;
|
||||
}
|
||||
|
||||
public String getBuyerName()
|
||||
{
|
||||
return buyerName;
|
||||
}
|
||||
public void setBuyerTelephone(String buyerTelephone)
|
||||
{
|
||||
this.buyerTelephone = buyerTelephone;
|
||||
}
|
||||
|
||||
public String getBuyerTelephone()
|
||||
{
|
||||
return buyerTelephone;
|
||||
}
|
||||
public void setBuyerIdType(Integer buyerIdType)
|
||||
{
|
||||
this.buyerIdType = buyerIdType;
|
||||
}
|
||||
|
||||
public Integer getBuyerIdType()
|
||||
{
|
||||
return buyerIdType;
|
||||
}
|
||||
public void setBuyerIdNumber(String buyerIdNumber)
|
||||
{
|
||||
this.buyerIdNumber = buyerIdNumber;
|
||||
}
|
||||
|
||||
public String getBuyerIdNumber()
|
||||
{
|
||||
return buyerIdNumber;
|
||||
}
|
||||
public void setConsignee(String consignee)
|
||||
{
|
||||
this.consignee = consignee;
|
||||
}
|
||||
|
||||
public String getConsignee()
|
||||
{
|
||||
return consignee;
|
||||
}
|
||||
public void setConsigneeTelephone(String consigneeTelephone)
|
||||
{
|
||||
this.consigneeTelephone = consigneeTelephone;
|
||||
}
|
||||
|
||||
public String getConsigneeTelephone()
|
||||
{
|
||||
return consigneeTelephone;
|
||||
}
|
||||
public void setConsigneeAddress(String consigneeAddress)
|
||||
{
|
||||
this.consigneeAddress = consigneeAddress;
|
||||
}
|
||||
|
||||
public String getConsigneeAddress()
|
||||
{
|
||||
return consigneeAddress;
|
||||
}
|
||||
public void setConsigneeProvince(String consigneeProvince)
|
||||
{
|
||||
this.consigneeProvince = consigneeProvince;
|
||||
}
|
||||
|
||||
public String getConsigneeProvince()
|
||||
{
|
||||
return consigneeProvince;
|
||||
}
|
||||
public void setConsigneeCity(String consigneeCity)
|
||||
{
|
||||
this.consigneeCity = consigneeCity;
|
||||
}
|
||||
|
||||
public String getConsigneeCity()
|
||||
{
|
||||
return consigneeCity;
|
||||
}
|
||||
public void setConsigneeDistrict(String consigneeDistrict)
|
||||
{
|
||||
this.consigneeDistrict = consigneeDistrict;
|
||||
}
|
||||
|
||||
public String getConsigneeDistrict()
|
||||
{
|
||||
return consigneeDistrict;
|
||||
}
|
||||
public void setTotalAmount(BigDecimal totalAmount)
|
||||
{
|
||||
this.totalAmount = totalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalAmount()
|
||||
{
|
||||
return totalAmount;
|
||||
}
|
||||
public void setDiscountAmount(BigDecimal discountAmount)
|
||||
{
|
||||
this.discountAmount = discountAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getDiscountAmount()
|
||||
{
|
||||
return discountAmount;
|
||||
}
|
||||
public void setPayTotalAmount(BigDecimal payTotalAmount)
|
||||
{
|
||||
this.payTotalAmount = payTotalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getPayTotalAmount()
|
||||
{
|
||||
return payTotalAmount;
|
||||
}
|
||||
public void setTaxTotalAmount(BigDecimal taxTotalAmount)
|
||||
{
|
||||
this.taxTotalAmount = taxTotalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxTotalAmount()
|
||||
{
|
||||
return taxTotalAmount;
|
||||
}
|
||||
public void setShopTaxTotalAmount(BigDecimal shopTaxTotalAmount)
|
||||
{
|
||||
this.shopTaxTotalAmount = shopTaxTotalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getShopTaxTotalAmount()
|
||||
{
|
||||
return shopTaxTotalAmount;
|
||||
}
|
||||
public void setFreightAmount(BigDecimal freightAmount)
|
||||
{
|
||||
this.freightAmount = freightAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getFreightAmount()
|
||||
{
|
||||
return freightAmount;
|
||||
}
|
||||
public void setTotalGrossWeight(BigDecimal totalGrossWeight)
|
||||
{
|
||||
this.totalGrossWeight = totalGrossWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalGrossWeight()
|
||||
{
|
||||
return totalGrossWeight;
|
||||
}
|
||||
public void setTotalNetWeight(BigDecimal totalNetWeight)
|
||||
{
|
||||
this.totalNetWeight = totalNetWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalNetWeight()
|
||||
{
|
||||
return totalNetWeight;
|
||||
}
|
||||
public void setTotalQuantity(Integer totalQuantity)
|
||||
{
|
||||
this.totalQuantity = totalQuantity;
|
||||
}
|
||||
|
||||
public Integer getTotalQuantity()
|
||||
{
|
||||
return totalQuantity;
|
||||
}
|
||||
public void setPayName(String payName)
|
||||
{
|
||||
this.payName = payName;
|
||||
}
|
||||
|
||||
public String getPayName()
|
||||
{
|
||||
return payName;
|
||||
}
|
||||
public void setPayCode(String payCode)
|
||||
{
|
||||
this.payCode = payCode;
|
||||
}
|
||||
|
||||
public String getPayCode()
|
||||
{
|
||||
return payCode;
|
||||
}
|
||||
public void setPayTime(Date payTime)
|
||||
{
|
||||
this.payTime = payTime;
|
||||
}
|
||||
|
||||
public Date getPayTime()
|
||||
{
|
||||
return payTime;
|
||||
}
|
||||
public void setGatewayOrderId(String gatewayOrderId)
|
||||
{
|
||||
this.gatewayOrderId = gatewayOrderId;
|
||||
}
|
||||
|
||||
public String getGatewayOrderId()
|
||||
{
|
||||
return gatewayOrderId;
|
||||
}
|
||||
public void setConsignor(String consignor)
|
||||
{
|
||||
this.consignor = consignor;
|
||||
}
|
||||
|
||||
public String getConsignor()
|
||||
{
|
||||
return consignor;
|
||||
}
|
||||
public void setConsignorAddress(String consignorAddress)
|
||||
{
|
||||
this.consignorAddress = consignorAddress;
|
||||
}
|
||||
|
||||
public String getConsignorAddress()
|
||||
{
|
||||
return consignorAddress;
|
||||
}
|
||||
public void setConsignorTelephone(String consignorTelephone)
|
||||
{
|
||||
this.consignorTelephone = consignorTelephone;
|
||||
}
|
||||
|
||||
public String getConsignorTelephone()
|
||||
{
|
||||
return consignorTelephone;
|
||||
}
|
||||
public void setConsignorCountry(String consignorCountry)
|
||||
{
|
||||
this.consignorCountry = consignorCountry;
|
||||
}
|
||||
|
||||
public String getConsignorCountry()
|
||||
{
|
||||
return consignorCountry;
|
||||
}
|
||||
public void setConsignorProvince(String consignorProvince)
|
||||
{
|
||||
this.consignorProvince = consignorProvince;
|
||||
}
|
||||
|
||||
public String getConsignorProvince()
|
||||
{
|
||||
return consignorProvince;
|
||||
}
|
||||
public void setConsignorCity(String consignorCity)
|
||||
{
|
||||
this.consignorCity = consignorCity;
|
||||
}
|
||||
|
||||
public String getConsignorCity()
|
||||
{
|
||||
return consignorCity;
|
||||
}
|
||||
public void setConsignorDistrict(String consignorDistrict)
|
||||
{
|
||||
this.consignorDistrict = consignorDistrict;
|
||||
}
|
||||
|
||||
public String getConsignorDistrict()
|
||||
{
|
||||
return consignorDistrict;
|
||||
}
|
||||
public void setReceiptAccount(String receiptAccount)
|
||||
{
|
||||
this.receiptAccount = receiptAccount;
|
||||
}
|
||||
|
||||
public String getReceiptAccount()
|
||||
{
|
||||
return receiptAccount;
|
||||
}
|
||||
public void setVerDept(Integer verDept)
|
||||
{
|
||||
this.verDept = verDept;
|
||||
}
|
||||
|
||||
public Integer getVerDept()
|
||||
{
|
||||
return verDept;
|
||||
}
|
||||
public void setPayType(Integer payType)
|
||||
{
|
||||
this.payType = payType;
|
||||
}
|
||||
|
||||
public Integer getPayType()
|
||||
{
|
||||
return payType;
|
||||
}
|
||||
public void setInitalRequest(String initalRequest)
|
||||
{
|
||||
this.initalRequest = initalRequest;
|
||||
}
|
||||
|
||||
public String getInitalRequest()
|
||||
{
|
||||
return initalRequest;
|
||||
}
|
||||
public void setInitalResponse(String initalResponse)
|
||||
{
|
||||
this.initalResponse = initalResponse;
|
||||
}
|
||||
|
||||
public String getInitalResponse()
|
||||
{
|
||||
return initalResponse;
|
||||
}
|
||||
public void setExpressReturn(String expressReturn)
|
||||
{
|
||||
this.expressReturn = expressReturn;
|
||||
}
|
||||
|
||||
public String getExpressReturn()
|
||||
{
|
||||
return expressReturn;
|
||||
}
|
||||
public void setProcess(String process)
|
||||
{
|
||||
this.process = process;
|
||||
}
|
||||
|
||||
public String getProcess()
|
||||
{
|
||||
return process;
|
||||
}
|
||||
public void setAddTime(Date addTime)
|
||||
{
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public Date getAddTime()
|
||||
{
|
||||
return addTime;
|
||||
}
|
||||
public void setInventoryNo(String inventoryNo)
|
||||
{
|
||||
this.inventoryNo = inventoryNo;
|
||||
}
|
||||
|
||||
public String getInventoryNo()
|
||||
{
|
||||
return inventoryNo;
|
||||
}
|
||||
public void setBatchNumber(String batchNumber)
|
||||
{
|
||||
this.batchNumber = batchNumber;
|
||||
}
|
||||
|
||||
public String getBatchNumber()
|
||||
{
|
||||
return batchNumber;
|
||||
}
|
||||
|
||||
public List<CustomOrderItem> getCustomOrderItemList()
|
||||
{
|
||||
return customOrderItemList;
|
||||
}
|
||||
|
||||
public void setCustomOrderItemList(List<CustomOrderItem> customOrderItemList)
|
||||
{
|
||||
this.customOrderItemList = customOrderItemList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("declarePortId", getDeclarePortId())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("mode", getMode())
|
||||
.append("userId", getUserId())
|
||||
.append("sOrderNo", getsOrderNo())
|
||||
.append("declareOrderNo", getDeclareOrderNo())
|
||||
.append("status", getStatus())
|
||||
.append("expressName", getExpressName())
|
||||
.append("shipOrderNumber", getShipOrderNumber())
|
||||
.append("buyerRegNo", getBuyerRegNo())
|
||||
.append("buyerName", getBuyerName())
|
||||
.append("buyerTelephone", getBuyerTelephone())
|
||||
.append("buyerIdType", getBuyerIdType())
|
||||
.append("buyerIdNumber", getBuyerIdNumber())
|
||||
.append("consignee", getConsignee())
|
||||
.append("consigneeTelephone", getConsigneeTelephone())
|
||||
.append("consigneeAddress", getConsigneeAddress())
|
||||
.append("consigneeProvince", getConsigneeProvince())
|
||||
.append("consigneeCity", getConsigneeCity())
|
||||
.append("consigneeDistrict", getConsigneeDistrict())
|
||||
.append("totalAmount", getTotalAmount())
|
||||
.append("discountAmount", getDiscountAmount())
|
||||
.append("payTotalAmount", getPayTotalAmount())
|
||||
.append("taxTotalAmount", getTaxTotalAmount())
|
||||
.append("shopTaxTotalAmount", getShopTaxTotalAmount())
|
||||
.append("freightAmount", getFreightAmount())
|
||||
.append("totalGrossWeight", getTotalGrossWeight())
|
||||
.append("totalNetWeight", getTotalNetWeight())
|
||||
.append("totalQuantity", getTotalQuantity())
|
||||
.append("payName", getPayName())
|
||||
.append("payCode", getPayCode())
|
||||
.append("payTime", getPayTime())
|
||||
.append("gatewayOrderId", getGatewayOrderId())
|
||||
.append("consignor", getConsignor())
|
||||
.append("consignorAddress", getConsignorAddress())
|
||||
.append("consignorTelephone", getConsignorTelephone())
|
||||
.append("consignorCountry", getConsignorCountry())
|
||||
.append("consignorProvince", getConsignorProvince())
|
||||
.append("consignorCity", getConsignorCity())
|
||||
.append("consignorDistrict", getConsignorDistrict())
|
||||
.append("receiptAccount", getReceiptAccount())
|
||||
.append("verDept", getVerDept())
|
||||
.append("payType", getPayType())
|
||||
.append("initalRequest", getInitalRequest())
|
||||
.append("initalResponse", getInitalResponse())
|
||||
.append("remark", getRemark())
|
||||
.append("expressReturn", getExpressReturn())
|
||||
.append("process", getProcess())
|
||||
.append("addTime", getAddTime())
|
||||
.append("inventoryNo", getInventoryNo())
|
||||
.append("batchNumber", getBatchNumber())
|
||||
.append("customOrderItemList", getCustomOrderItemList())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,427 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 备案订单项对象 custom_order_item
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
public class CustomOrderItem extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "批次号")
|
||||
private Long orderId;
|
||||
|
||||
/** 口岸Id */
|
||||
@Excel(name = "口岸Id")
|
||||
private Long declarePortId;
|
||||
|
||||
/** 仓库Id */
|
||||
@Excel(name = "仓库Id")
|
||||
private Long warehouseId;
|
||||
|
||||
/** 商品条形码 */
|
||||
@Excel(name = "商品条形码")
|
||||
private String barCode;
|
||||
|
||||
/** skucode */
|
||||
@Excel(name = "skucode")
|
||||
private String skuCode;
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private Integer quantity;
|
||||
|
||||
/** 单价 */
|
||||
@Excel(name = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 商城单价 */
|
||||
@Excel(name = "商城单价")
|
||||
private BigDecimal shopPrice;
|
||||
|
||||
/** 运费 */
|
||||
@Excel(name = "运费")
|
||||
private BigDecimal freight;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "运费")
|
||||
private BigDecimal taxAmount;
|
||||
|
||||
/** 商品链接 */
|
||||
@Excel(name = "商品链接")
|
||||
private String itemLink;
|
||||
|
||||
/** 账(手)册商品序号 */
|
||||
@Excel(name = "账(手)册商品序号")
|
||||
private String bookNumber;
|
||||
|
||||
/** 商品货号 */
|
||||
@Excel(name = "商品货号")
|
||||
private String productCode;
|
||||
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
|
||||
/** 品牌 */
|
||||
@Excel(name = "品牌")
|
||||
private String brand;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String specificationModel;
|
||||
|
||||
/** 商品描述 */
|
||||
@Excel(name = "商品描述")
|
||||
private String description;
|
||||
|
||||
/** 数量单位 */
|
||||
@Excel(name = "数量单位")
|
||||
private String quantityUnit;
|
||||
|
||||
/** 生产国 */
|
||||
@Excel(name = "生产国")
|
||||
private String produceCountry;
|
||||
|
||||
/** 检验检疫编码 */
|
||||
@Excel(name = "检验检疫编码")
|
||||
private String inspectionAndQuarantineCode;
|
||||
|
||||
/** HS编码 */
|
||||
@Excel(name = "HS编码")
|
||||
private String hsCode;
|
||||
|
||||
/** 税率 */
|
||||
@Excel(name = "税率")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/** 申报数量(法定数量=申报数量*购买数量) */
|
||||
@Excel(name = "申报数量", readConverterExp = "法=定数量=申报数量*购买数量")
|
||||
private BigDecimal declaredCount;
|
||||
|
||||
/** 法定计量单位 */
|
||||
@Excel(name = "法定计量单位")
|
||||
private String legalMeteringUnit;
|
||||
|
||||
/** 第二申报数量(第二数量=第二申报数量*购买数量) */
|
||||
@Excel(name = "第二申报数量", readConverterExp = "第=二数量=第二申报数量*购买数量")
|
||||
private BigDecimal secondDeclaredCount;
|
||||
|
||||
/** 第二计量单位 */
|
||||
@Excel(name = "第二计量单位")
|
||||
private String secondMeteringUnit;
|
||||
|
||||
/** 毛重 */
|
||||
@Excel(name = "毛重")
|
||||
private BigDecimal grossWeight;
|
||||
|
||||
/** 净重 */
|
||||
@Excel(name = "净重")
|
||||
private BigDecimal netWeight;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setDeclarePortId(Long declarePortId)
|
||||
{
|
||||
this.declarePortId = declarePortId;
|
||||
}
|
||||
|
||||
public Long getDeclarePortId()
|
||||
{
|
||||
return declarePortId;
|
||||
}
|
||||
public void setWarehouseId(Long warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public Long getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
public void setBarCode(String barCode)
|
||||
{
|
||||
this.barCode = barCode;
|
||||
}
|
||||
|
||||
public String getBarCode()
|
||||
{
|
||||
return barCode;
|
||||
}
|
||||
public void setQuantity(Integer quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public String getSkuCode() {
|
||||
return skuCode;
|
||||
}
|
||||
|
||||
public void setSkuCode(String skuCode) {
|
||||
this.skuCode = skuCode;
|
||||
}
|
||||
|
||||
public Integer getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
public void setShopPrice(BigDecimal shopPrice)
|
||||
{
|
||||
this.shopPrice = shopPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getShopPrice()
|
||||
{
|
||||
return shopPrice;
|
||||
}
|
||||
public void setFreight(BigDecimal freight)
|
||||
{
|
||||
this.freight = freight;
|
||||
}
|
||||
|
||||
public BigDecimal getFreight()
|
||||
{
|
||||
return freight;
|
||||
}
|
||||
public void setTaxAmount(BigDecimal taxAmount)
|
||||
{
|
||||
this.taxAmount = taxAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxAmount()
|
||||
{
|
||||
return taxAmount;
|
||||
}
|
||||
public void setItemLink(String itemLink)
|
||||
{
|
||||
this.itemLink = itemLink;
|
||||
}
|
||||
|
||||
public String getItemLink()
|
||||
{
|
||||
return itemLink;
|
||||
}
|
||||
public void setBookNumber(String bookNumber)
|
||||
{
|
||||
this.bookNumber = bookNumber;
|
||||
}
|
||||
|
||||
public String getBookNumber()
|
||||
{
|
||||
return bookNumber;
|
||||
}
|
||||
public void setProductCode(String productCode)
|
||||
{
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public String getProductCode()
|
||||
{
|
||||
return productCode;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setBrand(String brand)
|
||||
{
|
||||
this.brand = brand;
|
||||
}
|
||||
|
||||
public String getBrand()
|
||||
{
|
||||
return brand;
|
||||
}
|
||||
public void setSpecificationModel(String specificationModel)
|
||||
{
|
||||
this.specificationModel = specificationModel;
|
||||
}
|
||||
|
||||
public String getSpecificationModel()
|
||||
{
|
||||
return specificationModel;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
public void setQuantityUnit(String quantityUnit)
|
||||
{
|
||||
this.quantityUnit = quantityUnit;
|
||||
}
|
||||
|
||||
public String getQuantityUnit()
|
||||
{
|
||||
return quantityUnit;
|
||||
}
|
||||
public void setProduceCountry(String produceCountry)
|
||||
{
|
||||
this.produceCountry = produceCountry;
|
||||
}
|
||||
|
||||
public String getProduceCountry()
|
||||
{
|
||||
return produceCountry;
|
||||
}
|
||||
public void setInspectionAndQuarantineCode(String inspectionAndQuarantineCode)
|
||||
{
|
||||
this.inspectionAndQuarantineCode = inspectionAndQuarantineCode;
|
||||
}
|
||||
|
||||
public String getInspectionAndQuarantineCode()
|
||||
{
|
||||
return inspectionAndQuarantineCode;
|
||||
}
|
||||
public void setHsCode(String hsCode)
|
||||
{
|
||||
this.hsCode = hsCode;
|
||||
}
|
||||
|
||||
public String getHsCode()
|
||||
{
|
||||
return hsCode;
|
||||
}
|
||||
public void setTaxRate(BigDecimal taxRate)
|
||||
{
|
||||
this.taxRate = taxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxRate()
|
||||
{
|
||||
return taxRate;
|
||||
}
|
||||
public void setDeclaredCount(BigDecimal declaredCount)
|
||||
{
|
||||
this.declaredCount = declaredCount;
|
||||
}
|
||||
|
||||
public BigDecimal getDeclaredCount()
|
||||
{
|
||||
return declaredCount;
|
||||
}
|
||||
public void setLegalMeteringUnit(String legalMeteringUnit)
|
||||
{
|
||||
this.legalMeteringUnit = legalMeteringUnit;
|
||||
}
|
||||
|
||||
public String getLegalMeteringUnit()
|
||||
{
|
||||
return legalMeteringUnit;
|
||||
}
|
||||
public void setSecondDeclaredCount(BigDecimal secondDeclaredCount)
|
||||
{
|
||||
this.secondDeclaredCount = secondDeclaredCount;
|
||||
}
|
||||
|
||||
public BigDecimal getSecondDeclaredCount()
|
||||
{
|
||||
return secondDeclaredCount;
|
||||
}
|
||||
public void setSecondMeteringUnit(String secondMeteringUnit)
|
||||
{
|
||||
this.secondMeteringUnit = secondMeteringUnit;
|
||||
}
|
||||
|
||||
public String getSecondMeteringUnit()
|
||||
{
|
||||
return secondMeteringUnit;
|
||||
}
|
||||
public void setGrossWeight(BigDecimal grossWeight)
|
||||
{
|
||||
this.grossWeight = grossWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getGrossWeight()
|
||||
{
|
||||
return grossWeight;
|
||||
}
|
||||
public void setNetWeight(BigDecimal netWeight)
|
||||
{
|
||||
this.netWeight = netWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getNetWeight()
|
||||
{
|
||||
return netWeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("declarePortId", getDeclarePortId())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("barCode", getBarCode())
|
||||
.append("quantity", getQuantity())
|
||||
.append("price", getPrice())
|
||||
.append("shopPrice", getShopPrice())
|
||||
.append("freight", getFreight())
|
||||
.append("taxAmount", getTaxAmount())
|
||||
.append("itemLink", getItemLink())
|
||||
.append("bookNumber", getBookNumber())
|
||||
.append("productCode", getProductCode())
|
||||
.append("name", getName())
|
||||
.append("brand", getBrand())
|
||||
.append("specificationModel", getSpecificationModel())
|
||||
.append("description", getDescription())
|
||||
.append("quantityUnit", getQuantityUnit())
|
||||
.append("produceCountry", getProduceCountry())
|
||||
.append("inspectionAndQuarantineCode", getInspectionAndQuarantineCode())
|
||||
.append("hsCode", getHsCode())
|
||||
.append("taxRate", getTaxRate())
|
||||
.append("declaredCount", getDeclaredCount())
|
||||
.append("legalMeteringUnit", getLegalMeteringUnit())
|
||||
.append("secondDeclaredCount", getSecondDeclaredCount())
|
||||
.append("secondMeteringUnit", getSecondMeteringUnit())
|
||||
.append("grossWeight", getGrossWeight())
|
||||
.append("netWeight", getNetWeight())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,402 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 备案订单项对象 custom_order_item
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@TableName(value = "custom_order_item")
|
||||
public class CustomOrderItemPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "净重")
|
||||
private Long orderId;
|
||||
/** 口岸Id */
|
||||
@Excel(name = "口岸Id")
|
||||
private Long declarePortId;
|
||||
/** 仓库Id */
|
||||
@Excel(name = "仓库Id")
|
||||
private Long warehouseId;
|
||||
/** 商品条形码 */
|
||||
@Excel(name = "商品条形码")
|
||||
private String barCode;
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private Integer quantity;
|
||||
/** 单价 */
|
||||
@Excel(name = "单价")
|
||||
private BigDecimal price;
|
||||
/** 商城单价 */
|
||||
@Excel(name = "商城单价")
|
||||
private BigDecimal shopPrice;
|
||||
/** 运费 */
|
||||
@Excel(name = "运费")
|
||||
private BigDecimal freight;
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "运费")
|
||||
private BigDecimal taxAmount;
|
||||
/** 商品链接 */
|
||||
@Excel(name = "商品链接")
|
||||
private String itemLink;
|
||||
/** 账(手)册商品序号 */
|
||||
@Excel(name = "账(手)册商品序号")
|
||||
private String bookNumber;
|
||||
/** 商品货号 */
|
||||
@Excel(name = "商品货号")
|
||||
private String productCode;
|
||||
/** 名称 */
|
||||
@Excel(name = "名称")
|
||||
private String name;
|
||||
/** 品牌 */
|
||||
@Excel(name = "品牌")
|
||||
private String brand;
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String specificationModel;
|
||||
/** 商品描述 */
|
||||
@Excel(name = "商品描述")
|
||||
private String description;
|
||||
/** 数量单位 */
|
||||
@Excel(name = "数量单位")
|
||||
private String quantityUnit;
|
||||
/** 生产国 */
|
||||
@Excel(name = "生产国")
|
||||
private String produceCountry;
|
||||
/** 检验检疫编码 */
|
||||
@Excel(name = "检验检疫编码")
|
||||
private String inspectionAndQuarantineCode;
|
||||
/** HS编码 */
|
||||
@Excel(name = "HS编码")
|
||||
private String hsCode;
|
||||
/** 税率 */
|
||||
@Excel(name = "税率")
|
||||
private BigDecimal taxRate;
|
||||
/** 申报数量(法定数量=申报数量*购买数量) */
|
||||
@Excel(name = "申报数量", readConverterExp = "法=定数量=申报数量*购买数量")
|
||||
private BigDecimal declaredCount;
|
||||
/** 法定计量单位 */
|
||||
@Excel(name = "法定计量单位")
|
||||
private String legalMeteringUnit;
|
||||
/** 第二申报数量(第二数量=第二申报数量*购买数量) */
|
||||
@Excel(name = "第二申报数量", readConverterExp = "第=二数量=第二申报数量*购买数量")
|
||||
private BigDecimal secondDeclaredCount;
|
||||
/** 第二计量单位 */
|
||||
@Excel(name = "第二计量单位")
|
||||
private String secondMeteringUnit;
|
||||
/** 毛重 */
|
||||
@Excel(name = "毛重")
|
||||
private BigDecimal grossWeight;
|
||||
/** 净重 */
|
||||
@Excel(name = "净重")
|
||||
private BigDecimal netWeight;
|
||||
/** skucode */
|
||||
@Excel(name = "skucode")
|
||||
private String skuCode;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSkuCode() {
|
||||
return skuCode;
|
||||
}
|
||||
|
||||
public void setSkuCode(String skuCode) {
|
||||
this.skuCode = skuCode;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Long getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setDeclarePortId(Long declarePortId)
|
||||
{
|
||||
this.declarePortId = declarePortId;
|
||||
}
|
||||
|
||||
public Long getDeclarePortId()
|
||||
{
|
||||
return declarePortId;
|
||||
}
|
||||
public void setWarehouseId(Long warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public Long getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
public void setBarCode(String barCode)
|
||||
{
|
||||
this.barCode = barCode;
|
||||
}
|
||||
|
||||
public String getBarCode()
|
||||
{
|
||||
return barCode;
|
||||
}
|
||||
public void setQuantity(Integer quantity)
|
||||
{
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Integer getQuantity()
|
||||
{
|
||||
return quantity;
|
||||
}
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
public void setShopPrice(BigDecimal shopPrice)
|
||||
{
|
||||
this.shopPrice = shopPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getShopPrice()
|
||||
{
|
||||
return shopPrice;
|
||||
}
|
||||
public void setFreight(BigDecimal freight)
|
||||
{
|
||||
this.freight = freight;
|
||||
}
|
||||
|
||||
public BigDecimal getFreight()
|
||||
{
|
||||
return freight;
|
||||
}
|
||||
public void setTaxAmount(BigDecimal taxAmount)
|
||||
{
|
||||
this.taxAmount = taxAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxAmount()
|
||||
{
|
||||
return taxAmount;
|
||||
}
|
||||
public void setItemLink(String itemLink)
|
||||
{
|
||||
this.itemLink = itemLink;
|
||||
}
|
||||
|
||||
public String getItemLink()
|
||||
{
|
||||
return itemLink;
|
||||
}
|
||||
public void setBookNumber(String bookNumber)
|
||||
{
|
||||
this.bookNumber = bookNumber;
|
||||
}
|
||||
|
||||
public String getBookNumber()
|
||||
{
|
||||
return bookNumber;
|
||||
}
|
||||
public void setProductCode(String productCode)
|
||||
{
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public String getProductCode()
|
||||
{
|
||||
return productCode;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setBrand(String brand)
|
||||
{
|
||||
this.brand = brand;
|
||||
}
|
||||
|
||||
public String getBrand()
|
||||
{
|
||||
return brand;
|
||||
}
|
||||
public void setSpecificationModel(String specificationModel)
|
||||
{
|
||||
this.specificationModel = specificationModel;
|
||||
}
|
||||
|
||||
public String getSpecificationModel()
|
||||
{
|
||||
return specificationModel;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
public void setQuantityUnit(String quantityUnit)
|
||||
{
|
||||
this.quantityUnit = quantityUnit;
|
||||
}
|
||||
|
||||
public String getQuantityUnit()
|
||||
{
|
||||
return quantityUnit;
|
||||
}
|
||||
public void setProduceCountry(String produceCountry)
|
||||
{
|
||||
this.produceCountry = produceCountry;
|
||||
}
|
||||
|
||||
public String getProduceCountry()
|
||||
{
|
||||
return produceCountry;
|
||||
}
|
||||
public void setInspectionAndQuarantineCode(String inspectionAndQuarantineCode)
|
||||
{
|
||||
this.inspectionAndQuarantineCode = inspectionAndQuarantineCode;
|
||||
}
|
||||
|
||||
public String getInspectionAndQuarantineCode()
|
||||
{
|
||||
return inspectionAndQuarantineCode;
|
||||
}
|
||||
public void setHsCode(String hsCode)
|
||||
{
|
||||
this.hsCode = hsCode;
|
||||
}
|
||||
|
||||
public String getHsCode()
|
||||
{
|
||||
return hsCode;
|
||||
}
|
||||
public void setTaxRate(BigDecimal taxRate)
|
||||
{
|
||||
this.taxRate = taxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxRate()
|
||||
{
|
||||
return taxRate;
|
||||
}
|
||||
public void setDeclaredCount(BigDecimal declaredCount)
|
||||
{
|
||||
this.declaredCount = declaredCount;
|
||||
}
|
||||
|
||||
public BigDecimal getDeclaredCount()
|
||||
{
|
||||
return declaredCount;
|
||||
}
|
||||
public void setLegalMeteringUnit(String legalMeteringUnit)
|
||||
{
|
||||
this.legalMeteringUnit = legalMeteringUnit;
|
||||
}
|
||||
|
||||
public String getLegalMeteringUnit()
|
||||
{
|
||||
return legalMeteringUnit;
|
||||
}
|
||||
public void setSecondDeclaredCount(BigDecimal secondDeclaredCount)
|
||||
{
|
||||
this.secondDeclaredCount = secondDeclaredCount;
|
||||
}
|
||||
|
||||
public BigDecimal getSecondDeclaredCount()
|
||||
{
|
||||
return secondDeclaredCount;
|
||||
}
|
||||
public void setSecondMeteringUnit(String secondMeteringUnit)
|
||||
{
|
||||
this.secondMeteringUnit = secondMeteringUnit;
|
||||
}
|
||||
|
||||
public String getSecondMeteringUnit()
|
||||
{
|
||||
return secondMeteringUnit;
|
||||
}
|
||||
public void setGrossWeight(BigDecimal grossWeight)
|
||||
{
|
||||
this.grossWeight = grossWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getGrossWeight()
|
||||
{
|
||||
return grossWeight;
|
||||
}
|
||||
public void setNetWeight(BigDecimal netWeight)
|
||||
{
|
||||
this.netWeight = netWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getNetWeight()
|
||||
{
|
||||
return netWeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("declarePortId", getDeclarePortId())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("barCode", getBarCode())
|
||||
.append("quantity", getQuantity())
|
||||
.append("price", getPrice())
|
||||
.append("shopPrice", getShopPrice())
|
||||
.append("freight", getFreight())
|
||||
.append("taxAmount", getTaxAmount())
|
||||
.append("itemLink", getItemLink())
|
||||
.append("bookNumber", getBookNumber())
|
||||
.append("productCode", getProductCode())
|
||||
.append("name", getName())
|
||||
.append("brand", getBrand())
|
||||
.append("specificationModel", getSpecificationModel())
|
||||
.append("description", getDescription())
|
||||
.append("quantityUnit", getQuantityUnit())
|
||||
.append("produceCountry", getProduceCountry())
|
||||
.append("inspectionAndQuarantineCode", getInspectionAndQuarantineCode())
|
||||
.append("hsCode", getHsCode())
|
||||
.append("taxRate", getTaxRate())
|
||||
.append("declaredCount", getDeclaredCount())
|
||||
.append("legalMeteringUnit", getLegalMeteringUnit())
|
||||
.append("secondDeclaredCount", getSecondDeclaredCount())
|
||||
.append("secondMeteringUnit", getSecondMeteringUnit())
|
||||
.append("grossWeight", getGrossWeight())
|
||||
.append("netWeight", getNetWeight())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,722 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 备案订单对象 custom_order
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@TableName(value = "custom_order")
|
||||
public class CustomOrderPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
/** 口岸Id */
|
||||
@Excel(name = "口岸Id")
|
||||
private Long declarePortId;
|
||||
/** 仓库Id */
|
||||
@Excel(name = "仓库Id")
|
||||
private Long warehouseId;
|
||||
/** 清关方式:1、保税;2、直邮;3、个人 */
|
||||
@Excel(name = "清关方式:1、保税;2、直邮;3、个人")
|
||||
private Integer mode;
|
||||
/** 用户id */
|
||||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
/** 系统订单号 */
|
||||
@Excel(name = "系统订单号")
|
||||
private String sOrderNo;
|
||||
/** 申报订单号(商城订单号) */
|
||||
@Excel(name = "申报订单号", readConverterExp = "商=城订单号")
|
||||
private String declareOrderNo;
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private Integer status;
|
||||
/** 快递公司 */
|
||||
@Excel(name = "快递公司")
|
||||
private String expressName;
|
||||
/** 运单号 */
|
||||
@Excel(name = "运单号")
|
||||
private String shipOrderNumber;
|
||||
/** 购买人注册号 */
|
||||
@Excel(name = "购买人注册号")
|
||||
private String buyerRegNo;
|
||||
/** 购买人 */
|
||||
@Excel(name = "购买人")
|
||||
private String buyerName;
|
||||
/** 购买人电话 */
|
||||
@Excel(name = "购买人电话")
|
||||
private String buyerTelephone;
|
||||
/** 购买人身份证类型:1-身份证,2-其它,3-军官证,4-护照。 */
|
||||
@Excel(name = "购买人身份证类型:1-身份证,2-其它,3-军官证,4-护照。")
|
||||
private Integer buyerIdType;
|
||||
/** 购买人身份证 */
|
||||
@Excel(name = "购买人身份证")
|
||||
private String buyerIdNumber;
|
||||
/** 收件人 */
|
||||
@Excel(name = "收件人")
|
||||
private String consignee;
|
||||
/** 收件人电话 */
|
||||
@Excel(name = "收件人电话")
|
||||
private String consigneeTelephone;
|
||||
/** 收件人地址 */
|
||||
@Excel(name = "收件人地址")
|
||||
private String consigneeAddress;
|
||||
/** 收件人省 */
|
||||
@Excel(name = "收件人省")
|
||||
private String consigneeProvince;
|
||||
/** 收件人市 */
|
||||
@Excel(name = "收件人市")
|
||||
private String consigneeCity;
|
||||
/** 收件人区 */
|
||||
@Excel(name = "收件人区")
|
||||
private String consigneeDistrict;
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "收件人区")
|
||||
private BigDecimal totalAmount;
|
||||
/** 非现金抵扣金额 */
|
||||
@Excel(name = "非现金抵扣金额")
|
||||
private BigDecimal discountAmount;
|
||||
/** 实际支付金额 */
|
||||
@Excel(name = "实际支付金额")
|
||||
private BigDecimal payTotalAmount;
|
||||
/** 税费 */
|
||||
@Excel(name = "税费")
|
||||
private BigDecimal taxTotalAmount;
|
||||
/** 商城税费 */
|
||||
@Excel(name = "商城税费")
|
||||
private BigDecimal shopTaxTotalAmount;
|
||||
/** 运费 */
|
||||
@Excel(name = "运费")
|
||||
private BigDecimal freightAmount;
|
||||
/** 总毛重 */
|
||||
@Excel(name = "总毛重")
|
||||
private BigDecimal totalGrossWeight;
|
||||
/** 总净重 */
|
||||
@Excel(name = "总净重")
|
||||
private BigDecimal totalNetWeight;
|
||||
/** 总数量 */
|
||||
@Excel(name = "总数量")
|
||||
private Integer totalQuantity;
|
||||
/** 支付公司名称 */
|
||||
@Excel(name = "支付公司名称")
|
||||
private String payName;
|
||||
/** 支付公司代码 */
|
||||
@Excel(name = "支付公司代码")
|
||||
private String payCode;
|
||||
/** 支付时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date payTime;
|
||||
/** 支付单号 */
|
||||
@Excel(name = "支付单号")
|
||||
private String gatewayOrderId;
|
||||
/** 发件人 */
|
||||
@Excel(name = "发件人")
|
||||
private String consignor;
|
||||
/** 发件人地址 */
|
||||
@Excel(name = "发件人地址")
|
||||
private String consignorAddress;
|
||||
/** 发件人电话 */
|
||||
@Excel(name = "发件人电话")
|
||||
private String consignorTelephone;
|
||||
/** 发件人所在国 */
|
||||
@Excel(name = "发件人所在国")
|
||||
private String consignorCountry;
|
||||
/** 发件人省 */
|
||||
@Excel(name = "发件人省")
|
||||
private String consignorProvince;
|
||||
/** 发件人市 */
|
||||
@Excel(name = "发件人市")
|
||||
private String consignorCity;
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "发件人市")
|
||||
private String consignorDistrict;
|
||||
/** 收款账户 */
|
||||
@Excel(name = "收款账户")
|
||||
private String receiptAccount;
|
||||
/** 验核机构:1-银联 2-网联 3-其他 */
|
||||
@Excel(name = "验核机构:1-银联 2-网联 3-其他")
|
||||
private Integer verDept;
|
||||
/** 支付类型:1-APP 2-PC 3-扫码 4-其他 */
|
||||
@Excel(name = "支付类型:1-APP 2-PC 3-扫码 4-其他")
|
||||
private Integer payType;
|
||||
/** 支付原始请求 */
|
||||
@Excel(name = "支付原始请求")
|
||||
private String initalRequest;
|
||||
/** 支付原始响应 */
|
||||
@Excel(name = "支付原始响应")
|
||||
private String initalResponse;
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
/** 接口信息返回结果 */
|
||||
@Excel(name = "接口信息返回结果")
|
||||
private String expressReturn;
|
||||
/** 订单处理过程 */
|
||||
@Excel(name = "订单处理过程")
|
||||
private String process;
|
||||
/** 添加时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date addTime;
|
||||
/** 清单编号 */
|
||||
@Excel(name = "清单编号")
|
||||
private String inventoryNo;
|
||||
/** 批次号 */
|
||||
@Excel(name = "批次号")
|
||||
private String batchNumber;
|
||||
/** 备案订单项信息 */
|
||||
private List<CustomOrderItem> customOrderItemList;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setDeclarePortId(Long declarePortId)
|
||||
{
|
||||
this.declarePortId = declarePortId;
|
||||
}
|
||||
|
||||
public Long getDeclarePortId()
|
||||
{
|
||||
return declarePortId;
|
||||
}
|
||||
public void setWarehouseId(Long warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public Long getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
public void setMode(Integer mode)
|
||||
{
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
public Integer getMode()
|
||||
{
|
||||
return mode;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setsOrderNo(String sOrderNo)
|
||||
{
|
||||
this.sOrderNo = sOrderNo;
|
||||
}
|
||||
|
||||
public String getsOrderNo()
|
||||
{
|
||||
return sOrderNo;
|
||||
}
|
||||
public void setDeclareOrderNo(String declareOrderNo)
|
||||
{
|
||||
this.declareOrderNo = declareOrderNo;
|
||||
}
|
||||
|
||||
public String getDeclareOrderNo()
|
||||
{
|
||||
return declareOrderNo;
|
||||
}
|
||||
public void setStatus(Integer status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setExpressName(String expressName)
|
||||
{
|
||||
this.expressName = expressName;
|
||||
}
|
||||
|
||||
public String getExpressName()
|
||||
{
|
||||
return expressName;
|
||||
}
|
||||
public void setShipOrderNumber(String shipOrderNumber)
|
||||
{
|
||||
this.shipOrderNumber = shipOrderNumber;
|
||||
}
|
||||
|
||||
public String getShipOrderNumber()
|
||||
{
|
||||
return shipOrderNumber;
|
||||
}
|
||||
public void setBuyerRegNo(String buyerRegNo)
|
||||
{
|
||||
this.buyerRegNo = buyerRegNo;
|
||||
}
|
||||
|
||||
public String getBuyerRegNo()
|
||||
{
|
||||
return buyerRegNo;
|
||||
}
|
||||
public void setBuyerName(String buyerName)
|
||||
{
|
||||
this.buyerName = buyerName;
|
||||
}
|
||||
|
||||
public String getBuyerName()
|
||||
{
|
||||
return buyerName;
|
||||
}
|
||||
public void setBuyerTelephone(String buyerTelephone)
|
||||
{
|
||||
this.buyerTelephone = buyerTelephone;
|
||||
}
|
||||
|
||||
public String getBuyerTelephone()
|
||||
{
|
||||
return buyerTelephone;
|
||||
}
|
||||
public void setBuyerIdType(Integer buyerIdType)
|
||||
{
|
||||
this.buyerIdType = buyerIdType;
|
||||
}
|
||||
|
||||
public Integer getBuyerIdType()
|
||||
{
|
||||
return buyerIdType;
|
||||
}
|
||||
public void setBuyerIdNumber(String buyerIdNumber)
|
||||
{
|
||||
this.buyerIdNumber = buyerIdNumber;
|
||||
}
|
||||
|
||||
public String getBuyerIdNumber()
|
||||
{
|
||||
return buyerIdNumber;
|
||||
}
|
||||
public void setConsignee(String consignee)
|
||||
{
|
||||
this.consignee = consignee;
|
||||
}
|
||||
|
||||
public String getConsignee()
|
||||
{
|
||||
return consignee;
|
||||
}
|
||||
public void setConsigneeTelephone(String consigneeTelephone)
|
||||
{
|
||||
this.consigneeTelephone = consigneeTelephone;
|
||||
}
|
||||
|
||||
public String getConsigneeTelephone()
|
||||
{
|
||||
return consigneeTelephone;
|
||||
}
|
||||
public void setConsigneeAddress(String consigneeAddress)
|
||||
{
|
||||
this.consigneeAddress = consigneeAddress;
|
||||
}
|
||||
|
||||
public String getConsigneeAddress()
|
||||
{
|
||||
return consigneeAddress;
|
||||
}
|
||||
public void setConsigneeProvince(String consigneeProvince)
|
||||
{
|
||||
this.consigneeProvince = consigneeProvince;
|
||||
}
|
||||
|
||||
public String getConsigneeProvince()
|
||||
{
|
||||
return consigneeProvince;
|
||||
}
|
||||
public void setConsigneeCity(String consigneeCity)
|
||||
{
|
||||
this.consigneeCity = consigneeCity;
|
||||
}
|
||||
|
||||
public String getConsigneeCity()
|
||||
{
|
||||
return consigneeCity;
|
||||
}
|
||||
public void setConsigneeDistrict(String consigneeDistrict)
|
||||
{
|
||||
this.consigneeDistrict = consigneeDistrict;
|
||||
}
|
||||
|
||||
public String getConsigneeDistrict()
|
||||
{
|
||||
return consigneeDistrict;
|
||||
}
|
||||
public void setTotalAmount(BigDecimal totalAmount)
|
||||
{
|
||||
this.totalAmount = totalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalAmount()
|
||||
{
|
||||
return totalAmount;
|
||||
}
|
||||
public void setDiscountAmount(BigDecimal discountAmount)
|
||||
{
|
||||
this.discountAmount = discountAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getDiscountAmount()
|
||||
{
|
||||
return discountAmount;
|
||||
}
|
||||
public void setPayTotalAmount(BigDecimal payTotalAmount)
|
||||
{
|
||||
this.payTotalAmount = payTotalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getPayTotalAmount()
|
||||
{
|
||||
return payTotalAmount;
|
||||
}
|
||||
public void setTaxTotalAmount(BigDecimal taxTotalAmount)
|
||||
{
|
||||
this.taxTotalAmount = taxTotalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxTotalAmount()
|
||||
{
|
||||
return taxTotalAmount;
|
||||
}
|
||||
public void setShopTaxTotalAmount(BigDecimal shopTaxTotalAmount)
|
||||
{
|
||||
this.shopTaxTotalAmount = shopTaxTotalAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getShopTaxTotalAmount()
|
||||
{
|
||||
return shopTaxTotalAmount;
|
||||
}
|
||||
public void setFreightAmount(BigDecimal freightAmount)
|
||||
{
|
||||
this.freightAmount = freightAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getFreightAmount()
|
||||
{
|
||||
return freightAmount;
|
||||
}
|
||||
public void setTotalGrossWeight(BigDecimal totalGrossWeight)
|
||||
{
|
||||
this.totalGrossWeight = totalGrossWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalGrossWeight()
|
||||
{
|
||||
return totalGrossWeight;
|
||||
}
|
||||
public void setTotalNetWeight(BigDecimal totalNetWeight)
|
||||
{
|
||||
this.totalNetWeight = totalNetWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getTotalNetWeight()
|
||||
{
|
||||
return totalNetWeight;
|
||||
}
|
||||
public void setTotalQuantity(Integer totalQuantity)
|
||||
{
|
||||
this.totalQuantity = totalQuantity;
|
||||
}
|
||||
|
||||
public Integer getTotalQuantity()
|
||||
{
|
||||
return totalQuantity;
|
||||
}
|
||||
public void setPayName(String payName)
|
||||
{
|
||||
this.payName = payName;
|
||||
}
|
||||
|
||||
public String getPayName()
|
||||
{
|
||||
return payName;
|
||||
}
|
||||
public void setPayCode(String payCode)
|
||||
{
|
||||
this.payCode = payCode;
|
||||
}
|
||||
|
||||
public String getPayCode()
|
||||
{
|
||||
return payCode;
|
||||
}
|
||||
public void setPayTime(Date payTime)
|
||||
{
|
||||
this.payTime = payTime;
|
||||
}
|
||||
|
||||
public Date getPayTime()
|
||||
{
|
||||
return payTime;
|
||||
}
|
||||
public void setGatewayOrderId(String gatewayOrderId)
|
||||
{
|
||||
this.gatewayOrderId = gatewayOrderId;
|
||||
}
|
||||
|
||||
public String getGatewayOrderId()
|
||||
{
|
||||
return gatewayOrderId;
|
||||
}
|
||||
public void setConsignor(String consignor)
|
||||
{
|
||||
this.consignor = consignor;
|
||||
}
|
||||
|
||||
public String getConsignor()
|
||||
{
|
||||
return consignor;
|
||||
}
|
||||
public void setConsignorAddress(String consignorAddress)
|
||||
{
|
||||
this.consignorAddress = consignorAddress;
|
||||
}
|
||||
|
||||
public String getConsignorAddress()
|
||||
{
|
||||
return consignorAddress;
|
||||
}
|
||||
public void setConsignorTelephone(String consignorTelephone)
|
||||
{
|
||||
this.consignorTelephone = consignorTelephone;
|
||||
}
|
||||
|
||||
public String getConsignorTelephone()
|
||||
{
|
||||
return consignorTelephone;
|
||||
}
|
||||
public void setConsignorCountry(String consignorCountry)
|
||||
{
|
||||
this.consignorCountry = consignorCountry;
|
||||
}
|
||||
|
||||
public String getConsignorCountry()
|
||||
{
|
||||
return consignorCountry;
|
||||
}
|
||||
public void setConsignorProvince(String consignorProvince)
|
||||
{
|
||||
this.consignorProvince = consignorProvince;
|
||||
}
|
||||
|
||||
public String getConsignorProvince()
|
||||
{
|
||||
return consignorProvince;
|
||||
}
|
||||
public void setConsignorCity(String consignorCity)
|
||||
{
|
||||
this.consignorCity = consignorCity;
|
||||
}
|
||||
|
||||
public String getConsignorCity()
|
||||
{
|
||||
return consignorCity;
|
||||
}
|
||||
public void setConsignorDistrict(String consignorDistrict)
|
||||
{
|
||||
this.consignorDistrict = consignorDistrict;
|
||||
}
|
||||
|
||||
public String getConsignorDistrict()
|
||||
{
|
||||
return consignorDistrict;
|
||||
}
|
||||
public void setReceiptAccount(String receiptAccount)
|
||||
{
|
||||
this.receiptAccount = receiptAccount;
|
||||
}
|
||||
|
||||
public String getReceiptAccount()
|
||||
{
|
||||
return receiptAccount;
|
||||
}
|
||||
public void setVerDept(Integer verDept)
|
||||
{
|
||||
this.verDept = verDept;
|
||||
}
|
||||
|
||||
public Integer getVerDept()
|
||||
{
|
||||
return verDept;
|
||||
}
|
||||
public void setPayType(Integer payType)
|
||||
{
|
||||
this.payType = payType;
|
||||
}
|
||||
|
||||
public Integer getPayType()
|
||||
{
|
||||
return payType;
|
||||
}
|
||||
public void setInitalRequest(String initalRequest)
|
||||
{
|
||||
this.initalRequest = initalRequest;
|
||||
}
|
||||
|
||||
public String getInitalRequest()
|
||||
{
|
||||
return initalRequest;
|
||||
}
|
||||
public void setInitalResponse(String initalResponse)
|
||||
{
|
||||
this.initalResponse = initalResponse;
|
||||
}
|
||||
|
||||
public String getInitalResponse()
|
||||
{
|
||||
return initalResponse;
|
||||
}
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
public void setExpressReturn(String expressReturn)
|
||||
{
|
||||
this.expressReturn = expressReturn;
|
||||
}
|
||||
|
||||
public String getExpressReturn()
|
||||
{
|
||||
return expressReturn;
|
||||
}
|
||||
public void setProcess(String process)
|
||||
{
|
||||
this.process = process;
|
||||
}
|
||||
|
||||
public String getProcess()
|
||||
{
|
||||
return process;
|
||||
}
|
||||
public void setAddTime(Date addTime)
|
||||
{
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public Date getAddTime()
|
||||
{
|
||||
return addTime;
|
||||
}
|
||||
public void setInventoryNo(String inventoryNo)
|
||||
{
|
||||
this.inventoryNo = inventoryNo;
|
||||
}
|
||||
|
||||
public String getInventoryNo()
|
||||
{
|
||||
return inventoryNo;
|
||||
}
|
||||
public void setBatchNumber(String batchNumber)
|
||||
{
|
||||
this.batchNumber = batchNumber;
|
||||
}
|
||||
|
||||
public String getBatchNumber()
|
||||
{
|
||||
return batchNumber;
|
||||
}
|
||||
|
||||
public List<CustomOrderItem> getCustomOrderItemList()
|
||||
{
|
||||
return customOrderItemList;
|
||||
}
|
||||
|
||||
public void setCustomOrderItemList(List<CustomOrderItem> customOrderItemList)
|
||||
{
|
||||
this.customOrderItemList = customOrderItemList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("declarePortId", getDeclarePortId())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("mode", getMode())
|
||||
.append("userId", getUserId())
|
||||
.append("sOrderNo", getsOrderNo())
|
||||
.append("declareOrderNo", getDeclareOrderNo())
|
||||
.append("status", getStatus())
|
||||
.append("expressName", getExpressName())
|
||||
.append("shipOrderNumber", getShipOrderNumber())
|
||||
.append("buyerRegNo", getBuyerRegNo())
|
||||
.append("buyerName", getBuyerName())
|
||||
.append("buyerTelephone", getBuyerTelephone())
|
||||
.append("buyerIdType", getBuyerIdType())
|
||||
.append("buyerIdNumber", getBuyerIdNumber())
|
||||
.append("consignee", getConsignee())
|
||||
.append("consigneeTelephone", getConsigneeTelephone())
|
||||
.append("consigneeAddress", getConsigneeAddress())
|
||||
.append("consigneeProvince", getConsigneeProvince())
|
||||
.append("consigneeCity", getConsigneeCity())
|
||||
.append("consigneeDistrict", getConsigneeDistrict())
|
||||
.append("totalAmount", getTotalAmount())
|
||||
.append("discountAmount", getDiscountAmount())
|
||||
.append("payTotalAmount", getPayTotalAmount())
|
||||
.append("taxTotalAmount", getTaxTotalAmount())
|
||||
.append("shopTaxTotalAmount", getShopTaxTotalAmount())
|
||||
.append("freightAmount", getFreightAmount())
|
||||
.append("totalGrossWeight", getTotalGrossWeight())
|
||||
.append("totalNetWeight", getTotalNetWeight())
|
||||
.append("totalQuantity", getTotalQuantity())
|
||||
.append("payName", getPayName())
|
||||
.append("payCode", getPayCode())
|
||||
.append("payTime", getPayTime())
|
||||
.append("gatewayOrderId", getGatewayOrderId())
|
||||
.append("consignor", getConsignor())
|
||||
.append("consignorAddress", getConsignorAddress())
|
||||
.append("consignorTelephone", getConsignorTelephone())
|
||||
.append("consignorCountry", getConsignorCountry())
|
||||
.append("consignorProvince", getConsignorProvince())
|
||||
.append("consignorCity", getConsignorCity())
|
||||
.append("consignorDistrict", getConsignorDistrict())
|
||||
.append("receiptAccount", getReceiptAccount())
|
||||
.append("verDept", getVerDept())
|
||||
.append("payType", getPayType())
|
||||
.append("initalRequest", getInitalRequest())
|
||||
.append("initalResponse", getInitalResponse())
|
||||
.append("remark", getRemark())
|
||||
.append("expressReturn", getExpressReturn())
|
||||
.append("process", getProcess())
|
||||
.append("addTime", getAddTime())
|
||||
.append("inventoryNo", getInventoryNo())
|
||||
.append("batchNumber", getBatchNumber())
|
||||
.append("customOrderItemList", getCustomOrderItemList())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,141 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 行邮税号对象 custom_parcel_number
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
public class CustomParcelNumber extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** 行邮税号 */
|
||||
@Excel(name = "行邮税号")
|
||||
private String parcelNumber;
|
||||
|
||||
/** 品名及规格 */
|
||||
@Excel(name = "品名及规格")
|
||||
private String name;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
/** 完税价格 */
|
||||
@Excel(name = "完税价格")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 税率 */
|
||||
@Excel(name = "税率")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/** 税额 */
|
||||
@Excel(name = "税额")
|
||||
private BigDecimal taxAmount;
|
||||
|
||||
/** 添加时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date addTime;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setParcelNumber(String parcelNumber)
|
||||
{
|
||||
this.parcelNumber = parcelNumber;
|
||||
}
|
||||
|
||||
public String getParcelNumber()
|
||||
{
|
||||
return parcelNumber;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setUnit(String unit)
|
||||
{
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getUnit()
|
||||
{
|
||||
return unit;
|
||||
}
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
public void setTaxRate(BigDecimal taxRate)
|
||||
{
|
||||
this.taxRate = taxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxRate()
|
||||
{
|
||||
return taxRate;
|
||||
}
|
||||
public void setTaxAmount(BigDecimal taxAmount)
|
||||
{
|
||||
this.taxAmount = taxAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxAmount()
|
||||
{
|
||||
return taxAmount;
|
||||
}
|
||||
public void setAddTime(Date addTime)
|
||||
{
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public Date getAddTime()
|
||||
{
|
||||
return addTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("parcelNumber", getParcelNumber())
|
||||
.append("name", getName())
|
||||
.append("unit", getUnit())
|
||||
.append("price", getPrice())
|
||||
.append("taxRate", getTaxRate())
|
||||
.append("taxAmount", getTaxAmount())
|
||||
.append("remark", getRemark())
|
||||
.append("addTime", getAddTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,159 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
/**
|
||||
* 行邮税号对象 custom_parcel_number
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
@TableName(value = "custom_parcel_number")
|
||||
public class CustomParcelNumberPlus implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
/** 行邮税号 */
|
||||
@Excel(name = "行邮税号")
|
||||
private String parcelNumber;
|
||||
/** 品名及规格 */
|
||||
@Excel(name = "品名及规格")
|
||||
private String name;
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
/** 完税价格 */
|
||||
@Excel(name = "完税价格")
|
||||
private BigDecimal price;
|
||||
/** 税率 */
|
||||
@Excel(name = "税率")
|
||||
private BigDecimal taxRate;
|
||||
/** 税额 */
|
||||
@Excel(name = "税额")
|
||||
private BigDecimal taxAmount;
|
||||
/** 备注 */
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
/** 添加时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date addTime;
|
||||
/** 更新时间 */
|
||||
private Date updateTime;
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setParcelNumber(String parcelNumber)
|
||||
{
|
||||
this.parcelNumber = parcelNumber;
|
||||
}
|
||||
|
||||
public String getParcelNumber()
|
||||
{
|
||||
return parcelNumber;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setUnit(String unit)
|
||||
{
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getUnit()
|
||||
{
|
||||
return unit;
|
||||
}
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
public void setTaxRate(BigDecimal taxRate)
|
||||
{
|
||||
this.taxRate = taxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxRate()
|
||||
{
|
||||
return taxRate;
|
||||
}
|
||||
public void setTaxAmount(BigDecimal taxAmount)
|
||||
{
|
||||
this.taxAmount = taxAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxAmount()
|
||||
{
|
||||
return taxAmount;
|
||||
}
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
public void setAddTime(Date addTime)
|
||||
{
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public Date getAddTime()
|
||||
{
|
||||
return addTime;
|
||||
}
|
||||
public void setUpdateTime(Date updateTime)
|
||||
{
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime()
|
||||
{
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("parcelNumber", getParcelNumber())
|
||||
.append("name", getName())
|
||||
.append("unit", getUnit())
|
||||
.append("price", getPrice())
|
||||
.append("taxRate", getTaxRate())
|
||||
.append("taxAmount", getTaxAmount())
|
||||
.append("remark", getRemark())
|
||||
.append("addTime", getAddTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,533 +0,0 @@
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 商品备案对象 custom_product_record
|
||||
*
|
||||
* @author luqj
|
||||
* @date 2021-10-23
|
||||
*/
|
||||
public class CustomProductRecord extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long id;
|
||||
|
||||
/** sku编码 */
|
||||
@Excel(name = "sku编码")
|
||||
private String skuCode;
|
||||
|
||||
/** 商品条形码 */
|
||||
@Excel(name = "商品条形码")
|
||||
private String barCode;
|
||||
|
||||
/** 商品货号 */
|
||||
@Excel(name = "商品货号")
|
||||
private String productCode;
|
||||
|
||||
/** HS编码 */
|
||||
@Excel(name = "HS编码")
|
||||
private String hsCode;
|
||||
|
||||
/** 商品名称 */
|
||||
@Excel(name = "商品名称")
|
||||
private String name;
|
||||
|
||||
/** 品牌 */
|
||||
@Excel(name = "品牌")
|
||||
private String brand;
|
||||
|
||||
/** 商品描述 */
|
||||
@Excel(name = "商品描述")
|
||||
private String description;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String specificationModel;
|
||||
|
||||
/** 生产国 */
|
||||
@Excel(name = "生产国")
|
||||
private String produceCountry;
|
||||
|
||||
/** 生产国代码 */
|
||||
@Excel(name = "生产国代码")
|
||||
private String produceCountryCode;
|
||||
|
||||
/** 数量单位 */
|
||||
@Excel(name = "数量单位")
|
||||
private String quantityUnit;
|
||||
|
||||
/** 数量单位代码 */
|
||||
@Excel(name = "数量单位代码")
|
||||
private String quantityUnitCode;
|
||||
|
||||
/** 申报数量(法定数量=申报数量*购买数量) */
|
||||
@Excel(name = "申报数量", readConverterExp = "法=定数量=申报数量*购买数量")
|
||||
private BigDecimal declaredCount;
|
||||
|
||||
/** 法定计量单位 */
|
||||
@Excel(name = "法定计量单位")
|
||||
private String legalMeteringUnit;
|
||||
|
||||
/** 法定计量单位代码 */
|
||||
@Excel(name = "法定计量单位代码")
|
||||
private String legalMeteringUnitCode;
|
||||
|
||||
/** 第二申报数量(第二数量=第二申报数量*购买数量) */
|
||||
@Excel(name = "第二申报数量", readConverterExp = "第=二数量=第二申报数量*购买数量")
|
||||
private BigDecimal secondDeclaredCount;
|
||||
|
||||
/** 第二计量单位 */
|
||||
@Excel(name = "第二计量单位")
|
||||
private String secondMeteringUnit;
|
||||
|
||||
/** 第二计量单位代码 */
|
||||
@Excel(name = "第二计量单位代码")
|
||||
private String secondMeteringUnitCode;
|
||||
|
||||
/** 单价 */
|
||||
@Excel(name = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 毛重(KG) */
|
||||
@Excel(name = "毛重", readConverterExp = "K=G")
|
||||
private BigDecimal grossWeight;
|
||||
|
||||
/** 净重(KG) */
|
||||
@Excel(name = "净重", readConverterExp = "K=G")
|
||||
private BigDecimal netWeight;
|
||||
|
||||
/** 检验检疫编码 */
|
||||
@Excel(name = "检验检疫编码")
|
||||
private String inspectionAndQuarantineCode;
|
||||
|
||||
/** 用户id */
|
||||
@Excel(name = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/** 仓库id */
|
||||
@Excel(name = "仓库id")
|
||||
private Long warehouseId;
|
||||
|
||||
/** 申报口岸Id */
|
||||
@Excel(name = "申报口岸Id")
|
||||
private Long declarePortId;
|
||||
|
||||
/** 税率 */
|
||||
@Excel(name = "税率")
|
||||
private BigDecimal taxRate;
|
||||
|
||||
/** 成分 */
|
||||
@Excel(name = "成分")
|
||||
private String ingredient;
|
||||
|
||||
/** 账(手)册商品序号 */
|
||||
@Excel(name = "账(手)册商品序号")
|
||||
private String bookNumber;
|
||||
|
||||
/** 1、保税;2、直邮;3、个人 */
|
||||
@Excel(name = "1、保税;2、直邮;3、个人")
|
||||
private Integer type;
|
||||
|
||||
/** 添加时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "添加时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date addTime;
|
||||
|
||||
/** 行邮税号 */
|
||||
@Excel(name = "行邮税号")
|
||||
private String parcelNumber;
|
||||
|
||||
/** 行邮税率 */
|
||||
@Excel(name = "行邮税率")
|
||||
private BigDecimal parcelNumberTaxRate;
|
||||
|
||||
/** 英文品名 */
|
||||
@Excel(name = "英文品名")
|
||||
private String englishName;
|
||||
|
||||
/** 完税价格 */
|
||||
@Excel(name = "完税价格")
|
||||
private BigDecimal dutyPrice;
|
||||
|
||||
/** 税额 */
|
||||
@Excel(name = "税额")
|
||||
private BigDecimal taxAmount;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setSkuCode(String skuCode)
|
||||
{
|
||||
this.skuCode = skuCode;
|
||||
}
|
||||
|
||||
public String getSkuCode()
|
||||
{
|
||||
return skuCode;
|
||||
}
|
||||
public void setBarCode(String barCode)
|
||||
{
|
||||
this.barCode = barCode;
|
||||
}
|
||||
|
||||
public String getBarCode()
|
||||
{
|
||||
return barCode;
|
||||
}
|
||||
public void setProductCode(String productCode)
|
||||
{
|
||||
this.productCode = productCode;
|
||||
}
|
||||
|
||||
public String getProductCode()
|
||||
{
|
||||
return productCode;
|
||||
}
|
||||
public void setHsCode(String hsCode)
|
||||
{
|
||||
this.hsCode = hsCode;
|
||||
}
|
||||
|
||||
public String getHsCode()
|
||||
{
|
||||
return hsCode;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setBrand(String brand)
|
||||
{
|
||||
this.brand = brand;
|
||||
}
|
||||
|
||||
public String getBrand()
|
||||
{
|
||||
return brand;
|
||||
}
|
||||
public void setDescription(String description)
|
||||
{
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
public void setSpecificationModel(String specificationModel)
|
||||
{
|
||||
this.specificationModel = specificationModel;
|
||||
}
|
||||
|
||||
public String getSpecificationModel()
|
||||
{
|
||||
return specificationModel;
|
||||
}
|
||||
public void setProduceCountry(String produceCountry)
|
||||
{
|
||||
this.produceCountry = produceCountry;
|
||||
}
|
||||
|
||||
public String getProduceCountry()
|
||||
{
|
||||
return produceCountry;
|
||||
}
|
||||
public void setProduceCountryCode(String produceCountryCode)
|
||||
{
|
||||
this.produceCountryCode = produceCountryCode;
|
||||
}
|
||||
|
||||
public String getProduceCountryCode()
|
||||
{
|
||||
return produceCountryCode;
|
||||
}
|
||||
public void setQuantityUnit(String quantityUnit)
|
||||
{
|
||||
this.quantityUnit = quantityUnit;
|
||||
}
|
||||
|
||||
public String getQuantityUnit()
|
||||
{
|
||||
return quantityUnit;
|
||||
}
|
||||
public void setQuantityUnitCode(String quantityUnitCode)
|
||||
{
|
||||
this.quantityUnitCode = quantityUnitCode;
|
||||
}
|
||||
|
||||
public String getQuantityUnitCode()
|
||||
{
|
||||
return quantityUnitCode;
|
||||
}
|
||||
public void setDeclaredCount(BigDecimal declaredCount)
|
||||
{
|
||||
this.declaredCount = declaredCount;
|
||||
}
|
||||
|
||||
public BigDecimal getDeclaredCount()
|
||||
{
|
||||
return declaredCount;
|
||||
}
|
||||
public void setLegalMeteringUnit(String legalMeteringUnit)
|
||||
{
|
||||
this.legalMeteringUnit = legalMeteringUnit;
|
||||
}
|
||||
|
||||
public String getLegalMeteringUnit()
|
||||
{
|
||||
return legalMeteringUnit;
|
||||
}
|
||||
public void setLegalMeteringUnitCode(String legalMeteringUnitCode)
|
||||
{
|
||||
this.legalMeteringUnitCode = legalMeteringUnitCode;
|
||||
}
|
||||
|
||||
public String getLegalMeteringUnitCode()
|
||||
{
|
||||
return legalMeteringUnitCode;
|
||||
}
|
||||
public void setSecondDeclaredCount(BigDecimal secondDeclaredCount)
|
||||
{
|
||||
this.secondDeclaredCount = secondDeclaredCount;
|
||||
}
|
||||
|
||||
public BigDecimal getSecondDeclaredCount()
|
||||
{
|
||||
return secondDeclaredCount;
|
||||
}
|
||||
public void setSecondMeteringUnit(String secondMeteringUnit)
|
||||
{
|
||||
this.secondMeteringUnit = secondMeteringUnit;
|
||||
}
|
||||
|
||||
public String getSecondMeteringUnit()
|
||||
{
|
||||
return secondMeteringUnit;
|
||||
}
|
||||
public void setSecondMeteringUnitCode(String secondMeteringUnitCode)
|
||||
{
|
||||
this.secondMeteringUnitCode = secondMeteringUnitCode;
|
||||
}
|
||||
|
||||
public String getSecondMeteringUnitCode()
|
||||
{
|
||||
return secondMeteringUnitCode;
|
||||
}
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
public void setGrossWeight(BigDecimal grossWeight)
|
||||
{
|
||||
this.grossWeight = grossWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getGrossWeight()
|
||||
{
|
||||
return grossWeight;
|
||||
}
|
||||
public void setNetWeight(BigDecimal netWeight)
|
||||
{
|
||||
this.netWeight = netWeight;
|
||||
}
|
||||
|
||||
public BigDecimal getNetWeight()
|
||||
{
|
||||
return netWeight;
|
||||
}
|
||||
public void setInspectionAndQuarantineCode(String inspectionAndQuarantineCode)
|
||||
{
|
||||
this.inspectionAndQuarantineCode = inspectionAndQuarantineCode;
|
||||
}
|
||||
|
||||
public String getInspectionAndQuarantineCode()
|
||||
{
|
||||
return inspectionAndQuarantineCode;
|
||||
}
|
||||
public void setUserId(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public Long getUserId()
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
public void setWarehouseId(Long warehouseId)
|
||||
{
|
||||
this.warehouseId = warehouseId;
|
||||
}
|
||||
|
||||
public Long getWarehouseId()
|
||||
{
|
||||
return warehouseId;
|
||||
}
|
||||
public void setDeclarePortId(Long declarePortId)
|
||||
{
|
||||
this.declarePortId = declarePortId;
|
||||
}
|
||||
|
||||
public Long getDeclarePortId()
|
||||
{
|
||||
return declarePortId;
|
||||
}
|
||||
public void setTaxRate(BigDecimal taxRate)
|
||||
{
|
||||
this.taxRate = taxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxRate()
|
||||
{
|
||||
return taxRate;
|
||||
}
|
||||
public void setIngredient(String ingredient)
|
||||
{
|
||||
this.ingredient = ingredient;
|
||||
}
|
||||
|
||||
public String getIngredient()
|
||||
{
|
||||
return ingredient;
|
||||
}
|
||||
public void setBookNumber(String bookNumber)
|
||||
{
|
||||
this.bookNumber = bookNumber;
|
||||
}
|
||||
|
||||
public String getBookNumber()
|
||||
{
|
||||
return bookNumber;
|
||||
}
|
||||
public void setType(Integer type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setAddTime(Date addTime)
|
||||
{
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
public Date getAddTime()
|
||||
{
|
||||
return addTime;
|
||||
}
|
||||
public void setParcelNumber(String parcelNumber)
|
||||
{
|
||||
this.parcelNumber = parcelNumber;
|
||||
}
|
||||
|
||||
public String getParcelNumber()
|
||||
{
|
||||
return parcelNumber;
|
||||
}
|
||||
public void setParcelNumberTaxRate(BigDecimal parcelNumberTaxRate)
|
||||
{
|
||||
this.parcelNumberTaxRate = parcelNumberTaxRate;
|
||||
}
|
||||
|
||||
public BigDecimal getParcelNumberTaxRate()
|
||||
{
|
||||
return parcelNumberTaxRate;
|
||||
}
|
||||
public void setEnglishName(String englishName)
|
||||
{
|
||||
this.englishName = englishName;
|
||||
}
|
||||
|
||||
public String getEnglishName()
|
||||
{
|
||||
return englishName;
|
||||
}
|
||||
public void setDutyPrice(BigDecimal dutyPrice)
|
||||
{
|
||||
this.dutyPrice = dutyPrice;
|
||||
}
|
||||
|
||||
public BigDecimal getDutyPrice()
|
||||
{
|
||||
return dutyPrice;
|
||||
}
|
||||
public void setTaxAmount(BigDecimal taxAmount)
|
||||
{
|
||||
this.taxAmount = taxAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getTaxAmount()
|
||||
{
|
||||
return taxAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("skuCode", getSkuCode())
|
||||
.append("barCode", getBarCode())
|
||||
.append("productCode", getProductCode())
|
||||
.append("hsCode", getHsCode())
|
||||
.append("name", getName())
|
||||
.append("brand", getBrand())
|
||||
.append("description", getDescription())
|
||||
.append("specificationModel", getSpecificationModel())
|
||||
.append("produceCountry", getProduceCountry())
|
||||
.append("produceCountryCode", getProduceCountryCode())
|
||||
.append("quantityUnit", getQuantityUnit())
|
||||
.append("quantityUnitCode", getQuantityUnitCode())
|
||||
.append("declaredCount", getDeclaredCount())
|
||||
.append("legalMeteringUnit", getLegalMeteringUnit())
|
||||
.append("legalMeteringUnitCode", getLegalMeteringUnitCode())
|
||||
.append("secondDeclaredCount", getSecondDeclaredCount())
|
||||
.append("secondMeteringUnit", getSecondMeteringUnit())
|
||||
.append("secondMeteringUnitCode", getSecondMeteringUnitCode())
|
||||
.append("price", getPrice())
|
||||
.append("grossWeight", getGrossWeight())
|
||||
.append("netWeight", getNetWeight())
|
||||
.append("remark", getRemark())
|
||||
.append("inspectionAndQuarantineCode", getInspectionAndQuarantineCode())
|
||||
.append("userId", getUserId())
|
||||
.append("warehouseId", getWarehouseId())
|
||||
.append("declarePortId", getDeclarePortId())
|
||||
.append("taxRate", getTaxRate())
|
||||
.append("ingredient", getIngredient())
|
||||
.append("bookNumber", getBookNumber())
|
||||
.append("type", getType())
|
||||
.append("addTime", getAddTime())
|
||||
.append("parcelNumber", getParcelNumber())
|
||||
.append("parcelNumberTaxRate", getParcelNumberTaxRate())
|
||||
.append("englishName", getEnglishName())
|
||||
.append("dutyPrice", getDutyPrice())
|
||||
.append("taxAmount", getTaxAmount())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
Loaded 100 of 758 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user