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.ShengchanliuchengEntity;
import com.entity.view.ShengchanliuchengView;
import com.service.ShengchanliuchengService;
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-03-19 15:00:26
*/
@RestController
@RequestMapping("/shengchanliucheng")
public class ShengchanliuchengController {
@Autowired
private ShengchanliuchengService shengchanliuchengService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ShengchanliuchengEntity shengchanliucheng,
HttpServletRequest request){
EntityWrapper<ShengchanliuchengEntity> ew = new EntityWrapper<ShengchanliuchengEntity>();
PageUtils page = shengchanliuchengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shengchanliucheng), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ShengchanliuchengEntity shengchanliucheng,
HttpServletRequest request){
EntityWrapper<ShengchanliuchengEntity> ew = new EntityWrapper<ShengchanliuchengEntity>();
PageUtils page = shengchanliuchengService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, shengchanliucheng), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ShengchanliuchengEntity shengchanliucheng){
EntityWrapper<ShengchanliuchengEntity> ew = new EntityWrapper<ShengchanliuchengEntity>();
ew.allEq(MPUtil.allEQMapPre( shengchanliucheng, "shengchanliucheng"));
return R.ok().put("data", shengchanliuchengService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ShengchanliuchengEntity shengchanliucheng){
EntityWrapper< ShengchanliuchengEntity> ew = new EntityWrapper< ShengchanliuchengEntity>();
ew.allEq(MPUtil.allEQMapPre( shengchanliucheng, "shengchanliucheng"));
ShengchanliuchengView shengchanliuchengView = shengchanliuchengService.selectView(ew);
return R.ok("查询生产流程成功").put("data", shengchanliuchengView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ShengchanliuchengEntity shengchanliucheng = shengchanliuchengService.selectById(id);
return R.ok().put("data", shengchanliucheng);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ShengchanliuchengEntity shengchanliucheng = shengchanliuchengService.selectById(id);
return R.ok().put("data", shengchanliucheng);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ShengchanliuchengEntity shengchanliucheng, HttpServletRequest request){
shengchanliucheng.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(shengchanliucheng);
shengchanliuchengService.insert(shengchanliucheng);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ShengchanliuchengEntity shengchanliucheng, HttpServletRequest request){
shengchanliucheng.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(shengchanliucheng);
shengchanliuchengService.insert(shengchanliucheng);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ShengchanliuchengEntity shengchanliucheng, HttpServletRequest request){
//ValidatorUtils.validateEntity(shengchanliucheng);
shengchanliuchengService.updateById(shengchanliucheng);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
shengchanliuchengService.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<ShengchanliuchengEntity> wrapper = new EntityWrapper<ShengchanliuchengEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
int count = shengchanliuchengService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* (按值统计)
*/
@RequestMapping("/value/{xColumnName}/{yColumnName}")
public R value(@PathVariable("yColumnName") String yColumnName, @PathVariable("xColumnName") String xColumnName,HttpServletRequest request) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("xColumn", xColumnName);
params.put("yColumn", yColumnName);
EntityWrapper<ShengchanliuchengEntity> ew = new EntityWrapper<ShengchanliuchengEntity>();
List<Map<String, Object>> result = shengchanliuchengService.selectValue(params, ew);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for(Map<String, 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",
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于VUE的工厂车间管理系统;Spring Boot框架;Java;MySQL 管理员功能实现 人员管理 管理员可以对人员信息进行添加,修改,删除,查询操作。 看板信息管理 管理员可以对看板信息信息进行添加,修改,删除,查询操作 设备信息管理 管理员可以对设备信息进行添加,修改,删除,查询操作 生产开立管理 管理员可以查看,修改,删除,查询生产开立信息 人员功能实现 生产开立管理 人员可以对生产开立信息进行添加,修改,删除,查询操作 生产工序管理 人员可以对生产工序信息进行进行添加,修改,删除,查询操作 生产流程管理 人员可以对生产流程信息进行进行添加,修改,删除,查询操作
资源推荐
资源详情
资源评论
收起资源包目录
基于springBoot+vue的工厂车间管理系统的设计(毕业论文) (392个子文件)
update-password.vue.bak 3KB
IndexMain.vue.bak 2KB
IndexAsideStatic.vue.bak 2KB
BreadCrumbs.vue.bak 2KB
IndexHeader.vue.bak 2KB
3-build.bat 15B
2-run.bat 14B
1-install.bat 12B
.classpath 2KB
mvnw.cmd 7KB
app.377781be.css 261KB
chunk-vendors.a72b0961.css 37KB
canvas-bg-1.css 391B
canvas-bg-2.css 83B
canvas-bg-3.css 61B
.factorypath 15KB
.gitignore 364B
index.html 924B
index.html 552B
favicon.ico 4KB
favicon.ico 4KB
maven-wrapper.jar 50KB
ShengchanliuchengController.java 10KB
CommonController.java 9KB
RenyuanController.java 9KB
ShengchangongxuController.java 7KB
ShengchankailiController.java 7KB
ShebeixinxiController.java 7KB
KanbanxinxiController.java 7KB
MPUtil.java 5KB
UserController.java 5KB
MavenWrapperDownloader.java 5KB
ShengchangongxuEntity.java 4KB
ShengchanliuchengEntity.java 4KB
FileController.java 4KB
RenyuanEntity.java 4KB
ShengchankailiEntity.java 4KB
BaiduUtil.java 4KB
ShebeixinxiEntity.java 3KB
AuthorizationInterceptor.java 3KB
ConfigController.java 3KB
ShengchangongxuModel.java 3KB
ShengchanliuchengModel.java 3KB
ShengchangongxuVO.java 3KB
KanbanxinxiEntity.java 3KB
ShengchanliuchengVO.java 3KB
ShengchanliuchengServiceImpl.java 3KB
Query.java 3KB
RenyuanModel.java 3KB
RenyuanVO.java 2KB
TokenServiceImpl.java 2KB
ShengchankailiModel.java 2KB
ShengchankailiVO.java 2KB
ShebeixinxiModel.java 2KB
TokenEntity.java 2KB
CommonUtil.java 2KB
ShebeixinxiVO.java 2KB
ShengchangongxuServiceImpl.java 2KB
ShengchankailiServiceImpl.java 2KB
PageUtils.java 2KB
ShebeixinxiServiceImpl.java 2KB
KanbanxinxiServiceImpl.java 2KB
RenyuanServiceImpl.java 2KB
KanbanxinxiModel.java 2KB
ShengchanliuchengDao.java 2KB
KanbanxinxiVO.java 2KB
InterceptorConfig.java 1KB
ShengchanliuchengService.java 1KB
CommonServiceImpl.java 1KB
UserServiceImpl.java 1KB
UserEntity.java 1KB
SpringContextUtils.java 1KB
ValidatorUtils.java 1KB
ShengchangongxuService.java 1KB
ShengchangongxuDao.java 1KB
ShengchankailiService.java 1KB
SQLFilter.java 1KB
ShengchankailiDao.java 1KB
ShebeixinxiService.java 1KB
KanbanxinxiService.java 1KB
ShebeixinxiDao.java 1014B
KanbanxinxiDao.java 1014B
HttpClientUtils.java 1013B
ShengchanliuchengView.java 991B
ShengchangongxuView.java 973B
RenyuanService.java 966B
ShengchankailiView.java 964B
RenyuanDao.java 948B
KanbanxinxiView.java 937B
ShebeixinxiView.java 937B
ConfigServiceImpl.java 918B
RenyuanView.java 895B
R.java 884B
ConfigEntity.java 851B
EIException.java 845B
SpringbootSchemaApplication.java 802B
JQPageInfo.java 790B
CommonDao.java 701B
TokenService.java 684B
FileUtil.java 680B
共 392 条
- 1
- 2
- 3
- 4
资源评论
- zhizhi2050302024-04-09资源有一定的参考价值,与资源描述一致,很实用,能够借鉴的部分挺多的,值得下载。
code.song
- 粉丝: 981
- 资源: 1108
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功