|
|
@@ -15,6 +15,7 @@ import com.sqx.modules.common.entity.CommonInfo;
|
|
|
import com.sqx.modules.common.service.CommonInfoService;
|
|
|
import com.sqx.modules.coupon.dao.TbCouponUserDao;
|
|
|
import com.sqx.modules.coupon.entity.TbCouponUser;
|
|
|
+import com.sqx.modules.coupon.service.TbCouponUserService;
|
|
|
import com.sqx.modules.errand.dao.UserInfoDao;
|
|
|
import com.sqx.modules.errand.entity.ErrandEvaluate;
|
|
|
import com.sqx.modules.errand.entity.ErrandRedPacket;
|
|
|
@@ -24,16 +25,14 @@ import com.sqx.modules.errand.service.UserInfoService;
|
|
|
import com.sqx.modules.pay.dao.PayDetailsDao;
|
|
|
import com.sqx.modules.pay.service.CashOutService;
|
|
|
import com.sqx.modules.utils.VerifyIdCardUtils;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.Calendar;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Service
|
|
|
public class UserInfoServiceImpl extends ServiceImpl<UserInfoDao, ErrandEvaluate> implements UserInfoService {
|
|
|
@@ -53,6 +52,9 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoDao, ErrandEvaluate
|
|
|
@Autowired
|
|
|
private TbCouponUserDao tbCouponUserDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TbCouponUserService tbCouponUserService;
|
|
|
+
|
|
|
@Override
|
|
|
public UserEntity findUserInfoById(Long userId) {
|
|
|
return userInfoDao.findUserInfoById(userId);
|
|
|
@@ -280,9 +282,18 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoDao, ErrandEvaluate
|
|
|
tbCouponUser.setStatus(0);
|
|
|
tbCouponUser.setEndTime(String.valueOf(endTime));
|
|
|
tbCouponUser.setShopId(0L);
|
|
|
+ // 批量插入红包
|
|
|
+ List<TbCouponUser> couponUserList = new ArrayList<>();
|
|
|
for(int i = 0;i<num; i++){
|
|
|
- tbCouponUserDao.insert(tbCouponUser);
|
|
|
+ TbCouponUser newCouponUser = new TbCouponUser();
|
|
|
+ BeanUtils.copyProperties(tbCouponUser, newCouponUser);
|
|
|
+ couponUserList.add(newCouponUser);
|
|
|
}
|
|
|
+ // 批量插入
|
|
|
+ if (!couponUserList.isEmpty()) {
|
|
|
+ tbCouponUserService.saveBatch(couponUserList);
|
|
|
+ }
|
|
|
+
|
|
|
//修改用户为非新用户
|
|
|
userInfoDao.updateNewUserFlagWm(userId);
|
|
|
return Result.success();
|