md
This commit is contained in:
parent
a05d51bebf
commit
4c00c8d7e4
@ -1071,15 +1071,28 @@ public class EmisBaseService {
|
||||
|
||||
/**
|
||||
* 计算预估到达时间
|
||||
* @param startDate
|
||||
* @param sendDate 开单时间
|
||||
* @param prodCode
|
||||
* @param receiveCountry
|
||||
* @param sendCountry
|
||||
* @return
|
||||
*/
|
||||
public Date getEstimateDate(Date startDate,String prodCode,String receiveCountry,String sendCountry) {
|
||||
public Date getEstimateDate(Date sendDate,String prodCode,String receiveCountry,String sendCountry) {
|
||||
Date estDate = null;
|
||||
|
||||
// 发件时间+1天,从下一天的0点开始算
|
||||
sendDate = DateUtils.addDays(sendDate,1);
|
||||
|
||||
// 初始化0点时间
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(sendDate);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
|
||||
Date startDate=calendar.getTime();
|
||||
|
||||
// 获取产品最大时效
|
||||
EmisTransProduct emisTransProduct = getTransProductByCode(prodCode);
|
||||
|
||||
@ -1096,6 +1109,7 @@ public class EmisBaseService {
|
||||
startDate,
|
||||
endDate);
|
||||
|
||||
// 1+1+
|
||||
int totalDays=emisTransProduct.getMaxAging()+weekDays+notCaclDays;
|
||||
log.info("计算预估到达时间:[maxAging="+emisTransProduct.getMaxAging()+",weekDays="+weekDays+",notCaclDays="+notCaclDays);
|
||||
// 预估达到时间
|
||||
|
||||
@ -502,6 +502,10 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
|
||||
if(emisWaybillSave.getSendDate()==null){
|
||||
emisWaybillSave.setSendDate(new Date());
|
||||
}
|
||||
|
||||
// 开单当天不算时效
|
||||
Date startDate = emisWaybillSave.getSendDate();
|
||||
|
||||
Date estDate = getEstimateDate(
|
||||
emisWaybillSave.getSendDate(),emisWaybillSave.getProductType(),
|
||||
emisWaybillSave.getSendCountry(),
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getNotCalcAgingDays" resultType="integer">
|
||||
select count(1) from emis_not_calc_aging where ( FIND_IN_SET('-1',country) or FIND_IN_SET(#{recieveCountry},country) or FIND_IN_SET(#{sendCountry},country) ) and no_calc_day <![CDATA[ >= ]]> #{startDate} and no_calc_day <![CDATA[ <= ]]> #{endDate}
|
||||
select count(distinct no_calc_day) from emis_not_calc_aging where ( FIND_IN_SET('-1',country) or FIND_IN_SET(#{recieveCountry},country) or FIND_IN_SET(#{sendCountry},country) ) and no_calc_day <![CDATA[ >= ]]> #{startDate} and no_calc_day <![CDATA[ <= ]]> #{endDate}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user