Commit 356fe707 authored by chenhao's avatar chenhao

修改bug 2472

parent 12dd8fae
...@@ -37,7 +37,7 @@ public interface IDutyCommonService { ...@@ -37,7 +37,7 @@ public interface IDutyCommonService {
* @param endDate 结束日期 * @param endDate 结束日期
* @return ResponseModel * @return ResponseModel
*/ */
List<Map<String, Object>> list(String beginDate, String endDate) throws ParseException; List<Map<String, Object>> list(Long teamId,String beginDate, String endDate) throws ParseException;
/** /**
* 获取表单参数 * 获取表单参数
......
...@@ -141,14 +141,16 @@ public interface IOrgUsrService { ...@@ -141,14 +141,16 @@ public interface IOrgUsrService {
List<Map<String, Object>> selectForShowByListId(List<Long> ids) throws Exception; List<Map<String, Object>> selectForShowByListId(List<Long> ids) throws Exception;
/** /**
* * @param null * * @param null
* *
* @return <PRE> * @return
*
* <PRE>
* author tw * author tw
* date 2021/7/20 * date 2021/7/20
* </PRE> * </PRE>
*
* 列表 * 列表
*/ */
List<CompanyDto> listContractDto(Integer pageNum, Integer pageSize, RequestData requestData); List<CompanyDto> listContractDto(Integer pageNum, Integer pageSize, RequestData requestData);
...@@ -156,10 +158,13 @@ public interface IOrgUsrService { ...@@ -156,10 +158,13 @@ public interface IOrgUsrService {
/** /**
* * @param null * * @param null
* *
* @return <PRE> * @return
*
* <PRE>
* author tw * author tw
* date 2021/7/20 * date 2021/7/20
* </PRE> * </PRE>
*
* 统计 * 统计
*/ */
Integer listContractDtoCount(RequestData par); Integer listContractDtoCount(RequestData par);
...@@ -167,7 +172,9 @@ public interface IOrgUsrService { ...@@ -167,7 +172,9 @@ public interface IOrgUsrService {
/** /**
* * @param null * * @param null
* *
* @return <PRE> * @return
*
* <PRE>
* author tw * author tw
* date 2021/7/26 * date 2021/7/26
* </PRE> * </PRE>
...@@ -186,7 +193,7 @@ public interface IOrgUsrService { ...@@ -186,7 +193,7 @@ public interface IOrgUsrService {
/** /**
* 根据登陆人获取公司部门人员树 * 根据登陆人获取公司部门人员树
*/ */
List<OrgMenuDto> companyUserTreeByUser (AgencyUserModel user); List<OrgMenuDto> companyUserTreeByUser(AgencyUserModel user);
/** /**
* 根据登陆人获取公司部门树 * 根据登陆人获取公司部门树
...@@ -198,4 +205,6 @@ public interface IOrgUsrService { ...@@ -198,4 +205,6 @@ public interface IOrgUsrService {
*/ */
List<OrgUsrTreeDto> companyListByUser(AgencyUserModel user); List<OrgUsrTreeDto> companyListByUser(AgencyUserModel user);
List<OrgUsr> getPersonListByParentId(Long id);
} }
...@@ -61,8 +61,9 @@ public class DutyPersonController extends BaseController { ...@@ -61,8 +61,9 @@ public class DutyPersonController extends BaseController {
@GetMapping(value = "/list") @GetMapping(value = "/list")
@ApiOperation(httpMethod = "GET", value = "值班列表视图-不分页", notes = "值班列表视图-不分页") @ApiOperation(httpMethod = "GET", value = "值班列表视图-不分页", notes = "值班列表视图-不分页")
public ResponseModel list(@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate, public ResponseModel list(@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException { @ApiParam(value = "结束日期", required = true) @RequestParam String endDate,
return ResponseHelper.buildResponse(iDutyPersonService.list(beginDate, endDate)); @RequestParam(required = false) Long teamId) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.list(teamId,beginDate, endDate));
} }
......
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.common.api.dto.CompanyPerson;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonShiftDto;
...@@ -14,6 +15,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift; ...@@ -14,6 +15,7 @@ import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
import com.yeejoin.amos.boot.module.common.api.entity.DutyShift; import com.yeejoin.amos.boot.module.common.api.entity.DutyShift;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.enums.DutyViewTypeEnum; import com.yeejoin.amos.boot.module.common.api.enums.DutyViewTypeEnum;
import com.yeejoin.amos.boot.module.common.api.service.IDutyCommonService; import com.yeejoin.amos.boot.module.common.api.service.IDutyCommonService;
...@@ -70,10 +72,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -70,10 +72,10 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
*/ */
final int LIMIT_SHIFT_NUMBER = 2; final int LIMIT_SHIFT_NUMBER = 2;
@Override @Override
public IPage<Map<String, Object>> pageList(int current, int size, String beginDate, String endDate) throws ParseException { public IPage<Map<String, Object>> pageList(int current, int size, String beginDate, String endDate)
//1.已column为准 进行返回 throws ParseException {
// 1.已column为准 进行返回
String groupCode = this.getGroupCode(); String groupCode = this.getGroupCode();
IPage<Map<String, Object>> iPage = dynamicFormInstanceService.pageList(current, size, groupCode); IPage<Map<String, Object>> iPage = dynamicFormInstanceService.pageList(current, size, groupCode);
for (Map<String, Object> m : iPage.getRecords()) { for (Map<String, Object> m : iPage.getRecords()) {
...@@ -84,17 +86,18 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -84,17 +86,18 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException { private void fillDutyShiftData(String beginDate, String endDate, Map<String, Object> m) throws ParseException {
String instanceId = m.get("instanceId").toString(); String instanceId = m.get("instanceId").toString();
List<DutyShift> dutyShifts = List<DutyShift> dutyShifts = dutyShiftService.list(new LambdaQueryWrapper<DutyShift>()
dutyShiftService.list(new LambdaQueryWrapper<DutyShift>().eq(BaseEntity::getIsDelete, false).eq(DutyShift::getAppKey, RequestContext.getAppKey())); .eq(BaseEntity::getIsDelete, false).eq(DutyShift::getAppKey, RequestContext.getAppKey()));
Map<Long, DutyShift> keyNameMap = dutyShifts.stream().collect(Collectors.toMap(BaseEntity::getSequenceNbr, Map<Long, DutyShift> keyNameMap = dutyShifts.stream()
Function.identity())); .collect(Collectors.toMap(BaseEntity::getSequenceNbr, Function.identity()));
List<DutyPersonShiftDto> personShiftList = dutyPersonShiftService.list(new LambdaQueryWrapper<DutyPersonShift>() List<DutyPersonShiftDto> personShiftList = dutyPersonShiftService
.eq(DutyPersonShift::getInstanceId, instanceId) .list(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId, instanceId)
.ge(beginDate != null, DutyPersonShift::getDutyDate, beginDate) .ge(beginDate != null, DutyPersonShift::getDutyDate, beginDate)
.le(endDate != null, DutyPersonShift::getDutyDate, endDate)).stream().map(e -> { .le(endDate != null, DutyPersonShift::getDutyDate, endDate))
.stream().map(e -> {
DutyPersonShiftDto dto = new DutyPersonShiftDto(); DutyPersonShiftDto dto = new DutyPersonShiftDto();
Bean.copyExistPropertis(e, dto); Bean.copyExistPropertis(e, dto);
//没值班信息,默认休 // 没值班信息,默认休
DutyShift dutyShift = keyNameMap.get(e.getShiftId()); DutyShift dutyShift = keyNameMap.get(e.getShiftId());
dto.setShiftName(dutyShift != null ? dutyShift.getName() : "休"); dto.setShiftName(dutyShift != null ? dutyShift.getName() : "休");
dto.setColor(dutyShift != null ? dutyShift.getColor() : ""); dto.setColor(dutyShift != null ? dutyShift.getColor() : "");
...@@ -134,9 +137,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -134,9 +137,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
private DutyViewTypeEnum inferView(String beginDate, String endDate, String appKey) { private DutyViewTypeEnum inferView(String beginDate, String endDate, String appKey) {
Map<String, Long> result = dutyPersonShiftService.getBaseMapper().calMaxPersonAndShiftNum(beginDate, endDate, Map<String, Long> result = dutyPersonShiftService.getBaseMapper().calMaxPersonAndShiftNum(beginDate, endDate,
appKey, this.getGroupCode()); appKey, this.getGroupCode());
//计算班次最大执勤人数,时间区间内 // 计算班次最大执勤人数,时间区间内
Long maxDutyPersonNumDay = result.get("maxDutyPersonNumDay"); Long maxDutyPersonNumDay = result.get("maxDutyPersonNumDay");
//计算天的最大班次数量,时间区间内 // 计算天的最大班次数量,时间区间内
Long maxShiftNumDay = result.get("maxShiftNumDay"); Long maxShiftNumDay = result.get("maxShiftNumDay");
if (maxDutyPersonNumDay <= LIMIT_PERSON_NUMBER && maxShiftNumDay <= LIMIT_SHIFT_NUMBER) { if (maxDutyPersonNumDay <= LIMIT_PERSON_NUMBER && maxShiftNumDay <= LIMIT_SHIFT_NUMBER) {
return DutyViewTypeEnum.BANK; return DutyViewTypeEnum.BANK;
...@@ -146,14 +149,29 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -146,14 +149,29 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
} }
@Override @Override
public List<Map<String, Object>> list(String beginDate, String endDate) throws ParseException { public List<Map<String, Object>> list(Long teamId, String beginDate, String endDate) throws ParseException {
//1.已column为准 进行返回 // 1.已column为准 进行返回
String groupCode = this.getGroupCode(); String groupCode = this.getGroupCode();
List<Map<String, Object>> list = dynamicFormInstanceService.listAll(groupCode); List<Map<String, Object>> list = dynamicFormInstanceService.listAll(groupCode);
//2.组织值班数据
// 2.组织值班数据
for (Map<String, Object> map : list) { for (Map<String, Object> map : list) {
this.fillDutyShiftData(beginDate, endDate, map); this.fillDutyShiftData(beginDate, endDate, map);
} }
/*bug2472 添加根据部门id筛选数据的方法 陈浩 2021-08-21 开始 */
if(teamId!=null && teamId.intValue()!=0) {
List<OrgUsr> orgUsrList = orgUsrService.getPersonListByParentId(teamId);
List<Map<String, Object>> resultList= new ArrayList<Map<String, Object>>();
list.stream().forEach(i->{
orgUsrList.forEach(m->{
if(i.get("userId").toString().equals(m.getSequenceNbr().longValue()+"")) {
resultList.add(i);
}
});
});
return resultList;
}
/*bug2472 添加根据部门id筛选数据的方法 陈浩 2021-08-21 结束 */
return list; return list;
} }
...@@ -164,7 +182,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -164,7 +182,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Override @Override
public List downloadList(String beginDate, String endDate) throws ParseException { public List downloadList(String beginDate, String endDate) throws ParseException {
List<Map<String, Object>> maps = this.list(beginDate, endDate); List<Map<String, Object>> maps = this.list(null,beginDate, endDate);
JSONArray jsonArray = new JSONArray(); JSONArray jsonArray = new JSONArray();
jsonArray.addAll(maps); jsonArray.addAll(maps);
List<?> list = new ArrayList<>(); List<?> list = new ArrayList<>();
...@@ -183,53 +201,52 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -183,53 +201,52 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
List<DynamicFormInstance> formInstanceList = new ArrayList<>(); List<DynamicFormInstance> formInstanceList = new ArrayList<>();
Set<DutyPersonShift> dutyPersonShifts = new HashSet<>(); Set<DutyPersonShift> dutyPersonShifts = new HashSet<>();
dataList.forEach(d -> { dataList.forEach(d -> {
//TODO: 业务唯一索引,用户id // TODO: 业务唯一索引,用户id
String userId = d.get("userId").toString(); String userId = d.get("userId").toString();
List<DynamicFormInstance> instances = List<DynamicFormInstance> instances = dynamicFormInstanceService
dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>() .list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getFieldCode, "userId")
.eq(DynamicFormInstance::getFieldCode, "userId")
.eq(DynamicFormInstance::getFieldValue, userId) .eq(DynamicFormInstance::getFieldValue, userId)
.eq(DynamicFormInstance::getGroupCode, this.getGroupCode())); .eq(DynamicFormInstance::getGroupCode, this.getGroupCode()));
Long instanceId = null; Long instanceId = null;
List<DynamicFormColumn> columns = List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>()
dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, this.getGroupCode())); .eq(DynamicFormColumn::getGroupCode, this.getGroupCode()));
//1.组装动态表单数据 // 1.组装动态表单数据
if (!instances.isEmpty()) { if (!instances.isEmpty()) {
//0.定位instanceId,准备进行更新操作 // 0.定位instanceId,准备进行更新操作
instanceId = instances.get(0).getInstanceId(); instanceId = instances.get(0).getInstanceId();
//1.查询已有数据 // 1.查询已有数据
List<DynamicFormInstance> instancesInDb = List<DynamicFormInstance> instancesInDb = dynamicFormInstanceService
dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId)); .list(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId,
//2.list 转 map instanceId));
// 2.list 转 map
Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instancesInDb, "fieldCode", Map<Object, DynamicFormInstance> instanceMap = Bean.listToMap(instancesInDb, "fieldCode",
DynamicFormInstance.class); DynamicFormInstance.class);
//3.待更新数据组装,待批量入库 // 3.待更新数据组装,待批量入库
this.updateFormValue(formInstanceList, d, instanceId, columns, instanceMap); this.updateFormValue(formInstanceList, d, instanceId, columns, instanceMap);
} else { } else {
//0.新数据,生成id // 0.新数据,生成id
instanceId = sequence.nextId(); instanceId = sequence.nextId();
Long finalInstanceId1 = instanceId; Long finalInstanceId1 = instanceId;
//1.组装数据 // 1.组装数据
List<DynamicFormInstance> newInstances = columns.stream().map(column -> { List<DynamicFormInstance> newInstances = columns.stream().map(column -> {
DynamicFormInstance instance = new DynamicFormInstance(); DynamicFormInstance instance = new DynamicFormInstance();
buildFormInstanceData(finalInstanceId1, d, column, instance); buildFormInstanceData(finalInstanceId1, d, column, instance);
return instance; return instance;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
//2.待更新数据组装,待批量入库 // 2.待更新数据组装,待批量入库
formInstanceList.addAll(newInstances); formInstanceList.addAll(newInstances);
} }
//2.组装值班数据 // 2.组装值班数据
List<DutyPersonShiftDto> shiftDtos = (List<DutyPersonShiftDto>) d.get("dutyShift"); List<DutyPersonShiftDto> shiftDtos = (List<DutyPersonShiftDto>) d.get("dutyShift");
Long finalInstanceId = instanceId; Long finalInstanceId = instanceId;
//按照业务唯一索引查询主键 // 按照业务唯一索引查询主键
List<DutyPersonShift> dutyPersonShiftsDb = List<DutyPersonShift> dutyPersonShiftsDb = dutyPersonShiftService
dutyPersonShiftService.list(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId, instanceId)); .list(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId, instanceId));
Map<Date, Long> dutyPersonShiftMap = Map<Date, Long> dutyPersonShiftMap = dutyPersonShiftsDb.stream()
dutyPersonShiftsDb.stream().collect(Collectors.toMap(DutyPersonShift::getDutyDate, .collect(Collectors.toMap(DutyPersonShift::getDutyDate, DutyPersonShift::getSequenceNbr));
DutyPersonShift::getSequenceNbr)); // todo: 只更新当天及值班之后数据
//todo: 只更新当天及值班之后数据 Set<DutyPersonShift> needToDb = shiftDtos.stream()
Set<DutyPersonShift> needToDb = shiftDtos.stream().filter(s -> DateUtils.dateCompare(s.getDutyDate(), .filter(s -> DateUtils.dateCompare(s.getDutyDate(), new Date()) >= 0).map(shiftDto -> {
new Date()) >= 0).map(shiftDto -> {
DutyPersonShift dutyPersonShift = new DutyPersonShift(); DutyPersonShift dutyPersonShift = new DutyPersonShift();
Bean.copyExistPropertis(shiftDto, dutyPersonShift); Bean.copyExistPropertis(shiftDto, dutyPersonShift);
dutyPersonShift.setInstanceId(finalInstanceId); dutyPersonShift.setInstanceId(finalInstanceId);
...@@ -252,11 +269,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -252,11 +269,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
for (DynamicFormColumn column : columns) { for (DynamicFormColumn column : columns) {
DynamicFormInstance formInstance = instanceMap.get(column.getFieldCode()); DynamicFormInstance formInstance = instanceMap.get(column.getFieldCode());
if (!ObjectUtils.isEmpty(formInstance)) { if (!ObjectUtils.isEmpty(formInstance)) {
//有的更新 // 有的更新
formInstance.setFieldValue(d.get(column.getFieldCode()) != null ? formInstance.setFieldValue(
d.get(column.getFieldCode()).toString() : ""); d.get(column.getFieldCode()) != null ? d.get(column.getFieldCode()).toString() : "");
} else { } else {
//没有的新增 // 没有的新增
formInstance = new DynamicFormInstance(); formInstance = new DynamicFormInstance();
buildFormInstanceData(instanceId, d, column, formInstance); buildFormInstanceData(instanceId, d, column, formInstance);
} }
...@@ -276,15 +293,16 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -276,15 +293,16 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
formInstance.setInstanceId(instanceId); formInstance.setInstanceId(instanceId);
formInstance.setSequenceNbr(l); formInstance.setSequenceNbr(l);
formInstance.setFormColumnId(column.getSequenceNbr()); formInstance.setFormColumnId(column.getSequenceNbr());
formInstance.setFieldValue(map.get(column.getFieldCode()) != null ? formInstance
map.get(column.getFieldCode()).toString() : ""); .setFieldValue(map.get(column.getFieldCode()) != null ? map.get(column.getFieldCode()).toString() : "");
} }
@Override @Override
public Boolean deleteDutyData(Long instanceId) { public Boolean deleteDutyData(Long instanceId) {
dynamicFormInstanceService.remove(new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId)); dynamicFormInstanceService.remove(
dutyPersonShiftService.remove(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId, new LambdaQueryWrapper<DynamicFormInstance>().eq(DynamicFormInstance::getInstanceId, instanceId));
instanceId)); dutyPersonShiftService
.remove(new LambdaQueryWrapper<DutyPersonShift>().eq(DutyPersonShift::getInstanceId, instanceId));
return true; return true;
} }
...@@ -293,8 +311,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -293,8 +311,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
String groupCode = this.getGroupCode(); String groupCode = this.getGroupCode();
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("postType", postType); params.put("postType", postType);
List<DynamicFormColumn> columns = List<DynamicFormColumn> columns = dynamicFormColumnService
dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode)); .list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class); Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
return dynamicFormInstanceService.getBaseMapper().listOneDayDutyPerson(dutyDay, shiftId, fieldCodes, return dynamicFormInstanceService.getBaseMapper().listOneDayDutyPerson(dutyDay, shiftId, fieldCodes,
RequestContext.getAppKey(), groupCode, params); RequestContext.getAppKey(), groupCode, params);
...@@ -309,11 +327,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -309,11 +327,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
String shiftIds = StringUtils.join(shiftIdList.toArray(), ","); String shiftIds = StringUtils.join(shiftIdList.toArray(), ",");
String dutyDay = now.toString("yyyy-MM-dd"); String dutyDay = now.toString("yyyy-MM-dd");
// 获取当前值班人员 // 获取当前值班人员
List<DynamicFormColumn> columns = List<DynamicFormColumn> columns = dynamicFormColumnService
dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode)); .list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class); Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
List<Map<String, Object>> maps = dynamicFormInstanceService.getBaseMapper().listOnDutyPerson(dutyDay, List<Map<String, Object>> maps = dynamicFormInstanceService.getBaseMapper().listOnDutyPerson(dutyDay, shiftIds,
shiftIds, fieldCodes, groupCode); fieldCodes, groupCode);
// 获取人员照片和电话 // 获取人员照片和电话
List<Long> ids = new ArrayList<>(); List<Long> ids = new ArrayList<>();
maps.forEach(item -> ids.add(Long.valueOf(String.valueOf(item.get("userId"))))); maps.forEach(item -> ids.add(Long.valueOf(String.valueOf(item.get("userId")))));
...@@ -351,7 +369,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -351,7 +369,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
Integer endMinute = Integer.valueOf(endTime[1]); Integer endMinute = Integer.valueOf(endTime[1]);
if ("当日".equals(start[0])) { if ("当日".equals(start[0])) {
if (hour > startHour || hour == startHour && minute > startMinute) { if (hour > startHour || hour == startHour && minute > startMinute) {
if ("次日".equals(end[0]) || "当日".equals(end[0]) && (hour < endHour || hour == endHour && minute < endMinute)) { if ("次日".equals(end[0])
|| "当日".equals(end[0]) && (hour < endHour || hour == endHour && minute < endMinute)) {
shiftIds.add(item.getSequenceNbr()); shiftIds.add(item.getSequenceNbr());
} }
} }
......
...@@ -20,6 +20,9 @@ import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService; ...@@ -20,6 +20,9 @@ import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.RoleModel; import com.yeejoin.amos.feign.privilege.model.RoleModel;
import net.bytebuddy.asm.Advice.This;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -1294,6 +1297,22 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1294,6 +1297,22 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return pid; return pid;
} }
/**
* 查询组织机构下面的人员信息
* @param id
* @return
*/
public List<OrgUsr> getPersonListByParentId(Long id) {
LambdaQueryWrapper<OrgUsr> wrapper = new LambdaQueryWrapper<OrgUsr>();
wrapper.eq(OrgUsr::getIsDelete, false);
wrapper.eq(OrgUsr::getParentId,id);
wrapper.eq(OrgUsr::getBizOrgType, OrgPersonEnum.人员.getKey());
return this.baseMapper.selectList(wrapper);
}
} }
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