• springboot(ssm 企业员工薪酬关系系统 Java(code&LW)


    springboot(ssm 企业员工薪酬关系系统 Java(code&LW)

    开发语言:Java

    框架:ssm/springboot + vue

    JDK版本:JDK1.8(或11)

    服务器:tomcat

    数据库:mysql 5.7(或8.0)

    数据库工具:Navicat

    开发软件:eclipse//idea

    依赖管理包:Maven

    您是否想要一个与众不同的网站?我这提供精美的基于springboot(ssm)+vue框架的网站源码,涵盖多个领域,采用轻量级数据库mysql,适用于个人学习等。

    另外,如需了解更多代码细节或修改代码功能界面,本人都能提供技术支持。(声音嘎嘎好听喔!)

    祝你早日找到合适的代码哦~

    1. package com.controller;
    2. import java.text.SimpleDateFormat;
    3. import java.util.ArrayList;
    4. import java.util.Arrays;
    5. import java.util.Calendar;
    6. import java.util.Map;
    7. import java.util.HashMap;
    8. import java.util.Iterator;
    9. import java.util.Date;
    10. import java.util.List;
    11. import javax.servlet.http.HttpServletRequest;
    12. import com.utils.ValidatorUtils;
    13. import org.apache.commons.lang3.StringUtils;
    14. import org.springframework.beans.factory.annotation.Autowired;
    15. import org.springframework.format.annotation.DateTimeFormat;
    16. import org.springframework.web.bind.annotation.PathVariable;
    17. import org.springframework.web.bind.annotation.RequestBody;
    18. import org.springframework.web.bind.annotation.RequestMapping;
    19. import org.springframework.web.bind.annotation.RequestParam;
    20. import org.springframework.web.bind.annotation.RestController;
    21. import com.baomidou.mybatisplus.mapper.EntityWrapper;
    22. import com.baomidou.mybatisplus.mapper.Wrapper;
    23. import com.annotation.IgnoreAuth;
    24. import com.entity.NewsEntity;
    25. import com.entity.view.NewsView;
    26. import com.service.NewsService;
    27. import com.service.TokenService;
    28. import com.utils.PageUtils;
    29. import com.utils.R;
    30. import com.utils.MD5Util;
    31. import com.utils.MPUtil;
    32. import com.utils.CommonUtil;
    33. import java.io.IOException;
    34. /**
    35. * 后端接口
    36. * @author
    37. * @email
    38. * @date 2023-03-25 14:13:13
    39. */
    40. @RestController
    41. @RequestMapping("/news")
    42. public class NewsController {
    43. @Autowired
    44. private NewsService newsService;
    45. /**
    46. * 后端列表
    47. */
    48. @RequestMapping("/page")
    49. public R page(@RequestParam Map params,NewsEntity news,
    50. HttpServletRequest request){
    51. EntityWrapper ew = new EntityWrapper();
    52. PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
    53. return R.ok().put("data", page);
    54. }
    55. /**
    56. * 前端列表
    57. */
    58. @IgnoreAuth
    59. @RequestMapping("/list")
    60. public R list(@RequestParam Map params,NewsEntity news,
    61. HttpServletRequest request){
    62. EntityWrapper ew = new EntityWrapper();
    63. PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
    64. return R.ok().put("data", page);
    65. }
    66. /**
    67. * 列表
    68. */
    69. @RequestMapping("/lists")
    70. public R list( NewsEntity news){
    71. EntityWrapper ew = new EntityWrapper();
    72. ew.allEq(MPUtil.allEQMapPre( news, "news"));
    73. return R.ok().put("data", newsService.selectListView(ew));
    74. }
    75. /**
    76. * 查询
    77. */
    78. @RequestMapping("/query")
    79. public R query(NewsEntity news){
    80. EntityWrapper< NewsEntity> ew = new EntityWrapper< NewsEntity>();
    81. ew.allEq(MPUtil.allEQMapPre( news, "news"));
    82. NewsView newsView = newsService.selectView(ew);
    83. return R.ok("查询食堂资讯成功").put("data", newsView);
    84. }
    85. /**
    86. * 后端详情
    87. */
    88. @RequestMapping("/info/{id}")
    89. public R info(@PathVariable("id") Long id){
    90. NewsEntity news = newsService.selectById(id);
    91. return R.ok().put("data", news);
    92. }
    93. /**
    94. * 前端详情
    95. */
    96. @IgnoreAuth
    97. @RequestMapping("/detail/{id}")
    98. public R detail(@PathVariable("id") Long id){
    99. NewsEntity news = newsService.selectById(id);
    100. return R.ok().put("data", news);
    101. }
    102. /**
    103. * 后端保存
    104. */
    105. @RequestMapping("/save")
    106. public R save(@RequestBody NewsEntity news, HttpServletRequest request){
    107. news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    108. //ValidatorUtils.validateEntity(news);
    109. newsService.insert(news);
    110. return R.ok();
    111. }
    112. /**
    113. * 前端保存
    114. */
    115. @RequestMapping("/add")
    116. public R add(@RequestBody NewsEntity news, HttpServletRequest request){
    117. news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    118. //ValidatorUtils.validateEntity(news);
    119. newsService.insert(news);
    120. return R.ok();
    121. }
    122. /**
    123. * 修改
    124. */
    125. @RequestMapping("/update")
    126. public R update(@RequestBody NewsEntity news, HttpServletRequest request){
    127. //ValidatorUtils.validateEntity(news);
    128. newsService.updateById(news);//全部更新
    129. return R.ok();
    130. }
    131. /**
    132. * 删除
    133. */
    134. @RequestMapping("/delete")
    135. public R delete(@RequestBody Long[] ids){
    136. newsService.deleteBatchIds(Arrays.asList(ids));
    137. return R.ok();
    138. }
    139. /**
    140. * 提醒接口
    141. */
    142. @RequestMapping("/remind/{columnName}/{type}")
    143. public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
    144. @PathVariable("type") String type,@RequestParam Map map) {
    145. map.put("column", columnName);
    146. map.put("type", type);
    147. if(type.equals("2")) {
    148. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    149. Calendar c = Calendar.getInstance();
    150. Date remindStartDate = null;
    151. Date remindEndDate = null;
    152. if(map.get("remindstart")!=null) {
    153. Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
    154. c.setTime(new Date());
    155. c.add(Calendar.DAY_OF_MONTH,remindStart);
    156. remindStartDate = c.getTime();
    157. map.put("remindstart", sdf.format(remindStartDate));
    158. }
    159. if(map.get("remindend")!=null) {
    160. Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
    161. c.setTime(new Date());
    162. c.add(Calendar.DAY_OF_MONTH,remindEnd);
    163. remindEndDate = c.getTime();
    164. map.put("remindend", sdf.format(remindEndDate));
    165. }
    166. }
    167. Wrapper wrapper = new EntityWrapper();
    168. if(map.get("remindstart")!=null) {
    169. wrapper.ge(columnName, map.get("remindstart"));
    170. }
    171. if(map.get("remindend")!=null) {
    172. wrapper.le(columnName, map.get("remindend"));
    173. }
    174. int count = newsService.selectCount(wrapper);
    175. return R.ok().put("count", count);
    176. }
    177. }

  • 相关阅读:
    网络编程 day1
    Oracle-数据库对象的使用
    [Numpy] 广播机制(Broadcast)
    攻防千层饼
    RTC 实时音视频技术知识全面盘点
    分布式事务-TCC异常-空回滚
    C#爬虫项目实战:如何解决Instagram网站的封禁问题
    Solidity 小白教程:12. 事件
    Magic Bullet Suite2024.0.1(ae降噪插件合集)
    SPL比SQL更难了还是更容易了?
  • 原文地址:https://blog.csdn.net/2302_79459510/article/details/134301088