Commit fbd73d8f authored by 卜远杰's avatar 卜远杰

订单七天后才能开票

parent b93386ba
......@@ -41,6 +41,11 @@
<result column="price" property="price"/>
<result column="productImg" property="productImg"/>
<result column="isRs" property="isRs"/>
<result column="invoiceTitle" property="invoiceTitle"/>
<result column="invoiceType" property="invoiceType"/>
<result column="invoiceContent" property="invoiceContent"/>
<result column="invoiceStatus" property="invoiceStatus"/>
<result column="invoiceCreateTime" property="invoiceCreateTime"/>
</resultMap>
<sql id="sqlWhere">
......@@ -159,20 +164,27 @@
o.number number,
o.create_time createTime,
o.confirm confirm,
o.`status` status,
o.`status` STATUS,
o.total_amount totalAmount,
p.product_name productName,
p.format format,
p.unit unit,
p.price price,
p.product_img productImg,
p.is_rs isRs
p.is_rs isRs,
i.invoice_title invoiceTitle,
i.invoice_type invoiceType,
i.invoice_content invoiceContent,
i.`status` invoiceStatus,
i.create_time invoiceCreateTime
FROM
t_order o
LEFT JOIN t_order_details d ON d.order_id = o.id
AND d.del_flag = 0
LEFT JOIN t_aidea_product p ON d.drugs_id = p.id
AND p.del_flag = 0
LEFT JOIN t_aidea_invoice i ON i.order_id = o.number
AND i.del_flag = 0
<include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
</select>
......
......@@ -69,6 +69,32 @@ public class InvoiceDetail {
*/
private String isRs;
/**
* 抬头名称
*/
private String invoiceTitle;
/**
* 发票类型(1:蓝票,2红票)
*/
private String invoiceType;
/**
* 发票内容
*/
private String invoiceContent;
/**
* 抬头类型( 0:个人 1:企业 )
*/
private String invoiceStatus;
/**
* 申请时间
*/
private String invoiceCreateTime;
/**
* 移动端传的APPID
*/
......
<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>
<artifactId>logistics-module-web</artifactId>
<packaging>war</packaging>
<name>logistics-module-web Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>logistics-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>logistics-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:logistics:edit"))
<input class="btn btn-primary" id="save" value="保存" type="submit">
#end
<a href="#springUrl('/a/logistics/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/logistics/formData')", $("#myForm").serialize(), function (returnobj) {
$("#save").attr("disabled", false);
if (returnobj.errorNo == 2) { //保存成功
Cfapp.confirm({
message: "添加成功",
btnoktext: "继续添加",
btncanceltext: "关闭",
success: function () {
location.href = "#springUrl('/a/logistics/form')";
},
cancel: function () {
location.href = "#springUrl('/a/logistics/list')";
}
});
} else if (returnobj.errorNo == 0) { //修改成功
Cfapp.alert({
message: "更新成功",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/logistics/list')";
}
});
} else {
Cfapp.alert({
message: "创建失败",
btntext: "确定",
success: function () {
location.href = "#springUrl('/a/logistics/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>logistics-module</artifactId>
<dependencies>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>sys-module</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.cftech.logistics.dao;
import com.cftech.logistics.model.Logistics;
import com.cftech.core.generic.GenericDao;
/**
* 物流信息Mapper
*
* @author Buyj
* @date: 2020-11-29 17:19
*/
public interface LogisticsMapper extends GenericDao<Logistics> {
}
\ No newline at end of file
<?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.cftech.logistics.dao.LogisticsMapper">
<resultMap id="resultMap" type="com.cftech.logistics.model.Logistics">
<id column="id" property="id"/>
<result column="mail_no" property="mailNo"/>
<result column="order_no" property="orderNo"/>
<result column="accept_time" property="acceptTime"/>
<result column="number" property="number"/>
<result column="accept_address" property="acceptAddress"/>
<result column="opcode" property="opcode"/>
<result column="accounts_id" property="accountsId"/>
<result column="del_flag" property="delFlag"/>
<result column="status" property="status"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="description" property="description"/>
<result column="create_by" property="createBy"/>
<result column="update_by" property="updateBy"/>
</resultMap>
<sql id="sqlWhere">
<if test="conds!=null">
<trim prefix="WHERE" prefixOverrides="AND|OR">
<foreach collection="conds.conds" index="index" item="cond">
${cond.linkType}
<if test="cond.condType == 'EQUAL'">${cond.param} = #{cond.value}</if>
<if test="cond.condType == 'NOTEQUAL'">${cond.param} &lt;&gt; #{cond.value}</if>
<if test="cond.condType == 'GREATEQUAL'">${cond.param} &gt;= #{cond.value}</if>
<if test="cond.condType == 'GREATTHAN'">${cond.param} &gt; #{cond.value}</if>
<if test="cond.condType == 'LESSEQUAL'">${cond.param} &lt;= #{cond.value}</if>
<if test="cond.condType == 'LESSTHAN'">${cond.param} &lt; #{cond.value}</if>
<if test="cond.condType == 'BETWEEN'">${cond.param} BETWEEN #{cond.startValue} AND
#{cond.endValue}
</if>
<if test="cond.condType == 'ISNULL'">${cond.param} IS NULL</if>
<if test="cond.condType == 'NOTNULL'">${cond.param} IS NOT NULL</if>
<if test="cond.condType == 'LIKE'">${cond.param} LIKE #{cond.value}</if>
<if test="cond.condType == 'IN'">${cond.param} IN
<foreach item="item" index="index" collection="cond.value" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</foreach>
</trim>
</if>
</sql>
<sql id="sqlColumns">
id,
mail_no,
order_no,
accept_time,
number,
accept_address,
opcode,
accounts_id,
del_flag,
status,
create_time,
update_time,
description,
create_by,
update_by
</sql>
<insert id="save" parameterType="com.cftech.logistics.model.Logistics" useGeneratedKeys="true"
keyProperty="id">
insert into t_aidea_logistics
(
<include refid="sqlColumns"/>
)
values
(
#{id, jdbcType=BIGINT},
#{mailNo, jdbcType=VARCHAR},
#{orderNo, jdbcType=VARCHAR},
now(),
#{number, jdbcType=VARCHAR},
#{acceptAddress, jdbcType=VARCHAR},
#{opcode, jdbcType=VARCHAR},
#{accountsId, jdbcType=BIGINT},
#{delFlag, jdbcType=TINYINT},
#{status, jdbcType=VARCHAR},
now(),
now(),
#{description, jdbcType=VARCHAR},
#{createBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT}
)
</insert>
<select id="fetchById" parameterType="java.lang.Long" resultMap="resultMap">
SELECT
<include refid="sqlColumns"/>
FROM t_aidea_logistics t
WHERE t.id=#{id}
</select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_aidea_logistics
<include refid="sqlWhere"/>
</select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap">
SELECT
<include refid="sqlColumns"/>
FROM t_aidea_logistics
<include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
<update id="update" parameterType="com.cftech.logistics.model.Logistics">
update t_aidea_logistics
<set>
<if test="id != null">
id = #{id, jdbcType=BIGINT},
</if>
<if test="mailNo != null">
mail_no = #{mailNo, jdbcType=VARCHAR},
</if>
<if test="orderNo != null">
order_no = #{orderNo, jdbcType=VARCHAR},
</if>
<if test="acceptTime != null">
accept_time = #{acceptTime, jdbcType=TIMESTAMP},
</if>
<if test="number != null">
number = #{number, jdbcType=VARCHAR},
</if>
<if test="acceptAddress != null">
accept_address = #{acceptAddress, jdbcType=VARCHAR},
</if>
<if test="opcode != null">
opcode = #{opcode, jdbcType=VARCHAR},
</if>
<if test="accountsId != null">
accounts_id = #{accountsId, jdbcType=BIGINT},
</if>
<if test="delFlag != null">
del_flag = #{delFlag, jdbcType=TINYINT},
</if>
<if test="status != null">
status = #{status, jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime, jdbcType=TIMESTAMP},
</if>
<if test="description != null">
description = #{description, jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy, jdbcType=BIGINT},
</if>
<if test="updateBy != null">
update_by = #{updateBy, jdbcType=BIGINT},
</if>
</set>
where id=#{id,jdbcType=BIGINT}
</update>
<update id="delete" parameterType="java.lang.Long">
update t_aidea_logistics set del_flag=1 where id=#{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
package com.cftech.logistics.model;
import com.cftech.core.poi.ExportConfig;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 物流信息
*
* @author Buyj
* @date: 2020-11-29 17:19
*/
@Data
public class Logistics implements Serializable {
/** 主键id */
private Long id;
/** 顺风运单号 */
@ExportConfig(value = "顺风运单号", width = 100, showLevel = 1)
private String mailNo;
/** 订单号 */
@ExportConfig(value = "订单号", width = 100, showLevel = 1)
private String orderNo;
/** 路由节点发生时间 */
@ExportConfig(value = "路由节点发生时间", width = 100, showLevel = 1)
private Date acceptTime;
/** 物流编码 */
@ExportConfig(value = "物流编码", width = 100, showLevel = 1)
private String number;
/** 路由节点发生地 */
@ExportConfig(value = "路由节点发生地", width = 100, showLevel = 1)
private String acceptAddress;
/** 路由节点操作码 */
@ExportConfig(value = "路由节点操作码", width = 100, showLevel = 1)
private String opcode;
/** 所属的账号 */
private Long accountsId;
/** 删除标识 */
private boolean delFlag;
/** 状态 */
private String status;
/** 创建时间 */
private Date createTime;
/** 更新时间 */
private Date updateTime;
@ExportConfig(value = "路由节点描述", width = 100, showLevel = 1)
private String description;
/** 创建人 */
private Long createBy;
/** 更新人 */
private Long updateBy;
public Logistics() {
this.delFlag = false;
this.status = "0";
}
}
\ No newline at end of file
package com.cftech.logistics.service;
import com.cftech.logistics.model.Logistics;
import com.cftech.core.generic.GenericService;
/**
* 物流信息Service
*
* @author Buyj
* @date: 2020-11-29 17:19
*/
public interface LogisticsService extends GenericService<Logistics> {
}
package com.cftech.logistics.service.impl;
import com.cftech.logistics.model.Logistics;
import com.cftech.logistics.dao.LogisticsMapper;
import com.cftech.logistics.service.LogisticsService;
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 Buyj
* @date: 2020-11-29 17:19
*/
@Service("logisticsService")
public class LogisticsServiceImpl extends GenericServiceImpl<Logistics> implements LogisticsService {
@Autowired
@Qualifier("logisticsMapper")
private LogisticsMapper logisticsMapper;
@Override
public GenericDao<Logistics> getGenericMapper() {
return logisticsMapper;
}
}
\ No newline at end of file
package com.cftech.logistics.web;
import com.alibaba.fastjson.JSONObject;
import com.cftech.logistics.model.Logistics;
import com.cftech.logistics.service.LogisticsService;
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 LOGISTICS_VIEW = "qy:logistics:view"
* 查看:public static final String LOGISTICS_EDIT = "qy:logistics:edit"
*
* @author Buyj
* @date: 2020-11-29 17:19
*/
@Slf4j
@Controller
@RequestMapping("/a/logistics")
public class LogisticsController {
public static final String LOGISTICS_VIEW = "qy:logistics:view";
public static final String LOGISTICS_EDIT = "qy:logistics:edit";
@Autowired
private LogisticsService logisticsService;
//列表页面
@RequiresPermissions(value = LOGISTICS_VIEW)
@RequestMapping("/list")
public String list(HttpServletRequest request, Model model) {
Long accountId = UserUtils.getmpaccounts(request);
model.addAttribute("accountId", accountId);
return "logistics/logisticslist";
}
//编辑页面(新增、修改)
@RequiresPermissions(value = LOGISTICS_VIEW)
@RequestMapping("/form")
public String form(HttpServletRequest request, String id, Model model) {
if (!StringUtils.isEmpty(id)) {
Logistics logistics = logisticsService.fetchById(id);
model.addAttribute("data", logistics);
}
return "logistics/logisticsform";
}
//提交数据(新增、修改)
@RequiresPermissions(value = LOGISTICS_EDIT)
@RequestMapping("/formData")
@ResponseBody
public JSONObject formData(Logistics logistics, Model model, HttpServletRequest request) {
Long accountsId = UserUtils.getmpaccounts(request);
JSONObject rtnJson = new JSONObject();
try {
if (logistics != null && logistics.getId() != null) {
logistics.setUpdateBy(UserUtils.getUser().getId());
logisticsService.update(logistics);
rtnJson.put("errorNo", 0);
} else {
logistics.setAccountsId(accountsId);
logistics.setDelFlag(false);
logistics.setAccountsId(UserUtils.getmpaccounts(request));
logistics.setCreateBy(UserUtils.getUser().getId());
logistics.setUpdateBy(UserUtils.getUser().getId());
logisticsService.save(logistics);
rtnJson.put("errorNo", 2);
}
} catch (Exception e) {
rtnJson.put("errorNo", 1);
}
return rtnJson;
}
//获取列表数据
@RequiresPermissions(value = LOGISTICS_VIEW)
@RequestMapping(value = "/listData")
@ResponseBody
public JSONObject listData(int iDisplayStart, int iDisplayLength, Logistics logistics, 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<Logistics> list = logisticsService.fetchSearchByPage(conds, sort, iDisplayStart, iDisplayLength);
Integer counts = logisticsService.count(conds);
JSONObject rtnJson = new JSONObject();
rtnJson.put("iTotalRecords", counts);
rtnJson.put("iTotalDisplayRecords", counts);
rtnJson.put("aaData", list);
return rtnJson;
}
//删除数据
@RequiresPermissions(value = LOGISTICS_EDIT)
@RequestMapping("/delete")
@ResponseBody
public JSONObject delete(String id) {
JSONObject rtnJosn = new JSONObject();
try {
logisticsService.delete(id);
rtnJosn.put("errorNo", 0);
} catch (Exception e) {
rtnJosn.put("errorNo", 1);
}
return rtnJosn;
}
@RequestMapping("/exportExcel")
@RequiresPermissions(value = LOGISTICS_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<Logistics> list = logisticsService.fetchSearchByPage(conds, sort, 0, 0);
ExcelKit.$Export(Logistics.class, response).toExcel(list, "物流信息信息");
}
@RequestMapping("/templateExcel")
@RequiresPermissions(value = LOGISTICS_VIEW)
public void templateExcel(HttpServletRequest request, HttpServletResponse response) {
ExcelKit.$Export(Logistics.class, response).toExcel(null, "物流信息信息");
}
@RequestMapping("/importExcel")
@RequiresPermissions(value = LOGISTICS_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))) {
Logistics logistics = new Logistics();
logistics.setAccountsId(accountId);
logisticsService.save(logistics);
}
});
} catch (IOException e) {
log.error(e.getMessage());
}
return list(request, model);
}
}
......@@ -457,11 +457,16 @@
'aTargets': [0],
"mData":"id",
"mRender": function(a, b, c, d){
if (c.status == 4){
if(isCheckedQyCode.indexOf(a+"")!=-1){
return '<input class="isExport" checked value="'+a+'" type="checkBox">';
if (c.status == 4 ){
//是否超过7天 0标识超过7天
if( c.isExceedSevenDay == 0){
if(isCheckedQyCode.indexOf(a+"")!=-1){
return '<input class="isExport" checked value="'+a+'" type="checkBox">';
}else{
return '<input class="isExport" value="'+a+'" type="checkBox">';
}
}else{
return '<input class="isExport" value="'+a+'" type="checkBox">';
return "";
}
}else{
return "";
......
......@@ -134,6 +134,11 @@ public class Order extends OrderDetail implements Serializable {
*/
private String memberPhone;
/**
* 收件时间到今天是否超过七天 标识字段(0:是 1:否)
*/
private String isExceedSevenDay;
......
......@@ -44,7 +44,9 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
......@@ -178,7 +180,7 @@ public class OrderController {
@RequiresPermissions(value = ORDER_VIEW)
@RequestMapping(value = "/listData")
@ResponseBody
public JSONObject listData(int iDisplayStart, int iDisplayLength, Order order, HttpServletRequest request) {
public JSONObject listData(int iDisplayStart, int iDisplayLength, Order order, HttpServletRequest request) throws ParseException {
Long userid = UserUtils.getUser().getUserid();
Long accountsId = UserUtils.getmpaccounts(request);
......@@ -238,6 +240,21 @@ public class OrderController {
Sort sort = new Sort("o.create_time", OrderType.DESC);
List<Order> list = orderService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:ss");
Date today = new Date();
Date passDay = null;
int i = 0;
for (Order obj : list){
if(obj.getStatus().equals("4") && !StringUtils.isEmpty(obj.getAcceptExpressDateStr())){
passDay = format.parse(obj.getAcceptExpressDateStr());
i = (int)(today.getTime()-passDay.getTime()) / (1000*3600*24);
if(i >= 7){
obj.setIsExceedSevenDay("0");
}else {
obj.setIsExceedSevenDay("1");
}
}
}
Integer counts = orderService.count(conds, userid);
JSONObject rtnJson = new JSONObject();
rtnJson.put("iTotalRecords", counts);
......
......@@ -34,6 +34,8 @@
<module>authentication-module-web</module>
<module>invoice-module</module>
<module>invoice-module-web</module>
<module>logistics-module</module>
<module>logistics-module-web</module>
</modules>
......
......@@ -310,6 +310,12 @@
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>logistics-module-web</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<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