fix:最新订货时间定时任务过滤门店状态

This commit is contained in:
wangff
2025-10-27 13:46:48 +08:00
parent b2076cc6c5
commit 1830e2240e
4 changed files with 15 additions and 4 deletions

View File

@@ -99,7 +99,7 @@ public class StoreDao {
/** /**
* 查询所有门店id和门店编码 * 查询所有门店id和门店编码
*/ */
public List<StoreDO> getAllStoreIdAndNum() { public List<StoreDO> getAllStoreIdAndNum(List<String> storeStatus) {
return storeMapper.getAllStoreIdAndNum(); return storeMapper.getAllStoreIdAndNum(storeStatus);
} }
} }

View File

@@ -58,5 +58,5 @@ public interface StoreMapper {
/** /**
* 查询所有门店id和门店编码 * 查询所有门店id和门店编码
*/ */
List<StoreDO> getAllStoreIdAndNum(); List<StoreDO> getAllStoreIdAndNum(@Param("storeStatus") List<String> storeStatus);
} }

View File

@@ -248,5 +248,11 @@
SELECT store_id, store_num SELECT store_id, store_num
FROM store_${enterpriseId} FROM store_${enterpriseId}
WHERE is_delete = 'effective' WHERE is_delete = 'effective'
<if test="storeStatus != null and !storeStatus.isEmpty()">
AND store_status IN
<foreach item="item" collection="storeStatus" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</select> </select>
</mapper> </mapper>

View File

@@ -407,13 +407,18 @@ public class XxlJobHandler {
@XxlJob("latestOrderDate") @XxlJob("latestOrderDate")
public void latestOrderDate() { public void latestOrderDate() {
log.info("------start latestOrderDate------"); log.info("------start latestOrderDate------");
String param = XxlJobHelper.getJobParam();
List<String> storeStatus = null;
if (StringUtils.isNotBlank(param)) {
storeStatus = Arrays.asList(param.split(","));
}
boolean hasNext = true; boolean hasNext = true;
int pageNum = 1; int pageNum = 1;
int pageSize = CommonConstants.BATCH_SIZE; int pageSize = CommonConstants.BATCH_SIZE;
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
while (hasNext) { while (hasNext) {
PageHelper.startPage(pageNum, pageSize); PageHelper.startPage(pageNum, pageSize);
List<StoreDO> storeList = storeDao.getAllStoreIdAndNum(); List<StoreDO> storeList = storeDao.getAllStoreIdAndNum(storeStatus);
if (CollectionUtils.isEmpty(storeList)) { if (CollectionUtils.isEmpty(storeList)) {
break; break;
} }