Commit 719b5c94 authored by zhangqingle's avatar zhangqingle

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

parents 41f86373 ba6f7abc
......@@ -375,16 +375,18 @@ public class BChapterServiceImpl implements BChapterService {
for (BRStudentChapter studentChapter: brStudentChapterList){
double learnProgress = Double.parseDouble(lessonPerson.getLearnProgress().split("%")[0]) / 100 ;
double newLearnProgress = Double.parseDouble(numberFormat.format((float) (learnProgress * Integer.parseInt(bLesson.getClassHour()) - studentChapter.getProgress()) / Float.parseFloat(bLesson.getClassHour())));
if (learnProgress > 0 && newLearnProgress < 0.01){
newLearnProgress = 0.01;
if (newLearnProgress == 0){
lessonPerson.setIsFinish("0");
lessonPerson.setFinishDate(null);
}
if (newLearnProgress < 1){
if (0 < newLearnProgress && newLearnProgress < 1){
lessonPerson.setIsFinish("1");
lessonPerson.setFinishDate(null);
}
lessonPerson.setLearnProgress(newLearnProgress*100 + "%");
bLessonPersonRepository.updateByPrimaryKeySelective(lessonPerson);
studentChapter.setProgress(0);
studentChapter.setCurrentLocation(0);
brStudentChapterRepository.updateById(studentChapter);
}
}
......
......@@ -25,12 +25,13 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
"LEFT JOIN s_r_user_role AS ru ON su.business_id = ru.user_id " +
"LEFT JOIN tm_admin_role AS sr ON sr.r_id = ru.role_id " +
"WHERE su.del_flag = 0 " +
"and su.corp_id = #{corpId} " +
"<if test=\"name!=null and name != ''\"> and su.name like CONCAT('%',#{name},'%') </if>" +
"<if test=\"roleName!=null and roleName != ''\"> and sr.r_name = #{roleName}</if>" +
"<if test=\"dept!=null and dept != ''\"> and su.business_id in ( ${dept} )</if>" +
"<if test=\"userIds!=null and userIds.size() > 0 \"> " +
" and su.business_id in <foreach item='item' index='index' collection='userIds' open='(' separator=',' close=')'> #{item} </foreach>" +
"</if>" +
"<if test=\"flag!=null and flag != ''\"> and su.flag = #{flag}</if></script>")
@ResultMap(value = "BaseResultMap")
List<SysUser> queryUsers(QuerySysUserDTO dto);
......
......@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import java.util.List;
@Data
public class QuerySysUserDTO {
......@@ -19,7 +21,10 @@ public class QuerySysUserDTO {
@ApiModelProperty(value = "企业id")
private String corpId;
@ApiModelProperty(value = "部门(暂时不用)")
@ApiModelProperty(value = "部门")
private String dept;
@ApiModelProperty(value = "部门下的人")
private List<String> userIds;
}
......@@ -81,15 +81,7 @@ public class SysUserServiceImpl implements SysUserService {
deptIds.add(dto.getDept());
Set<String> deptSets = new HashSet<String>(deptIds);
List<String> data = mtCotactApiRequestClient.getSubUserIdsByDeptIds(dto.getCorpId(), deptSets);
if(data != null ){
for (String uid : data) {
stringBuffer.append(uid+",");
}
if (!stringBuffer.toString().equals("")) {
ids = stringBuffer.toString().substring(0, stringBuffer.toString().length() - 1);
}
dto.setDept(ids);
}
dto.setUserIds(data);
}
//step2:先查出符合条件的所有人
List<SysUser> users = sysUserMapper.queryUsers(dto);
......
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