fix: 修复发布期数异常的问题
This commit is contained in:
@@ -104,9 +104,9 @@ public class PricePublishController {
|
|||||||
var query = pricePublishService.getQuery(year, month, null, null, null, null);
|
var query = pricePublishService.getQuery(year, month, null, null, null, null);
|
||||||
List<PricePublish> items = pricePublishService.list(query);
|
List<PricePublish> items = pricePublishService.list(query);
|
||||||
PublicController.PublicUpdateInfo result;
|
PublicController.PublicUpdateInfo result;
|
||||||
if (items.size() == 0) {
|
if (items.size() == 0) { // 无发布数据
|
||||||
result = new PublicController.PublicUpdateInfo(year, month);
|
result = new PublicController.PublicUpdateInfo(year, month);
|
||||||
} else {
|
} else { // 有发布数据
|
||||||
var data = items.get(0);
|
var data = items.get(0);
|
||||||
result = new PublicController.PublicUpdateInfo(data);
|
result = new PublicController.PublicUpdateInfo(data);
|
||||||
}
|
}
|
||||||
|
@@ -209,7 +209,7 @@ public class PublicController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PublicUpdateInfo (PricePublish lastData) {
|
public PublicUpdateInfo (PricePublish lastData) {
|
||||||
this.date = lastData.getCreateTime().toLocalDate();
|
this.date = LocalDate.of(lastData.getYear(), lastData.getMonth(), 1);
|
||||||
this.period = getPeriod(this.date.getYear(), this.date.getMonth().getValue());
|
this.period = getPeriod(this.date.getYear(), this.date.getMonth().getValue());
|
||||||
this.year = date.getYear();
|
this.year = date.getYear();
|
||||||
this.month = date.getMonth().getValue();
|
this.month = date.getMonth().getValue();
|
||||||
|
Reference in New Issue
Block a user