Index: ssts-tousse/src/main/java/com/forgon/disinfectsystem/signRecord/service/SignRecordManagerImpl.java =================================================================== diff -u -r32034 -r33474 --- ssts-tousse/src/main/java/com/forgon/disinfectsystem/signRecord/service/SignRecordManagerImpl.java (.../SignRecordManagerImpl.java) (revision 32034) +++ ssts-tousse/src/main/java/com/forgon/disinfectsystem/signRecord/service/SignRecordManagerImpl.java (.../SignRecordManagerImpl.java) (revision 33474) @@ -378,14 +378,12 @@ endDate = endDate + " 23:59:59"; timeSql = " and " + dateQueryAdapter.dateAreaSql("invoiceSendTime", beginDate, endDate); } - // 发货时间 - String invoiceSendTimeSql = " (select min(ti1.invoiceSendTime) from TousseInstance ti1 where ti1.tousseName=ti.tousseName " - + " and ti1.status='" + TousseInstance.STATUS_SHIPPED + "'" - + timeSql - + " and ((location='" + departCoding + "' and location_2 is null) or (location_2 = '" + departCoding + "'))) invoiceSendTime "; + // 汇总 - String sql = "select ti.tousseName, count(0) amount, " + invoiceSendTimeSql + " from " + TousseInstance.class.getSimpleName() - + " ti where ((ti.location='" + departCoding + "' and ti.location_2 is null) or (ti.location_2 = '" + departCoding + "')) and ti.status='" + TousseInstance.STATUS_SHIPPED + "'" + String sql = "select ti.tousseName, count(0) amount, min(case when ti.invoice2_id is not null then i2.sendTime else i1.sendTime end) as invoiceSendTime from " + TousseInstance.class.getSimpleName() + " ti " + + "left join " + Invoice.class.getSimpleName() + " i1 on ti.invoice_id = i1.id " + + "left join " + Invoice.class.getSimpleName() + " i2 on ti.invoice2_id = i2.id " + + "where ((ti.location='" + departCoding + "' and ti.location_2 is null) or (ti.location_2 = '" + departCoding + "')) and ti.status='" + TousseInstance.STATUS_SHIPPED + "'" + timeSql + " group by ti.tousseName" + " order by ti.tousseName"; @@ -417,7 +415,10 @@ int minute = keyValueManager.getIntValue(procedure + "Minute", 0); for (Map map : list) { String invoiceSendTimeStr = (String)map.get("invoiceSendTime"); - Date invoiceSendTime = sdf.parse(invoiceSendTimeStr); + Date invoiceSendTime = DateTools.coverStrToDate(invoiceSendTimeStr, "yyyy-MM-dd"); + if(invoiceSendTime == null){ + invoiceSendTime = today; + } // 前台根据此字段做颜色设置 // (0表示待签收的物品的发货日期全部都是今天的(白色),1表示待签收的物品的发货日期有不是今天的日期的(黄色)) map.put("signTime", today.compareTo(invoiceSendTime));