国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

牧場系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)-計(jì)算機(jī)畢業(yè)設(shè)計(jì)源碼+LW文檔

關(guān)鍵代碼

package com.example.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import com.example.common.Result;
import com.example.common.ResultCode;
import com.example.entity.YaopinrukuInfo;
import com.example.dao.YaopinrukuInfoDao;
import com.example.service.YaopinrukuInfoService;
import com.example.exception.CustomException;
import com.example.common.ResultCode;
import com.example.vo.EchartsData;
import com.example.vo.YaopinrukuInfoVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.example.service.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Value;
import cn.hutool.core.util.StrUtil;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;

@RestController
@RequestMapping(value = "/yaopinrukuInfo")
public class YaopinrukuInfoController {

? ? @Resource
? ? private YaopinrukuInfoService yaopinrukuInfoService;
@Resource
? ? private YaopinrukuInfoDao yaopinrukuInfoDao;

? ? @PostMapping
? ? public Result<YaopinrukuInfo> add(@RequestBody YaopinrukuInfoVo yaopinrukuInfo) {
? ? ? ??
//mixmajixami
yaopinrukuInfoService.add(yaopinrukuInfo);
? ? ? ? return Result.success(yaopinrukuInfo);
? ? }

//youtixing1
? ? //youtixing2

? ? @DeleteMapping("/{id}")
? ? public Result delete(@PathVariable Long id) {
? ? ? ? yaopinrukuInfoService.delete(id);
? ? ? ? return Result.success();
? ? }

? ? @PutMapping
? ? public Result update(@RequestBody YaopinrukuInfoVo yaopinrukuInfo) {
? ? ? ? yaopinrukuInfoService.update(yaopinrukuInfo);
? ? ? ? return Result.success();
? ? }
? ? //@PutMapping("/update2")
//? ? public Result update2(@RequestBody YaopinrukuInfoVo yaopinrukuInfo) {
//? ? ? ? yaopinrukuInfoService.update2(yaopinrukuInfo);
//? ? ? ? return Result.success();
//? ? }
? ? @GetMapping("/{id}")
? ? public Result<YaopinrukuInfo> detail(@PathVariable Long id) {
? ? ? ? YaopinrukuInfo yaopinrukuInfo = yaopinrukuInfoService.findById(id);
? ? ? ? return Result.success(yaopinrukuInfo);
? ? }
? ? @GetMapping("/changeStatus/{id}")
? ? public Result<YaopinrukuInfo> changeStatus(@PathVariable Long id) {
? ? ? ? yaopinrukuInfoService.changeStatus(id);
? ? ? ? return Result.success();
? ? }


? ? @GetMapping
? ? public Result<List<YaopinrukuInfoVo>> all() {
? ? ? ? return Result.success(yaopinrukuInfoService.findAll());
? ? }

? ? @GetMapping("/page/{name}")
? ? public Result<PageInfo<YaopinrukuInfoVo>> page(@PathVariable String name,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? @RequestParam(defaultValue = "1") Integer pageNum,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? @RequestParam(defaultValue = "5") Integer pageSize,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? HttpServletRequest request) {
? ? ? ? return Result.success(yaopinrukuInfoService.findPage(name, pageNum, pageSize, request));
? ? }

@GetMapping("/pageqt/{name}")
? ? public Result<PageInfo<YaopinrukuInfoVo>> pageqt(@PathVariable String name,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? @RequestParam(defaultValue = "1") Integer pageNum,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? @RequestParam(defaultValue = "8") Integer pageSize,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? HttpServletRequest request) {
? ? ? ? return Result.success(yaopinrukuInfoService.findPageqt(name, pageNum, pageSize, request));
? ? }

? ?// @PostMapping("/register")
//? ? public Result<YaopinrukuInfo> register(@RequestBody YaopinrukuInfo yaopinrukuInfo) {
//? ? ? ? if (StrUtil.isBlank(yaopinrukuInfo.getName()) || StrUtil.isBlank(yaopinrukuInfo.getPassword())) {
//? ? ? ? ? ? throw new CustomException(ResultCode.PARAM_ERROR);
//? ? ? ? }
//? ? ? ? return Result.success(yaopinrukuInfoService.add(yaopinrukuInfo));
//? ? }

? ? /**
? ? * 批量通過excel添加信息
? ? * @param file excel文件
? ? * @throws IOException
? ? */
? ? @PostMapping("/upload")
? ? public Result upload(MultipartFile file) throws IOException {

? ? ? ? List<YaopinrukuInfo> infoList = ExcelUtil.getReader(file.getInputStream()).readAll(YaopinrukuInfo.class);
? ? ? ? if (!CollectionUtil.isEmpty(infoList)) {
? ? ? ? ? ? // 處理一下空數(shù)據(jù)
? ? ? ? ? ? List<YaopinrukuInfo> resultList = infoList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getYaopinmingcheng())).collect(Collectors.toList());
? ? ? ? ? ? for (YaopinrukuInfo info : resultList) {
? ? ? ? ? ? ? ? yaopinrukuInfoService.add(info);
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? return Result.success();
? ? }
//yoxutonxgjitu
? ? @GetMapping("/getExcelModel")
? ? public void getExcelModel(HttpServletResponse response) throws IOException {
? ? ? ? // 1. 生成excel
? ? ? ? Map<String, Object> row = new LinkedHashMap<>();
row.put("yaopinbianhao", "A藥品編號");
row.put("yaopinmingcheng", "A藥品名稱");
row.put("kucun", "A庫存");
row.put("rukushuliang", "A入庫數(shù)量");
row.put("rukushijian", "A入庫時(shí)間");
row.put("beizhu", "A備注");
row.put("caozuoren", "A操作人");?row.put("status", "是");
row.put("level", "yaopinruku");

? ? ? ? List<Map<String, Object>> list = CollUtil.newArrayList(row);

? ? ? ? // 2. 寫excel
? ? ? ? ExcelWriter writer = ExcelUtil.getWriter(true);
? ? ? ? writer.write(list, true);

? ? ? ? response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
? ? ? ? response.setHeader("Content-Disposition","attachment;filename=yaopinrukuInfoModel.xlsx");

? ? ? ? ServletOutputStream out = response.getOutputStream();
? ? ? ? writer.flush(out, true);
? ? ? ? writer.close();
? ? ? ? IoUtil.close(System.out);
? ? }
@GetMapping("/getExcel")
? ? public void getExcel(HttpServletResponse response) throws IOException {
? ? ? ? // 1. 生成excel
? ? ? ? Map<String, Object> row = new LinkedHashMap<>();
? ? ? ? row.put("yaopinbianhao", "A藥品編號");
row.put("yaopinmingcheng", "A藥品名稱");
row.put("kucun", "A庫存");
row.put("rukushuliang", "A入庫數(shù)量");
row.put("rukushijian", "A入庫時(shí)間");
row.put("beizhu", "A備注");
row.put("caozuoren", "A操作人");?
? ? ? ? row.put("status", "是");
? ? ? ? row.put("level", "權(quán)限");
? ? ? ? List<Map<String, Object>> list = CollUtil.newArrayList(row);
? ? ? ? List<Map<String, Object>> daochuexcellist = yaopinrukuInfoDao.daochuexcel();
? ? ? ? Map<String, Double> typeMap = new HashMap<>();
? ? ? ? for (Map<String, Object> map : daochuexcellist) {
? ? ? ? ? ? list.add(map);
? ? ? ? }
? ? ? ? // 2. 寫excel
? ? ? ? ExcelWriter writer = ExcelUtil.getWriter(true);
? ? ? ? writer.write(list, true);

? ? ? ? response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
? ? ? ? response.setHeader("Content-Disposition","attachment;filename=yaopinrukuInfo.xlsx");

? ? ? ? ServletOutputStream out = response.getOutputStream();
? ? ? ? writer.flush(out, true);
? ? ? ? writer.close();
? ? ? ? IoUtil.close(System.out);
? ? }
private void getPieData(String name, List<EchartsData> pieList, Map<String, Double> dataMap) {
? ? ? ? EchartsData pieData = new EchartsData();
? ? ? ? EchartsData.Series series = new EchartsData.Series();

? ? ? ? Map<String, String> titleMap = new HashMap<>(2);
? ? ? ? titleMap.put("text", name);
? ? ? ? pieData.setTitle(titleMap);

? ? ? ? series.setName(name + "比例");
? ? ? ? series.setType("pie");
? ? ? ? series.setRadius("55%");

? ? ? ? List<Object> objects = new ArrayList<>();
? ? ? ? List<Object> legendList = new ArrayList<>();
? ? ? ? for (String key : dataMap.keySet()) {
? ? ? ? ? ? Double value = dataMap.get(key);
? ? ? ? ? ? objects.add(new JSONObject().putOpt("name", key).putOpt("value", value));
? ? ? ? ? ? legendList.add(key);
? ? ? ? }
? ? ? ? series.setData(objects);

? ? ? ? pieData.setSeries(Collections.singletonList(series));
? ? ? ? Map<String, Boolean> map = new HashMap<>();
? ? ? ? map.put("show", true);
? ? ? ? pieData.setTooltip(map);

? ? ? ? Map<String, Object> legendMap = new HashMap<>(4);
? ? ? ? legendMap.put("orient", "vertical");
? ? ? ? legendMap.put("x", "left");
? ? ? ? legendMap.put("y", "center");
? ? ? ? legendMap.put("data", legendList);
? ? ? ? pieData.setLegend(legendMap);

? ? ? ? pieList.add(pieData);
? ? }

? ? private void getBarData(String name, List<EchartsData> barList, Map<String, Double> dataMap) {
? ? ? ? EchartsData barData = new EchartsData();
? ? ? ? EchartsData.Series series = new EchartsData.Series();

? ? ? ? List<Object> seriesObjs = new ArrayList<>();
? ? ? ? List<Object> xAxisObjs = new ArrayList<>();
? ? ? ? for (String key : dataMap.keySet()) {
? ? ? ? ? ? Double value = dataMap.get(key);
? ? ? ? ? ? xAxisObjs.add(key);
? ? ? ? ? ? seriesObjs.add(value);
? ? ? ? }

? ? ? ? series.setType("bar");
? ? ? ? series.setName(name);
? ? ? ? series.setData(seriesObjs);
? ? ? ? barData.setSeries(Collections.singletonList(series));

? ? ? ? Map<String, Object> xAxisMap = new HashMap<>(1);
? ? ? ? xAxisMap.put("data", xAxisObjs);
? ? ? ? barData.setxAxis(xAxisMap);

? ? ? ? barData.setyAxis(new HashMap<>());

? ? ? ? Map<String, Object> legendMap = new HashMap<>(1);
? ? ? ? legendMap.put("data", Collections.singletonList(name));
? ? ? ? barData.setLegend(legendMap);

? ? ? ? Map<String, Boolean> map = new HashMap<>(1);
? ? ? ? map.put("show", true);
? ? ? ? barData.setTooltip(map);

? ? ? ? Map<String, String> titleMap = new HashMap<>(1);
? ? ? ? titleMap.put("text", name);
? ? ? ? barData.setTitle(titleMap);

? ? ? ? barList.add(barData);
? ? }
}


牧場系統(tǒng)設(shè)計(jì)與實(shí)現(xiàn)-計(jì)算機(jī)畢業(yè)設(shè)計(jì)源碼+LW文檔的評論 (共 條)

分享到微博請遵守國家法律
罗平县| 郓城县| 南昌市| 沙田区| 宁都县| 临武县| 通江县| 酒泉市| 双江| 淮北市| 周口市| 堆龙德庆县| 乌拉特后旗| 仪陇县| 阳曲县| 彰化县| 富源县| 恩平市| 五寨县| 崇明县| 高尔夫| 兰州市| 仪陇县| 高阳县| 河津市| 乡宁县| 穆棱市| 碌曲县| 澄城县| 岫岩| 嘉峪关市| 余江县| 永寿县| 民乐县| 庄浪县| 北安市| 辽宁省| 崇阳县| 鹤壁市| 阳曲县| 皋兰县|