|
|
|
@ -5,6 +5,7 @@ import static com.thing.carbon.pub.entity.table.CarbonPubProductionResultEntityT |
|
|
|
import static com.thing.common.core.enumeration.CarbonLifecycleEnum.*; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONException; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.mybatisflex.core.paginate.Page; |
|
|
|
import com.mybatisflex.core.query.QueryColumn; |
|
|
|
@ -269,14 +270,19 @@ public class CarbonPubProductionResultServiceImpl extends BaseServiceImpl<Carbon |
|
|
|
QueryWrapper.create() |
|
|
|
.in(CarbonPubProductionModelEntity::getProductId, productIds) |
|
|
|
.eq(CarbonPubProductionModelEntity::getTenantCode, tenantCode)); |
|
|
|
List<CarbonPubLibRecordBaseInfoOnYear> res = |
|
|
|
productions.stream() |
|
|
|
.map( |
|
|
|
p -> |
|
|
|
CarbonPubLibRecordBaseInfoOnYear.init( |
|
|
|
JSONObject.parseObject(p.getProductJson(), ProductJsonBean.class), |
|
|
|
p.getProductId())) |
|
|
|
.toList(); |
|
|
|
|
|
|
|
List<CarbonPubLibRecordBaseInfoOnYear> res = productions.stream() |
|
|
|
.map(production -> { |
|
|
|
try { |
|
|
|
ProductJsonBean productJsonBean = JSONObject.parseObject(production.getProductJson(), ProductJsonBean.class); |
|
|
|
return CarbonPubLibRecordBaseInfoOnYear.init(productJsonBean, production.getProductId()); |
|
|
|
} catch (Exception e) { |
|
|
|
// 处理 JSON 解析异常,例如记录日志或返回一个默认值 |
|
|
|
return null; // 或者返回一个默认的 CarbonPubLibRecordBaseInfoOnYear 对象 |
|
|
|
} |
|
|
|
}) |
|
|
|
.filter(Objects::nonNull) // 过滤掉 null 值 |
|
|
|
.toList(); |
|
|
|
|
|
|
|
Date start = new Date(DateTimeUtils.yearStartTs()); |
|
|
|
Date end = new Date(DateTimeUtils.yearEndTs()); |
|
|
|
|