|
@@ -13,6 +13,7 @@ import com.cyksj.common.util.Jsons;
|
|
|
import com.cyksj.common.util.StringUtil;
|
|
import com.cyksj.common.util.StringUtil;
|
|
|
import com.cyksj.mapper.AccountMapper;
|
|
import com.cyksj.mapper.AccountMapper;
|
|
|
import com.cyksj.mapper.AccountUpdatePasswordRecordMapper;
|
|
import com.cyksj.mapper.AccountUpdatePasswordRecordMapper;
|
|
|
|
|
+import com.cyksj.mapper.SysEmailMapper;
|
|
|
import com.cyksj.mapper.manage.AutoUpdateAccountPwdLogMapper;
|
|
import com.cyksj.mapper.manage.AutoUpdateAccountPwdLogMapper;
|
|
|
import com.cyksj.mapper.manage.cms.CmsUserMapper;
|
|
import com.cyksj.mapper.manage.cms.CmsUserMapper;
|
|
|
import com.cyksj.model.entity.*;
|
|
import com.cyksj.model.entity.*;
|
|
@@ -33,7 +34,9 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
+import java.io.*;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -62,6 +65,8 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
|
|
|
|
|
|
|
|
private final SysConfigService sysConfigService;
|
|
private final SysConfigService sysConfigService;
|
|
|
|
|
|
|
|
|
|
+ private final SysEmailMapper sysEmailMapper;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public IPage<ExpiredAccountDataView> getExpiredAccountView(Boolean isCorpWx, String customerService, Long goodsId, Long skuId, String account, Boolean renewStatus, Boolean handleStatus, String cnAccount, String usAccount, Integer userId, String startTime, String endTime, String now, Long offset, Long limit) {
|
|
public IPage<ExpiredAccountDataView> getExpiredAccountView(Boolean isCorpWx, String customerService, Long goodsId, Long skuId, String account, Boolean renewStatus, Boolean handleStatus, String cnAccount, String usAccount, Integer userId, String startTime, String endTime, String now, Long offset, Long limit) {
|
|
|
return accountMapper.getExpiredAccountView(isCorpWx, customerService, goodsId, skuId, account, renewStatus, handleStatus, cnAccount, usAccount, userId, startTime, endTime, now, new Page<>(offset, limit));
|
|
return accountMapper.getExpiredAccountView(isCorpWx, customerService, goodsId, skuId, account, renewStatus, handleStatus, cnAccount, usAccount, userId, startTime, endTime, now, new Page<>(offset, limit));
|
|
@@ -185,6 +190,40 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
|
|
|
insertAccount(goodsId, skuId, accountList);
|
|
insertAccount(goodsId, skuId, accountList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void readFileAndImportEmail(MultipartFile file) throws Exception {
|
|
|
|
|
+ InputStream in = null;
|
|
|
|
|
+ BufferedReader br = null;
|
|
|
|
|
+ String regex = "----";
|
|
|
|
|
+ List<SysEmail> sysEmails = new ArrayList<>();
|
|
|
|
|
+ try {
|
|
|
|
|
+ in = file.getInputStream();
|
|
|
|
|
+ br = new BufferedReader(new InputStreamReader(file.getInputStream()));
|
|
|
|
|
+ String content = null;
|
|
|
|
|
+ while ((content = br.readLine()) != null) {
|
|
|
|
|
+ String[] split = content.split(regex);
|
|
|
|
|
+ String email = split[0];
|
|
|
|
|
+ String password = split[1];
|
|
|
|
|
+ SysEmail sysEmail = new SysEmail();
|
|
|
|
|
+ sysEmail.setEmail(email);
|
|
|
|
|
+ sysEmail.setPassword(password);
|
|
|
|
|
+ sysEmails.add(sysEmail);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (CollUtil.isNotEmpty(sysEmails)) {
|
|
|
|
|
+ Lists.partition(sysEmails, 1000).forEach(data->{
|
|
|
|
|
+ sysEmailMapper.batchInsert(data);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ if (br != null) {
|
|
|
|
|
+ br.close();
|
|
|
|
|
+ }
|
|
|
|
|
+ if (in != null) {
|
|
|
|
|
+ in.close();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
*
|
|
*
|
|
|
* @param goodsId
|
|
* @param goodsId
|