|
@@ -38,14 +38,16 @@ public class ProductionCapacityServiceImpl extends ServiceImpl<ProductionCapacit
|
|
|
@Override
|
|
|
public Result getProductionCapacity(Map<String, String> paramsMap) {
|
|
|
String yearNum = paramsMap.get("yearNum");
|
|
|
- List<ProductionCapacity> productionCapacity = productionCapacityMapper.getProductionCapacity(yearNum);
|
|
|
- if (ObjectUtil.isEmpty(productionCapacity)){
|
|
|
+ List<ProductionCapacity> productionCapacities = productionCapacityMapper.selectList(new QueryWrapper<ProductionCapacity>()
|
|
|
+ .between("year", Integer.valueOf(dateUtil.getThisYear()) - Integer.valueOf(yearNum), Integer.valueOf(dateUtil.getThisYear()))
|
|
|
+ .orderByDesc("year"));
|
|
|
+ if (ObjectUtil.isEmpty(productionCapacities)){
|
|
|
ProductionCapacity productionCapacity1 = new ProductionCapacity();
|
|
|
productionCapacity1.setYear(Integer.valueOf(dateUtil.getThisYear()));
|
|
|
- productionCapacity.add(productionCapacity1);
|
|
|
+ productionCapacities.add(productionCapacity1);
|
|
|
productionCapacityMapper.insert(productionCapacity1);
|
|
|
}
|
|
|
- return new Result(ResultCode.SUCCESS,productionCapacity);
|
|
|
+ return new Result(ResultCode.SUCCESS,productionCapacities);
|
|
|
}
|
|
|
|
|
|
@Override
|