|
@@ -18,6 +18,7 @@ import com.ym.mec.common.page.PageInfo;
|
|
|
import com.ym.mec.common.service.impl.BaseServiceImpl;
|
|
|
import com.ym.mec.common.tenant.TenantContextHolder;
|
|
|
import com.ym.mec.util.collection.MapUtil;
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -81,28 +82,27 @@ public class StudentGoodsSellServiceImpl extends BaseServiceImpl<Integer, Studen
|
|
|
public void affirmReceive(String orderNo) {
|
|
|
String str = "MANUAL_RECEIVE";
|
|
|
if (StringUtils.isNotEmpty(orderNo)) {
|
|
|
- studentGoodsSellDao.autoAffirmReceive(orderNo, str);
|
|
|
+ List<String> orderNos = new ArrayList<>();
|
|
|
+ orderNos.add(orderNo);
|
|
|
+ studentGoodsSellDao.autoAffirmReceive(orderNos, str);
|
|
|
return;
|
|
|
}
|
|
|
//如果订单编号为空,那么自动确认
|
|
|
- StringBuffer sb = new StringBuffer();
|
|
|
str = "AUTO_RECEIVE";
|
|
|
List<TenantInfo> tenantInfos = tenantInfoService.list(new QueryWrapper<TenantInfo>().eq("state_",1));
|
|
|
if(tenantInfos != null && tenantInfos.size() > 0){
|
|
|
+ List<String> orderNos = new ArrayList<>();
|
|
|
for (int i = 0; i < tenantInfos.size(); i++) {
|
|
|
TenantInfo tenantInfo = tenantInfos.get(i);
|
|
|
String autoAffirmReceiveTime = sysTenantConfigService.getTenantConfigValue(SysConfigService.AUTO_AFFIRM_RECEIVE_TIME,tenantInfo.getId());
|
|
|
//获取到期的订单编号
|
|
|
- String s = studentGoodsSellDao.queryNoAffirmOrderNo(autoAffirmReceiveTime, tenantInfo.getId());
|
|
|
- if(StringUtils.isNotEmpty(s)){
|
|
|
- if(sb.length() > 0){
|
|
|
- sb.append(",");
|
|
|
- }
|
|
|
- sb.append(s);
|
|
|
+ List<String> strings = studentGoodsSellDao.queryNoAffirmOrderNo(autoAffirmReceiveTime, tenantInfo.getId());
|
|
|
+ if(CollectionUtils.isNotEmpty(strings)){
|
|
|
+ orderNos.addAll(strings);
|
|
|
}
|
|
|
}
|
|
|
- if (sb.length() > 0) {
|
|
|
- studentGoodsSellDao.autoAffirmReceive(sb.toString(), str);
|
|
|
+ if (CollectionUtils.isNotEmpty(orderNos)) {
|
|
|
+ studentGoodsSellDao.autoAffirmReceive(orderNos, str);
|
|
|
}
|
|
|
}
|
|
|
}
|