当前位置:   article > 正文

基于springboot生鲜交易商城微信小程序源码和论文

基于springboot生鲜交易商城微信小程序源码和论文

伴随着信息科技的高效发展与互联网技术的日益健全,大家越来越注重电商。生鲜交易小程序是电商的一个典型性代表。市场从之前的路边货市场变化到网络里,根据交易系统进行了交易。而生鲜交易小程序带来农户省时省力、省劲、划算的货品交易平台,它可使农户们灵活运用信息科技的优点去解决生鲜,越来越更加顺畅、便捷、便捷,能够满足用户快速地享受在线购物带来的生活。为后能比较方便地达到生鲜的合理利用,科学研究现阶段交易的发展状况,根据要求、可行性研究,设计方案完成一个生鲜交易小程序。

本系统主要是完成灵便、可扩展性强、客户交互方式好平台。 系统给予强悍的数据库管理、精确高效率的数据分析、迅速灵活多变的数据统计服务。 采用前端微信小程序技术,设计界面简约、易用性高、良好的人际交互体验; 采用后端SpringbBoot Mybatis等新技术,搭建便于管理方法、易上手、高安全系数、协调能力、可扩展性、高效率、动态性、互动式浏览数据库的管理系统; 完成形象化、科学、简单生鲜交易小程序。

关键字: 生鲜交易;微信小程序;SpringBoot;Mysql

【706】基于springboot生鲜交易商城微信小程序源码和论文

ABSTRACT

With the efficient development of information technology and the increasingly sound Internet technology, people are paying more and more attention to e-commerce. The fresh food trading applet is a typical representative of e-commerce. The market has changed from the previous roadside goods market to the network, where transactions are conducted according to the trading system. The fresh food trading applet brings farmers a time-saving, labor-saving and cost-effective goods trading platform. It enables farmers to flexibly use the advantages of information technology to solve fresh food, which is more and more smooth, convenient and convenient, and can satisfy users to quickly enjoy the life brought by online shopping. In order to achieve the reasonable utilization of fresh food more conveniently in the future, scientific research on the development of the current trading situation, design a scheme to complete a small program of fresh food trading according to the requirements and feasibility study。

This system is mainly a platform with convenient, strong scalability and good customer interaction. The system provides powerful database management, accurate and efficient data analysis, and fast and flexible data statistics services. The front-end WeChat applet technology is adopted to design a simple interface, high usability and good interpersonal interaction experience; New technologies such as SpringbBoot Mybatis on the back end are adopted to build a management system that is easy to manage, easy to use, high safety factor, coordination ability, scalability, high efficiency, dynamic and interactive to browse the database; Complete visualized, scientific and simple fresh food trading applet。

Keywords: fresh food transaction; WeChat applet; SpringBoot; Mysql

生鲜商城,对国家经济的发展和鹏飞以及对人类社会的文明带来了巨大影响。生鲜行业已成为许多国家的支柱产业,随着人们生活水平以及生鲜性能的不断提高,人们对生鲜的消费和需求也越来越旺盛,世界生鲜行业也保持庞大的市场需求和市场规模。近年来,中国生鲜市场发展迅猛,以接近 37%的速度增长,巨大的市场容量和可观的经济效益,引起各生鲜厂家纷纷加大投资,生鲜市场烽烟四起,生鲜销售策略和模式频出,竞争已是空前的激烈,在此形势下,一种介于生产厂家和用户之间的桥梁,生鲜销售公司正在不断的产生和发展壮大。

通过网络进行生鲜销售,是这个时代发展的必然结果,是随着网络的普及和电子商务概念的兴盛而兴起的。这种全新出现的新型生鲜销售形式,与传统通过生鲜店面进行销售的方式相比优势显著: 1,降低了生鲜销售成本;2,改变生鲜传统的了解和购买方式,使用网络平台了解生鲜信息并购买,使得商业活动没有空间和时间的限制;3,生鲜信息的传递更有效率和直观,新车信息上传后,人们可以立即了解咨询,交易可以马上进行,从而大大提高了生鲜交易的效率。正是由于这些巨大的优势,生鲜销售平台才能得以迅速地开拓市场。生鲜销售平台的主要是借助平台作为交易平台,将生鲜的各项指标,优势劣势,精美图片以发布到网络中,人们能够借助网络登录生鲜销售平台来查看各种生鲜的信息并提交订单订购或者预定生鲜,实现在线交易。开发之前需要做好详细的系统架构,这种系统架构内容包括了市场需求分析,平台前端设计,后台设计,技术可行性分析,框架组合分析等 。

1.2  课题目的及意义

生鲜销售信息管理,是企业管理生鲜销售的一个不可缺少的平台。在以往,传统的信息管理方式主要以人为主体,人们投入大量时间和精力去操作, 存在着管理上的局限性、主观性和片面性,人为的管理手段已经无法适应互联网时代的发展,这种方法无疑是在浪费大量的人力和财力,而在信息高速发达的时代, 主要是以计算机为处理手段。本系统将取代传统的手动操作管理,实现人和计算机的完美结合,充分发挥人和机器的特长,能对生鲜销售信息的数据进行收集、记录、统计和导出的系统。灵活和可配置地为管理人员提供直观可视化、科学化和简约化管理。本系统的开发能一定程度上提高企业工作效率,能够比较全面、准确地掌握企业生鲜销售的信息并进行统计、查询和管理。建立现代化生鲜销售信息管理体制,统一化、规范化和流程化企业各部门之间的业务流程,实现各部门协调合作、无纸办公。

 

 

  1. package com.example.controller;
  2. import cn.hutool.core.collection.CollectionUtil;
  3. import cn.hutool.core.util.StrUtil;
  4. import cn.hutool.crypto.SecureUtil;
  5. import com.example.common.Result;
  6. import com.example.common.ResultCode;
  7. import com.example.entity.UserInfo;
  8. import com.example.entity.Account;
  9. import com.example.exception.CustomException;
  10. import com.example.service.UserInfoService;
  11. import org.springframework.web.bind.annotation.*;
  12. import javax.annotation.Resource;
  13. import javax.servlet.http.HttpServletRequest;
  14. import javax.servlet.http.HttpSession;
  15. import java.util.HashMap;
  16. import java.util.Map;
  17. @RestController
  18. public class AccountController {
  19. @Resource
  20. private UserInfoService userInfoService;
  21. @GetMapping("/logout")
  22. public Result logout(HttpServletRequest request) {
  23. request.getSession().setAttribute("user", null);
  24. return Result.success();
  25. }
  26. @GetMapping("/auth")
  27. public Result getAuth(HttpServletRequest request) {
  28. Object user = request.getSession().getAttribute("user");
  29. if(user == null) {
  30. return Result.error("401", "未登录");
  31. }
  32. return Result.success((UserInfo)user);
  33. }
  34. /**
  35. * 注册
  36. */
  37. @PostMapping("/register")
  38. public Result<UserInfo> register(@RequestBody UserInfo userInfo, HttpServletRequest request) {
  39. if (StrUtil.isBlank(userInfo.getName()) || StrUtil.isBlank(userInfo.getPassword())) {
  40. throw new CustomException(ResultCode.PARAM_ERROR);
  41. }
  42. UserInfo register = userInfoService.add(userInfo);
  43. HttpSession session = request.getSession();
  44. session.setAttribute("user", register);
  45. session.setMaxInactiveInterval(120 * 60);
  46. return Result.success(register);
  47. }
  48. /**
  49. * 后台登录
  50. */
  51. @PostMapping("/login")
  52. public Result<UserInfo> login(@RequestBody UserInfo userInfo, HttpServletRequest request) {
  53. if (StrUtil.isBlank(userInfo.getName()) || StrUtil.isBlank(userInfo.getPassword())) {
  54. throw new CustomException(ResultCode.USER_ACCOUNT_ERROR);
  55. }
  56. UserInfo login = userInfoService.login(userInfo.getName(), userInfo.getPassword());
  57. HttpSession session = request.getSession();
  58. session.setAttribute("user", login);
  59. session.setMaxInactiveInterval(120 * 60);
  60. return Result.success(login);
  61. }
  62. /**
  63. * 微信登录
  64. */
  65. @PostMapping("/wxlogin")
  66. public Result<UserInfo> wxlogin(@RequestBody UserInfo userInfo, HttpServletRequest request) {
  67. if (StrUtil.isBlank(userInfo.getName()) || StrUtil.isBlank(userInfo.getPassword())) {
  68. throw new CustomException(ResultCode.USER_ACCOUNT_ERROR);
  69. }
  70. UserInfo login = userInfoService.wxlogin(userInfo.getName(), userInfo.getPassword());
  71. if (login==null) {
  72. return Result.error("500","用户不存在");
  73. }
  74. if (!SecureUtil.md5(userInfo.getPassword()).equalsIgnoreCase(login.getPassword())) {
  75. return Result.error("500","账号或密码错误");
  76. }
  77. if(login.getLevel()!=3){
  78. return Result.error("500","请用顾客账号登录微信端");
  79. }
  80. HttpSession session = request.getSession();
  81. session.setAttribute("user", login);
  82. session.setMaxInactiveInterval(120 * 60);
  83. return Result.success(login);
  84. }
  85. /**
  86. * 微信register
  87. */
  88. @PostMapping("/wxregister")
  89. public Result<UserInfo> wxregister(@RequestBody UserInfo userInfo, HttpServletRequest request) {
  90. if (StrUtil.isBlank(userInfo.getName()) || StrUtil.isBlank(userInfo.getPassword())) {
  91. throw new CustomException(ResultCode.USER_ACCOUNT_ERROR);
  92. }
  93. UserInfo login = userInfoService.wxlogin(userInfo.getName(), userInfo.getPassword());
  94. if (login!=null) {
  95. return Result.error("500","用户名已存在");
  96. }
  97. userInfo.setLevel(3);
  98. userInfo.setAccount(0.00);
  99. userInfoService.add(userInfo);
  100. return Result.success();
  101. }
  102. /**
  103. * 重置密码为123456
  104. */
  105. @PutMapping("/resetPassword")
  106. public Result<UserInfo> resetPassword(@RequestParam String username) {
  107. return Result.success(userInfoService.resetPassword(username));
  108. }
  109. @PutMapping("/updatePassword")
  110. public Result updatePassword(@RequestBody UserInfo info, HttpServletRequest request) {
  111. UserInfo account = (UserInfo) request.getSession().getAttribute("user");
  112. if (account == null) {
  113. return Result.error(ResultCode.USER_NOT_EXIST_ERROR.code, ResultCode.USER_NOT_EXIST_ERROR.msg);
  114. }
  115. String oldPassword = SecureUtil.md5(info.getPassword());
  116. if (!oldPassword.equals(account.getPassword())) {
  117. return Result.error(ResultCode.PARAM_PASSWORD_ERROR.code, ResultCode.PARAM_PASSWORD_ERROR.msg);
  118. }
  119. account.setPassword(SecureUtil.md5(info.getNewPassword()));
  120. userInfoService.update(account);
  121. // 清空session,让用户重新登录
  122. request.getSession().setAttribute("user", null);
  123. return Result.success();
  124. }
  125. @GetMapping("/mini/userInfo/{id}/{level}")
  126. public Result<Account> miniLogin(@PathVariable Long id, @PathVariable Integer level) {
  127. Account account = userInfoService.findByIdAndLevel(id, level);
  128. return Result.success(account);
  129. }
  130. /**
  131. *
  132. * 修改密码
  133. */
  134. @PutMapping("/changePassword")
  135. public Result<Boolean> changePassword(@RequestParam Long id,
  136. @RequestParam String newPassword) {
  137. return Result.success(userInfoService.changePassword(id, newPassword));
  138. }
  139. @GetMapping("/getSession")
  140. public Result<Map<String, String>> getSession(HttpServletRequest request) {
  141. UserInfo account = (UserInfo) request.getSession().getAttribute("user");
  142. if (account == null) {
  143. return Result.success(new HashMap<>(1));
  144. }
  145. Map<String, String> map = new HashMap<>(1);
  146. map.put("username", account.getName());
  147. return Result.success(map);
  148. }
  149. }
  1. package com.controller;
  2. import java.io.File;
  3. import java.math.BigDecimal;
  4. import java.net.URL;
  5. import java.text.SimpleDateFormat;
  6. import com.alibaba.fastjson.JSONObject;
  7. import java.util.*;
  8. import org.springframework.beans.BeanUtils;
  9. import javax.servlet.http.HttpServletRequest;
  10. import org.springframework.web.context.ContextLoader;
  11. import javax.servlet.ServletContext;
  12. import com.service.TokenService;
  13. import com.utils.*;
  14. import java.lang.reflect.InvocationTargetException;
  15. import com.service.DictionaryService;
  16. import org.apache.commons.lang3.StringUtils;
  17. import com.annotation.IgnoreAuth;
  18. import org.slf4j.Logger;
  19. import org.slf4j.LoggerFactory;
  20. import org.springframework.beans.factory.annotation.Autowired;
  21. import org.springframework.stereotype.Controller;
  22. import org.springframework.web.bind.annotation.*;
  23. import com.baomidou.mybatisplus.mapper.EntityWrapper;
  24. import com.baomidou.mybatisplus.mapper.Wrapper;
  25. import com.entity.*;
  26. import com.entity.view.*;
  27. import com.service.*;
  28. import com.utils.PageUtils;
  29. import com.utils.R;
  30. import com.alibaba.fastjson.*;
  31. /**
  32. * 论坛
  33. * 后端接口
  34. * @author
  35. * @email
  36. */
  37. @RestController
  38. @Controller
  39. @RequestMapping("/forum")
  40. public class ForumController {
  41. private static final Logger logger = LoggerFactory.getLogger(ForumController.class);
  42. private static final String TABLE_NAME = "forum";
  43. @Autowired
  44. private ForumService forumService;
  45. @Autowired
  46. private TokenService tokenService;
  47. @Autowired
  48. private DictionaryService dictionaryService;//字典
  49. @Autowired
  50. private JuanzhengService juanzhengService;//捐赠信息
  51. @Autowired
  52. private NewsService newsService;//公告资讯
  53. @Autowired
  54. private QiuzhuService qiuzhuService;//求助信息
  55. @Autowired
  56. private QiuzhuCollectionService qiuzhuCollectionService;//求助收藏
  57. @Autowired
  58. private QiuzhuLiuyanService qiuzhuLiuyanService;//求助留言
  59. @Autowired
  60. private YonghuService yonghuService;//用户
  61. @Autowired
  62. private UsersService usersService;//管理员
  63. /**
  64. * 后端列表
  65. */
  66. @RequestMapping("/page")
  67. public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
  68. logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
  69. CommonUtil.checkMap(params);
  70. PageUtils page = forumService.queryPage(params);
  71. //字典表数据转换
  72. List<ForumView> list =(List<ForumView>)page.getList();
  73. for(ForumView c:list){
  74. //修改对应字典表字段
  75. dictionaryService.dictionaryConvert(c, request);
  76. }
  77. return R.ok().put("data", page);
  78. }
  79. /**
  80. * 后端详情
  81. */
  82. @RequestMapping("/info/{id}")
  83. public R info(@PathVariable("id") Long id, HttpServletRequest request){
  84. logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
  85. ForumEntity forum = forumService.selectById(id);
  86. if(forum !=null){
  87. //entity转view
  88. ForumView view = new ForumView();
  89. BeanUtils.copyProperties( forum , view );//把实体数据重构到view中
  90. //级联表 用户
  91. //级联表
  92. YonghuEntity yonghu = yonghuService.selectById(forum.getYonghuId());
  93. if(yonghu != null){
  94. BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"
  95. , "usersId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
  96. view.setYonghuId(yonghu.getId());
  97. }
  98. //级联表 管理员
  99. //管理员表做额外的处理
  100. UsersEntity users = usersService.selectById(forum.getUsersId());
  101. if(users != null){
  102. view.setUsersId(users.getId());
  103. view.setUusername(users.getUsername());
  104. view.setUpassword(users.getPassword());
  105. view.setUrole(users.getRole());
  106. view.setUaddtime(users.getAddtime());
  107. }
  108. //修改对应字典表字段
  109. dictionaryService.dictionaryConvert(view, request);
  110. return R.ok().put("data", view);
  111. }else {
  112. return R.error(511,"查不到数据");
  113. }
  114. }
  115. /**
  116. * 后端保存
  117. */
  118. @RequestMapping("/save")
  119. public R save(@RequestBody ForumEntity forum, HttpServletRequest request){
  120. logger.debug("save方法:,,Controller:{},,forum:{}",this.getClass().getName(),forum.toString());
  121. String role = String.valueOf(request.getSession().getAttribute("role"));
  122. if(false)
  123. return R.error(511,"永远不会进入");
  124. else if("用户".equals(role))
  125. forum.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
  126. else if("管理员".equals(role))
  127. forum.setUsersId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
  128. Wrapper<ForumEntity> queryWrapper = new EntityWrapper<ForumEntity>()
  129. .eq("forum_name", forum.getForumName())
  130. .eq("yonghu_id", forum.getYonghuId())
  131. .eq("users_id", forum.getUsersId())
  132. .eq("super_ids", forum.getSuperIds())
  133. .eq("forum_state_types", forum.getForumStateTypes())
  134. ;
  135. logger.info("sql语句:"+queryWrapper.getSqlSegment());
  136. ForumEntity forumEntity = forumService.selectOne(queryWrapper);
  137. if(forumEntity==null){
  138. forum.setInsertTime(new Date());
  139. forum.setCreateTime(new Date());
  140. forumService.insert(forum);
  141. return R.ok();
  142. }else {
  143. return R.error(511,"表中有相同数据");
  144. }
  145. }
  146. /**
  147. * 后端修改
  148. */
  149. @RequestMapping("/update")
  150. public R update(@RequestBody ForumEntity forum, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
  151. logger.debug("update方法:,,Controller:{},,forum:{}",this.getClass().getName(),forum.toString());
  152. ForumEntity oldForumEntity = forumService.selectById(forum.getId());//查询原先数据
  153. String role = String.valueOf(request.getSession().getAttribute("role"));
  154. // if(false)
  155. // return R.error(511,"永远不会进入");
  156. // else if("用户".equals(role))
  157. // forum.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
  158. // else if("管理员".equals(role))
  159. // forum.setUsersId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
  160. forum.setUpdateTime(new Date());
  161. forumService.updateById(forum);//根据id更新
  162. return R.ok();
  163. }
  164. /**
  165. * 删除
  166. */
  167. @RequestMapping("/delete")
  168. public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
  169. logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
  170. List<ForumEntity> oldForumList =forumService.selectBatchIds(Arrays.asList(ids));//要删除的数据
  171. forumService.deleteBatchIds(Arrays.asList(ids));
  172. return R.ok();
  173. }
  174. /**
  175. * 批量上传
  176. */
  177. @RequestMapping("/batchInsert")
  178. public R save( String fileName, HttpServletRequest request){
  179. logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
  180. Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
  181. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  182. //.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
  183. try {
  184. List<ForumEntity> forumList = new ArrayList<>();//上传的东西
  185. Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
  186. Date date = new Date();
  187. int lastIndexOf = fileName.lastIndexOf(".");
  188. if(lastIndexOf == -1){
  189. return R.error(511,"该文件没有后缀");
  190. }else{
  191. String suffix = fileName.substring(lastIndexOf);
  192. if(!".xls".equals(suffix)){
  193. return R.error(511,"只支持后缀为xls的excel文件");
  194. }else{
  195. URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
  196. File file = new File(resource.getFile());
  197. if(!file.exists()){
  198. return R.error(511,"找不到上传文件,请联系管理员");
  199. }else{
  200. List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
  201. dataList.remove(0);//删除第一行,因为第一行是提示
  202. for(List<String> data:dataList){
  203. //循环
  204. ForumEntity forumEntity = new ForumEntity();
  205. // forumEntity.setForumName(data.get(0)); //帖子标题 要改的
  206. // forumEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
  207. // forumEntity.setUsersId(Integer.valueOf(data.get(0))); //管理员 要改的
  208. // forumEntity.setForumContent("");//详情和图片
  209. // forumEntity.setSuperIds(Integer.valueOf(data.get(0))); //父id 要改的
  210. // forumEntity.setForumStateTypes(Integer.valueOf(data.get(0))); //帖子状态 要改的
  211. // forumEntity.setInsertTime(date);//时间
  212. // forumEntity.setUpdateTime(sdf.parse(data.get(0))); //修改时间 要改的
  213. // forumEntity.setCreateTime(date);//时间
  214. forumList.add(forumEntity);
  215. //把要查询是否重复的字段放入map中
  216. }
  217. //查询是否重复
  218. forumService.insertBatch(forumList);
  219. return R.ok();
  220. }
  221. }
  222. }
  223. }catch (Exception e){
  224. e.printStackTrace();
  225. return R.error(511,"批量插入数据异常,请联系管理员");
  226. }
  227. }
  228. /**
  229. * 前端列表
  230. */
  231. @IgnoreAuth
  232. @RequestMapping("/list")
  233. public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
  234. logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
  235. CommonUtil.checkMap(params);
  236. PageUtils page = forumService.queryPage(params);
  237. //字典表数据转换
  238. List<ForumView> list =(List<ForumView>)page.getList();
  239. for(ForumView c:list)
  240. dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段
  241. return R.ok().put("data", page);
  242. }
  243. /**
  244. * 前端详情
  245. */
  246. @RequestMapping("/detail/{id}")
  247. public R detail(@PathVariable("id") Long id, HttpServletRequest request){
  248. logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
  249. ForumEntity forum = forumService.selectById(id);
  250. if(forum !=null){
  251. //entity转view
  252. ForumView view = new ForumView();
  253. BeanUtils.copyProperties( forum , view );//把实体数据重构到view中
  254. //级联表
  255. YonghuEntity yonghu = yonghuService.selectById(forum.getYonghuId());
  256. if(yonghu != null){
  257. BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
  258. view.setYonghuId(yonghu.getId());
  259. }
  260. UsersEntity users = usersService.selectById(forum.getUsersId());
  261. if(users != null){
  262. view.setUsersId(users.getId());
  263. view.setUusername(users.getUsername());
  264. view.setUpassword(users.getPassword());
  265. view.setUrole(users.getRole());
  266. view.setUaddtime(users.getAddtime());
  267. }
  268. //修改对应字典表字段
  269. dictionaryService.dictionaryConvert(view, request);
  270. return R.ok().put("data", view);
  271. }else {
  272. return R.error(511,"查不到数据");
  273. }
  274. }
  275. /**
  276. * 前端保存
  277. */
  278. @RequestMapping("/add")
  279. public R add(@RequestBody ForumEntity forum, HttpServletRequest request){
  280. logger.debug("add方法:,,Controller:{},,forum:{}",this.getClass().getName(),forum.toString());
  281. Wrapper<ForumEntity> queryWrapper = new EntityWrapper<ForumEntity>()
  282. .eq("forum_name", forum.getForumName())
  283. .eq("yonghu_id", forum.getYonghuId())
  284. .eq("users_id", forum.getUsersId())
  285. .eq("super_ids", forum.getSuperIds())
  286. .eq("forum_state_types", forum.getForumStateTypes())
  287. // .notIn("forum_types", new Integer[]{102})
  288. ;
  289. logger.info("sql语句:"+queryWrapper.getSqlSegment());
  290. ForumEntity forumEntity = forumService.selectOne(queryWrapper);
  291. if(forumEntity==null){
  292. forum.setInsertTime(new Date());
  293. forum.setCreateTime(new Date());
  294. forumService.insert(forum);
  295. return R.ok();
  296. }else {
  297. return R.error(511,"表中有相同数据");
  298. }
  299. }
  300. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/593581
推荐阅读
相关标签
  

闽ICP备14008679号