Merge pull request 'develop' (#177) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/177
This commit is contained in:
heyu 2025-09-05 11:01:04 +08:00
commit 74bf68b582
5 changed files with 29 additions and 17 deletions

View File

@ -1460,7 +1460,7 @@ public class EmisWaybillController extends EmisBaseController
// 23:59:59未签收,且在emis_waybill_problem_info表内的所有运单信息
// 重新计算并更新预估到达时间
String beginDate = "2025-08-01 00:00:00";
String endDate = "2025-09-03 23:59:59";
String endDate = "2025-09-05 23:59:59";
// 构建查询条件
EmisWaybill queryWaybill = new EmisWaybill();

View File

@ -69,6 +69,8 @@ public class EmisWaybill extends BaseEntity {
private String customerCode;
/* 客户类型 1-普通客户 2-月结客户 */
private String customerType;
/* 主账号id */
private Long mainUserId;
/* 客户客户名称 */
private String customerName;
/* wx openid */

View File

@ -71,6 +71,9 @@ public class WaybillOrder implements Serializable {
/* 客户类型 1-普通客户 2-月结客户 */
private String customerType;
/* 主账号id */
private Long mainUserId;
/* 支付方式 : 现金或月结 */
private String paymentType;
@ -422,7 +425,7 @@ public class WaybillOrder implements Serializable {
/**
* 转 VO
*
*
* @param dbWaybill
* @param dbCargoList
* @param dbFeeitemList
@ -518,6 +521,7 @@ public class WaybillOrder implements Serializable {
voItem.setCustomerCode(dbWaybill.getCustomerCode());
voItem.setCustomerName(dbWaybill.getCustomerName());
voItem.setCustomerType(dbWaybill.getCustomerType());
voItem.setMainUserId(dbWaybill.getMainUserId());
voItem.setSendSiteName(dbWaybill.getSendSiteName());
voItem.setTakePieceEmployeeName(dbWaybill.getTakePieceEmployeeName());
voItem.setOperateEmployeeName(dbWaybill.getOperateEmployeeName());
@ -712,7 +716,7 @@ public class WaybillOrder implements Serializable {
/**
* 转为数据库类型值
*
*
* @return
*/
public EmisWaybill toDb() {
@ -746,6 +750,7 @@ public class WaybillOrder implements Serializable {
dbWaybill.setOrderDate(this.getOrderDate());
dbWaybill.setUserId(this.getUserId());
dbWaybill.setCustomerCode(this.getCustomerCode());
dbWaybill.setMainUserId(this.getMainUserId());
// 虚拟单
dbWaybill.setBlVirtual(this.getBlVirtual());

View File

@ -4104,20 +4104,22 @@ public class EmisBaseService {
/**
* 计算预估到达时间,根据产品时效来计算
* @param sendDate 开单时间
*
* @param sendDate 开单时间
* @param prodCode
* @param receiveCountry
* @param sendCountry
* @return
*/
public Date getEstimateDate(Date sendDate,String prodCode,String receiveCountry,String sendCountry,Integer otherAddDay) {
public Date getEstimateDate(Date sendDate, String prodCode, String receiveCountry, String sendCountry,
Integer otherAddDay) {
Date estDate = null;
if(otherAddDay==null){
otherAddDay=0;
if (otherAddDay == null) {
otherAddDay = 0;
}
// 发件时间+1天,从下一天的0点开始算
sendDate = DateUtils.addDays(sendDate,1);
sendDate = DateUtils.addDays(sendDate, 1);
// 初始化0点时间
Calendar calendar = Calendar.getInstance();
@ -4127,35 +4129,36 @@ public class EmisBaseService {
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MILLISECOND, 0);
Date startDate=calendar.getTime();
Date startDate = calendar.getTime();
// 获取产品最大时效
EmisTransProduct emisTransProduct = getTransProductByCode(prodCode);
// 预估到达时间 startData+最大时效
Date endDate = DateUtils.addDays(startDate, emisTransProduct.getMaxAging()+otherAddDay-1);
Date endDate = DateUtils.addDays(startDate, emisTransProduct.getMaxAging() + otherAddDay - 1);
// 计算周末
int weekDays = computeWeekDays(startDate,endDate,true);
int weekDays = computeWeekDays(startDate, endDate, true);
// 计算不计较时效的时间
int notCaclDays=emisNotCalcAgingMapper.getNotCalcAgingDays(
int notCaclDays = emisNotCalcAgingMapper.getNotCalcAgingDays(
receiveCountry,
sendCountry,
startDate,
endDate);
// 1+1+ 5+0-1+2+0
int totalDays=(emisTransProduct.getMaxAging()+otherAddDay-1)+weekDays+notCaclDays;
log.info("计算预估到达时间:[maxAging="+emisTransProduct.getMaxAging()+",weekDays="+weekDays+",notCaclDays="+notCaclDays);
// 1+1+ 5+0-1+2+0
int totalDays = (emisTransProduct.getMaxAging() + otherAddDay - 1) + weekDays + notCaclDays;
log.info("计算预估到达时间:[maxAging=" + emisTransProduct.getMaxAging() + ",weekDays=" + weekDays + ",notCaclDays="
+ notCaclDays);
// 预估达到时间
Date estimateDate = DateUtils.addDays(startDate, totalDays);
// 判断预估到达时间是否为周末,如果是周末则往后加一天
// 判断预估到达时间是否为周日,如果是周日则往后加一天
Calendar cal = Calendar.getInstance();
cal.setTime(estimateDate);
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
if (dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY) {
if (dayOfWeek == Calendar.SUNDAY) {
estimateDate = DateUtils.addDays(estimateDate, 1);
}

View File

@ -231,6 +231,7 @@
<result property="customerNickName" column="customer_nick_name" />
<result property="customerAvatar" column="customer_avatar" />
<result property="customerType" column="customer_type" />
<result property="mainUserId" column="main_user_id" />
<result property="blVirtual" column="bl_virtual" />
<result property="masterBillCode" column="master_bill_code" />
@ -444,6 +445,7 @@
a3.sales_support ,
a3.sales_executive ,
a3.customer_type as customer_type,
a3.main_user_id ,
p.emp_name as dispatch_man_name,q.site_name as print_site_name,
r.emp_name as print_man_name,