校园外卖系统带万字文档在线外卖管理系统java项目java课程设计java毕业设计

文章目录

  • 校园外卖系统
    • 一、项目演示
    • 二、项目介绍
    • 三、万字项目文档
    • 四、部分功能截图
    • 五、部分代码展示
    • 六、底部获取项目源码带万字文档(9.9¥带走)

校园外卖系统

一、项目演示

校园外卖服务系统

二、项目介绍

语言:java 数据库:MySQL

技术栈:SpringBoot、Mybatis、Vue、Html

系统角色:用户、管理员

用户:注册、登录、首页、公告信息、外卖菜品、购物车、个人中心、外卖收藏、外卖订单、订单评价、修改密码

管理员:个人中心、公告类型管理、会员等级类型管理、外卖类型管理、公告信息管理、外卖评价管理、外卖收藏管理、外卖订单管理、用户管理、轮播图管理

三、万字项目文档

在这里插入图片描述
在这里插入图片描述

四、部分功能截图

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

五、部分代码展示


package com.controller;import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;/*** 收货地址* 后端接口* @author* @email
*/
@RestController
@Controller
@RequestMapping("/address")
public class AddressController {private static final Logger logger = LoggerFactory.getLogger(AddressController.class);@Autowiredprivate AddressService addressService;@Autowiredprivate TokenService tokenService;@Autowiredprivate DictionaryService dictionaryService;//级联表service@Autowiredprivate YonghuService yonghuService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永不会进入");else if("用户".equals(role))params.put("yonghuId",request.getSession().getAttribute("userId"));if(params.get("orderBy")==null || params.get("orderBy")==""){params.put("orderBy","id");}PageUtils page = addressService.queryPage(params);//字典表数据转换List<AddressView> list =(List<AddressView>)page.getList();for(AddressView c:list){//修改对应字典表字段dictionaryService.dictionaryConvert(c, request);}return R.ok().put("data", page);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id, HttpServletRequest request){logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);AddressEntity address = addressService.selectById(id);if(address !=null){//entity转viewAddressView view = new AddressView();BeanUtils.copyProperties( address , view );//把实体数据重构到view中//级联表YonghuEntity yonghu = yonghuService.selectById(address.getYonghuId());if(yonghu != null){BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime"});//把级联的数据添加到view中,并排除id和创建时间字段view.setYonghuId(yonghu.getId());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody AddressEntity address, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,address:{}",this.getClass().getName(),address.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");else if("用户".equals(role))address.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));Wrapper<AddressEntity> queryWrapper = new EntityWrapper<AddressEntity>().eq("yonghu_id", address.getYonghuId()).eq("address_name", address.getAddressName()).eq("address_phone", address.getAddressPhone()).eq("address_dizhi", address.getAddressDizhi()).eq("isdefault_types", address.getIsdefaultTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());AddressEntity addressEntity = addressService.selectOne(queryWrapper);if(addressEntity==null){address.setInsertTime(new Date());address.setCreateTime(new Date());Integer isdefaultTypes = address.getIsdefaultTypes();if(isdefaultTypes == 2 ){//如果当前的是默认地址,把当前用户的其他改为不是默认地址List<AddressEntity> addressEntitys = addressService.selectList(new EntityWrapper<AddressEntity>().eq("isdefault_types",2));if(addressEntitys != null && addressEntitys.size()>0){for(AddressEntity a:addressEntitys)a.setIsdefaultTypes(1);addressService.updateBatchById(addressEntitys);}}addressService.insert(address);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody AddressEntity address, HttpServletRequest request){logger.debug("update方法:,,Controller:{},,address:{}",this.getClass().getName(),address.toString());String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
//        else if("用户".equals(role))
//            address.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));//根据字段查询是否有相同数据Wrapper<AddressEntity> queryWrapper = new EntityWrapper<AddressEntity>().notIn("id",address.getId()).andNew().eq("yonghu_id", address.getYonghuId()).eq("address_name", address.getAddressName()).eq("address_phone", address.getAddressPhone()).eq("address_dizhi", address.getAddressDizhi()).eq("isdefault_types", address.getIsdefaultTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());AddressEntity addressEntity = addressService.selectOne(queryWrapper);address.setUpdateTime(new Date());if(addressEntity==null){Integer isdefaultTypes = address.getIsdefaultTypes();if(isdefaultTypes == 2 ){//如果当前的是默认地址,把当前用户的其他改为不是默认地址List<AddressEntity> addressEntitys = addressService.selectList(new EntityWrapper<AddressEntity>().eq("isdefault_types",2));if(addressEntitys != null && addressEntitys.size()>0){for(AddressEntity a:addressEntitys)a.setIsdefaultTypes(1);addressService.updateBatchById(addressEntitys);}}addressService.updateById(address);//根据id更新return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());addressService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 批量上传*/@RequestMapping("/batchInsert")public R save( String fileName, HttpServletRequest request){logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");try {List<AddressEntity> addressList = new ArrayList<>();//上传的东西Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段Date date = new Date();int lastIndexOf = fileName.lastIndexOf(".");if(lastIndexOf == -1){return R.error(511,"该文件没有后缀");}else{String suffix = fileName.substring(lastIndexOf);if(!".xls".equals(suffix)){return R.error(511,"只支持后缀为xls的excel文件");}else{URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径File file = new File(resource.getFile());if(!file.exists()){return R.error(511,"找不到上传文件,请联系管理员");}else{List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件dataList.remove(0);//删除第一行,因为第一行是提示for(List<String> data:dataList){//循环AddressEntity addressEntity = new AddressEntity();
//                            addressEntity.setYonghuId(Integer.valueOf(data.get(0)));   //创建用户 要改的
//                            addressEntity.setAddressName(data.get(0));                    //收货人 要改的
//                            addressEntity.setAddressPhone(data.get(0));                    //电话 要改的
//                            addressEntity.setAddressDizhi(data.get(0));                    //地址 要改的
//                            addressEntity.setIsdefaultTypes(Integer.valueOf(data.get(0)));   //是否默认地址 要改的
//                            addressEntity.setInsertTime(date);//时间
//                            addressEntity.setUpdateTime(sdf.parse(data.get(0)));          //修改时间 要改的
//                            addressEntity.setCreateTime(date);//时间addressList.add(addressEntity);//把要查询是否重复的字段放入map中//电话if(seachFields.containsKey("addressPhone")){List<String> addressPhone = seachFields.get("addressPhone");addressPhone.add(data.get(0));//要改的}else{List<String> addressPhone = new ArrayList<>();addressPhone.add(data.get(0));//要改的seachFields.put("addressPhone",addressPhone);}}//查询是否重复//电话List<AddressEntity> addressEntities_addressPhone = addressService.selectList(new EntityWrapper<AddressEntity>().in("address_phone", seachFields.get("addressPhone")));if(addressEntities_addressPhone.size() >0 ){ArrayList<String> repeatFields = new ArrayList<>();for(AddressEntity s:addressEntities_addressPhone){repeatFields.add(s.getAddressPhone());}return R.error(511,"数据库的该表中的 [电话] 字段已经存在 存在数据为:"+repeatFields.toString());}addressService.insertBatch(addressList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,"批量插入数据异常,请联系管理员");}}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));// 没有指定排序字段就默认id倒序if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){params.put("orderBy","id");}PageUtils page = addressService.queryPage(params);//字典表数据转换List<AddressView> list =(List<AddressView>)page.getList();for(AddressView c:list)dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段return R.ok().put("data", page);}/*** 前端详情*/@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id, HttpServletRequest request){logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);AddressEntity address = addressService.selectById(id);if(address !=null){//entity转viewAddressView view = new AddressView();BeanUtils.copyProperties( address , view );//把实体数据重构到view中//级联表YonghuEntity yonghu = yonghuService.selectById(address.getYonghuId());if(yonghu != null){BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段view.setYonghuId(yonghu.getId());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody AddressEntity address, HttpServletRequest request){logger.debug("add方法:,,Controller:{},,address:{}",this.getClass().getName(),address.toString());Wrapper<AddressEntity> queryWrapper = new EntityWrapper<AddressEntity>().eq("yonghu_id", address.getYonghuId()).eq("address_name", address.getAddressName()).eq("address_phone", address.getAddressPhone()).eq("address_dizhi", address.getAddressDizhi()).eq("isdefault_types", address.getIsdefaultTypes());logger.info("sql语句:"+queryWrapper.getSqlSegment());AddressEntity addressEntity = addressService.selectOne(queryWrapper);if(addressEntity==null){address.setInsertTime(new Date());address.setCreateTime(new Date());Integer isdefaultTypes = address.getIsdefaultTypes();if(isdefaultTypes == 2 ){//如果当前的是默认地址,把当前用户的其他改为不是默认地址List<AddressEntity> addressEntitys = addressService.selectList(new EntityWrapper<AddressEntity>().eq("isdefault_types",2));if(addressEntitys != null && addressEntitys.size()>0){for(AddressEntity a:addressEntitys)a.setIsdefaultTypes(1);addressService.updateBatchById(addressEntitys);}}addressService.insert(address);return R.ok();}else {return R.error(511,"表中有相同数据");}}}
package com.controller;import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*;import javax.servlet.http.HttpServletRequest;import com.alibaba.fastjson.JSON;
import com.utils.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;import com.annotation.IgnoreAuth;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.baidu.aip.util.Base64Util;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ConfigEntity;
import com.service.CommonService;
import com.service.ConfigService;
import com.utils.BaiduUtil;
import com.utils.FileUtil;
import com.utils.R;/*** 通用接口*/
@RestController
public class CommonController{private static final Logger logger = LoggerFactory.getLogger(CommonController.class);@Autowiredprivate CommonService commonService;@Autowiredprivate ConfigService configService;private static AipFace client = null;private static String BAIDU_DITU_AK = null;@RequestMapping("/location")public R location(String lng,String lat) {if(BAIDU_DITU_AK==null) {BAIDU_DITU_AK = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "baidu_ditu_ak")).getValue();if(BAIDU_DITU_AK==null) {return R.error("请在配置管理中正确配置baidu_ditu_ak");}}Map<String, String> map = BaiduUtil.getCityByLonLat(BAIDU_DITU_AK, lng, lat);return R.ok().put("data", map);}/*** 人脸比对* * @param face1 人脸1* @param face2 人脸2* @return*/@RequestMapping("/matchFace")public R matchFace(String face1, String face2, HttpServletRequest request) {if(client==null) {/*String AppID = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "AppID")).getValue();*/String APIKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "APIKey")).getValue();String SecretKey = configService.selectOne(new EntityWrapper<ConfigEntity>().eq("name", "SecretKey")).getValue();String token = BaiduUtil.getAuth(APIKey, SecretKey);if(token==null) {return R.error("请在配置管理中正确配置APIKey和SecretKey");}client = new AipFace(null, APIKey, SecretKey);client.setConnectionTimeoutInMillis(2000);client.setSocketTimeoutInMillis(60000);}JSONObject res = null;try {File file1 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face1);File file2 = new File(request.getSession().getServletContext().getRealPath("/upload")+"/"+face2);String img1 = Base64Util.encode(FileUtil.FileToByte(file1));String img2 = Base64Util.encode(FileUtil.FileToByte(file2));MatchRequest req1 = new MatchRequest(img1, "BASE64");MatchRequest req2 = new MatchRequest(img2, "BASE64");ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();requests.add(req1);requests.add(req2);res = client.match(requests);System.out.println(res.get("result"));} catch (FileNotFoundException e) {e.printStackTrace();return R.error("文件不存在");} catch (IOException e) {e.printStackTrace();} return R.ok().put("data", com.alibaba.fastjson.JSONObject.parse(res.get("result").toString()));}/*** 获取table表中的column列表(联动接口)* @return*/@RequestMapping("/option/{tableName}/{columnName}")@IgnoreAuthpublic R getOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName,String level,String parent) {Map<String, Object> params = new HashMap<String, Object>();params.put("table", tableName);params.put("column", columnName);if(StringUtils.isNotBlank(level)) {params.put("level", level);}if(StringUtils.isNotBlank(parent)) {params.put("parent", parent);}List<String> data = commonService.getOption(params);return R.ok().put("data", data);}/*** 根据table中的column获取单条记录* @return*/@RequestMapping("/follow/{tableName}/{columnName}")@IgnoreAuthpublic R getFollowByOption(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @RequestParam String columnValue) {Map<String, Object> params = new HashMap<String, Object>();params.put("table", tableName);params.put("column", columnName);params.put("columnValue", columnValue);Map<String, Object> result = commonService.getFollowByOption(params);return R.ok().put("data", result);}/*** 修改table表的sfsh状态* @param map* @return*/@RequestMapping("/sh/{tableName}")public R sh(@PathVariable("tableName") String tableName, @RequestBody Map<String, Object> map) {map.put("table", tableName);commonService.sh(map);return R.ok();}/*** 获取需要提醒的记录数* @param tableName* @param columnName* @param type 1:数字 2:日期* @param map* @return*/@RequestMapping("/remind/{tableName}/{columnName}/{type}")@IgnoreAuthpublic R remindCount(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName, @PathVariable("type") String type,@RequestParam Map<String, Object> map) {map.put("table", tableName);map.put("column", columnName);map.put("type", type);if(type.equals("2")) {SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");Calendar c = Calendar.getInstance();Date remindStartDate = null;Date remindEndDate = null;if(map.get("remindstart")!=null) {Integer remindStart = Integer.parseInt(map.get("remindstart").toString());c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindStart);remindStartDate = c.getTime();map.put("remindstart", sdf.format(remindStartDate));}if(map.get("remindend")!=null) {Integer remindEnd = Integer.parseInt(map.get("remindend").toString());c.setTime(new Date());c.add(Calendar.DAY_OF_MONTH,remindEnd);remindEndDate = c.getTime();map.put("remindend", sdf.format(remindEndDate));}}int count = commonService.remindCount(map);return R.ok().put("count", count);}/*** 圖表统计*/@IgnoreAuth@RequestMapping("/group/{tableName}")public R group1(@PathVariable("tableName") String tableName, @RequestParam Map<String,Object> params) {params.put("table1", tableName);List<Map<String, Object>> result = commonService.chartBoth(params);return R.ok().put("data", result);}/*** 单列求和*/@RequestMapping("/cal/{tableName}/{columnName}")@IgnoreAuthpublic R cal(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {Map<String, Object> params = new HashMap<String, Object>();params.put("table", tableName);params.put("column", columnName);Map<String, Object> result = commonService.selectCal(params);return R.ok().put("data", result);}/*** 分组统计*/@RequestMapping("/group/{tableName}/{columnName}")@IgnoreAuthpublic R group(@PathVariable("tableName") String tableName, @PathVariable("columnName") String columnName) {Map<String, Object> params = new HashMap<String, Object>();params.put("table", tableName);params.put("column", columnName);List<Map<String, Object>> result = commonService.selectGroup(params);return R.ok().put("data", result);}/*** (按值统计)*/@RequestMapping("/value/{tableName}/{xColumnName}/{yColumnName}")@IgnoreAuthpublic R value(@PathVariable("tableName") String tableName, @PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName) {Map<String, Object> params = new HashMap<String, Object>();params.put("table", tableName);params.put("xColumn", xColumnName);params.put("yColumn", yColumnName);List<Map<String, Object>> result = commonService.selectValue(params);return R.ok().put("data", result);}/*** 下面为新加的****//*** 查询字典表的分组求和* tableName  		表名* groupColumn  		分组字段* sumCloum			统计字段* @return*/@RequestMapping("/newSelectGroupSum")public R newSelectGroupSum(@RequestParam Map<String,Object> params) {logger.debug("newSelectGroupSum:,,Controller:{},,params:{}",this.getClass().getName(),params);List<Map<String, Object>> result = commonService.newSelectGroupSum(params);return R.ok().put("data", result);}/**tableName 查询表condition1 条件1condition1Value 条件1值average 计算平均评分取值有值 Number(res.data.value.toFixed(1))无值 if(res.data){}* */@IgnoreAuth@RequestMapping("/queryScore")public R queryScore(@RequestParam Map<String, Object> params) {logger.debug("queryScore:,,Controller:{},,params:{}",this.getClass().getName(),params);Map<String, Object> queryScore = commonService.queryScore(params);return R.ok().put("data", queryScore);}/*** 查询字典表的分组统计总条数*  tableName  		表名*	groupColumn  	分组字段* @return*/@RequestMapping("/newSelectGroupCount")public R newSelectGroupCount(@RequestParam Map<String,Object> params) {logger.debug("newSelectGroupCount:,,Controller:{},,params:{}",this.getClass().getName(),params);List<Map<String, Object>> result = commonService.newSelectGroupCount(params);return R.ok().put("data", result);}/*** 当前表的日期分组求和* tableName  		表名* groupColumn  		分组字段* sumCloum			统计字段* dateFormatType	日期格式化类型   1:年 2:月 3:日* @return*/@RequestMapping("/newSelectDateGroupSum")public R newSelectDateGroupSum(@RequestParam Map<String,Object> params) {logger.debug("newSelectDateGroupSum:,,Controller:{},,params:{}",this.getClass().getName(),params);String dateFormatType = String.valueOf(params.get("dateFormatType"));if("1".equals(dateFormatType)){params.put("dateFormat", "%Y");}else if("2".equals(dateFormatType)){params.put("dateFormat", "%Y-%m");}else if("3".equals(dateFormatType)){params.put("dateFormat", "%Y-%m-%d");}else{R.error("日期格式化不正确");}List<Map<String, Object>> result = commonService.newSelectDateGroupSum(params);return R.ok().put("data", result);}/**** 查询字典表的分组统计总条数* tableName  		表名* groupColumn  		分组字段* dateFormatType	日期格式化类型   1:年 2:月 3:日* @return*/@RequestMapping("/newSelectDateGroupCount")public R newSelectDateGroupCount(@RequestParam Map<String,Object> params) {logger.debug("newSelectDateGroupCount:,,Controller:{},,params:{}",this.getClass().getName(),params);String dateFormatType = String.valueOf(params.get("dateFormatType"));if("1".equals(dateFormatType)){params.put("dateFormat", "%Y");}else if("2".equals(dateFormatType)){params.put("dateFormat", "%Y-%m");}else if("3".equals(dateFormatType)){params.put("dateFormat", "%Y-%m-%d");}else{R.error("日期格式化类型不正确");}List<Map<String, Object>> result = commonService.newSelectDateGroupCount(params);return R.ok().put("data", result);}
/*** 饼状图* -- 饼状图  查询当前表-- 				查询字典表【月】-- 				 统计   -- 查询某个月的每个类型的订单销售数量-- 				 求和   -- 查询某个月的每个类型的订单销售额-- 				查询某个字符串【月】-- 				 统计   -- 查询某个月的每个员工的订单销售数量-- 				 求和   -- 查询某个月的每个员工的订单销售额-- 				查询时间【年】-- 				 统计 	-- 查询每个月的订单销售数量-- 				 求和 	-- 查询每个月的订单销售额-- 饼状图  查询级联表-- 				查询字典表-- 				 统计  	-- 查询某个月的每个类型的订单销售数量-- 				 求和   -- 查询某个月的每个类型的订单销售额-- 				查询某个字符串-- 				 统计   -- 查询某个月的每个员工的订单销售数量-- 				 求和   -- 查询某个月的每个员工的订单销售额-- 				查询时间-- 				 统计 	-- 统计每个月的订单销售数量-- 				 求和 	-- 查询每个月的订单销售额*//*** 柱状图-- 柱状图  查询当前表--             某个【年,月】-- 			 当前表 2 级联表 1-- 						统计--   						【日期,字符串,下拉框】-- 						求和--   						【日期,字符串,下拉框】-- 柱状图  查询级联表-- 					某个【年,月】-- 						统计--   						【日期,字符串,下拉框】-- 						求和--   						【日期,字符串,下拉框】*//*** 柱状图求和*/@RequestMapping("/barSum")public R barSum(@RequestParam Map<String,Object> params) {logger.debug("barSum方法:,,Controller:{},,params:{}",this.getClass().getName(), com.alibaba.fastjson.JSONObject.toJSONString(params));Boolean isJoinTableFlag =  false;//是否有级联表相关String one =  "";//第一优先String two =  "";//第二优先//处理thisTable和joinTable 处理内容是把json字符串转为Map并把带有,的切割为数组//当前表Map<String,Object> thisTable = JSON.parseObject(String.valueOf(params.get("thisTable")),Map.class);params.put("thisTable",thisTable);//级联表String joinTableString = String.valueOf(params.get("joinTable"));if(StringUtil.isNotEmpty(joinTableString)) {Map<String, Object> joinTable = JSON.parseObject(joinTableString, Map.class);params.put("joinTable", joinTable);isJoinTableFlag = true;}if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("date")))){//当前表日期thisTable.put("date",String.valueOf(thisTable.get("date")).split(","));one = "thisDate0";}if(isJoinTableFlag){//级联表日期Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("date")))){joinTable.put("date",String.valueOf(joinTable.get("date")).split(","));if(StringUtil.isEmpty(one)){one ="joinDate0";}else{if(StringUtil.isEmpty(two)){two ="joinDate0";}}}}if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("string")))){//当前表字符串thisTable.put("string",String.valueOf(thisTable.get("string")).split(","));if(StringUtil.isEmpty(one)){one ="thisString0";}else{if(StringUtil.isEmpty(two)){two ="thisString0";}}}if(isJoinTableFlag){//级联表字符串Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("string")))){joinTable.put("string",String.valueOf(joinTable.get("string")).split(","));if(StringUtil.isEmpty(one)){one ="joinString0";}else{if(StringUtil.isEmpty(two)){two ="joinString0";}}}}if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("types")))){//当前表类型thisTable.put("types",String.valueOf(thisTable.get("types")).split(","));if(StringUtil.isEmpty(one)){one ="thisTypes0";}else{if(StringUtil.isEmpty(two)){two ="thisTypes0";}}}if(isJoinTableFlag){//级联表类型Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("types")))){joinTable.put("types",String.valueOf(joinTable.get("types")).split(","));if(StringUtil.isEmpty(one)){one ="joinTypes0";}else{if(StringUtil.isEmpty(two)){two ="joinTypes0";}}}}List<Map<String, Object>> result = commonService.barSum(params);List<String> xAxis = new ArrayList<>();//报表x轴List<List<String>> yAxis = new ArrayList<>();//y轴List<String> legend = new ArrayList<>();//标题if(StringUtil.isEmpty(two)){//不包含第二列List<String> yAxis0 = new ArrayList<>();yAxis.add(yAxis0);legend.add("数值");for(Map<String, Object> map :result){String oneValue = String.valueOf(map.get(one));String value = String.valueOf(map.get("value"));xAxis.add(oneValue);yAxis0.add(value);}}else{//包含第二列Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();if(StringUtil.isNotEmpty(two)){for(Map<String, Object> map :result){String oneValue = String.valueOf(map.get(one));String twoValue = String.valueOf(map.get(two));String value = String.valueOf(map.get("value"));if(!legend.contains(twoValue)){legend.add(twoValue);//添加完成后 就是最全的第二列的类型}if(dataMap.containsKey(oneValue)){dataMap.get(oneValue).put(twoValue,value);}else{HashMap<String, String> oneData = new HashMap<>();oneData.put(twoValue,value);dataMap.put(oneValue,oneData);}}}for(int i =0; i<legend.size(); i++){yAxis.add(new ArrayList<String>());}Set<String> keys = dataMap.keySet();for(String key:keys){xAxis.add(key);HashMap<String, String> map = dataMap.get(key);for(int i =0; i<legend.size(); i++){List<String> data = yAxis.get(i);if(StringUtil.isNotEmpty(map.get(legend.get(i)))){data.add(map.get(legend.get(i)));}else{data.add("0");}}}System.out.println();}Map<String, Object> resultMap = new HashMap<>();resultMap.put("xAxis",xAxis);resultMap.put("yAxis",yAxis);resultMap.put("legend",legend);return R.ok().put("data", resultMap);}/*** 柱状图统计*/@RequestMapping("/barCount")public R barCount(@RequestParam Map<String,Object> params) {logger.debug("barCount方法:,,Controller:{},,params:{}",this.getClass().getName(), com.alibaba.fastjson.JSONObject.toJSONString(params));Boolean isJoinTableFlag =  false;//是否有级联表相关String one =  "";//第一优先String two =  "";//第二优先//处理thisTable和joinTable 处理内容是把json字符串转为Map并把带有,的切割为数组//当前表Map<String,Object> thisTable = JSON.parseObject(String.valueOf(params.get("thisTable")),Map.class);params.put("thisTable",thisTable);//级联表String joinTableString = String.valueOf(params.get("joinTable"));if(StringUtil.isNotEmpty(joinTableString)) {Map<String, Object> joinTable = JSON.parseObject(joinTableString, Map.class);params.put("joinTable", joinTable);isJoinTableFlag = true;}if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("date")))){//当前表日期thisTable.put("date",String.valueOf(thisTable.get("date")).split(","));one = "thisDate0";}if(isJoinTableFlag){//级联表日期Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("date")))){joinTable.put("date",String.valueOf(joinTable.get("date")).split(","));if(StringUtil.isEmpty(one)){one ="joinDate0";}else{if(StringUtil.isEmpty(two)){two ="joinDate0";}}}}if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("string")))){//当前表字符串thisTable.put("string",String.valueOf(thisTable.get("string")).split(","));if(StringUtil.isEmpty(one)){one ="thisString0";}else{if(StringUtil.isEmpty(two)){two ="thisString0";}}}if(isJoinTableFlag){//级联表字符串Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("string")))){joinTable.put("string",String.valueOf(joinTable.get("string")).split(","));if(StringUtil.isEmpty(one)){one ="joinString0";}else{if(StringUtil.isEmpty(two)){two ="joinString0";}}}}if(StringUtil.isNotEmpty(String.valueOf(thisTable.get("types")))){//当前表类型thisTable.put("types",String.valueOf(thisTable.get("types")).split(","));if(StringUtil.isEmpty(one)){one ="thisTypes0";}else{if(StringUtil.isEmpty(two)){two ="thisTypes0";}}}if(isJoinTableFlag){//级联表类型Map<String, Object> joinTable = (Map<String, Object>) params.get("joinTable");if(StringUtil.isNotEmpty(String.valueOf(joinTable.get("types")))){joinTable.put("types",String.valueOf(joinTable.get("types")).split(","));if(StringUtil.isEmpty(one)){one ="joinTypes0";}else{if(StringUtil.isEmpty(two)){two ="joinTypes0";}}}}List<Map<String, Object>> result = commonService.barCount(params);List<String> xAxis = new ArrayList<>();//报表x轴List<List<String>> yAxis = new ArrayList<>();//y轴List<String> legend = new ArrayList<>();//标题if(StringUtil.isEmpty(two)){//不包含第二列List<String> yAxis0 = new ArrayList<>();yAxis.add(yAxis0);legend.add("数值");for(Map<String, Object> map :result){String oneValue = String.valueOf(map.get(one));String value = String.valueOf(map.get("value"));xAxis.add(oneValue);yAxis0.add(value);}}else{//包含第二列Map<String, HashMap<String, String>> dataMap = new LinkedHashMap<>();if(StringUtil.isNotEmpty(two)){for(Map<String, Object> map :result){String oneValue = String.valueOf(map.get(one));String twoValue = String.valueOf(map.get(two));String value = String.valueOf(map.get("value"));if(!legend.contains(twoValue)){legend.add(twoValue);//添加完成后 就是最全的第二列的类型}if(dataMap.containsKey(oneValue)){dataMap.get(oneValue).put(twoValue,value);}else{HashMap<String, String> oneData = new HashMap<>();oneData.put(twoValue,value);dataMap.put(oneValue,oneData);}}}for(int i =0; i<legend.size(); i++){yAxis.add(new ArrayList<String>());}Set<String> keys = dataMap.keySet();for(String key:keys){xAxis.add(key);HashMap<String, String> map = dataMap.get(key);for(int i =0; i<legend.size(); i++){List<String> data = yAxis.get(i);if(StringUtil.isNotEmpty(map.get(legend.get(i)))){data.add(map.get(legend.get(i)));}else{data.add("0");}}}System.out.println();}Map<String, Object> resultMap = new HashMap<>();resultMap.put("xAxis",xAxis);resultMap.put("yAxis",yAxis);resultMap.put("legend",legend);return R.ok().put("data", resultMap);}
}

package com.controller;import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;/*** 字典* 后端接口* @author* @email
*/
@RestController
@Controller
@RequestMapping("/dictionary")
public class DictionaryController {private static final Logger logger = LoggerFactory.getLogger(DictionaryController.class);@Autowiredprivate DictionaryService dictionaryService;@Autowiredprivate TokenService tokenService;//级联表service@Autowiredprivate YonghuService yonghuService;/*** 后端列表*/@RequestMapping("/page")@IgnoreAuthpublic R page(@RequestParam Map<String, Object> params, HttpServletRequest request){logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));if(params.get("orderBy")==null || params.get("orderBy")==""){params.put("orderBy","id");}PageUtils page = dictionaryService.queryPage(params);//字典表数据转换List<DictionaryView> list =(List<DictionaryView>)page.getList();for(DictionaryView c:list){//修改对应字典表字段dictionaryService.dictionaryConvert(c, request);}return R.ok().put("data", page);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id, HttpServletRequest request){logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);DictionaryEntity dictionary = dictionaryService.selectById(id);if(dictionary !=null){//entity转viewDictionaryView view = new DictionaryView();BeanUtils.copyProperties( dictionary , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>().eq("dic_code", dictionary.getDicCode()).eq("index_name", dictionary.getIndexName());if(dictionary.getDicCode().contains("_erji_types")){queryWrapper.eq("super_id",dictionary.getSuperId());}logger.info("sql语句:"+queryWrapper.getSqlSegment());DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);if(dictionaryEntity==null){dictionary.setCreateTime(new Date());dictionaryService.insert(dictionary);//字典表新增数据,把数据再重新查出,放入监听器中List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());ServletContext servletContext = request.getServletContext();Map<String, Map<Integer,String>> map = new HashMap<>();for(DictionaryEntity d :dictionaryEntities){Map<Integer, String> m = map.get(d.getDicCode());if(m ==null || m.isEmpty()){m = new HashMap<>();}m.put(d.getCodeIndex(),d.getIndexName());map.put(d.getDicCode(),m);}servletContext.setAttribute("dictionaryMap",map);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody DictionaryEntity dictionary, HttpServletRequest request){logger.debug("update方法:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");//根据字段查询是否有相同数据Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>().notIn("id",dictionary.getId()).eq("dic_code", dictionary.getDicCode()).eq("index_name", dictionary.getIndexName());if(dictionary.getDicCode().contains("_erji_types")){queryWrapper.eq("super_id",dictionary.getSuperId());}logger.info("sql语句:"+queryWrapper.getSqlSegment());DictionaryEntity dictionaryEntity = dictionaryService.selectOne(queryWrapper);if(dictionaryEntity==null){dictionaryService.updateById(dictionary);//根据id更新//如果字典表修改数据的话,把数据再重新查出,放入监听器中List<DictionaryEntity> dictionaryEntities = dictionaryService.selectList(new EntityWrapper<DictionaryEntity>());ServletContext servletContext = request.getServletContext();Map<String, Map<Integer,String>> map = new HashMap<>();for(DictionaryEntity d :dictionaryEntities){Map<Integer, String> m = map.get(d.getDicCode());if(m ==null || m.isEmpty()){m = new HashMap<>();}m.put(d.getCodeIndex(),d.getIndexName());map.put(d.getDicCode(),m);}servletContext.setAttribute("dictionaryMap",map);return R.ok();}else {return R.error(511,"表中有相同数据");}}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Integer[] ids){logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());dictionaryService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 最大值*/@RequestMapping("/maxCodeIndex")public R maxCodeIndex(@RequestBody DictionaryEntity dictionary){logger.debug("maxCodeIndex:,,Controller:{},,dictionary:{}",this.getClass().getName(),dictionary.toString());List<String> descs = new ArrayList<>();descs.add("code_index");Wrapper<DictionaryEntity> queryWrapper = new EntityWrapper<DictionaryEntity>().eq("dic_code", dictionary.getDicCode()).orderDesc(descs);logger.info("sql语句:"+queryWrapper.getSqlSegment());List<DictionaryEntity> dictionaryEntityList = dictionaryService.selectList(queryWrapper);if(dictionaryEntityList != null ){return R.ok().put("maxCodeIndex",dictionaryEntityList.get(0).getCodeIndex()+1);}else{return R.ok().put("maxCodeIndex",1);}}/*** 批量上传*/@RequestMapping("/batchInsert")public R save( String fileName, HttpServletRequest request){logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");try {List<DictionaryEntity> dictionaryList = new ArrayList<>();//上传的东西Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段Date date = new Date();int lastIndexOf = fileName.lastIndexOf(".");if(lastIndexOf == -1){return R.error(511,"该文件没有后缀");}else{String suffix = fileName.substring(lastIndexOf);if(!".xls".equals(suffix)){return R.error(511,"只支持后缀为xls的excel文件");}else{URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径File file = new File(resource.getFile());if(!file.exists()){return R.error(511,"找不到上传文件,请联系管理员");}else{List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件dataList.remove(0);//删除第一行,因为第一行是提示for(List<String> data:dataList){//循环DictionaryEntity dictionaryEntity = new DictionaryEntity();
//                            dictionaryEntity.setDicCode(data.get(0));                    //字段 要改的
//                            dictionaryEntity.setDicName(data.get(0));                    //字段名 要改的
//                            dictionaryEntity.setCodeIndex(Integer.valueOf(data.get(0)));   //编码 要改的
//                            dictionaryEntity.setIndexName(data.get(0));                    //编码名字 要改的
//                            dictionaryEntity.setSuperId(Integer.valueOf(data.get(0)));   //父字段id 要改的
//                            dictionaryEntity.setBeizhu(data.get(0));                    //备注 要改的
//                            dictionaryEntity.setCreateTime(date);//时间dictionaryList.add(dictionaryEntity);//把要查询是否重复的字段放入map中}//查询是否重复dictionaryService.insertBatch(dictionaryList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,"批量插入数据异常,请联系管理员");}}}

六、底部获取项目源码带万字文档(9.9¥带走)

有问题,或者需要协助调试运行项目的也可以

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/869797.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【fastadmin 开发实战】select 级联选择

先看实现的效果 1、表单页面实现级联选择 2、级联选项后台可以编辑添加 前端代码&#xff08;编辑窗口&#xff09;&#xff1a; <div class"form-group"><label class"control-label col-xs-12 col-sm-2">{:__(渠道归属)}:</label><…

力扣之有序链表去重

删除链表中的重复元素&#xff0c;重复元素保留一个 p1 p2 1 -> 1 -> 2 -> 3 -> 3 -> null p1.val p2.val 那么删除 p2&#xff0c;注意 p1 此时保持不变 p1 p2 1 -> 2 -> 3 -> 3 -> null p1.val ! p2.val 那么 p1&#xff0c;p2 向后移动 p1 …

Postman API测试覆盖率:全面评估指南

&#x1f4ca; Postman API测试覆盖率&#xff1a;全面评估指南 在API测试中&#xff0c;测试覆盖率是一个关键指标&#xff0c;它衡量了测试用例对代码的覆盖程度。Postman提供了多种工具和方法来评估API测试覆盖率&#xff0c;帮助开发者和测试人员确保API的质量和稳定性。本…

力扣 双指针基础

class Solution {public void moveZeroes(int[] nums) {int l 0;//慢指针但先走for (int r 0; r < nums.length; r) {//快指针&#xff0c;遍历次数if (nums[r] 0) continue;//l比r先到&#xff0c;在此处定住l&#xff0c;r继续移动int t nums[l];nums[l] nums[r];num…

关于力扣150题目——逆波兰表达式求值Java实现的三种解法

题目介绍 逆波兰表达式是一种后缀表达式&#xff0c;其运算符位于操作数之后。力扣150题目要求我们实现一个函数&#xff0c;计算给定逆波兰表达式的值。本文将介绍三种不同的Java实现方法来解决这个问题。 解法一&#xff1a;使用栈 这是最直观和常见的解法&#xff0c;使用…

33、PHP求1+2+3+...+n、php 实现不用加减乘除做加法

题目&#xff1a;PHP 求123…n 描述&#xff1a; 求123…n&#xff0c;要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判断语句&#xff08;A?B:C&#xff09;。 <?phpfunction Sum_Solution($n) {$sum 0;$n > 0 && $sum$nSum_Sol…

防火墙基础实验配置

一&#xff0c;实验拓扑 二&#xff0c;实验需求&#xff1a; 1.DMZ区内的服务器&#xff0c;办公区仅能在办公时间内&#xff08;9&#xff1a;00 - 18&#xff1a;00&#xff09;可以访问&#xff0c;生产区的设备全天可以访问 2.生产区不允许访问互联网&#xff0c;办公区…

外贸展示型网站设计

清洁能源风能设备wordpress外贸公司模板 风能设备wordpress外贸公司模板&#xff0c;做新能源网通设备的公司网站模板。 https://www.jianzhanpress.com/?p3606 钢材wordpress外贸公司模板 金属钢材wordpress外贸公司模板&#xff0c;做金属成品贸易公司的企业网站模板。 …

高项-法律法规与规范知识点

1、招标有公开招标、邀请招标和议标等。 2、国有资金占控股或者主导地位的依法必须进行招标的项目&#xff0c;应当公开招标&#xff1b; 下列情形可以邀请招标&#xff1a; (1) 需要采用不可替代的专利或者专有技术&#xff1b; (2) 采购人依法能够自行建设、生产或者提供&…

金九银十招聘季, 自动化测试面试题分享

马上进入金九银十&#xff0c;很多小伙伴有被动跳槽的打算&#xff0c;所以更新一些相关的自动化面试题&#xff0c;希望能帮到大家。 一 怎么设计接口测试用例&#xff1f; 通常&#xff0c;设计接口测试用例需要考虑以下几个方面&#xff1a; ① 是否满足前提条件 有些接…

面试经典题

找出字符串中第一个匹配项的下标 class Solution { public:vector<int> getNextArray(string needle){int n needle.size();if(n 1){return {-1};}else if(n 2){return {-1, 0};}vector<int> res(n);res[0] -1;res[1] 0;int cnt 0;int i 2;while(i < n)…

从零开始搭建互联网医院系统:技术与案例解析

随着信息技术的飞速发展和人们对医疗服务需求的增加&#xff0c;互联网医院逐渐成为医疗服务的重要模式。本文将详细介绍从零开始搭建互联网医院系统的关键技术和具体案例&#xff0c;帮助读者理解如何构建一个高效、可靠的互联网医院系统。 一、互联网医院系统的核心技术 1…

60秒带你了解冒泡排序

排序似乎有很多种排序&#xff0c;选择、插入、快速、归并、基数排序等等&#xff0c;今天实现一种最简单的排序方式&#xff1a;冒泡排序&#xff08;Bubble Sort&#xff09;。 int[] arr {9,1,6,3,8,4}; ↓&#xff08;如何通过算法实现这个过程&#xff1f;&#xff09; …

SMU Summer 2024 Contest Round 3

A.Hcode OnlineJudge 先用欧拉筛把质数预处理出来&#xff0c;然后枚举左端点的质数&#xff0c;只需要询问右端点是不是质数并取差值的min就行了 #include<bits/stdc.h> #define endl \n #define mk make_pair #define int long long using namespace std; typedef lon…

深入解析 Laravel 策略路由:提高应用安全性与灵活性的利器

引言 Laravel 是一个功能强大的 PHP Web 应用框架&#xff0c;以其优雅和简洁的语法而受到开发者的喜爱。在 Laravel 中&#xff0c;路由是应用中非常重要的一部分&#xff0c;它负责将用户的请求映射到相应的控制器方法上。Laravel 提供了多种路由方式&#xff0c;其中策略路…

NodeJS小饰品销售管理系统-计算机毕业设计源码21597

摘 要 在当今的数字化时代&#xff0c;电子商务已经成为了商业领域中不可或缺的一部分。随着消费者对于购物体验的要求越来越高&#xff0c;一个高效、便捷、用户友好的小饰品销售管理系统显得尤为重要。 本系统旨在利用 JavaScript 技术&#xff0c;设计并实现一个功能强大的小…

conda篇----在已有conda环境的基础上升级python包

conda篇----在已有conda环境的基础上升级python包 原先的python版本 第一步&#xff1a; conda update --all(py11) [xxxaivrs01 xxx]$ conda update --all Collecting package metadata (current_repodata.json): done Solving environment: done> WARNING: A newer vers…

如何高效学习(二)

二、如何练就超强学习能力&#xff1f;为什么有的人学的又快又好&#xff1f;高效学习的底层逻辑在这&#xff01; 说实话看到这个标题我感觉我捡到宝了&#xff0c;这不就是我一直在找寻的吗 这一节视频他分了三部分&#xff0c;分别是取势篇、明道篇、优术篇还有每次都有的&q…

【读点论文】ASAM: Boosting Segment Anything Model with Adversarial Tuning,对抗学习提升性能

ASAM: Boosting Segment Anything Model with Adversarial Tuning Abstract 在不断发展的计算机视觉领域&#xff0c;基础模型已成为关键工具&#xff0c;对各种任务表现出卓越的适应性。其中&#xff0c;Meta AI 的 Segment Anything Model (SAM) 在图像分割方面表现突出。然…

C语言 输出图案

输出以下图案: * * * * * * * * * * * * * * * * * * * * * * * * * #include <stdio.h>int main() {int n 5;for (int i 0; i < n; i) {for (int j 0; j < i; j) {printf(" ");}for (int k 0; k < n; k) {printf("* ");}pr…