|
|
@@ -9,6 +9,7 @@ import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.common.exception.CustomException;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
+import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
import com.fs.course.domain.FsUserCoursePeriod;
|
|
|
import com.fs.course.domain.FsUserCoursePeriodDays;
|
|
|
@@ -30,6 +31,8 @@ import com.fs.framework.service.TokenService;
|
|
|
import com.fs.his.vo.OptionsVO;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import com.hc.openapi.tool.fastjson.JSON;
|
|
|
+import com.hc.openapi.tool.fastjson.JSONObject;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -83,6 +86,19 @@ public class FsUserCoursePeriodController extends BaseController {
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
fsUserCoursePeriod.setCompanyIdList(Collections.singletonList(loginUser.getCompany().getCompanyId()));
|
|
|
List<FsUserCoursePeriodVO> list = fsUserCoursePeriodService.selectFsUserCoursePeriodPage(fsUserCoursePeriod);
|
|
|
+ Long currentCompanyId = loginUser.getCompany().getCompanyId();
|
|
|
+ for (FsUserCoursePeriodVO vo : list) {
|
|
|
+ String isNeedRegisterMember = vo.getIsNeedRegisterMember();
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(isNeedRegisterMember)) {
|
|
|
+ boolean containsCurrentCompany = Arrays.stream(isNeedRegisterMember.split(","))
|
|
|
+ .map(String::trim)
|
|
|
+ .anyMatch(id -> id.equals(String.valueOf(currentCompanyId)));
|
|
|
+ vo.setIsNeedRegisterMember(containsCurrentCompany ? "1" : "0");
|
|
|
+ } else {
|
|
|
+ vo.setIsNeedRegisterMember("0");
|
|
|
+ }
|
|
|
+ }
|
|
|
PageInfo<FsUserCoursePeriodVO> pageInfo = new PageInfo<>(list);
|
|
|
Map<String, Object> result = new HashMap<>();
|
|
|
result.put("rows", pageInfo.getList());
|
|
|
@@ -145,6 +161,25 @@ public class FsUserCoursePeriodController extends BaseController {
|
|
|
return toAjax(fsUserCoursePeriodService.updateFsUserCoursePeriod(fsUserCoursePeriod));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改会员营期单独注册状态
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('course:period:edit')")
|
|
|
+ @Log(title = "会员营期", businessType = BusinessType.UPDATE)
|
|
|
+ @PutMapping("/editIsNeedRegisterMember")
|
|
|
+ public AjaxResult editIsNeedRegisterMember(@RequestBody FsUserCoursePeriod fsUserCoursePeriod)
|
|
|
+ {
|
|
|
+ FsUserCoursePeriod fsUserCoursePeriod1 = fsUserCoursePeriodService.selectFsUserCoursePeriodById(fsUserCoursePeriod.getPeriodId());
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
+ if (ObjectUtil.isEmpty(fsUserCoursePeriod.getIsNeedRegisterMember())){
|
|
|
+ throw new CustomException("修改失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ return toAjax(fsUserCoursePeriodService.editIsNeedRegisterMember(fsUserCoursePeriod,loginUser.getCompany().getCompanyId().toString()));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 删除会员营期
|
|
|
*/
|