收发货统计表
This commit is contained in:
		
							parent
							
								
									26d041f794
								
							
						
					
					
						commit
						692d2511ed
					
				|  | @ -121,7 +121,7 @@ public class RecordsExcel { | |||
|                     map.put("endCode", endCode); | ||||
|                     map.put("startTime", startTime); | ||||
|                     map.put("endTime", endTime); | ||||
|                     map.put("goodsNo", goodsNo); | ||||
|                     map.put("goodsNo", objectMap.get("goodsNo")+""); | ||||
|                     List list2 = receiptRecordsService.findGoods(map, ".getMajorNum"); | ||||
|                     Map map1 = (Map) list2.get(0); | ||||
|                     if (map1 != null) { | ||||
|  | @ -138,7 +138,7 @@ public class RecordsExcel { | |||
|                     map.put("endCode", endCode); | ||||
|                     map.put("invoiceStartTime", startTime); | ||||
|                     map.put("invoiceEndTime", endTime); | ||||
|                     map.put("goodsNo", goodsNo); | ||||
|                     map.put("goodsNo", objectMap.get("goodsNo")+""); | ||||
|                     Integer invoiceNum = receiptRecordsService.countAll(map, ".countRecordsByCondition"); | ||||
|                     invoiceNum = StringUtil.isNullOrEmpty(invoiceNum)? 0:invoiceNum; | ||||
|                     receiptRecordsBo.setInvoiceNum(invoiceNum.toString()); | ||||
|  | @ -149,7 +149,7 @@ public class RecordsExcel { | |||
|                     map.put("endCode", endCode); | ||||
|                     map.put("receiveStartTime", startTime); | ||||
|                     map.put("receiveEndTime", endTime); | ||||
|                     map.put("goodsNo", goodsNo); | ||||
|                     map.put("goodsNo", objectMap.get("goodsNo")+""); | ||||
|                     map.put("timeFlag", "1"); | ||||
|                     Integer receiveNum = receiptRecordsService.countAll(map, ".statisticsRecords"); | ||||
|                     receiveNum = StringUtil.isNullOrEmpty(receiveNum)? 0:receiveNum; | ||||
|  | @ -161,7 +161,7 @@ public class RecordsExcel { | |||
|                     map.put("endCode", endCode); | ||||
|                     map.put("deliveryStartTime", startTime); | ||||
|                     map.put("deliveryEndTime", endTime); | ||||
|                     map.put("goodsNo", goodsNo); | ||||
|                     map.put("goodsNo", objectMap.get("goodsNo")+""); | ||||
|                     map.put("timeFlag", "2"); | ||||
|                     Integer deliveryNum = receiptRecordsService.countAll(map, ".statisticsRecords"); | ||||
|                     deliveryNum = StringUtil.isNullOrEmpty(deliveryNum)? 0:deliveryNum; | ||||
|  | @ -208,10 +208,12 @@ public class RecordsExcel { | |||
|         map.putAll(tranMap); | ||||
|         String startTime = tranMap.get("startTime") + ""; | ||||
|         String endTime = tranMap.get("endTime") + ""; | ||||
|         String goodsNo = tranMap.get("goodsNo") + ""; | ||||
| 
 | ||||
|         // 应发数量 该经销商发货单的应发数量汇总 | ||||
|         map.put("startTime", startTime); | ||||
|         map.put("endTime", endTime); | ||||
|         map.put("goodsNo", goodsNo); | ||||
|         List list2 = receiptRecordsService.findGoods(map, ".getMajorNum"); | ||||
|         Map map1 = (Map) list2.get(0); | ||||
|         if (map1 != null) { | ||||
|  | @ -226,6 +228,7 @@ public class RecordsExcel { | |||
|         map.remove("endTime"); | ||||
|         map.put("invoiceStartTime", startTime); | ||||
|         map.put("invoiceEndTime", endTime); | ||||
|         map.put("isAll", "1"); | ||||
|         Integer invoiceNum = receiptRecordsService.countAll(map, ".countRecordsByCondition"); | ||||
|         invoiceNum = StringUtil.isNullOrEmpty(invoiceNum)? 0:invoiceNum; | ||||
|         receiptRecordsBo.setInvoiceNum(invoiceNum.toString()); | ||||
|  |  | |||
|  | @ -124,6 +124,9 @@ | |||
|             <if test="goodsNo != null and goodsNo != ''"> | ||||
|                 AND a.GOODS_NO = #{goodsNo} | ||||
|             </if> | ||||
|             <if test="goodsNo == null or goodsNo == ''"> | ||||
|                 AND (a.GOODS_NO is null or a.GOODS_NO = '') | ||||
|             </if> | ||||
|             <if test="clientId != null and clientId != ''"> | ||||
|                 AND c.client_id = #{clientId} | ||||
|             </if> | ||||
|  |  | |||
|  | @ -264,6 +264,21 @@ | |||
|             <if test="goodsNo != null and goodsNo != ''"> | ||||
|                 AND a.GOODS_NO = #{goodsNo} | ||||
|             </if> | ||||
|             <if test="isAll != null"> | ||||
|                 and a.INVOICE_CLIENT_ID  in | ||||
|                 ( SELECT client_id FROM crm_total_records | ||||
|                 <where> | ||||
|                     <if test="invoiceStartTime != null and invoiceStartTime != ''"> | ||||
|                         AND TO_CHAR(TO_DATE(SUBSTR(create_time,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') >= | ||||
|                         TO_CHAR(TO_DATE(SUBSTR(#{invoiceStartTime},1,10),'yyyy-MM-dd'),'yyyy-MM-dd') | ||||
|                     </if> | ||||
|                     <if test="invoiceEndTime != null and invoiceEndTime != ''"> | ||||
|                         AND TO_CHAR(TO_DATE(SUBSTR(create_time,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') <= | ||||
|                         TO_CHAR(TO_DATE(SUBSTR(#{invoiceEndTime},1,10),'yyyy-MM-dd'),'yyyy-MM-dd') | ||||
|                     </if> | ||||
|                 </where> | ||||
|                 ) | ||||
|             </if> | ||||
|             <if test="goodsNo == null or goodsNo == ''"> | ||||
|                 AND (a.GOODS_NO is null or a.GOODS_NO = '') | ||||
|             </if> | ||||
|  | @ -394,7 +409,9 @@ | |||
|                 </if> | ||||
|             </if> | ||||
|         </where> | ||||
|         group by GOODS_NO | ||||
|         <if test="isAll == null or isAll == ''"> | ||||
|             group by GOODS_NO | ||||
|         </if> | ||||
| --         ORDER BY a.create_time DESC | ||||
|     </select> | ||||
| 
 | ||||
|  | @ -408,6 +425,29 @@ | |||
|             <if test="goodsNo != null and goodsNo != ''"> | ||||
|                 AND a.GOODS_NO = #{goodsNo} | ||||
|             </if> | ||||
|             <if test="isAll != null"> | ||||
|                 and a.CLIENT_ID  in | ||||
|                 ( SELECT client_id FROM crm_total_records | ||||
|                 <where> | ||||
|                     <if test="receiveStartTime != null and receiveStartTime != ''"> | ||||
|                         AND TO_CHAR(TO_DATE(SUBSTR(create_time,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') >= | ||||
|                         TO_CHAR(TO_DATE(SUBSTR(#{receiveStartTime},1,10),'yyyy-MM-dd'),'yyyy-MM-dd') | ||||
|                     </if> | ||||
|                     <if test="receiveEndTime != null and receiveEndTime != ''"> | ||||
|                         AND TO_CHAR(TO_DATE(SUBSTR(create_time,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') <= | ||||
|                         TO_CHAR(TO_DATE(SUBSTR(#{receiveEndTime},1,10),'yyyy-MM-dd'),'yyyy-MM-dd') | ||||
|                     </if> | ||||
|                     <if test="deliveryStartTime != null and deliveryStartTime != ''"> | ||||
|                         AND TO_CHAR(TO_DATE(SUBSTR(create_time,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') >= | ||||
|                         TO_CHAR(TO_DATE(SUBSTR(#{deliveryStartTime},1,10),'yyyy-MM-dd'),'yyyy-MM-dd') | ||||
|                     </if> | ||||
|                     <if test="deliveryEndTime != null and deliveryEndTime != ''"> | ||||
|                         AND TO_CHAR(TO_DATE(SUBSTR(create_time,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') <= | ||||
|                         TO_CHAR(TO_DATE(SUBSTR(#{deliveryEndTime},1,10),'yyyy-MM-dd'),'yyyy-MM-dd') | ||||
|                     </if> | ||||
|                 </where> | ||||
|                 ) | ||||
|             </if> | ||||
|             <if test="goodsNo == null or goodsNo == ''"> | ||||
|                 AND (a.GOODS_NO is null or a.GOODS_NO = '') | ||||
|             </if> | ||||
|  | @ -553,7 +593,9 @@ | |||
|                 </if> | ||||
|             </if> | ||||
|         </where> | ||||
|         group by GOODS_NO | ||||
|         <if test="isAll == null or isAll == ''"> | ||||
|             group by GOODS_NO | ||||
|         </if> | ||||
|     </select> | ||||
| 
 | ||||
|     <select id="oneById" resultMap="recordsMap" parameterType="map"> | ||||
|  |  | |||
|  | @ -350,6 +350,7 @@ public class ReceiptRecordsService { | |||
|         map.putAll(params); | ||||
|         map.put("invoiceStartTime", startTime); | ||||
|         map.put("invoiceEndTime", endTime); | ||||
|         map.put("isAll", "1"); | ||||
|         Integer invoiceNum = this.countAll(map, ".countRecordsByCondition"); | ||||
|         receiptRecordsBo.setInvoiceNum(StringUtil.isNullOrEmpty(invoiceNum) ? "0":invoiceNum+""); | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue