Add method to update field shopify_synced in batch

pull/8040/head
Qiuyi LI 2024-05-31 16:08:00 +02:00
parent be751f5fb9
commit 033e0a08b4
4 changed files with 20 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import org.jeecg.modules.business.vo.clientPlatformOrder.section.OrderQuantity;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -224,4 +225,6 @@ public interface PlatformOrderMapper extends BaseMapper<PlatformOrder> {
void anonymizePersonalData(@Param("period") int indirectClientAnonymizationPeriod); void anonymizePersonalData(@Param("period") int indirectClientAnonymizationPeriod);
List<PlatformOrderOption> ordersByShop(@Param("shopID") String shopID); List<PlatformOrderOption> ordersByShop(@Param("shopID") String shopID);
void updateShopifySynced(@Param("platformOrderIds") Collection<String> platformOrderIds);
} }

View File

@ -463,6 +463,7 @@
#{shop} #{shop}
</foreach> </foreach>
AND ready_for_shopify_sync = 1 AND ready_for_shopify_sync = 1
AND shopify_synced = 0
AND erp_status = 3 AND erp_status = 3
ORDER BY shipping_time; ORDER BY shipping_time;
</select> </select>
@ -898,4 +899,13 @@
WHERE shop_id = #{shopID} WHERE shop_id = #{shopID}
AND erp_status IN (1,2,3) AND erp_status IN (1,2,3)
</select> </select>
<update id="updateShopifySynced">
UPDATE platform_order
SET shopify_synced = 1
WHERE platform_order_id IN
<foreach collection="platformOrderIds" separator="," open="(" close=")" index="index" item="platformOrderId">
#{platformOrderId}
</foreach>
</update>
</mapper> </mapper>

View File

@ -248,4 +248,6 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
void anonymizePersonalData(int indirectClientAnonymizationPeriod); void anonymizePersonalData(int indirectClientAnonymizationPeriod);
List<PlatformOrderOption> ordersByShop(String shopID); List<PlatformOrderOption> ordersByShop(String shopID);
void updateShopifySynced(Collection<String> platformOrderIds);
} }

View File

@ -501,4 +501,9 @@ public class PlatformOrderServiceImpl extends ServiceImpl<PlatformOrderMapper, P
public List<PlatformOrderOption> ordersByShop(String shopID) { public List<PlatformOrderOption> ordersByShop(String shopID) {
return platformOrderMap.ordersByShop(shopID); return platformOrderMap.ordersByShop(shopID);
} }
@Override
public void updateShopifySynced(Collection<String> platformOrderIds) {
platformOrderMap.updateShopifySynced(platformOrderIds);
}
} }