浏览代码

Merge branch 'master' of http://git.ds-bay.com/project/cus-wms-supervise2.0

csk 5 年之前
父节点
当前提交
a89f29a98a

+ 2 - 2
src/main/java/com/emato/cus/supervise/schedule/AcqGoodsSeatSchedule.java

@@ -30,8 +30,8 @@ public class AcqGoodsSeatSchedule {
      * 每30分钟1次
      * 每30分钟1次
      */
      */
     //每月1号开始,每天10,12,15,18,22点各1次,共5次
     //每月1号开始,每天10,12,15,18,22点各1次,共5次
-    @Scheduled(cron = "0 0 10,12,15,18,22 1/1 * ?")
-//    @Scheduled(cron = "0 0/1 * * * ? ")
+//    @Scheduled(cron = "0 0 10,12,15,18,22 1/1 * ?")
+    @Scheduled(cron = "0 0/1 * * * ? ")
     public void timerUp() {
     public void timerUp() {
         logger.info("==================== 库位货物数据::监控数据读取开始 ====================");
         logger.info("==================== 库位货物数据::监控数据读取开始 ====================");
         String begDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);
         String begDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);

+ 2 - 2
src/main/java/com/emato/cus/supervise/schedule/AcqInventoryInfoSchedule.java

@@ -28,8 +28,8 @@ public class AcqInventoryInfoSchedule {
      * 货物库存数据
      * 货物库存数据
      */
      */
     //每月1号开始,每天12,22点各1次,共2次
     //每月1号开始,每天12,22点各1次,共2次
-    @Scheduled(cron = "0 0 12,22 1/1 * ?")
-//    @Scheduled(cron = "0 0/1 * * * ? ")
+//    @Scheduled(cron = "0 0 12,22 1/1 * ?")
+    @Scheduled(cron = "0 0/1 * * * ? ")
     public void timer() {
     public void timer() {
         logger.info("==================== 货物库存数据::监控数据读取开始 ====================");
         logger.info("==================== 货物库存数据::监控数据读取开始 ====================");
         String begDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);
         String begDateTime = LocalDateTimeUtils.formatNow(LocalDateTimeUtils.DATA_TIME_HYPHEN);

+ 29 - 28
src/main/resources/mybatis/mapper/wms-acq-goods-on-seat.xml

@@ -5,34 +5,35 @@
 
 
     <!-- 库位上的货品信息 -->
     <!-- 库位上的货品信息 -->
     <select id="getWmsAcqGoodsSeat" parameterType="java.util.Map" resultType="com.emato.cus.supervise.domain.WmsAcqGoodsOnSeat">
     <select id="getWmsAcqGoodsSeat" parameterType="java.util.Map" resultType="com.emato.cus.supervise.domain.WmsAcqGoodsOnSeat">
-        SELECT * FROM
-        (SELECT
-          th.companyCode AS merchSn,
-          th.locationCode AS seatNo,
-          th.itemName AS goodsName,
-          th.itemCode AS codeTs,
-          th.itemCode AS skuNo,
-          th.itemCode AS goodsId,
-          i.unitDesc AS gUnit,
-          th.afterOnHandQty AS gQty,
-          th.warehouseCode AS storeCode,
-          CONCAT( i.itemSize, '-', i.itemColor, '-', i.itemStyle ) AS goodsModel
-        FROM transaction_history th
-        LEFT JOIN ( SELECT itemCode, locationCode, SUM( onHandQty ) AS qty FROM location_inventory GROUP BY itemCode, locationCode ) AS li
-          ON th.itemCode = li.itemCode AND th.locationCode = li.locationCode
-        LEFT JOIN item i ON th.itemCode = i.CODE
-        <where>
-           1 = 1
-           and th.zone in ('A区', 'B区', 'C区', 'GQ区', 'F区', 'P区')
-           and (th.afterOnHandQty = li.qty or th.afterOnHandQty = 0)
-           and li.qty is not null
-           <if test="thisTime != null">
-              and th.created &gt;= #{thisTime}
-           </if>
-        </where>
-        ORDER BY th.created DESC
-        ) AS temp
-        GROUP BY skuNo, seatNo
+        SELECT
+          *
+        FROM
+          (SELECT DISTINCT
+            th.companyCode AS merchSn,
+            th.locationCode AS seatNo,
+            th.itemName AS goodsName,
+            th.itemCode AS codeTs,
+            th.itemCode AS skuNo,
+            th.itemCode AS goodsId,
+            i.unitDesc AS gUnit,
+            ( case when (li.qty is null and th.afterOnHandQty = 0) or (li.qty is not null and th.afterOnHandQty = li.qty) then th.afterOnHandQty
+              else li.qty end)  AS gQty,
+            th.warehouseCode AS storeCode,
+            CONCAT( i.itemSize, '-', i.itemColor, '-', i.itemStyle ) AS goodsModel
+          FROM
+            transaction_history th
+              LEFT JOIN ( SELECT itemCode, locationCode, SUM( onHandQty ) AS qty FROM location_inventory GROUP BY itemCode, locationCode ) AS li ON
+                th.itemCode = li.itemCode AND th.locationCode = li.locationCode
+              LEFT JOIN item i ON th.itemCode = i.CODE
+          WHERE
+            1 = 1
+            AND th.zone IN ( 'A区', 'B区', 'C区', 'GQ区', 'F区', 'P区', 'Y区' )
+            AND th.created >= '2018-01-01'
+          ORDER BY
+            th.created DESC
+          ) AS a
+        GROUP BY
+          skuNo, seatNo
     </select>
     </select>
 
 
 
 

+ 34 - 18
src/main/resources/mybatis/mapper/wms-acq-inventory-info.xml

@@ -8,24 +8,40 @@
     <select id="getWmsAcqInventoryInfo" parameterType="java.util.Map"
     <select id="getWmsAcqInventoryInfo" parameterType="java.util.Map"
             resultType="com.emato.cus.supervise.domain.WmsAcqInventoryInfo">
             resultType="com.emato.cus.supervise.domain.WmsAcqInventoryInfo">
 		SELECT
 		SELECT
-		li.companyCode AS merchSn,
-		li.itemName AS goodsName,
-		li.itemCode AS codeTs,
-		i.unitDesc AS gUnit,
-		SUM(li.onHandQty) AS gQty,
-		CONCAT(i.itemSize,'-',i.itemColor,'-',i.itemStyle) as goodsModel
-		FROM location_inventory li
-		LEFT JOIN item i ON li.itemCode = i.CODE
-		LEFT JOIN location l ON li.locationCode = l.CODE
-		<where>
-			1 = 1
-			and l.zoneCode in ('A区', 'B区', 'C区', 'GQ区', 'F区', 'P区')
-			<if test="thisTime != null">
-				and li.lastUpdated &gt;= #{thisTime}
-			</if>
-		</where>
-		GROUP BY li.itemCode
-    </select>
+			merchSn,
+			goodsName,
+			codeTs,
+			gUnit,
+			SUM( gQty ) AS gQty,
+			goodsModel
+		FROM
+			(SELECT DISTINCT
+				th.companyCode AS merchSn,
+				th.locationCode AS seatNo,
+				th.itemName AS goodsName,
+				th.itemCode AS codeTs,
+				th.itemCode AS skuNo,
+				th.itemCode AS goodsId,
+				i.unitDesc AS gUnit,
+				( case when (li.qty is null and th.afterOnHandQty = 0) or (li.qty is not null and th.afterOnHandQty = li.qty) then th.afterOnHandQty
+					else li.qty end)  AS gQty,
+				th.warehouseCode AS storeCode,
+				CONCAT( i.itemSize, '-', i.itemColor, '-', i.itemStyle ) AS goodsModel
+			FROM
+				transaction_history th
+					LEFT JOIN ( SELECT itemCode, locationCode, SUM( onHandQty ) AS qty FROM location_inventory GROUP BY itemCode, locationCode ) AS li ON
+						th.itemCode = li.itemCode AND th.locationCode = li.locationCode
+					LEFT JOIN item i ON th.itemCode = i.CODE
+			WHERE
+				1 = 1
+				AND th.zone IN ( 'A区', 'B区', 'C区', 'GQ区', 'F区', 'P区', 'Y区' )
+				AND th.created >= '2018-01-01'
+			ORDER BY
+				th.created DESC
+			) AS a
+		GROUP BY
+			codeTs
+	</select>
 
 
 
 
 </mapper>
 </mapper>