|
|
|
|
@ -41,6 +41,8 @@ import org.apache.commons.lang3.time.DateFormatUtils; |
|
|
|
|
import org.apache.commons.lang3.time.DateUtils; |
|
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.jackson.JsonUtil; |
|
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
import org.springblade.desk.dashboard.constant.DsPartConstant; |
|
|
|
|
@ -243,6 +245,8 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<WorkOrderDto> schedulingBoard(WorkOrderDto workOrder) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<WorkOrderDto> list = baseMapper.selectWorkOrderList(workOrder); |
|
|
|
|
String yesterday = DateFormatUtils.format(DateUtils.addDays(new Date(), -1), "yyyy-MM-dd"); |
|
|
|
|
String twodaysAgo = DateFormatUtils.format(DateUtils.addDays(new Date(), -2), "yyyy-MM-dd"); |
|
|
|
|
@ -298,6 +302,23 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
LinkedHashMap::new |
|
|
|
|
)); |
|
|
|
|
} |
|
|
|
|
//非超级管理员,登陆人员只能看自己中心的数据
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
if(!user.getRoleName().equals("administrator")){ |
|
|
|
|
Long userId = AuthUtil.getUserId(); |
|
|
|
|
List<Long> workCenterList = baseMapper.selectUserCenter(userId); |
|
|
|
|
woCodeGroup = woCodeGroup.entrySet().stream() |
|
|
|
|
.filter(entry -> { |
|
|
|
|
return entry.getValue().stream() |
|
|
|
|
.anyMatch(dto -> workCenterList.contains(dto.getWorkCenterId())); |
|
|
|
|
}) |
|
|
|
|
.collect(Collectors.toMap( |
|
|
|
|
Map.Entry::getKey, |
|
|
|
|
Map.Entry::getValue, |
|
|
|
|
(oldValue, newValue) -> oldValue, |
|
|
|
|
LinkedHashMap::new |
|
|
|
|
)); |
|
|
|
|
} |
|
|
|
|
List<WorkOrderDto> resultList = new ArrayList<>(); |
|
|
|
|
for (Map.Entry<String, List<WorkOrderDto>> entry : woCodeGroup.entrySet()) { |
|
|
|
|
//根据工序名称过滤订单
|
|
|
|
|
@ -376,6 +397,12 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<SchedulingBoardExcel> exportSchedulingBoard(WorkOrderDto workOrder) { |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
if(!user.getRoleName().equals("administrator")){ |
|
|
|
|
Long userId = AuthUtil.getUserId(); |
|
|
|
|
List<Long> workCenterList = baseMapper.selectUserCenter(userId); |
|
|
|
|
workOrder.setWorkCenterList(workCenterList); |
|
|
|
|
} |
|
|
|
|
return baseMapper.exportSchedulingBoard(workOrder); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|