|
|
|
|
@ -86,12 +86,11 @@ public class ProdReportServiceImpl implements IProdReportService {
|
|
|
|
|
* @return 生产计划明细数据库表名
|
|
|
|
|
*/
|
|
|
|
|
public String getPlanDetailTableNameByProcessId(Long processId) {
|
|
|
|
|
if (StringUtils.isNull(processId)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String tableName;
|
|
|
|
|
if (processId == 17L) {
|
|
|
|
|
if (StringUtils.isNull(processId)) {
|
|
|
|
|
// 默认返回半制品表
|
|
|
|
|
tableName = DatabaseConstants.TABLE_NAME_PROD_PLAN_INFO_PREFIX + "_2";
|
|
|
|
|
}else if (processId == 17L) {
|
|
|
|
|
tableName = DatabaseConstants.TABLE_NAME_PROD_PRODUCT_PLAN_DETAIL_PREFIX + "_3";
|
|
|
|
|
} else if (processId == 18L) {
|
|
|
|
|
tableName = DatabaseConstants.TABLE_NAME_PROD_PRODUCT_PLAN_DETAIL_PREFIX + "_4";
|
|
|
|
|
@ -154,7 +153,7 @@ public class ProdReportServiceImpl implements IProdReportService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public TableDataInfo<WorkHourReportVo> workHourReportList(Map hashMap, PageQuery pageQuery) {
|
|
|
|
|
Long processId = Long.parseLong(String.valueOf(hashMap.get("processId")));
|
|
|
|
|
Long processId = parseProcessId(String.valueOf(hashMap.get("processId")));
|
|
|
|
|
String detailTable = getPlanDetailTableNameByProcessId(processId);
|
|
|
|
|
String planTable = getPlanInfoTableNameByProcessId(processId);
|
|
|
|
|
Page<WorkHourReportVo> page = prodReportMapper.workHourReportList(hashMap, pageQuery.build(), detailTable, planTable);
|
|
|
|
|
@ -163,12 +162,26 @@ public class ProdReportServiceImpl implements IProdReportService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<WorkHourReportVo> workHourReportList(Map hashMap) {
|
|
|
|
|
Long processId = Long.parseLong(String.valueOf(hashMap.get("processId")));
|
|
|
|
|
Long processId = parseProcessId(String.valueOf(hashMap.get("processId")));
|
|
|
|
|
String detailTable = getPlanDetailTableNameByProcessId(processId);
|
|
|
|
|
String planTable = getPlanInfoTableNameByProcessId(processId);
|
|
|
|
|
return prodReportMapper.workHourReportList(hashMap, detailTable, planTable);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 新增辅助方法用于安全解析 processId
|
|
|
|
|
private Long parseProcessId(Object processIdObj) {
|
|
|
|
|
if (processIdObj == null) {
|
|
|
|
|
return null; // 或者根据业务需要返回默认值如 16L
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
return Long.parseLong(String.valueOf(processIdObj));
|
|
|
|
|
} catch (NumberFormatException e) {
|
|
|
|
|
// 可以记录日志
|
|
|
|
|
return null; // 或者根据业务需要返回默认值
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public TableDataInfo<TeamWorkReportVo> teamWorkReportList(Map hashMap, PageQuery pageQuery) {
|
|
|
|
|
Long processId = Long.parseLong(String.valueOf(hashMap.get("processId")));
|
|
|
|
|
|