lisai17@sina.com 2020-09-01 16:37:46 +08:00
parent 51298f9184
commit eec075a81b
2 changed files with 8 additions and 11 deletions

View File

@ -96,10 +96,12 @@ public class DateTimeUtil {
* @return * @return
*/ */
public static boolean isToday(Date date){ public static boolean isToday(Date date){
Calendar calendar = Calendar.getInstance(); Calendar c = Calendar.getInstance();
long now = System.currentTimeMillis() - calendar.get(Calendar.HOUR_OF_DAY) * 60 * 60 * 1000; c.set(Calendar.HOUR_OF_DAY, 23);
calendar.setTime(date); c.set(Calendar.MINUTE, 59);
c.set(Calendar.SECOND, 59);
c.set(Calendar.MILLISECOND, 999);
return now == date.getTime() - calendar.get(Calendar.HOUR_OF_DAY) * 60 * 60 * 1000; return c.getTime().getTime() >= date.getTime();
} }
} }

View File

@ -251,11 +251,6 @@ public class OrderTempSyncService {
return Result.failedstr("集团订单只能在%s使用", DateTimeUtil.sdfymd.get().format(ordercluster.getCutoffTime())); return Result.failedstr("集团订单只能在%s使用", DateTimeUtil.sdfymd.get().format(ordercluster.getCutoffTime()));
} }
Customer customer = Customer.dao.findById(ordercluster.getCustomerId());
if (customer == null) {
return Result.failedstr("客户信息【%s】信息不存在", ordercluster.getCustomerId());
}
if (ordercluster.getState() == OrderStateEnum.INVALID.getStateid()) { if (ordercluster.getState() == OrderStateEnum.INVALID.getStateid()) {
return Result.failedstr("集团订单【%s】已完结请重新下单", ordercluster_id); return Result.failedstr("集团订单【%s】已完结请重新下单", ordercluster_id);
} }
@ -297,11 +292,11 @@ public class OrderTempSyncService {
|| transport.getSecondWeight().compareTo(min) < 0 || transport.getSecondWeight().compareTo(min) < 0
|| transport.getSecondWeight().subtract(transport.getFirstWeight()).doubleValue() <= 0 // 销售订单 第一重量要比第二次重量小, 即 毛重 > 皮重 || transport.getSecondWeight().subtract(transport.getFirstWeight()).doubleValue() <= 0 // 销售订单 第一重量要比第二次重量小, 即 毛重 > 皮重
) { ) {
return Result.failedstr("重量数据有误,第一次称重:%.4f第二次称重%.4f", transport.getFirstWeight(), transport.getSecondWeight()); return Result.failedstr("重量数据有误,第一次称重:%.2f第二次称重%.2f", transport.getFirstWeight(), transport.getSecondWeight());
} }
if (transport.getSecondWeight().compareTo(BigDecimal.valueOf(Config.configprop.getInt("weigh.max"))) > 0) { if (transport.getSecondWeight().compareTo(BigDecimal.valueOf(Config.configprop.getInt("weigh.max"))) > 0) {
return Result.failedstr("毛重不能超过 %.2f 吨", Config.configprop.getInt("weigh.max")); return Result.failedstr("毛重 %.2f 吨,不能超过 %s 吨", transport.getSecondWeight(), Config.configprop.getInt("weigh.max"));
} }
BigDecimal net_weight = transport.getSecondWeight().subtract(transport.getFirstWeight()); // 销售的用第二次减第一次 BigDecimal net_weight = transport.getSecondWeight().subtract(transport.getFirstWeight()); // 销售的用第二次减第一次