Commit ed516db8 authored by cq990612's avatar cq990612

优化代码结构

parent d98fba71
......@@ -55,9 +55,8 @@
</if>
)
</if>
</where>
ORDER BY oc.work_day desc
ORDER BY oc.change_date desc
</select>
</mapper>
\ No newline at end of file
......@@ -4,7 +4,10 @@ import cn.wisenergy.common.utils.DateUtil;
import cn.wisenergy.common.utils.DateUtils;
import cn.wisenergy.common.utils.exception.BASE_RESP_CODE_ENUM;
import cn.wisenergy.common.utils.exception.BaseCustomException;
import cn.wisenergy.mapper.*;
import cn.wisenergy.mapper.WorkOrderChangeMapper;
import cn.wisenergy.mapper.WorkProjectMapper;
import cn.wisenergy.mapper.WorkTimeOrderMapper;
import cn.wisenergy.mapper.WorkUserMapper;
import cn.wisenergy.model.app.*;
import cn.wisenergy.model.dto.*;
import cn.wisenergy.model.enums.LevelEnum;
......@@ -348,7 +351,17 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
if (CollectionUtils.isEmpty(ts)) {
throw new BaseCustomException(BASE_RESP_CODE_ENUM.INPUT_PARAM_IS_NULL);
}
ts.forEach(t -> list.add((WorkTimeOrder) t));
ts.forEach(t ->{
if (t instanceof WorkTimeOrder) {
list.add((WorkTimeOrder) t);
}else{
WorkTimeOrderDto workTimeOrderDto = (WorkTimeOrderDto) t;
WorkTimeOrder workTimeOrder = new WorkTimeOrder();
BeanUtils.copyProperties(workTimeOrderDto,workTimeOrder);
list.add(workTimeOrder);
}
});
List<Integer> typeIds = workTypeService.getIdByReviewer(1);
int size = list.size();
for (int i = 0; i < size; i++) {
......@@ -820,7 +833,16 @@ public class WorkTimeOrderServiceImpl implements WorkTimeOrderService {
private int timeNotEight(int totalTime, List<?> ts) {
List<WorkTimeOrder> list = new ArrayList<>(8);
if (!CollectionUtils.isEmpty(ts)) {
ts.forEach(t -> list.add((WorkTimeOrder) t));
ts.forEach(t -> {
if (t instanceof WorkTimeOrder) {
list.add((WorkTimeOrder) t);
}else{
WorkTimeOrder workTimeOrder = new WorkTimeOrder();
WorkTimeOrderDto workTimeOrderDto = (WorkTimeOrderDto) t;
BeanUtils.copyProperties(workTimeOrderDto,workTimeOrder);
list.add(workTimeOrder);
}
});
}
if (!CollectionUtils.isEmpty(list)) {
for (WorkTimeOrder workOrder : list) {
......
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