当前位置: 首页 > news >正文

深圳市有方科技有限公司合肥seo推广公司哪家好

深圳市有方科技有限公司,合肥seo推广公司哪家好,本人已履行网站备案信息,淘宝运营培训班哪里有随着信息化时代的到来#xff0c;管理系统都趋向于智能化、系统化#xff0c;超市进销存系统也不例外#xff0c;但目前国内仍都使用人工管理#xff0c;市场规模越来越大#xff0c;同时信息量也越来越庞大#xff0c;人工管理显然已无法应对时代的变化#xff0c;而超…随着信息化时代的到来管理系统都趋向于智能化、系统化超市进销存系统也不例外但目前国内仍都使用人工管理市场规模越来越大同时信息量也越来越庞大人工管理显然已无法应对时代的变化而超市进销存系统能很好地解决这一问题轻松应对超市进销存平时的工作既能提高人力物力财力又能加快工作的效率取代人工管理是必然趋势。 本超市进销存系统以springboot作为框架b/s模式以及MySql作为后台运行的数据库同时使用Tomcat用为系统的服务器。本系统主要包括首页、个人中心、员工管理、客户管理、供应商管理、承运商管理、仓库信息管理、商品类别管理、 商品信息管理、采购信息管理、入库信息管理、出库信息管理、销售订单管理、部门管理、岗位管理等功能通过这些功能的实现基本能够满足日常超市进销存管理的操作。 本文着重阐述了超市进销存系统的分析、设计与实现首先介绍开发系统和环境配置、数据库的设计接着说明功能模块的详细实现最后进行了总结。 关键词超市进销存; springboot;MySql数据库;Tomcat; 基于springboot超市进销存系统源码和论文366 基于springboot超市进销存系统源码和论文 Abstract With the advent of the era of information technology, management systems tend to be intelligent, systematic, supermarket invoicing system is no exception, but at present domestic still use manual management, the size of the market is more and more big, at the same time, the amount of information is becoming more and more big, artificial management has clearly unable to cope with the changes of The Times, and the supermarket enters sells saves the system can well solve the problem, It can not only improve human, material and financial resources, but also speed up the efficiency of work. It is an inevitable trend to replace manual management. Springboot is used as the framework of the system, B/S mode and MySql are used as the background database, and Tomcat is used as the server of the system. This system mainly includes home page, personal center, staff management, customer management, supplier management, carrier management, warehouse information management, commodity category management, commodity information management, purchasing information management, warehousing information management, warehousing information management, sales order management, department management, post management and other functions, Through the realization of these functions can basically meet the daily supermarket purchase, sale and stock management operation. This paper focuses on the analysis, design and implementation of the supermarket purchase, sale and inventory system. First, it introduces the development system and environment configuration, the design of the database, and then explains the detailed implementation of the functional modules. Finally, it summarizes. Key words: supermarket; springboot; MySql database; Tomcat; 1.1  研究背景 科学技术日新月异的如今计算机在生活各个领域都占有重要的作用尤其在信息管理方面在这样的大背景下学习计算机知识不仅仅是为了掌握一种技能更重要的是能够让它真正地使用到实践中去以创新的视角去不断方便人们的生活推动对新知识的学习培养自学能力锻炼动手实践的本领。现代的超市进销存系统也应该摆脱人工管理的模式使用计算机技术来进行信息管理工作。所以本次系统设计的超市进销存管理结合了文字、图像并能实现超市进销存管理的功能这也是一般超市进销存系统的重要的要素。超市进销存系统经过几年的实践和总结正在往更深入的方向发展。由此人们要改善系统功能迫在眉睫。随着科学技术的飞速发展超市进销存系统也要不断完善其工作流程的繁杂性、多样化、管理复杂、收缴费用与设备维护繁琐等存在的问题。所以要通过计算机胜任超市进销存管理的工作使超市进销存系统更加准确、方便及快捷。 因此开发出一套高效率、低差错的超市进销存信息管理系统是十分必要。本系统主要目的是全面实现超市进销存系统数字化管理员对于员工的所有信息能够全部掌握而员工能够对自己的超市进销存信息能够有一个直观的了解。 1.2  系统研究现状 现如今超市进销存的服务并不全面普及就是尽管实行了超市进销存管理但系统进行的管理力量远远不够所以有很多超市进销存管理工作只停留在传统的服务状态。同时因资金有限再加上也缺少专业水平的工作人员所以超市进销存的管理手段较为落后也就很难提高超市进销存的管理效率同时也就不能很好的为市场的用户提供更为完善的服务。现在市场管理都是通过手动来进行管理记录及操作不但麻烦琐碎还经常出现错误给广大用户带来很不便同时也需要大量的人力、物力和财力极大的浪费了超市进销存的资源。超市进销存管理系统是超市进销存行业的一个重要组成部分随着超市进销存行业的快速发展人们慢慢地来希望超市进销存系统能够提供更为合理及完善的超市进销存服务。现在好的超市进销存管理也成为广大用户们选择超市进销存系统的关键。 1.3  系统实现的功能 本次设计任务是要设计一个超市进销存系统通过这个系统能够满足超市进销存系统的管理及员工的超市进销存管理功能。系统的主要功能包括首页、个人中心、员工管理、客户管理、供应商管理、承运商管理、仓库信息管理、商品类别管理、 商品信息管理、采购信息管理、入库信息管理、出库信息管理、销售订单管理、部门管理、岗位管理等功能。 管理员可以根据系统给定的账号进行登录登录后可以进入超市进销存系统对超市进销存所有模块进行管理。包括查看和修改自己的个人信息以及登录密码。 该系统为每一个用户都分配了一个用户账号员工通过账号的登录可以在系统中查看超市进销存信息及对个人信息进行修改等功能。 1.4  系统的特点 本系统提供给管理员对首页、个人中心、员工管理、客户管理、供应商管理、承运商管理、仓库信息管理、商品类别管理、 商品信息管理、采购信息管理、入库信息管理、出库信息管理、销售订单管理、部门管理、岗位管理等诸多功能进行管理。本系统对于用户输入的任何信息都进行了一定的验证为管理员操作提高了效率也使其数据安全性得到了保障。 package com.controller;import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.apache.commons.lang3.StringUtils; import org.json.JSONObject; 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.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{Autowiredprivate CommonService commonService;private static AipFace client null;Autowiredprivate ConfigService configService; /*** 获取table表中的column列表(联动接口)* param table* param column* return*/IgnoreAuthRequestMapping(/option/{tableName}/{columnName})public R getOption(PathVariable(tableName) String tableName, PathVariable(columnName) String columnName,String level,String parent) {MapString, Object params new HashMapString, 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);}ListString data commonService.getOption(params);return R.ok().put(data, data);}/*** 根据table中的column获取单条记录* param table* param column* return*/IgnoreAuthRequestMapping(/follow/{tableName}/{columnName})public R getFollowByOption(PathVariable(tableName) String tableName, PathVariable(columnName) String columnName, RequestParam String columnValue) {MapString, Object params new HashMapString, Object();params.put(table, tableName);params.put(column, columnName);params.put(columnValue, columnValue);MapString, Object result commonService.getFollowByOption(params);return R.ok().put(data, result);}/*** 修改table表的sfsh状态* param table* param map* return*/RequestMapping(/sh/{tableName})public R sh(PathVariable(tableName) String tableName, RequestBody MapString, Object map) {map.put(table, tableName);commonService.sh(map);return R.ok();}/*** 获取需要提醒的记录数* param tableName* param columnName* param type 1:数字 2:日期* param map* return*/IgnoreAuthRequestMapping(/remind/{tableName}/{columnName}/{type})public R remindCount(PathVariable(tableName) String tableName, PathVariable(columnName) String columnName, PathVariable(type) String type,RequestParam MapString, 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);}/*** 单列求和*/IgnoreAuthRequestMapping(/cal/{tableName}/{columnName})public R cal(PathVariable(tableName) String tableName, PathVariable(columnName) String columnName) {MapString, Object params new HashMapString, Object();params.put(table, tableName);params.put(column, columnName);MapString, Object result commonService.selectCal(params);return R.ok().put(data, result);}/*** 分组统计*/IgnoreAuthRequestMapping(/group/{tableName}/{columnName})public R group(PathVariable(tableName) String tableName, PathVariable(columnName) String columnName) {MapString, Object params new HashMapString, Object();params.put(table, tableName);params.put(column, columnName);ListMapString, Object result commonService.selectGroup(params);SimpleDateFormat sdf new SimpleDateFormat(yyyy-MM-dd);for(MapString, Object m : result) {for(String k : m.keySet()) {if(m.get(k) instanceof Date) {m.put(k, sdf.format((Date)m.get(k)));}}}return R.ok().put(data, result);}/*** 按值统计*/IgnoreAuthRequestMapping(/value/{tableName}/{xColumnName}/{yColumnName})public R value(PathVariable(tableName) String tableName, PathVariable(yColumnName) String yColumnName, PathVariable(xColumnName) String xColumnName) {MapString, Object params new HashMapString, Object();params.put(table, tableName);params.put(xColumn, xColumnName);params.put(yColumn, yColumnName);ListMapString, Object result commonService.selectValue(params);SimpleDateFormat sdf new SimpleDateFormat(yyyy-MM-dd);for(MapString, Object m : result) {for(String k : m.keySet()) {if(m.get(k) instanceof Date) {m.put(k, sdf.format((Date)m.get(k)));}}}return R.ok().put(data, result);}/*** 按值统计时间统计类型*/IgnoreAuthRequestMapping(/value/{tableName}/{xColumnName}/{yColumnName}/{timeStatType})public R valueDay(PathVariable(tableName) String tableName, PathVariable(yColumnName) String yColumnName, PathVariable(xColumnName) String xColumnName, PathVariable(timeStatType) String timeStatType) {MapString, Object params new HashMapString, Object();params.put(table, tableName);params.put(xColumn, xColumnName);params.put(yColumn, yColumnName);params.put(timeStatType, timeStatType);ListMapString, Object result commonService.selectTimeStatValue(params);SimpleDateFormat sdf new SimpleDateFormat(yyyy-MM-dd);for(MapString, Object m : result) {for(String k : m.keySet()) {if(m.get(k) instanceof Date) {m.put(k, sdf.format((Date)m.get(k)));}}}return R.ok().put(data, result);}/*** 人脸比对* * param face1 人脸1* param face2 人脸2* return*/RequestMapping(/matchFace)IgnoreAuthpublic R matchFace(String face1, String face2,HttpServletRequest request) {if(clientnull) {/*String AppID configService.selectOne(new EntityWrapperConfigEntity().eq(name, AppID)).getValue();*/String APIKey configService.selectOne(new EntityWrapperConfigEntity().eq(name, APIKey)).getValue();String SecretKey configService.selectOne(new EntityWrapperConfigEntity().eq(name, SecretKey)).getValue();String token BaiduUtil.getAuth(APIKey, SecretKey);if(tokennull) {return R.error(请在配置管理中正确配置APIKey和SecretKey);}client new AipFace(null, APIKey, SecretKey);client.setConnectionTimeoutInMillis(2000);client.setSocketTimeoutInMillis(60000);}JSONObject res null;try {File path new File(ResourceUtils.getURL(classpath:static).getPath());if(!path.exists()) {path new File();}File upload new File(path.getAbsolutePath(),/upload/);File file1 new File(upload.getAbsolutePath()/face1);File file2 new File(upload.getAbsolutePath()/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);ArrayListMatchRequest requests new ArrayListMatchRequest();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(score, com.alibaba.fastjson.JSONObject.parse(res.getJSONObject(result).get(score).toString()));} }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(/yonghu) public class YonghuController {private static final Logger logger LoggerFactory.getLogger(YonghuController.class);private static final String TABLE_NAME yonghu;Autowiredprivate YonghuService yonghuService;Autowiredprivate TokenService tokenService;Autowiredprivate DictionaryService dictionaryService;//字典Autowiredprivate ExampaperService exampaperService;//试卷表Autowiredprivate ExampapertopicService exampapertopicService;//试卷选题Autowiredprivate ExamquestionService examquestionService;//试题表Autowiredprivate ExamrecordService examrecordService;//答题记录表Autowiredprivate ExamredetailsService examredetailsService;//答题详情表Autowiredprivate ForumService forumService;//论坛Autowiredprivate NewsService newsService;//公告信息Autowiredprivate XuexishipinService xuexishipinService;//课程学习Autowiredprivate XuexishipinCollectionService xuexishipinCollectionService;//课程收藏Autowiredprivate ZhiyejieshaoService zhiyejieshaoService;//职业介绍Autowiredprivate ZhiyejieshaoCollectionService zhiyejieshaoCollectionService;//职业介绍收藏Autowiredprivate UsersService usersService;//管理员/*** 后端列表*/RequestMapping(/page)public R page(RequestParam MapString, 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));params.put(yonghuDeleteStart,1);params.put(yonghuDeleteEnd,1);CommonUtil.checkMap(params);PageUtils page yonghuService.queryPage(params);//字典表数据转换ListYonghuView list (ListYonghuView)page.getList();for(YonghuView 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);YonghuEntity yonghu yonghuService.selectById(id);if(yonghu !null){//entity转viewYonghuView view new YonghuView();BeanUtils.copyProperties( yonghu , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put(data, view);}else {return R.error(511,查不到数据);}}/*** 后端保存*/RequestMapping(/save)public R save(RequestBody YonghuEntity yonghu, HttpServletRequest request){logger.debug(save方法:,,Controller:{},,yonghu:{},this.getClass().getName(),yonghu.toString());String role String.valueOf(request.getSession().getAttribute(role));if(false)return R.error(511,永远不会进入);WrapperYonghuEntity queryWrapper new EntityWrapperYonghuEntity().eq(username, yonghu.getUsername()).or().eq(yonghu_phone, yonghu.getYonghuPhone()).or().eq(yonghu_id_number, yonghu.getYonghuIdNumber()).andNew().eq(yonghu_delete, 1);logger.info(sql语句:queryWrapper.getSqlSegment());YonghuEntity yonghuEntity yonghuService.selectOne(queryWrapper);if(yonghuEntitynull){yonghu.setYonghuDelete(1);yonghu.setCreateTime(new Date());yonghu.setPassword(123456);yonghuService.insert(yonghu);return R.ok();}else {return R.error(511,账户或者用户手机号或者用户身份证号已经被使用);}}/*** 后端修改*/RequestMapping(/update)public R update(RequestBody YonghuEntity yonghu, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {logger.debug(update方法:,,Controller:{},,yonghu:{},this.getClass().getName(),yonghu.toString());YonghuEntity oldYonghuEntity yonghuService.selectById(yonghu.getId());//查询原先数据String role String.valueOf(request.getSession().getAttribute(role)); // if(false) // return R.error(511,永远不会进入);if(.equals(yonghu.getYonghuPhoto()) || null.equals(yonghu.getYonghuPhoto())){yonghu.setYonghuPhoto(null);}yonghuService.updateById(yonghu);//根据id更新return R.ok();}/*** 删除*/RequestMapping(/delete)public R delete(RequestBody Integer[] ids, HttpServletRequest request){logger.debug(delete:,,Controller:{},,ids:{},this.getClass().getName(),ids.toString());ListYonghuEntity oldYonghuList yonghuService.selectBatchIds(Arrays.asList(ids));//要删除的数据ArrayListYonghuEntity list new ArrayList();for(Integer id:ids){YonghuEntity yonghuEntity new YonghuEntity();yonghuEntity.setId(id);yonghuEntity.setYonghuDelete(2);list.add(yonghuEntity);}if(list ! null list.size() 0){yonghuService.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 {ListYonghuEntity yonghuList new ArrayList();//上传的东西MapString, ListString 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{ListListString dataList PoiUtil.poiImport(file.getPath());//读取xls文件dataList.remove(0);//删除第一行因为第一行是提示for(ListString data:dataList){//循环YonghuEntity yonghuEntity new YonghuEntity(); // yonghuEntity.setUsername(data.get(0)); //账户 要改的 // //yonghuEntity.setPassword(123456);//密码 // yonghuEntity.setYonghuName(data.get(0)); //用户姓名 要改的 // yonghuEntity.setYonghuPhoto();//详情和图片 // yonghuEntity.setYonghuPhone(data.get(0)); //用户手机号 要改的 // yonghuEntity.setYonghuIdNumber(data.get(0)); //用户身份证号 要改的 // yonghuEntity.setSexTypes(Integer.valueOf(data.get(0))); //性别 要改的 // yonghuEntity.setYonghuEmail(data.get(0)); //邮箱 要改的 // yonghuEntity.setYonghuDelete(1);//逻辑删除字段 // yonghuEntity.setCreateTime(date);//时间yonghuList.add(yonghuEntity);//把要查询是否重复的字段放入map中//账户if(seachFields.containsKey(username)){ListString username seachFields.get(username);username.add(data.get(0));//要改的}else{ListString username new ArrayList();username.add(data.get(0));//要改的seachFields.put(username,username);}//用户手机号if(seachFields.containsKey(yonghuPhone)){ListString yonghuPhone seachFields.get(yonghuPhone);yonghuPhone.add(data.get(0));//要改的}else{ListString yonghuPhone new ArrayList();yonghuPhone.add(data.get(0));//要改的seachFields.put(yonghuPhone,yonghuPhone);}//用户身份证号if(seachFields.containsKey(yonghuIdNumber)){ListString yonghuIdNumber seachFields.get(yonghuIdNumber);yonghuIdNumber.add(data.get(0));//要改的}else{ListString yonghuIdNumber new ArrayList();yonghuIdNumber.add(data.get(0));//要改的seachFields.put(yonghuIdNumber,yonghuIdNumber);}}//查询是否重复//账户ListYonghuEntity yonghuEntities_username yonghuService.selectList(new EntityWrapperYonghuEntity().in(username, seachFields.get(username)).eq(yonghu_delete, 1));if(yonghuEntities_username.size() 0 ){ArrayListString repeatFields new ArrayList();for(YonghuEntity s:yonghuEntities_username){repeatFields.add(s.getUsername());}return R.error(511,数据库的该表中的 [账户] 字段已经存在 存在数据为:repeatFields.toString());}//用户手机号ListYonghuEntity yonghuEntities_yonghuPhone yonghuService.selectList(new EntityWrapperYonghuEntity().in(yonghu_phone, seachFields.get(yonghuPhone)).eq(yonghu_delete, 1));if(yonghuEntities_yonghuPhone.size() 0 ){ArrayListString repeatFields new ArrayList();for(YonghuEntity s:yonghuEntities_yonghuPhone){repeatFields.add(s.getYonghuPhone());}return R.error(511,数据库的该表中的 [用户手机号] 字段已经存在 存在数据为:repeatFields.toString());}//用户身份证号ListYonghuEntity yonghuEntities_yonghuIdNumber yonghuService.selectList(new EntityWrapperYonghuEntity().in(yonghu_id_number, seachFields.get(yonghuIdNumber)).eq(yonghu_delete, 1));if(yonghuEntities_yonghuIdNumber.size() 0 ){ArrayListString repeatFields new ArrayList();for(YonghuEntity s:yonghuEntities_yonghuIdNumber){repeatFields.add(s.getYonghuIdNumber());}return R.error(511,数据库的该表中的 [用户身份证号] 字段已经存在 存在数据为:repeatFields.toString());}yonghuService.insertBatch(yonghuList);return R.ok();}}}}catch (Exception e){e.printStackTrace();return R.error(511,批量插入数据异常请联系管理员);}}/*** 登录*/IgnoreAuthRequestMapping(value /login)public R login(String username, String password, String captcha, HttpServletRequest request) {YonghuEntity yonghu yonghuService.selectOne(new EntityWrapperYonghuEntity().eq(username, username));if(yonghunull || !yonghu.getPassword().equals(password))return R.error(账号或密码不正确);else if(yonghu.getYonghuDelete() ! 1)return R.error(账户已被删除);String token tokenService.generateToken(yonghu.getId(),username, yonghu, 用户);R r R.ok();r.put(token, token);r.put(role,用户);r.put(username,yonghu.getYonghuName());r.put(tableName,yonghu);r.put(userId,yonghu.getId());return r;}/*** 注册*/IgnoreAuthPostMapping(value /register)public R register(RequestBody YonghuEntity yonghu, HttpServletRequest request) { // ValidatorUtils.validateEntity(user);WrapperYonghuEntity queryWrapper new EntityWrapperYonghuEntity().eq(username, yonghu.getUsername()).or().eq(yonghu_phone, yonghu.getYonghuPhone()).or().eq(yonghu_id_number, yonghu.getYonghuIdNumber()).andNew().eq(yonghu_delete, 1);YonghuEntity yonghuEntity yonghuService.selectOne(queryWrapper);if(yonghuEntity ! null)return R.error(账户或者用户手机号或者用户身份证号已经被使用);yonghu.setYonghuDelete(1);yonghu.setCreateTime(new Date());yonghuService.insert(yonghu);return R.ok();}/*** 重置密码*/GetMapping(value /resetPassword)public R resetPassword(Integer id, HttpServletRequest request) {YonghuEntity yonghu yonghuService.selectById(id);yonghu.setPassword(123456);yonghuService.updateById(yonghu);return R.ok();}/*** 修改密码*/GetMapping(value /updatePassword)public R updatePassword(String oldPassword, String newPassword, HttpServletRequest request) {YonghuEntity yonghu yonghuService.selectById((Integer)request.getSession().getAttribute(userId));if(newPassword null){return R.error(新密码不能为空) ;}if(!oldPassword.equals(yonghu.getPassword())){return R.error(原密码输入错误);}if(newPassword.equals(yonghu.getPassword())){return R.error(新密码不能和原密码一致) ;}yonghu.setPassword(newPassword);yonghuService.updateById(yonghu);return R.ok();}/*** 忘记密码*/IgnoreAuthRequestMapping(value /resetPass)public R resetPass(String username, HttpServletRequest request) {YonghuEntity yonghu yonghuService.selectOne(new EntityWrapperYonghuEntity().eq(username, username));if(yonghu!null){yonghu.setPassword(123456);yonghuService.updateById(yonghu);return R.ok();}else{return R.error(账号不存在);}}/*** 获取用户的session用户信息*/RequestMapping(/session)public R getCurrYonghu(HttpServletRequest request){Integer id (Integer)request.getSession().getAttribute(userId);YonghuEntity yonghu yonghuService.selectById(id);if(yonghu !null){//entity转viewYonghuView view new YonghuView();BeanUtils.copyProperties( yonghu , 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(退出成功);}/*** 前端列表*/IgnoreAuthRequestMapping(/list)public R list(RequestParam MapString, Object params, HttpServletRequest request){logger.debug(list方法:,,Controller:{},,params:{},this.getClass().getName(),JSONObject.toJSONString(params));CommonUtil.checkMap(params);PageUtils page yonghuService.queryPage(params);//字典表数据转换ListYonghuView list (ListYonghuView)page.getList();for(YonghuView 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);YonghuEntity yonghu yonghuService.selectById(id);if(yonghu !null){//entity转viewYonghuView view new YonghuView();BeanUtils.copyProperties( yonghu , view );//把实体数据重构到view中//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put(data, view);}else {return R.error(511,查不到数据);}}/*** 前端保存*/RequestMapping(/add)public R add(RequestBody YonghuEntity yonghu, HttpServletRequest request){logger.debug(add方法:,,Controller:{},,yonghu:{},this.getClass().getName(),yonghu.toString());WrapperYonghuEntity queryWrapper new EntityWrapperYonghuEntity().eq(username, yonghu.getUsername()).or().eq(yonghu_phone, yonghu.getYonghuPhone()).or().eq(yonghu_id_number, yonghu.getYonghuIdNumber()).andNew().eq(yonghu_delete, 1) // .notIn(yonghu_types, new Integer[]{102});logger.info(sql语句:queryWrapper.getSqlSegment());YonghuEntity yonghuEntity yonghuService.selectOne(queryWrapper);if(yonghuEntitynull){yonghu.setYonghuDelete(1);yonghu.setCreateTime(new Date());yonghu.setPassword(123456);yonghuService.insert(yonghu);return R.ok();}else {return R.error(511,账户或者用户手机号或者用户身份证号已经被使用);}}}
http://www.zqtcl.cn/news/407315/

相关文章:

  • 1688网站怎么样百度一下你知道
  • 做电商图的设计网站蚌埠网页设计培训
  • 江苏省建设工程质量监督站网站手机网站 案例
  • 优而思 网站科技自立自强是国家强盛之基
  • 去哪里购买网站空间专门做家居的网站
  • 网站信息安全建设方案公众号网站建设
  • 网站的设计方案淘宝大数据查询平台
  • 深圳营销型网站建设 龙华信科网站项目有需要什么技术支持
  • 开源网站模板cms网店推广实训总结
  • 常见的电子商务网站有哪些建设校园门户网站信息意义
  • 象山经济开发区建设有限公司网站足球比赛直播app
  • 国外做mg动画的网站大全网站打不开 别的电脑能打开
  • 手机怎么创网站西宁企业做网站
  • 网站主机多大wordpress连接错误
  • 3d建站电商平台网站开发过程是什么
  • 优化核心系列网站wordpress下拉刷新
  • 深圳建站定制公司国外试用网站空间
  • 网站建设的原则有哪些内容建设网站的详细步骤
  • wordpress网站换字体宣传电脑的网站开发
  • 移动网站设计上机考试修改wordpress域名
  • 个体户 建设网站房子已交房 建设局网站查不到
  • 在自己的电脑建设空间网站百中搜优化软件
  • 专业房产网站建设公司wordpress导入项目
  • 网站安全建设必要性企业vi设计是什么意思
  • 建站工具有哪些社区兰州市城乡建设局网站通知公告
  • 深圳市移动端网站建设wordpress get_category_parents
  • 多用户商城(c2c)网站制作方案招聘网站如何做推广
  • 微信云网站用什么做做网站卖产品
  • 最专业的企业营销型网站建设简述无线网络优化的流程
  • 茶叶响应式网站做网站还有钱赚吗