基于springboot特产销售平台源码和论文

2024-02-18 06:28

本文主要是介绍基于springboot特产销售平台源码和论文,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

“互联网+”的战略实施后,很多行业的信息化水平都有了很大的提升。但是目前很多藏区特产销售信息仍是通过人工管理的方式进行,需要在各个岗位投入大量的人力进行很多重复性工作,使得对人力物力造成诸多浪费,工作效率不高等情况;同时为后续的工作带来了隐患。并且现有的藏区特产销售平台由于用户的体验感较差、系统流程不完善导致系统的使用率较低。此藏区特产销售平台的部署与应用,将对特产信息管理、特产分类管理、特产分类管理、特产评分管理、系统管理、订单管理等业务进行管理,这可以简化藏区特产销售管理工作程序、降低劳动成本、提高业务效率和工作效率。为了有效推动藏区特产销售管理资源的合理配置和使用,适应现代藏区特产销售管理机构的管理办法,迫切需要研发一套更加全面的藏区特产销售平台

本课题在充分研究了SpringBoot框架基础上,采用B/S模式,以Java为开发语言,MyEclipse为开发工具,MySQL为数据管理平台,实现的内容主要包括首页、个人中心、用户管理、特产信息管理、特产分类管理、特产分类管理、特产评分管理、系统管理、订单管理等功能。

关键词藏区特产销售平台Java;互联网+

基于springboot特产销售平台源码和论文375

演示视频:

基于springboot特产销售平台源码和论文

Abstract

After the implementation of the "Internet plus" strategy, the informatization level of many industries has been greatly improved. However, at present, a lot of sales information of Tibetan specialties is still carried out by manual management, which requires a lot of manpower to be invested in various posts for a lot of repetitive work, resulting in a lot of waste of human and material resources and low work efficiency. At the same time for the follow-up work brought hidden trouble. In addition, the existing Tibetan specialty sales platform has a low utilization rate due to poor user experience and imperfect system process. The deployment and application of the Tibetan specialty sales platform will manage the specialty information management, specialty classification management, specialty classification management, specialty scoring management, system management, order management and other businesses, which can simplify the Tibetan specialty sales management work procedures, reduce labor costs, improve business efficiency and work efficiency. In order to effectively promote the rational allocation and use of Tibetan specialty sales management resources and adapt to the management methods of modern Tibetan specialty sales management organizations, it is urgent to develop a more comprehensive Tibetan specialty sales platform.

This topic is based on the full study of SpringBoot framework, using B/S mode, Java as the development language, MyEclipse as the development tool, MySQL as the data management platform, The main contents include home page, personal center, user management, specialty information management, specialty classification management, specialty classification management, specialty scoring management, system management, order management and other functions.

Key words: Tibetan specialty sales platform; Java; Internet +

package com.controller;import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
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.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;import com.entity.AddressEntity;
import com.entity.view.AddressView;import com.service.AddressService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import java.io.IOException;/*** 地址* 后端接口* @author * @email * @date 2022-04-06 15:28:34*/
@RestController
@RequestMapping("/address")
public class AddressController {@Autowiredprivate AddressService addressService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,AddressEntity address,HttpServletRequest request){if(!request.getSession().getAttribute("role").toString().equals("管理员")) {address.setUserid((Long)request.getSession().getAttribute("userId"));}EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));return R.ok().put("data", page);}/*** 前端列表*/@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,AddressEntity address, HttpServletRequest request){if(!request.getSession().getAttribute("role").toString().equals("管理员")) {address.setUserid((Long)request.getSession().getAttribute("userId"));}EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();PageUtils page = addressService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, address), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( AddressEntity address){EntityWrapper<AddressEntity> ew = new EntityWrapper<AddressEntity>();ew.allEq(MPUtil.allEQMapPre( address, "address")); return R.ok().put("data", addressService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(AddressEntity address){EntityWrapper< AddressEntity> ew = new EntityWrapper< AddressEntity>();ew.allEq(MPUtil.allEQMapPre( address, "address")); AddressView addressView =  addressService.selectView(ew);return R.ok("查询地址成功").put("data", addressView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){AddressEntity address = addressService.selectById(id);return R.ok().put("data", address);}/*** 前端详情*/@IgnoreAuth@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){AddressEntity address = addressService.selectById(id);return R.ok().put("data", address);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody AddressEntity address, HttpServletRequest request){address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(address);address.setUserid((Long)request.getSession().getAttribute("userId"));Long userId = (Long)request.getSession().getAttribute("userId");if(address.getIsdefault().equals("是")) {addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));}address.setUserid(userId);addressService.insert(address);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody AddressEntity address, HttpServletRequest request){address.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(address);address.setUserid((Long)request.getSession().getAttribute("userId"));Long userId = (Long)request.getSession().getAttribute("userId");if(address.getIsdefault().equals("是")) {addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", userId));}address.setUserid(userId);addressService.insert(address);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody AddressEntity address, HttpServletRequest request){//ValidatorUtils.validateEntity(address);if(address.getIsdefault().equals("是")) {addressService.updateForSet("isdefault='否'", new EntityWrapper<AddressEntity>().eq("userid", request.getSession().getAttribute("userId")));}addressService.updateById(address);//全部更新return R.ok();}/*** 获取默认地址*/@RequestMapping("/default")public R defaultAddress(HttpServletRequest request){Wrapper<AddressEntity> wrapper = new EntityWrapper<AddressEntity>().eq("isdefault", "是").eq("userid", request.getSession().getAttribute("userId"));AddressEntity address = addressService.selectOne(wrapper);return R.ok().put("data", address);}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){addressService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 提醒接口*/@RequestMapping("/remind/{columnName}/{type}")public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, @PathVariable("type") String type,@RequestParam Map<String, Object> map) {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));}}Wrapper<AddressEntity> wrapper = new EntityWrapper<AddressEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}if(!request.getSession().getAttribute("role").toString().equals("管理员")) {wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));}int count = addressService.selectCount(wrapper);return R.ok().put("count", count);}}

 


package com.controller;import com.alibaba.fastjson.JSONObject;
import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.ZhuanjiaEntity;
import com.entity.view.ZhuanjiaView;
import com.service.DictionaryService;
import com.service.HuiyuanService;
import com.service.TokenService;
import com.service.ZhuanjiaService;
import com.utils.PageUtils;
import com.utils.PoiUtil;
import com.utils.R;
import com.utils.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.*;/*** 医生* 后端接口* @author* @email
*/
@RestController
@Controller
@RequestMapping("/zhuanjia")
public class ZhuanjiaController {private static final Logger logger = LoggerFactory.getLogger(ZhuanjiaController.class);@Autowiredprivate ZhuanjiaService zhuanjiaService;@Autowiredprivate TokenService tokenService;@Autowiredprivate DictionaryService dictionaryService;//级联表service@Autowiredprivate HuiyuanService huiyuanService;/*** 后端列表*/@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("用户 show2 photoShow".equals(role))params.put("huiyuanId",request.getSession().getAttribute("userId"));else if("医生".equals(role))params.put("zhuanjiaId",request.getSession().getAttribute("userId"));params.put("zhuanjiaDeleteStart",1);params.put("zhuanjiaDeleteEnd",1);if(params.get("orderBy")==null || params.get("orderBy")==""){params.put("orderBy","id");}PageUtils page = zhuanjiaService.queryPage(params);//字典表数据转换List<ZhuanjiaView> list =(List<ZhuanjiaView>)page.getList();for(ZhuanjiaView 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);ZhuanjiaEntity zhuanjia = zhuanjiaService.selectById(id);if(zhuanjia !=null){//entity转viewZhuanjiaView view = new ZhuanjiaView();BeanUtils.copyProperties( zhuanjia , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody ZhuanjiaEntity zhuanjia, HttpServletRequest request){logger.debug("save方法:,,Controller:{},,zhuanjia:{}",this.getClass().getName(),zhuanjia.toString());String role = String.valueOf(request.getSession().getAttribute("role"));if(false)return R.error(511,"永远不会进入");Wrapper<ZhuanjiaEntity> queryWrapper = new EntityWrapper<ZhuanjiaEntity>().eq("username", zhuanjia.getUsername()).or().eq("zhuanjia_phone", zhuanjia.getZhuanjiaPhone()).or().eq("zhuanjia_id_number", zhuanjia.getZhuanjiaIdNumber()).andNew().eq("zhuanjia_delete", 1);logger.info("sql语句:"+queryWrapper.getSqlSegment());ZhuanjiaEntity zhuanjiaEntity = zhuanjiaService.selectOne(queryWrapper);if(zhuanjiaEntity==null){zhuanjia.setZhuanjiaDelete(1);zhuanjia.setInsertTime(new Date());zhuanjia.setCreateTime(new Date());zhuanjia.setPassword("123456");zhuanjiaService.insert(zhuanjia);return R.ok();}else {return R.error(511,"账户或者医生手机号或者医生身份证号已经被使用");}}/*** 后端修改*/@RequestMapping("/update")public R update(@RequestBody ZhuanjiaEntity zhuanjia, HttpServletRequest request){logger.debug("update方法:,,Controller:{},,zhuanjia:{}",this.getClass().getName(),zhuanjia.toString());String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");//根据字段查询是否有相同数据Wrapper<ZhuanjiaEntity> queryWrapper = new EntityWrapper<ZhuanjiaEntity>().notIn("id",zhuanjia.getId()).andNew().eq("username", zhuanjia.getUsername()).or().eq("zhuanjia_phone", zhuanjia.getZhuanjiaPhone()).or().eq("zhuanjia_id_number", zhuanjia.getZhuanjiaIdNumber()).andNew().eq("zhuanjia_delete", 1);logger.info("sql语句:"+queryWrapper.getSqlSegment());ZhuanjiaEntity zhuanjiaEntity = zhuanjiaService.selectOne(queryWrapper);if("".equals(zhuanjia.getZhuanjiaPhoto()) || "null".equals(zhuanjia.getZhuanjiaPhoto())){zhuanjia.setZhuanjiaPhoto(null);}if(zhuanjiaEntity==null){zhuanjiaService.updateById(zhuanjia);//根据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());ArrayList<ZhuanjiaEntity> list = new ArrayList<>();for(Integer id:ids){ZhuanjiaEntity zhuanjiaEntity = new ZhuanjiaEntity();zhuanjiaEntity.setId(id);zhuanjiaEntity.setZhuanjiaDelete(2);list.add(zhuanjiaEntity);}if(list != null && list.size() >0){zhuanjiaService.updateBatchById(list);}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<ZhuanjiaEntity> zhuanjiaList = 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){//循环ZhuanjiaEntity zhuanjiaEntity = new ZhuanjiaEntity();
//                            zhuanjiaEntity.setUsername(data.get(0));                    //账户 要改的
//                            //zhuanjiaEntity.setPassword("123456");//密码
//                            zhuanjiaEntity.setZhuanjiaName(data.get(0));                    //医生姓名 要改的
//                            zhuanjiaEntity.setZhuanjiaPhone(data.get(0));                    //医生手机号 要改的
//                            zhuanjiaEntity.setZhuanjiaIdNumber(data.get(0));                    //医生身份证号 要改的
//                            zhuanjiaEntity.setZhuanjiaPhoto("");//详情和图片
//                            zhuanjiaEntity.setSexTypes(Integer.valueOf(data.get(0)));   //性别 要改的
//                            zhuanjiaEntity.setKeshiTypes(Integer.valueOf(data.get(0)));   //科室 要改的
//                            zhuanjiaEntity.setZhiweiTypes(Integer.valueOf(data.get(0)));   //职位 要改的
//                            zhuanjiaEntity.setGuahaoMoney(data.get(0));                    //挂号费 要改的
//                            zhuanjiaEntity.setZhuanjiaEmail(data.get(0));                    //电子邮箱 要改的
//                            zhuanjiaEntity.setZhuanjiaContent("");//详情和图片
//                            zhuanjiaEntity.setZhuanjiaDelete(1);//逻辑删除字段
//                            zhuanjiaEntity.setInsertTime(date);//时间
//                            zhuanjiaEntity.setCreateTime(date);//时间
//                            zhuanjiaEntity.setZhuanjiaPaiban(data.get(0));                    //医生排班 要改的zhuanjiaList.add(zhuanjiaEntity);//把要查询是否重复的字段放入map中//账户if(seachFields.containsKey("username")){List<String> username = seachFields.get("username");username.add(data.get(0));//要改的}else{List<String> username = new ArrayList<>();username.add(data.get(0));//要改的seachFields.put("username",username);}//医生手机号if(seachFields.containsKey("zhuanjiaPhone")){List<String> zhuanjiaPhone = seachFields.get("zhuanjiaPhone");zhuanjiaPhone.add(data.get(0));//要改的}else{List<String> zhuanjiaPhone = new ArrayList<>();zhuanjiaPhone.add(data.get(0));//要改的seachFields.put("zhuanjiaPhone",zhuanjiaPhone);}//医生身份证号if(seachFields.containsKey("zhuanjiaIdNumber")){List<String> zhuanjiaIdNumber = seachFields.get("zhuanjiaIdNumber");zhuanjiaIdNumber.add(data.get(0));//要改的}else{List<String> zhuanjiaIdNumber = new ArrayList<>();zhuanjiaIdNumber.add(data.get(0));//要改的seachFields.put("zhuanjiaIdNumber",zhuanjiaIdNumber);}}//查询是否重复//账户List<ZhuanjiaEntity> zhuanjiaEntities_username = zhuanjiaService.selectList(new EntityWrapper<ZhuanjiaEntity>().in("username", seachFields.get("username")).eq("zhuanjia_delete", 1));if(zhuanjiaEntities_username.size() >0 ){ArrayList<String> repeatFields = new ArrayList<>();for(ZhuanjiaEntity s:zhuanjiaEntities_username){repeatFields.add(s.getUsername());}return R.error(511,"数据库的该表中的 [账户] 字段已经存在 存在数据为:"+repeatFields.toString());}//医生手机号List<ZhuanjiaEntity> zhuanjiaEntities_zhuanjiaPhone = zhuanjiaService.selectList(new EntityWrapper<ZhuanjiaEntity>().in("zhuanjia_phone", seachFields.get("zhuanjiaPhone")).eq("zhuanjia_delete", 1));if(zhuanjiaEntities_zhuanjiaPhone.size() >0 ){ArrayList<String> repeatFields = new ArrayList<>();for(ZhuanjiaEntity s:zhuanjiaEntities_zhuanjiaPhone){repeatFields.add(s.getZhuanjiaPhone());}return R.error(511,"数据库的该表中的 [医生手机号] 字段已经存在 存在数据为:"+repeatFields.toString());}//医生身份证号List<ZhuanjiaEntity> zhuanjiaEntities_zhuanjiaIdNumber = zhuanjiaService.selectList(new EntityWrapper<ZhuanjiaEntity>().in("zhuanjia_id_number", seachFields.get("zhuanjiaIdNumber")).eq("zhuanjia_delete", 1));if(zhuanjiaEntities_zhuanjiaIdNumber.size() >0 ){ArrayList<String> repeatFields = new ArrayList<>();for(ZhuanjiaEntity s:zhuanjiaEntities_zhuanjiaIdNumber){repeatFields.add(s.getZhuanjiaIdNumber());}return R.error(511,"数据库的该表中的 [医生身份证号] 字段已经存在 存在数据为:"+repeatFields.toString());}zhuanjiaService.insertBatch(zhuanjiaList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,"批量插入数据异常,请联系管理员");}}/*** 登录*/@IgnoreAuth@RequestMapping(value = "/login")public R login(String username, String password, String captcha, HttpServletRequest request) {ZhuanjiaEntity zhuanjia = zhuanjiaService.selectOne(new EntityWrapper<ZhuanjiaEntity>().eq("username", username));if(zhuanjia==null || !zhuanjia.getPassword().equals(password))return R.error("账号或密码不正确");else if(zhuanjia.getZhuanjiaDelete() != 1)return R.error("账户已被删除");//  // 获取监听器中的字典表// ServletContext servletContext = ContextLoader.getCurrentWebApplicationContext().getServletContext();// Map<String, Map<Integer, String>> dictionaryMap= (Map<String, Map<Integer, String>>) servletContext.getAttribute("dictionaryMap");// Map<Integer, String> role_types = dictionaryMap.get("role_types");// role_types.get(.getRoleTypes());String token = tokenService.generateToken(zhuanjia.getId(),username, "zhuanjia", "医生");R r = R.ok();r.put("token", token);r.put("role","医生");r.put("username",zhuanjia.getZhuanjiaName());r.put("tableName","zhuanjia");r.put("userId",zhuanjia.getId());return r;}/*** 注册*/@IgnoreAuth@PostMapping(value = "/register")public R register(@RequestBody ZhuanjiaEntity zhuanjia){
//    	ValidatorUtils.validateEntity(user);Wrapper<ZhuanjiaEntity> queryWrapper = new EntityWrapper<ZhuanjiaEntity>().eq("username", zhuanjia.getUsername()).or().eq("zhuanjia_phone", zhuanjia.getZhuanjiaPhone()).or().eq("zhuanjia_id_number", zhuanjia.getZhuanjiaIdNumber()).andNew().eq("zhuanjia_delete", 1);ZhuanjiaEntity zhuanjiaEntity = zhuanjiaService.selectOne(queryWrapper);if(zhuanjiaEntity != null)return R.error("账户或者医生手机号或者医生身份证号已经被使用");zhuanjia.setGuahaoMoney(0.0);zhuanjia.setZhuanjiaDelete(1);zhuanjia.setInsertTime(new Date());zhuanjia.setCreateTime(new Date());zhuanjiaService.insert(zhuanjia);return R.ok();}/*** 重置密码*/@GetMapping(value = "/resetPassword")public R resetPassword(Integer  id){ZhuanjiaEntity zhuanjia = new ZhuanjiaEntity();zhuanjia.setPassword("123456");zhuanjia.setId(id);zhuanjia.setInsertTime(new Date());zhuanjiaService.updateById(zhuanjia);return R.ok();}/*** 忘记密码*/@IgnoreAuth@RequestMapping(value = "/resetPass")public R resetPass(String username, HttpServletRequest request) {ZhuanjiaEntity zhuanjia = zhuanjiaService.selectOne(new EntityWrapper<ZhuanjiaEntity>().eq("username", username));if(zhuanjia!=null){zhuanjia.setPassword("123456");boolean b = zhuanjiaService.updateById(zhuanjia);if(!b){return R.error();}}else{return R.error("账号不存在");}return R.ok();}/*** 获取用户的session用户信息*/@RequestMapping("/session")public R getCurrZhuanjia(HttpServletRequest request){Integer id = (Integer)request.getSession().getAttribute("userId");ZhuanjiaEntity zhuanjia = zhuanjiaService.selectById(id);if(zhuanjia !=null){//entity转viewZhuanjiaView view = new ZhuanjiaView();BeanUtils.copyProperties( zhuanjia , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 退出*/@GetMapping(value = "logout")public R logout(HttpServletRequest request) {request.getSession().invalidate();return R.ok("退出成功");}/*** 前端列表*/@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 = zhuanjiaService.queryPage(params);//字典表数据转换List<ZhuanjiaView> list =(List<ZhuanjiaView>)page.getList();for(ZhuanjiaView 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);ZhuanjiaEntity zhuanjia = zhuanjiaService.selectById(id);if(zhuanjia !=null){//entity转viewZhuanjiaView view = new ZhuanjiaView();BeanUtils.copyProperties( zhuanjia , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put("data", view);}else {return R.error(511,"查不到数据");}}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody ZhuanjiaEntity zhuanjia, HttpServletRequest request){logger.debug("add方法:,,Controller:{},,zhuanjia:{}",this.getClass().getName(),zhuanjia.toString());Wrapper<ZhuanjiaEntity> queryWrapper = new EntityWrapper<ZhuanjiaEntity>().eq("username", zhuanjia.getUsername()).or().eq("zhuanjia_phone", zhuanjia.getZhuanjiaPhone()).or().eq("zhuanjia_id_number", zhuanjia.getZhuanjiaIdNumber()).andNew().eq("zhuanjia_delete", 1);logger.info("sql语句:"+queryWrapper.getSqlSegment());ZhuanjiaEntity zhuanjiaEntity = zhuanjiaService.selectOne(queryWrapper);if(zhuanjiaEntity==null){zhuanjia.setZhuanjiaDelete(1);zhuanjia.setInsertTime(new Date());zhuanjia.setCreateTime(new Date());zhuanjia.setPassword("123456");zhuanjiaService.insert(zhuanjia);return R.ok();}else {return R.error(511,"账户或者医生手机号或者医生身份证号已经被使用");}}}

这篇关于基于springboot特产销售平台源码和论文的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/720314

相关文章

在Ubuntu上部署SpringBoot应用的操作步骤

《在Ubuntu上部署SpringBoot应用的操作步骤》随着云计算和容器化技术的普及,Linux服务器已成为部署Web应用程序的主流平台之一,Java作为一种跨平台的编程语言,具有广泛的应用场景,本... 目录一、部署准备二、安装 Java 环境1. 安装 JDK2. 验证 Java 安装三、安装 mys

Springboot的ThreadPoolTaskScheduler线程池轻松搞定15分钟不操作自动取消订单

《Springboot的ThreadPoolTaskScheduler线程池轻松搞定15分钟不操作自动取消订单》:本文主要介绍Springboot的ThreadPoolTaskScheduler线... 目录ThreadPoolTaskScheduler线程池实现15分钟不操作自动取消订单概要1,创建订单后

JAVA中整型数组、字符串数组、整型数和字符串 的创建与转换的方法

《JAVA中整型数组、字符串数组、整型数和字符串的创建与转换的方法》本文介绍了Java中字符串、字符数组和整型数组的创建方法,以及它们之间的转换方法,还详细讲解了字符串中的一些常用方法,如index... 目录一、字符串、字符数组和整型数组的创建1、字符串的创建方法1.1 通过引用字符数组来创建字符串1.2

SpringCloud集成AlloyDB的示例代码

《SpringCloud集成AlloyDB的示例代码》AlloyDB是GoogleCloud提供的一种高度可扩展、强性能的关系型数据库服务,它兼容PostgreSQL,并提供了更快的查询性能... 目录1.AlloyDBjavascript是什么?AlloyDB 的工作原理2.搭建测试环境3.代码工程1.

Java调用Python代码的几种方法小结

《Java调用Python代码的几种方法小结》Python语言有丰富的系统管理、数据处理、统计类软件包,因此从java应用中调用Python代码的需求很常见、实用,本文介绍几种方法从java调用Pyt... 目录引言Java core使用ProcessBuilder使用Java脚本引擎总结引言python

SpringBoot操作spark处理hdfs文件的操作方法

《SpringBoot操作spark处理hdfs文件的操作方法》本文介绍了如何使用SpringBoot操作Spark处理HDFS文件,包括导入依赖、配置Spark信息、编写Controller和Ser... 目录SpringBoot操作spark处理hdfs文件1、导入依赖2、配置spark信息3、cont

springboot整合 xxl-job及使用步骤

《springboot整合xxl-job及使用步骤》XXL-JOB是一个分布式任务调度平台,用于解决分布式系统中的任务调度和管理问题,文章详细介绍了XXL-JOB的架构,包括调度中心、执行器和Web... 目录一、xxl-job是什么二、使用步骤1. 下载并运行管理端代码2. 访问管理页面,确认是否启动成功

Java中的密码加密方式

《Java中的密码加密方式》文章介绍了Java中使用MD5算法对密码进行加密的方法,以及如何通过加盐和多重加密来提高密码的安全性,MD5是一种不可逆的哈希算法,适合用于存储密码,因为其输出的摘要长度固... 目录Java的密码加密方式密码加密一般的应用方式是总结Java的密码加密方式密码加密【这里采用的

Java中ArrayList的8种浅拷贝方式示例代码

《Java中ArrayList的8种浅拷贝方式示例代码》:本文主要介绍Java中ArrayList的8种浅拷贝方式的相关资料,讲解了Java中ArrayList的浅拷贝概念,并详细分享了八种实现浅... 目录引言什么是浅拷贝?ArrayList 浅拷贝的重要性方法一:使用构造函数方法二:使用 addAll(

解决mybatis-plus-boot-starter与mybatis-spring-boot-starter的错误问题

《解决mybatis-plus-boot-starter与mybatis-spring-boot-starter的错误问题》本文主要讲述了在使用MyBatis和MyBatis-Plus时遇到的绑定异常... 目录myBATis-plus-boot-starpythonter与mybatis-spring-b