| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 农产品库存控制器 |
| | | * @since 2022-05-18 |
| | | * |
| | | * @author zhongrj |
| | | * @since 2022-05-18 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | |
| | | |
| | | /** |
| | | * 统计产量 |
| | | * |
| | | * @param farmProductStock |
| | | * @return |
| | | */ |
| | |
| | | return R.data(farmProductStockService.selctProductCount(year)); |
| | | } |
| | | |
| | | /** |
| | | * 小程序统计产量详情 |
| | | * |
| | | * @param farmProductStock |
| | | * @return |
| | | */ |
| | | @GetMapping("/statisticsProductx") |
| | | public R statisticsProductx(FarmProductStockVO farmProductStock, Query query) { |
| | | Double zwei = 0.0; |
| | | IPage<FarmProductStockVO> pages = farmProductStockService.statisticsProductx(Condition.getPage(query), farmProductStock); |
| | | for (int i = 0; i < pages.getRecords().size(); i++) { |
| | | String weight = pages.getRecords().get(i).getWeight(); |
| | | Double a=Double.parseDouble(weight); |
| | | DecimalFormat df = new DecimalFormat("#.00"); |
| | | String format = df.format(a); |
| | | //产量 |
| | | Double wei = Double.parseDouble(format); |
| | | pages.getRecords().get(i).setWeight(format); |
| | | zwei += wei; |
| | | } |
| | | Map map = new HashMap(); |
| | | List list = new ArrayList(); |
| | | DecimalFormat df = new DecimalFormat("#.00"); |
| | | String format = df.format(zwei); |
| | | map.put("zwei", format); |
| | | list.add(map); |
| | | list.add(pages); |
| | | return R.data(list); |
| | | } |
| | | |
| | | } |