Commit 50664c26 authored by 谢希宇's avatar 谢希宇

Aidea product update by Strive Date 2020-10-14

parent 1ac2b19d
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<result column="description" property="description"/> <result column="description" property="description"/>
<result column="create_by" property="createBy"/> <result column="create_by" property="createBy"/>
<result column="update_by" property="updateBy"/> <result column="update_by" property="updateBy"/>
<result column="product_name" property="productName"/> <result column="drugs_name" property="drugsName"/>
</resultMap> </resultMap>
<sql id="sqlWhere"> <sql id="sqlWhere">
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
d.description, d.description,
d.create_by, d.create_by,
d.update_by, d.update_by,
p.product_name p.drugs_name
</sql> </sql>
...@@ -102,7 +102,8 @@ ...@@ -102,7 +102,8 @@
now(), now(),
#{description, jdbcType=VARCHAR}, #{description, jdbcType=VARCHAR},
#{createBy, jdbcType=BIGINT}, #{createBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT} #{updateBy, jdbcType=BIGINT},
#{drugsName, jdbcType=VARCHAR}
) )
</insert> </insert>
...@@ -188,6 +189,9 @@ ...@@ -188,6 +189,9 @@
<if test="updateBy != null"> <if test="updateBy != null">
update_by = #{updateBy, jdbcType=BIGINT}, update_by = #{updateBy, jdbcType=BIGINT},
</if> </if>
<if test="drugsName != null">
drugs_name = #{drugsName, jdbcType=VARCHAR},
</if>
</set> </set>
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
......
...@@ -8,67 +8,68 @@ import java.io.Serializable; ...@@ -8,67 +8,68 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* 订单管理 * 订单管理
* *
* @author Licc * @author Licc
* @date: 2020-10-16 11:26 * @date: 2020-10-16 11:26
*/ */
@Data @Data
public class OrderDetails implements Serializable { public class OrderDetails implements Serializable {
/* 主键id */ /* 主键id */
private Long id; private Long id;
/* 订单id */ /* 订单id */
@ExportConfig(value = "订单id", width = 100, showLevel = 1) @ExportConfig(value = "订单id", width = 100, showLevel = 1)
private Long orderId; private Long orderId;
/* 订单编码 */ /* 订单编码 */
@ExportConfig(value = "订单编码", width = 100, showLevel = 1) @ExportConfig(value = "订单编码", width = 100, showLevel = 1)
private String orderCode; private String orderCode;
/* 商品id */ /* 商品id */
@ExportConfig(value = "商品id", width = 100, showLevel = 1) @ExportConfig(value = "商品id", width = 100, showLevel = 1)
private Long drugsId; private Long drugsId;
/* 商品数量 */ /* 商品名称 */
@ExportConfig(value = "商品名称", width = 100, showLevel = 1)
private String drugsName;
/* 商品数量 */
@ExportConfig(value = "商品数量", width = 100, showLevel = 1) @ExportConfig(value = "商品数量", width = 100, showLevel = 1)
private Long drugsNum; private Long drugsNum;
/* 用户所属公众号id */ /* 用户所属公众号id */
@ExportConfig(value = "用户所属公众号id", width = 100, showLevel = 1) @ExportConfig(value = "用户所属公众号id", width = 100, showLevel = 1)
private String openid; private String openid;
/* 商品价格 */ /* 商品价格 */
@ExportConfig(value = "商品价格", width = 100, showLevel = 1) @ExportConfig(value = "商品价格", width = 100, showLevel = 1)
private Double price; private Double price;
/* 商品总价 */ /* 商品总价 */
@ExportConfig(value = "商品总价", width = 100, showLevel = 1) @ExportConfig(value = "商品总价", width = 100, showLevel = 1)
private Double amount; private Double amount;
/* 商品编码 */ /* 商品编码 */
@ExportConfig(value = "商品编码", width = 100, showLevel = 1) @ExportConfig(value = "商品编码", width = 100, showLevel = 1)
private String drugsCode; private String drugsCode;
/* 商品sku(规格) */ /* 商品sku(规格) */
@ExportConfig(value = "商品sku(规格)", width = 100, showLevel = 1) @ExportConfig(value = "商品sku(规格)", width = 100, showLevel = 1)
private String drugsSku; private String drugsSku;
/* 对应erp物料号 */ /* 对应erp物料号 */
@ExportConfig(value = "对应erp物料号", width = 100, showLevel = 1) @ExportConfig(value = "对应erp物料号", width = 100, showLevel = 1)
private String drugsMateriel; private String drugsMateriel;
/* 所属的账号 */ /* 所属的账号 */
private Long accountsId; private Long accountsId;
/* 删除标识 */ /* 删除标识 */
private boolean delFlag; private boolean delFlag;
/* 状态 */ /* 状态 */
private String status; private String status;
/* 创建时间 */ /* 创建时间 */
@JSONField(format="yyyy-MM-dd HH:mm:ss") @JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime; private Date createTime;
/* 更新时间 */ /* 更新时间 */
private Date updateTime; private Date updateTime;
/* 备注 */ /* 备注 */
private String description; private String description;
/* 创建人 */ /* 创建人 */
private Long createBy; private Long createBy;
/* 更新人 */ /* 更新人 */
private Long updateBy; private Long updateBy;
private String productName; public OrderDetails() {
public OrderDetails() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
} }
......
...@@ -11,5 +11,11 @@ ...@@ -11,5 +11,11 @@
<artifactId>order-module</artifactId> <artifactId>order-module</artifactId>
<dependencies>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>order-detail-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project> </project>
\ No newline at end of file
...@@ -11,82 +11,82 @@ import java.util.List; ...@@ -11,82 +11,82 @@ import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* 订单管理 * 订单管理
* *
* @author Licc * @author Licc
* @date: 2020-10-10 14:20 * @date: 2020-10-10 14:20
*/ */
public class Order extends OrderDetail implements Serializable { public class Order extends OrderDetail implements Serializable {
/* 主键id */ /* 主键id */
private Long id; private Long id;
/* 订单编码 */ /* 订单编码 */
@ExportConfig(value = "订单编码", width = 100, showLevel = 1) @ExportConfig(value = "订单编码", width = 100, showLevel = 1)
private String orderCode; private String orderCode;
/* 咨询单id */ /* 咨询单id */
@ExportConfig(value = "咨询单id", width = 100, showLevel = 1) @ExportConfig(value = "咨询单id", width = 100, showLevel = 1)
private Long consultId; private Long consultId;
/* 咨询单编码 */ /* 咨询单编码 */
@ExportConfig(value = "咨询单编码", width = 100, showLevel = 1) @ExportConfig(value = "咨询单编码", width = 100, showLevel = 1)
private String number; private String number;
/* 所属会员id */ /* 所属会员id */
@ExportConfig(value = "所属会员id", width = 100, showLevel = 1) @ExportConfig(value = "所属会员id", width = 100, showLevel = 1)
private Long memberId; private Long memberId;
/* 客服id */ /* 客服id */
@ExportConfig(value = "客服id", width = 100, showLevel = 1) @ExportConfig(value = "客服id", width = 100, showLevel = 1)
private Long serviceId; private Long serviceId;
/* 医生id */ /* 医生id */
@ExportConfig(value = "医生id", width = 100, showLevel = 1) @ExportConfig(value = "医生id", width = 100, showLevel = 1)
private Long doctorId; private Long doctorId;
/* 用户所属公众号id */ /* 用户所属公众号id */
@ExportConfig(value = "用户所属公众号id", width = 100, showLevel = 1) @ExportConfig(value = "用户所属公众号id", width = 100, showLevel = 1)
private String openid; private String openid;
/* 付款状态 0未付款 1已付款 */ /* 付款状态 0未付款 1已付款 */
@ExportConfig(value = "付款状态 0未付款 1已付款", width = 100, showLevel = 1) @ExportConfig(value = "付款状态 0未付款 1已付款", width = 100, showLevel = 1)
private Long payStatus; private Long payStatus;
/* 付款金额 */ /* 付款金额 */
@ExportConfig(value = "付款金额", width = 100, showLevel = 1) @ExportConfig(value = "付款金额", width = 100, showLevel = 1)
private Double payAmount; private Double payAmount;
/* 订单金额 */ /* 订单金额 */
@ExportConfig(value = "订单金额", width = 100, showLevel = 1) @ExportConfig(value = "订单金额", width = 100, showLevel = 1)
private Double orderAmount; private Double orderAmount;
/* 商品最终金额 */ /* 商品最终金额 */
@ExportConfig(value = "商品最终金额", width = 100, showLevel = 1) @ExportConfig(value = "商品最终金额", width = 100, showLevel = 1)
private Double totalAmount; private Double totalAmount;
/* 付款时间 */ /* 付款时间 */
@ExportConfig(value = "付款时间", width = 100, showLevel = 1) @ExportConfig(value = "付款时间", width = 100, showLevel = 1)
private Date payTime; private Date payTime;
/* 交易号 支付宝/第三方平台 返回订单号 */ /* 交易号 支付宝/第三方平台 返回订单号 */
@ExportConfig(value = "交易号 支付宝/第三方平台 返回订单号", width = 100, showLevel = 1) @ExportConfig(value = "交易号 支付宝/第三方平台 返回订单号", width = 100, showLevel = 1)
private String tradeNo; private String tradeNo;
/* 卖家备注 */ /* 卖家备注 */
@ExportConfig(value = "卖家备注", width = 100, showLevel = 1) @ExportConfig(value = "卖家备注", width = 100, showLevel = 1)
private String remarks; private String remarks;
/* 订单取消原因 */ /* 订单取消原因 */
@ExportConfig(value = "订单取消原因", width = 100, showLevel = 1) @ExportConfig(value = "订单取消原因", width = 100, showLevel = 1)
private String orderCancel; private String orderCancel;
/* 所属的账号 */ /* 所属的账号 */
private Long accountsId; private Long accountsId;
/* 删除标识 */ /* 删除标识 */
private boolean delFlag; private boolean delFlag;
/* 状态 */ /* 状态 */
private String status; private String status;
/* 创建时间 */ /* 创建时间 */
@JSONField(format="yyyy-MM-dd HH:mm:ss") @JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime; private Date createTime;
/* 更新时间 */ /* 更新时间 */
private Date updateTime; private Date updateTime;
/* 备注 */ /* 备注 */
private String description; private String description;
/* 创建人 */ /* 创建人 */
private Long createBy; private Long createBy;
/* 更新人 */ /* 更新人 */
private Long updateBy; private Long updateBy;
private Long confirm; private Long confirm;
private String courierNumber; private String courierNumber;
/* 产品编码 */ /* 产品编码 */
private String productNumber; private String productNumber;
...@@ -98,7 +98,8 @@ private String courierNumber; ...@@ -98,7 +98,8 @@ private String courierNumber;
private Long productId; private Long productId;
private List<ProductVO> list; private List<ProductVO> list;
public Order() {
public Order() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
} }
...@@ -342,11 +343,11 @@ public Order() { ...@@ -342,11 +343,11 @@ public Order() {
} }
public String getProductName() { public String getProductName() {
if (list==null) { if (list == null) {
return null; return null;
} }
List<String> collect = this.list.stream().map(x -> x.getProductName()).collect(Collectors.toList()); List<String> collect = this.list.stream().map(x -> x.getProductName()).collect(Collectors.toList());
return StringUtils.join(collect,";"); return StringUtils.join(collect, ";");
} }
public void setProductName(String productName) { public void setProductName(String productName) {
......
...@@ -7,64 +7,67 @@ import java.io.Serializable; ...@@ -7,64 +7,67 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* 订单管理 * 订单管理
* *
* @author Licc * @author Licc
* @date: 2020-10-10 15:37 * @date: 2020-10-10 15:37
*/ */
@Data @Data
public class OrderDetail implements Serializable { public class OrderDetail implements Serializable {
/* 主键id */ /* 主键id */
private Long id; private Long id;
/* 订单id */ /* 订单id */
@ExportConfig(value = "订单id", width = 100, showLevel = 1) @ExportConfig(value = "订单id", width = 100, showLevel = 1)
private Long orderId; private Long orderId;
/* 订单编码 */ /* 订单编码 */
@ExportConfig(value = "订单编码", width = 100, showLevel = 1) @ExportConfig(value = "订单编码", width = 100, showLevel = 1)
private String orderCode; private String orderCode;
/* 商品id */ /* 商品id */
@ExportConfig(value = "商品id", width = 100, showLevel = 1) @ExportConfig(value = "商品id", width = 100, showLevel = 1)
private Long drugsId; private Long drugsId;
/* 商品数量 */ /* 商品数量 */
@ExportConfig(value = "商品名称", width = 100, showLevel = 1)
private String drugsName;
/* 商品数量 */
@ExportConfig(value = "商品数量", width = 100, showLevel = 1) @ExportConfig(value = "商品数量", width = 100, showLevel = 1)
private Long drugsNum; private Long drugsNum;
/* 用户所属公众号id */ /* 用户所属公众号id */
@ExportConfig(value = "用户所属公众号id", width = 100, showLevel = 1) @ExportConfig(value = "用户所属公众号id", width = 100, showLevel = 1)
private String openid; private String openid;
/* 商品价格 */ /* 商品价格 */
@ExportConfig(value = "商品价格", width = 100, showLevel = 1) @ExportConfig(value = "商品价格", width = 100, showLevel = 1)
private Double price; private Double price;
/* 商品总价 */ /* 商品总价 */
@ExportConfig(value = "商品总价", width = 100, showLevel = 1) @ExportConfig(value = "商品实际价格", width = 100, showLevel = 1)
private Double amount; private Double amount;
/* 商品编码 */ /* 商品编码 */
@ExportConfig(value = "商品编码", width = 100, showLevel = 1) @ExportConfig(value = "商品编码", width = 100, showLevel = 1)
private String drugsCode; private String drugsCode;
/* 商品sku(规格) */ /* 商品sku(规格) */
@ExportConfig(value = "商品sku(规格)", width = 100, showLevel = 1) @ExportConfig(value = "商品sku(规格)", width = 100, showLevel = 1)
private String drugsSku; private String drugsSku;
/* 对应erp物料号 */ /* 对应erp物料号 */
@ExportConfig(value = "对应erp物料号", width = 100, showLevel = 1) @ExportConfig(value = "对应erp物料号", width = 100, showLevel = 1)
private String drugsMateriel; private String drugsMateriel;
/* 所属的账号 */ /* 所属的账号 */
private Long accountsId; private Long accountsId;
/* 删除标识 */ /* 删除标识 */
private boolean delFlag; private boolean delFlag;
/* 状态 */ /* 状态 */
private String status; private String status;
/* 创建时间 */ /* 创建时间 */
private Date createTime; private Date createTime;
/* 更新时间 */ /* 更新时间 */
private Date updateTime; private Date updateTime;
/* 备注 */ /* 备注 */
private String description; private String description;
/* 创建人 */ /* 创建人 */
private Long createBy; private Long createBy;
/* 更新人 */ /* 更新人 */
private Long updateBy; private Long updateBy;
public OrderDetail() { public OrderDetail() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
} }
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
<module>order-detail-module-web</module> <module>order-detail-module-web</module>
<module>reportform-module</module> <module>reportform-module</module>
<module>reportform-module-web</module> <module>reportform-module-web</module>
<module>waybill-module</module>
<module>waybill-module-web</module>
</modules> </modules>
......
<?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/maven-v4_0_0.xsd">
<parent>
<artifactId>aidea-modules</artifactId>
<groupId>com.cftech</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.cftech</groupId>
<name>waybill-module-web</name>
<artifactId>waybill-module-web</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>waybill-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>waybill-module-web</finalName>
</build>
</project>
<!DOCTYPE html>
<!--[if IE 8]>
<html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]>
<html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html>
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<base href="#springUrl('/assets/adminlte/')"/>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>工作台</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- Bootstrap 3.3.5 -->
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="plugins/font-awesome/css/font-awesome.min.css">
<!-- Ionicons -->
<link rel="stylesheet" href="plugins/ionicons/css/ionicons.min.css">
<!-- DataTables -->
<link rel="stylesheet" href="plugins/datatables/dataTables.bootstrap.css">
<!-- Theme style -->
<link rel="stylesheet" href="dist/css/AdminLTE.min.css">
<!-- AdminLTE Skins. Choose a skin from the css/skins
folder instead of downloading all of them to reduce the load. -->
<link rel="stylesheet" href="dist/css/skins/_all-skins.min.css">
<!-- iCheck -->
<link rel="stylesheet" href="plugins/iCheck/flat/blue.css">
<!-- Date Picker -->
<link rel="stylesheet" href="plugins/datepicker/datepicker3.css">
<!-- Daterange picker -->
<link rel="stylesheet" href="plugins/daterangepicker/daterangepicker-bs3.css">
<!-- bootstrap wysihtml5 - text editor -->
<link rel="stylesheet" href="plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
<!--validate css-->
<link rel="stylesheet" href="plugins/jquery-validation/css/validate.css">
<!--fileinput css-->
<link rel="stylesheet" href="plugins/bootstrap-fileinput/bootstrap-fileinput.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<!-- END HEAD -->
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
<div class="content-wrapper" style="margin-left:0;">
<section class="content-header">
<h1>
顺丰物流运单管理
<small>顺丰物流运单</small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i>首页</a></li>
<li><a class="active">顺丰物流运单</a></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="row">
<div class="col-xs-12">
<!-- general form elements disabled -->
<div class="box box-primary">
<form role="form" id="myForm">
<input name="id" value="$!{data.id}" hidden="true"/>
<div class="box-body">
</div>
<div class="box-footer">
#if($shiro.hasPermission("qy:waybill:edit"))
<input class="btn btn-primary" id="save" value="保存" type="submit">
#end
<a href="#springUrl('/a/waybill/list')" class="btn btn-default">取消</a>
</div>
</form>
<!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /.col -->
</div><!-- /.row -->
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<!-- Add the sidebar's background. This div must be placed
immediately after the control sidebar -->
<div class="control-sidebar-bg"></div>
</div><!-- ./wrapper -->
<script src="plugins/jQuery/jQuery-2.1.4.min.js"></script>
<!-- Bootstrap 3.3.5 -->
<script src="bootstrap/js/bootstrap.min.js"></script>
<!-- DataTables -->
<script src="plugins/datatables/jquery.dataTables.min.js"></script>
<script src="plugins/datatables/extensions/i18n/lanauage_ch.js"></script>
<script src="plugins/datatables/dataTables.bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="plugins/fastclick/fastclick.min.js"></script>
<!--fileinput js-->
<script src="plugins/bootstrap-fileinput/bootstrap-fileinput.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/app.min.js"></script>
<script src="plugins/bootstrap-maxlength/bootstrap-maxlength.min.js" type="text/javascript"></script>
<script src="plugins/security/sha256.js" type="text/javascript"></script>
<script src="plugins/jquery-validation/js/jquery.validate.min.js"></script>
<script src="js/jquery.form.min.js"></script>
<script type="text/javascript" charset="utf-8" src="plugins/ueditor-min-1.4.3/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="plugins/ueditor-min-1.4.3/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="plugins/ueditor-min-1.4.3/lang/zh-cn/zh-cn.js"></script>
<script src="common/js/cfapp.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<script>
$().ready(function () {
Cfapp.init();
recdTypeAdd.init();
});
var recdTypeAdd = function () {
var initForm = function () {
var initFormCtrl = function () {
bindEvent();
};
var bindEvent = function () {
$("#myForm").validate({
rules: {},
messages: {},
submitHandler: function (form) {
$("#save").attr("disabled", true);
$.getJSON("#springUrl('/a/waybill/formData')", $("#myForm").serialize(), function (returnobj) {
$("#save").attr("disabled", false);
if (returnobj.errorNo == 2) { //保存成功
Cfapp.confirm({
message: "添加成功",
btnoktext: "继续添加",
btncanceltext: "关闭",
success: function () {
location.href = "#springUrl('/a/waybill/form')";
},
cancel: function () {
location.href = "#springUrl('/a/waybill/list')";
}
});
} else if (returnobj.errorNo == 0) { //修改成功
Cfapp.alert({
message: "更新成功",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/waybill/list')";
}
});
} else {
Cfapp.alert({
message: "创建失败",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/waybill/list')";
}
});
}
});
}
})
}
initFormCtrl();
}
return {
//main function to initiate the module
init: function () {
initForm();
}
};
}();
</script>
</body>
<!-- END BODY -->
</html>
\ No newline at end of file
<?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>aidea-modules</artifactId>
<groupId>com.cftech</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>waybill-module</artifactId>
<dependencies>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>member-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>order-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>order-detail-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>shipping-address-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
package com.cftech.waybill.dao;
import com.cftech.waybill.model.Waybill;
import com.cftech.core.generic.GenericDao;
/**
* 顺丰物流运单Mapper
*
* @author Strive
* @date: 2020-10-21 15:04
*/
public interface WaybillMapper extends GenericDao<Waybill> {
}
\ No newline at end of file
package com.cftech.waybill.model;
import com.cftech.core.poi.ExportConfig;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 顺丰物流运单
*
* @author Strive
* @date: 2020-10-21 15:04
*/
@Data
public class Waybill implements Serializable {
/* 主键id */
private Long id;
/* 咨询单Id */
@ExportConfig(value = "咨询单Id", width = 100, showLevel = 1)
private Long consultId;
/* 订单Id */
@ExportConfig(value = "订单Id", width = 100, showLevel = 1)
private Long orderId;
/* 物流单编码 */
@ExportConfig(value = "物流单编码", width = 100, showLevel = 1)
private String numbetr;
/* 会员Id */
@ExportConfig(value = "会员Id", width = 100, showLevel = 1)
private String memberId;
/* 粉丝Id */
@ExportConfig(value = "粉丝Id", width = 100, showLevel = 1)
private String openId;
/* 仓管员Id */
@ExportConfig(value = "仓管员Id", width = 100, showLevel = 1)
private String storageManage;
/* 顺丰运单号 */
@ExportConfig(value = "顺丰运单号", width = 100, showLevel = 1)
private String waybillNo;
/* 语言 */
@ExportConfig(value = "语言", width = 100, showLevel = 1)
private String language;
/* 顺丰月结卡号 */
@ExportConfig(value = "顺丰月结卡号", width = 100, showLevel = 1)
private String monthlyCard;
/* 快件产品类型 */
@ExportConfig(value = "快件产品类型", width = 100, showLevel = 1)
private String expressTypeId;
/* 温度范围控制 1:冷藏 3:冷冻 */
@ExportConfig(value = "温度范围控制 1:冷藏 3:冷冻", width = 100, showLevel = 1)
private String temperatureRange;
/* 联系人 */
@ExportConfig(value = "联系人", width = 100, showLevel = 1)
private String contact;
/* 联系电话 */
@ExportConfig(value = "联系电话", width = 100, showLevel = 1)
private String mobile;
/* 省份 */
@ExportConfig(value = "省份", width = 100, showLevel = 1)
private String province;
/* 城市 */
@ExportConfig(value = "城市", width = 100, showLevel = 1)
private String city;
/* 县/区级行政区名称 */
@ExportConfig(value = "县/区级行政区名称", width = 100, showLevel = 1)
private String county;
/* 地址Id */
@ExportConfig(value = "地址Id", width = 100, showLevel = 1)
private String addressId;
/* 详细地址 */
@ExportConfig(value = "详细地址", width = 100, showLevel = 1)
private String address;
/* 发件时间 */
@ExportConfig(value = "发件时间", width = 100, showLevel = 1)
private Date sendExpressDate;
/* 收件时间 */
@ExportConfig(value = "收件时间", width = 100, showLevel = 1)
private Date acceptExpressDate;
/* 运单描述 */
@ExportConfig(value = "运单描述", width = 100, showLevel = 1)
private String waybillRemark;
/* 所属的账号 */
private Long accountsId;
/* 删除标识 */
private boolean delFlag;
/* 状态 */
private String status;
/* 创建时间 */
private Date createTime;
/* 更新时间 */
private Date updateTime;
/* 备注 */
private String description;
/* 创建人 */
private Long createBy;
/* 更新人 */
private Long updateBy;
public Waybill() {
this.delFlag = false;
this.status = "0";
}
}
\ No newline at end of file
package com.cftech.waybill.service;
import com.cftech.waybill.model.Waybill;
import com.cftech.core.generic.GenericService;
/**
* 顺丰物流运单Service
*
* @author Strive
* @date: 2020-10-21 15:04
*/
public interface WaybillService extends GenericService<Waybill> {
}
package com.cftech.waybill.service.impl;
import com.cftech.waybill.model.Waybill;
import com.cftech.waybill.dao.WaybillMapper;
import com.cftech.waybill.service.WaybillService;
import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
/**
* 顺丰物流运单ServiceImpl
*
* @author Strive
* @date: 2020-10-21 15:04
*/
@Service("waybillService")
public class WaybillServiceImpl extends GenericServiceImpl<Waybill> implements WaybillService {
@Autowired
@Qualifier("waybillMapper")
private WaybillMapper waybillMapper;
@Override
public GenericDao<Waybill> getGenericMapper() {
return waybillMapper;
}
}
\ No newline at end of file
package com.cftech.waybill.utils;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
/**
* Created by 16444 on 2020/10/21.
*/
@Data
public class CloseableHttpEntity {
private int code;
private JSONObject retObj;
public CloseableHttpEntity(int code, JSONObject retObj) {
this.code = code;
this.retObj = retObj;
}
}
package com.cftech.waybill.utils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cftech.core.util.StringUtils;
import com.cftech.order.model.Order;
import com.cftech.orderdetail.model.OrderDetails;
import com.cftech.waybill.model.Waybill;
import lombok.extern.slf4j.Slf4j;
import sun.misc.BASE64Encoder;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;
/**
* Created by 16444 on 2020/10/21.
*/
@Slf4j
public class ExpressOrderInfoUtils {
private static final String language = "zh-CN";
private static final String countryCode = "CN";
private static final String currencyCode = "HKD";
/**
* 下订单接口参数封装
* @param order
* @param orderDetails
* @param waybillObj
* @return
*/
public static JSONObject generateWaybillOrder(Order order, List<OrderDetails> orderDetails, Waybill waybillObj) {
//订单
JSONObject waybill = new JSONObject();
try {
waybill.put("language", language);
waybill.put("orderId", order.getNumber());//快递单号
waybill.put("cargoDesc", "医疗药品");//托寄物描述
waybill.put("monthlyCard", "");//顺丰月结卡号
waybill.put("orderSource", "WECHAT_STORE");//平台编码 微信咨询平台
waybill.put("remark", waybillObj.getWaybillRemark());//订单备注
//业务需要增加
waybill.put("isReturnQRCode", "1");//是否返回用来推送业务的二维码 1:返回 0:不返回
waybill.put("specialDeliveryTypeCode", "1");//特殊派送类型代码 1:身份验证
waybill.put("specialDeliveryValue", "12345678");//特殊派件具体表述 证件类型:证件后8位如:1:09296231(1 表示身份证,暂不支持其他证件)
waybill.put("isReturnSignBackRoutelabel", "1");//是否返回签回单路由标签: 默认0, 1:返回路由标签,0:不返回
waybill.put("isReturnRoutelabel", "1");//是否返回路由标签: 默认0, 1:返回路由标签, 0:不返回
waybill.put("podModelAddress", "url");//签单返回范本地址
//特殊需求药品,需冷冻、冷藏
if (StringUtils.isNoneBlank(waybillObj.getExpressTypeId())) {
waybill.put("expressTypeId", waybillObj.getExpressTypeId());//快件产品类别Id 12医药类 冷冻 冷藏
waybill.put("temperatureRange", waybillObj.getTemperatureRange());//1:冷藏 3:冷冻
}
//托寄物信息List
JSONArray cargoDetails = new JSONArray();
for (OrderDetails orderd: orderDetails) {
JSONObject cargo = new JSONObject();
cargo.put("name", orderd.getDrugsName());//商品名称
cargo.put("count", 1);//商品数量
cargo.put("unit", "盒");//商品单位
cargo.put("amount", orderd.getPrice());//商品价格
cargo.put("currency", currencyCode);//币种编码
}
waybill.put("cargoDetails", cargoDetails);
//收寄双方信息List
JSONArray contactInfoList = new JSONArray();
//寄件方信息
JSONObject sender = new JSONObject();
sender.put("contactType", "1");
sender.put("company", "康诺");
sender.put("contact", "小谢");
sender.put("tel", "15800815547");
sender.put("mobile", "15800815547");
sender.put("country", countryCode);
sender.put("province", "上海市");
sender.put("city", "上海市");
sender.put("county", "闵行区");
sender.put("address", "江玮路100号");
contactInfoList.add(sender);
//收件方信息
JSONObject recipient = new JSONObject();
recipient.put("contactType", "2");
//recipient.put("company", "");
recipient.put("contact", waybillObj.getContact());
recipient.put("tel", waybillObj.getMobile());
recipient.put("mobile", waybillObj.getMobile());
recipient.put("country", countryCode);
recipient.put("province", waybillObj.getProvince());
recipient.put("city", waybillObj.getCity());
recipient.put("county", waybillObj.getCounty());
recipient.put("address", waybillObj.getAddress());
contactInfoList.add(recipient);
waybill.put("contactInfoList", contactInfoList);
} catch (Exception e) {
e.printStackTrace();
log.error("丰桥API {下订单接口} Request Params Error = " + e.getMessage());
return null;
}
return waybill;
}
/**
* 订单查询接口封装
* @param searchType 查询类型:1.正向单查询,传入的orderId为正向订单号,2.退货单查询,传入的orderId为退货原始订单号
* @return
*/
public static JSONObject generateOrderSel(Order order, String searchType) {
JSONObject retObj = new JSONObject();
try {
retObj.put("orderId", order.getNumber());
retObj.put("searchType", searchType);
retObj.put("language", language);
} catch (Exception e) {
e.printStackTrace();
log.error("丰桥API 订单查询接口 Request Params Error = " + e.getMessage());
return null;
}
return retObj;
}
/**
* 订单确认/取消接口
* @param order
* @param type
* @return
*/
public JSONObject generateOrderCancel(Order order, Waybill waybillObj, String type) {
JSONObject retObj = new JSONObject();
try {
retObj.put("orderId", order.getNumber());
retObj.put("dealType", type);
JSONArray waybillNoInfoList = new JSONArray();
JSONObject waybill = new JSONObject();
waybill.put("waybillType", 1);//母单
waybill.put("waybillNo", waybillObj.getWaybillNo());
waybillNoInfoList.add(waybill);
} catch (Exception e) {
e.printStackTrace();
log.error("丰桥API {订单查询、取消} Request Params Error = " + e.getMessage());
return null;
}
return retObj;
}
/**
* 路由查询
* @param waybillObj
* @return
*/
public static JSONObject generateRouteData(Waybill waybillObj) {
JSONObject retObj = new JSONObject();
try {
retObj.put("language", 0);//中文
retObj.put("trackingType", 1);//1:根据顺丰运单号查询
JSONArray waybills = new JSONArray();
waybills.add(waybillObj.getWaybillNo());
retObj.put("trackingNumber", waybills);//顺丰运单号
retObj.put("methodType", 1);//标准路由查询
} catch (Exception e) {
e.printStackTrace();
log.error("丰桥API 订单查询接口 Request Params Error = " + e.getMessage());
}
return retObj;
}
/**
* 生成顺丰签名
* @return
*/
public static String generateSfDigest(String msgData, Long timestamp, String checkWord) {
String msgDigest = null;
try {
StringBuffer verifyText = new StringBuffer();
verifyText.append(msgData);
verifyText.append(timestamp);
verifyText.append(checkWord);
//因业务报文中可能包含加号、空格等特殊字符,需要urlEnCode处理
String text = URLEncoder.encode(verifyText.toString(), "UTF-8");
//进行Md5加密
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(text.getBytes("UTF-8"));
byte[] md = md5.digest();
//通过BASE64生成数字签名
msgDigest = new String(new BASE64Encoder().encode(md));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
log.error("丰桥API 生成接口签名 md5 base64 error = " + e.getMessage());
return null;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
log.error("丰桥API 生成接口签名 无算法异常 md5 base64 error = " + e.getMessage());
return null;
}
return msgDigest;
}
}
package com.cftech.waybill.utils;
/**
* Created by 16444 on 2020/10/22.
*/
public class FqConstants {
/**
* 丰桥API:下订单接口URL
* url: 请求地址
* code: 接口服务代码
*/
public static final String SF_ORDER_SEND_URL = "https://sfapi-sbox.sf-express.com/std/service";
public static final String SF_ORDER_SEND_CODE = "EXP_RECE_CREATE_ORDER";
/**
* 丰桥API:订单查询接口URL
* code: 接口服务代码
*/
public static final String SF_ORDER_SEARCH_URL = "https://sfapi-sbox.sf-express.com/std/service";
public static final String SF_ORDER_SEARCH_CODE = "EXP_RECE_SEARCH_ORDER_RESP";
/**
* 丰桥API:订单确认/取消接口URL
* code: 接口服务代码
*/
public static final String SF_ORDER_CANCEL_URL = "https://sfapi-sbox.sf-express.com/std/service";
public static final String SF_ORDER_CANCEL_CODE = "EXP_RECE_UPDATE_ORDER";
/**
* 丰桥API:订单路由接口URL
* code: 接口服务代码
*/
public static final String SF_ORDER_ROUTE_URL = "https://sfapi-sbox.sf-express.com/std/service";
public static final String SF_ORDER_ROUTE_CODE = "EXP_RECE_SEARCH_ROUTES";
}
package com.cftech.waybill.web;
import com.alibaba.fastjson.JSONObject;
import com.cftech.waybill.model.Waybill;
import com.cftech.waybill.service.WaybillService;
import com.cftech.core.poi.ExcelKit;
import com.cftech.core.scope.OrderType;
import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants;
import com.cftech.sys.security.PermissionSign;
import com.cftech.sys.security.UserUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.List;
/**
* 顺丰物流运单Controller
* <p>
* 权限字符串说明:
* 查看:public static final String WAYBILL_VIEW = "qy:waybill:view"
* 查看:public static final String WAYBILL_EDIT = "qy:waybill:edit"
*
* @author Strive
* @date: 2020-10-21 15:04
*/
@Slf4j
@Controller
@RequestMapping("/a/waybill")
public class WaybillController {
public static final String WAYBILL_VIEW = "qy:waybill:view";
public static final String WAYBILL_EDIT = "qy:waybill:edit";
@Autowired
private WaybillService waybillService;
//列表页面
@RequiresPermissions(value = WAYBILL_VIEW)
@RequestMapping("/list")
public String list(HttpServletRequest request, Model model) {
Long accountId = UserUtils.getmpaccounts(request);
model.addAttribute("accountId", accountId);
return "waybill/waybilllist";
}
//编辑页面(新增、修改)
@RequiresPermissions(value = WAYBILL_VIEW)
@RequestMapping("/form")
public String form(HttpServletRequest request, String id, Model model) {
if (!StringUtils.isEmpty(id)) {
Waybill waybill = waybillService.fetchById(id);
model.addAttribute("data", waybill);
}
return "waybill/waybillform";
}
//提交数据(新增、修改)
@RequiresPermissions(value = WAYBILL_EDIT)
@RequestMapping("/formData")
@ResponseBody
public JSONObject formData(Waybill waybill, Model model, HttpServletRequest request) {
Long accountsId = UserUtils.getmpaccounts(request);
JSONObject rtnJson = new JSONObject();
try {
if (waybill != null && waybill.getId() != null) {
waybill.setUpdateBy(UserUtils.getUser().getId());
waybillService.update(waybill);
rtnJson.put("errorNo", 0);
} else {
waybill.setAccountsId(accountsId);
waybill.setDelFlag(false);
waybill.setAccountsId(UserUtils.getmpaccounts(request));
waybill.setCreateBy(UserUtils.getUser().getId());
waybill.setUpdateBy(UserUtils.getUser().getId());
waybillService.save(waybill);
rtnJson.put("errorNo", 2);
}
} catch (Exception e) {
rtnJson.put("errorNo", 1);
}
return rtnJson;
}
//获取列表数据
@RequiresPermissions(value = WAYBILL_VIEW)
@RequestMapping(value = "/listData")
@ResponseBody
public JSONObject listData(int iDisplayStart, int iDisplayLength, Waybill waybill, HttpServletRequest request) {
Long accountsId = UserUtils.getmpaccounts(request);
Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0);
conds.equal("accounts_id", accountsId);
Sort sort = new Sort("create_time", OrderType.DESC);
List<Waybill> list = waybillService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength);
Integer counts = waybillService.count(conds);
JSONObject rtnJson = new JSONObject();
rtnJson.put("iTotalRecords", counts);
rtnJson.put("iTotalDisplayRecords", counts);
rtnJson.put("aaData", list);
return rtnJson;
}
//删除数据
@RequiresPermissions(value = WAYBILL_EDIT)
@RequestMapping("/delete")
@ResponseBody
public JSONObject delete(String id) {
JSONObject rtnJosn = new JSONObject();
try {
waybillService.delete(id);
rtnJosn.put("errorNo", 0);
} catch (Exception e) {
rtnJosn.put("errorNo", 1);
}
return rtnJosn;
}
@RequestMapping("/exportExcel")
@RequiresPermissions(value = WAYBILL_VIEW)
public void exportExcel(HttpServletRequest request, HttpServletResponse response) {
Long accountId = UserUtils.getmpaccounts(request);
Sort sort = new Sort("create_time", OrderType.ASC);
Conds conds = new Conds();
conds.equal("del_flag", 0);
conds.equal("accounts_id", accountId);
List<Waybill> list = waybillService.fetchSearchByPage(conds, sort, 0, 0);
ExcelKit.$Export(Waybill.class, response).toExcel(list, "顺丰物流运单信息");
}
@RequestMapping("/templateExcel")
@RequiresPermissions(value = WAYBILL_VIEW)
public void templateExcel(HttpServletRequest request, HttpServletResponse response) {
ExcelKit.$Export(Waybill.class, response).toExcel(null, "顺丰物流运单信息");
}
@RequestMapping("/importExcel")
@RequiresPermissions(value = WAYBILL_EDIT)
public String importExcel(HttpServletRequest request, MultipartFile file, Model model) {
Long accountId = UserUtils.getmpaccounts(request);
if (file == null) {
return list(request, model);
}
// 构造临时路径来存储上传的文件
String uploadPath = System.getProperty("java.io.tmpdir");
File uploadDir = new File(uploadPath);
if (!uploadDir.exists()) {
uploadDir.mkdir();
}
String fileName = file.getOriginalFilename();
String filePath = uploadPath + File.separator + fileName;
File storeFile = new File(filePath);
try {
file.transferTo(storeFile);
ExcelKit.$Import().setEmptyCellValue("").readExcel(storeFile, rowData -> {
if (!StringUtils.isEmpty(rowData.get(0))) {
Waybill waybill = new Waybill();
waybill.setAccountsId(accountId);
waybillService.save(waybill);
}
});
} catch (IOException e) {
log.error(e.getMessage());
}
return list(request, model);
}
}
...@@ -42,7 +42,11 @@ security.secure=false ...@@ -42,7 +42,11 @@ security.secure=false
#\uFFFD\u01F7\uFFFD\uFFFD\u01FC\uFFFD\u023A\uFFFD\uFFFD\u02B1\uFFFD\uFFFD\uFFFD\uFFFDMaster\uFFFD\uFFFD\uFFFD\u06B5\uFFFD\u04BB\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue\uFFFD\uFFFD\uFFFD\uFFFD #\uFFFD\u01F7\uFFFD\uFFFD\u01FC\uFFFD\u023A\uFFFD\uFFFD\u02B1\uFFFD\uFFFD\uFFFD\uFFFDMaster\uFFFD\uFFFD\uFFFD\u06B5\uFFFD\u04BB\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue\uFFFD\uFFFD\uFFFD\uFFFD
quartz.isCluster=false quartz.isCluster=false
#\u987A\u4E30API\u914D\u7F6E\u53C2\u6570
#\u987A\u4E30\u5BA2\u6237\u7F16\u7801
sf.partnerID=XXYZ
#\u987A\u4E30\u5BA2\u6237\u6821\u9A8C\u7801
sf.checkWord=5Nhuavqk0JG7zTYLtPKq7JpnceuekRcH
......
...@@ -292,6 +292,12 @@ ...@@ -292,6 +292,12 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<type>war</type> <type>war</type>
</dependency> </dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>waybill-module-web</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>portal-web</finalName> <finalName>portal-web</finalName>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment