Commit 73cb6993 authored by zhangqingle's avatar zhangqingle

Merge remote-tracking branch 'origin/meiteng' into meiteng

parents 57c0092f 4ea9df43
...@@ -15,8 +15,8 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; ...@@ -15,8 +15,8 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
/** /**
* Created by lcy on 17/8/9. * Created by lcy on 17/8/9.
*/ */
@EnableDiscoveryClient //@EnableDiscoveryClient
//@EnableEurekaClient @EnableEurekaClient
@EnableFeignClients @EnableFeignClients
@SpringBootApplication @SpringBootApplication
@EnableTransactionManagement @EnableTransactionManagement
......
...@@ -12,11 +12,11 @@ public class AddOrUpdateDTO { ...@@ -12,11 +12,11 @@ public class AddOrUpdateDTO {
@ApiModelProperty(value = "BannerId" ,required = false, dataType = "varchar") @ApiModelProperty(value = "BannerId" ,required = false, dataType = "varchar")
private String businessId; private String businessId;
@NotBlank @NotBlank(message = "标题不能为空")
@ApiModelProperty(value = "标题" ,required = true, dataType = "varchar") @ApiModelProperty(value = "标题" ,required = true, dataType = "varchar")
private String title; private String title;
@NotBlank @NotBlank(message = "图片未上传")
@ApiModelProperty(value = "图片地址",required = true, dataType = "varchar") @ApiModelProperty(value = "图片地址",required = true, dataType = "varchar")
private String imageUrl; private String imageUrl;
......
...@@ -118,6 +118,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService { ...@@ -118,6 +118,7 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
@Override @Override
public PersistModel addMyLearnLesson(AddMyLearnLessonDTO addMyLearnLessonDTO) { public PersistModel addMyLearnLesson(AddMyLearnLessonDTO addMyLearnLessonDTO) {
List<BLessonPerson> bLessonPersons = bLessonPersonRepository.selectByPersonAndLesson(addMyLearnLessonDTO); List<BLessonPerson> bLessonPersons = bLessonPersonRepository.selectByPersonAndLesson(addMyLearnLessonDTO);
BLessonPerson bLessonPerson; BLessonPerson bLessonPerson;
int line = 0; int line = 0;
...@@ -136,6 +137,8 @@ public class BLessonPersonServiceImpl implements BLessonPersonService { ...@@ -136,6 +137,8 @@ public class BLessonPersonServiceImpl implements BLessonPersonService {
line = bLessonPersonRepository.insertBLessonPerson(bLessonPerson); line = bLessonPersonRepository.insertBLessonPerson(bLessonPerson);
//课程在学人数+1 //课程在学人数+1
bLessonRepository.personNumberPlusOne(addMyLearnLessonDTO.getLessonId()); bLessonRepository.personNumberPlusOne(addMyLearnLessonDTO.getLessonId());
}else if (bLessonPersons != null && bLessonPersons.size()>0){
line = 1;
} }
return new PersistModel(line); return new PersistModel(line);
} }
......
...@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiImplicitParams; ...@@ -8,6 +8,7 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.rcisoft.business.brstudentchapter.dto.BRStudentChapterDto; import org.rcisoft.business.brstudentchapter.dto.BRStudentChapterDto;
import org.rcisoft.common.controller.PaginationController; import org.rcisoft.common.controller.PaginationController;
import org.rcisoft.sys.user.bean.CurUser;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -41,7 +42,8 @@ public class BRStudentChapterController extends PaginationController<BRStudentCh ...@@ -41,7 +42,8 @@ public class BRStudentChapterController extends PaginationController<BRStudentCh
@ApiOperation(value="1201 添加/更新学生端观看章节进度", notes="添加/更新") @ApiOperation(value="1201 添加/更新学生端观看章节进度", notes="添加/更新")
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")}) //@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result addOrUpdate(@Valid BRStudentChapterDto brStudentChapterDto, BindingResult bindingResult) { public Result addOrUpdate(CurUser curUser, @Valid BRStudentChapterDto brStudentChapterDto, BindingResult bindingResult) {
brStudentChapterDto.setStudentId(curUser.getUserId());
PersistModel data = bRStudentChapterServiceImpl.save(brStudentChapterDto); PersistModel data = bRStudentChapterServiceImpl.save(brStudentChapterDto);
return Result.builder(data, return Result.builder(data,
MessageConstant.MESSAGE_ALERT_SUCCESS, MessageConstant.MESSAGE_ALERT_SUCCESS,
......
...@@ -61,10 +61,10 @@ public class ValidatedResult implements Serializable{ ...@@ -61,10 +61,10 @@ public class ValidatedResult implements Serializable{
while(var3.hasNext()) { while(var3.hasNext()) {
FieldError fieldError = (FieldError)var3.next(); FieldError fieldError = (FieldError)var3.next();
this.errorsMap.put(fieldError.getField(), new String[]{fieldError.getDefaultMessage(), fieldError.getCode()}); this.errorsMap.put(" ",new String[]{fieldError.getDefaultMessage()});
// this.errorsMap.put(fieldError.getField(), new String[]{fieldError.getDefaultMessage(), fieldError.getCode()});
} }
} }
return this.errorsMap; return this.errorsMap;
} }
......
...@@ -65,21 +65,23 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -65,21 +65,23 @@ public class SysUserServiceImpl implements SysUserService {
mtUserGetsReqDTO.setIds(list); mtUserGetsReqDTO.setIds(list);
List<MTUserInfoRspDTO> depart = mtCotactApiRequestClient.userGets(mtUserGetsReqDTO); List<MTUserInfoRspDTO> depart = mtCotactApiRequestClient.userGets(mtUserGetsReqDTO);
StringBuffer sb = new StringBuffer(); if (depart!=null) {
String position = ""; StringBuffer sb = new StringBuffer();
for (SysUser sysUser : users) { String position = "";
for (MTUserInfoRspDTO mtUserInfoRspDTO : depart) { for (SysUser sysUser : users) {
if (sysUser.getBusinessId().equals(mtUserInfoRspDTO.getId())) { for (MTUserInfoRspDTO mtUserInfoRspDTO : depart) {
for (MTUserInfoRspDTO.DeptsBean deptsBean : mtUserInfoRspDTO.getDepts()) { if (sysUser.getBusinessId().equals(mtUserInfoRspDTO.getId())) {
for (MTUserInfoRspDTO.DeptsBean.PathBean pathBean : deptsBean.getPath()) { for (MTUserInfoRspDTO.DeptsBean deptsBean : mtUserInfoRspDTO.getDepts()) {
if (null != pathBean) for (MTUserInfoRspDTO.DeptsBean.PathBean pathBean : deptsBean.getPath()) {
sb.append(pathBean.getName() + "-"); if (null != pathBean)
sb.append(pathBean.getName() + "-");
}
position = deptsBean.getPosition() == null ? "" : String.valueOf(deptsBean.getPosition());
} }
position = deptsBean.getPosition() == null ? "" : String.valueOf(deptsBean.getPosition()); sysUser.setDepart(sb.toString().substring(0, sb.toString().length() - 1));
sb = new StringBuffer();
sysUser.setPosition(position);
} }
sysUser.setDepart(sb.toString().substring(0, sb.toString().length() - 1));
sb = new StringBuffer();
sysUser.setPosition(position);
} }
} }
} }
...@@ -281,14 +283,15 @@ public class SysUserServiceImpl implements SysUserService { ...@@ -281,14 +283,15 @@ public class SysUserServiceImpl implements SysUserService {
} }
String updateTime = df.format(synchronizationTime.getSynchronizationTime()); String updateTime = df.format(synchronizationTime.getSynchronizationTime());
List<GetAllRspDTO> userGetRspDTOList = mtCotactApiRequestClient.accountGetMyInfoList(corpId, updateTime); List<GetAllRspDTO> userGetRspDTOList = mtCotactApiRequestClient.accountGetMyInfoList(corpId, updateTime);
if (null == userGetRspDTOList) { // if (null == userGetRspDTOList) {
throw new ServiceException(ResultServiceEnums.ZX_FAILED); // throw new ServiceException(ResultServiceEnums.ZX_FAILED);
} // }
List<SysUser> personnelsList = new ArrayList<>(); List<SysUser> personnelsList = new ArrayList<>();
int line = 0; int line = 0;
if (null != userGetRspDTOList) { if (null != userGetRspDTOList) {
for (GetAllRspDTO userInfo : userGetRspDTOList) { for (GetAllRspDTO userInfo : userGetRspDTOList) {
SysUser personnels = new SysUser(); SysUser personnels = new SysUser();
UserUtil.setCurrentPersistOperation(personnels);
personnels.setCorpId(corpId); personnels.setCorpId(corpId);
personnels.setBusinessId(userInfo.getId()); //id personnels.setBusinessId(userInfo.getId()); //id
personnels.setName(userInfo.getName()); //姓名 personnels.setName(userInfo.getName()); //姓名
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment