|
@@ -13,9 +13,10 @@ import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.company.service.impl.CompanyDeptServiceImpl;
|
|
import com.fs.company.service.impl.CompanyDeptServiceImpl;
|
|
|
|
|
+import com.fs.course.param.FsCourseWatchLogListParam;
|
|
|
import com.fs.course.param.FsUserCourseListUParam;
|
|
import com.fs.course.param.FsUserCourseListUParam;
|
|
|
-import com.fs.course.service.IFsUserCompanyBindService;
|
|
|
|
|
-import com.fs.course.service.IFsUserCourseStudyService;
|
|
|
|
|
|
|
+import com.fs.course.service.*;
|
|
|
|
|
+import com.fs.course.vo.FsCourseWatchLogListVO;
|
|
|
import com.fs.course.vo.FsUserCourseStudyListUVO;
|
|
import com.fs.course.vo.FsUserCourseStudyListUVO;
|
|
|
import com.fs.course.vo.UserWatchLogListVo;
|
|
import com.fs.course.vo.UserWatchLogListVo;
|
|
|
import com.fs.crm.param.CrmMyCustomerListQueryParam;
|
|
import com.fs.crm.param.CrmMyCustomerListQueryParam;
|
|
@@ -718,7 +719,78 @@ public class QwExternalContactController extends BaseController
|
|
|
return R.ok("正在批量修改备注中");
|
|
return R.ok("正在批量修改备注中");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * copy批量修改备注方法,该方法提供给我的看课记录里面使用
|
|
|
|
|
+ * @param param
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @throws JSONException
|
|
|
|
|
+ */
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('qw:externalContact:edit')")
|
|
|
|
|
+ @Log(title = "批量修改备注", businessType = BusinessType.UPDATE)
|
|
|
|
|
+ @PostMapping("/batchUpdateExternalContactNotesByWatchLog")
|
|
|
|
|
+ public R batchUpdateExternalContactNotesByWatchLog(@RequestBody QwExternalContactUpdateNoteParam param) throws JSONException {
|
|
|
|
|
+ if(param.isFilter()){
|
|
|
|
|
+ param.setWatchLogIds(getWatchLogIds(param.getFromMyList(), param.getWatchLogParam()));
|
|
|
|
|
+ }
|
|
|
|
|
+ //查询
|
|
|
|
|
+ if(null != param.getWatchLogIds() && !param.getWatchLogIds().isEmpty()){
|
|
|
|
|
+ param.setUserIds(getUserIdsByWatchLogIds(param.getWatchLogIds()));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(param.getUserIds() == null || param.getUserIds().isEmpty()){
|
|
|
|
|
+ return R.error("修改用户为空");
|
|
|
|
|
+ }
|
|
|
|
|
+ qwUserServiceAsyncHelper.batchUpdateExternalContactNotes(param);
|
|
|
|
|
+ return R.ok("正在批量修改备注中");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFsUserCoursePeriodService userCoursePeriodService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFsUserCoursePeriodDaysService userCoursePeriodDaysService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IFsCourseWatchLogService fsCourseWatchLogService;
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 用于适配看课批量修改标签【根据过滤条件版】
|
|
|
|
|
+ * @param fromMyList
|
|
|
|
|
+ * @param watchLogParam
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ private List<Long> getWatchLogIds(Integer fromMyList,FsCourseWatchLogListParam watchLogParam){
|
|
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
+ if(Integer.valueOf(0).equals(fromMyList)){
|
|
|
|
|
+ watchLogParam.setCompanyId( loginUser.getCompany().getCompanyId());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ watchLogParam.setCompanyUserId( loginUser.getUser().getUserId());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (watchLogParam.getSendType()==1&& watchLogParam.getPeriodETime()!=null && watchLogParam.getPeriodSTime()!=null) {
|
|
|
|
|
+ List<Long> periodIds = userCoursePeriodDaysService.selectFsUserCoursePeriodDaysByTime(watchLogParam.getPeriodSTime(), watchLogParam.getPeriodETime());
|
|
|
|
|
+
|
|
|
|
|
+ if (!periodIds.isEmpty()){
|
|
|
|
|
+ List<Long> longs = userCoursePeriodService.selectFsUserCoursePeriodListByPeriodId(periodIds, loginUser.getCompany().getCompanyId());
|
|
|
|
|
+ if (!longs.isEmpty()){
|
|
|
|
|
+ watchLogParam.setPeriodIds(longs);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ return new ArrayList<>();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ List<FsCourseWatchLogListVO> list = fsCourseWatchLogService.selectFsCourseWatchLogListVO(watchLogParam);
|
|
|
|
|
+ List<Long> collect = list.stream().map(FsCourseWatchLogListVO::getLogId).collect(Collectors.toList());
|
|
|
|
|
+ return collect;
|
|
|
|
|
+ }
|
|
|
|
|
+ private List<Long> getUserIdsByWatchLogIds(List<Long> watchLogIds){
|
|
|
|
|
+ List<Long> exContactIdsIdsByWatchLogIds = fsCourseWatchLogService.getExContactIdsIdsByWatchLogIds(watchLogIds);
|
|
|
|
|
+ Set<Long> set = new HashSet<>(exContactIdsIdsByWatchLogIds);
|
|
|
|
|
+ return new ArrayList<>(set);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
private List<Long> getList(Integer addType, QwExternalContactParam param){
|
|
private List<Long> getList(Integer addType, QwExternalContactParam param){
|
|
|
if(addType == null){
|
|
if(addType == null){
|