🍊作者:计算机编程-吉哥
🍊简介:专业从事JavaWeb程序开发,微信小程序开发,定制化项目、 源码、代码讲解、文档撰写、ppt制作。做自己喜欢的事,生活就是快乐的。
🍊心愿:点赞 👍 收藏 ⭐评论 📝
🍅 文末获取源码联系
👇🏻 精彩专栏推荐订阅 👇🏻 不然下次找不到哟~
Java毕业设计项目~热门选题推荐《1000套》
目录
[5.1 首页](#5.1 首页)
[5.2 装修风格](#5.2 装修风格)
[5.3 主材](#5.3 主材)
[5.4 个人中心](#5.4 个人中心)
[5.5 预算](#5.5 预算)
[5.6 合同](#5.6 合同)
[5.7 工程安排](#5.7 工程安排)
[5.8 装修风格收藏](#5.8 装修风格收藏)
[5.9 装修风格管理](#5.9 装修风格管理)
[5.10 预算管理](#5.10 预算管理)
[7.1 工程安排Controller](#7.1 工程安排Controller)
[7.2 工程安排Service](#7.2 工程安排Service)
[7.3 工程安排ServiceImpl](#7.3 工程安排ServiceImpl)
[7.4 工程安排DAO](#7.4 工程安排DAO)
1.技术选型
springboot、mybatisplus、vue、elementui、html、css、js、mysql、jdk1.8
2.数据库表结构
15张
3.开发工具
idea、navicat
4.功能
4.1【角色】
管理员、用户
4.2【前台功能模块】
- 登录注册
- 首页
- 装修风格
- 主材
- 个人中心(个人中心、预约、合同、工程安排、售后服务、装修风格收藏、主材收藏)
4.3【后台功能模块】
- 登录
- 首页
- 个人中心
- 管理员管理
- 基础数据管理
- 装修风格管理
- 主材管理
- 用户管理
- 装修管理
- 轮播图管理
5.项目演示截图
5.1 首页
5.2 装修风格
5.3 主材
5.4 个人中心
5.5 预算
5.6 合同
5.7 工程安排
5.8 装修风格收藏
5.9 装修风格管理
5.10 预算管理
6.数据库文件设计
sql
CREATE TABLE `config` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`name` varchar(100) DEFAULT NULL COMMENT '配置参数名称',
`value` varchar(100) DEFAULT NULL COMMENT '配置参数值',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='配置文件';
CREATE TABLE `dictionary` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`dic_code` varchar(200) DEFAULT NULL COMMENT '字段',
`dic_name` varchar(200) DEFAULT NULL COMMENT '字段名',
`code_index` int(11) DEFAULT NULL COMMENT '编码',
`index_name` varchar(200) DEFAULT NULL COMMENT '编码名字 Search111 ',
`super_id` int(11) DEFAULT NULL COMMENT '父字段id',
`beizhu` varchar(200) DEFAULT NULL COMMENT '备注',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8 COMMENT='字典';
CREATE TABLE `hetong` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`hetong_uuid_number` varchar(200) DEFAULT NULL COMMENT '合同编号',
`hetong_name` varchar(200) DEFAULT NULL COMMENT '合同名称 Search111 ',
`hetong_file` varchar(200) DEFAULT NULL COMMENT '合同文件',
`hetong_types` int(11) DEFAULT NULL COMMENT '合同状态 Search111',
`hetong_huafei` decimal(10,2) DEFAULT NULL COMMENT '合同金额',
`hetong_weiyuejin` decimal(10,2) DEFAULT NULL COMMENT '违约金',
`hetong_content` text COMMENT '合同内容',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '开具时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='合同';
CREATE TABLE `shouhou` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`hetong_id` int(11) DEFAULT NULL COMMENT '合同',
`shouhou_name` varchar(200) DEFAULT NULL COMMENT '售后服务名称 Search111 ',
`shouhou_uuid_number` varchar(200) DEFAULT NULL COMMENT '售后服务编号',
`shouhou_file` varchar(200) DEFAULT NULL COMMENT '售后服务附件',
`shouhou_types` int(11) DEFAULT NULL COMMENT '服务类型 Search111',
`fuwu_time` timestamp NULL DEFAULT NULL COMMENT '服务时间',
`shouhou_content` text COMMENT '售后服务内容',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 listShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='售后服务';
CREATE TABLE `token` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`userid` bigint(20) NOT NULL COMMENT '学生id',
`username` varchar(100) NOT NULL COMMENT '学生名',
`tablename` varchar(100) DEFAULT NULL COMMENT '表名',
`role` varchar(100) DEFAULT NULL COMMENT '角色',
`token` varchar(200) NOT NULL COMMENT '密码',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
`expiratedtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '过期时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='token表';
CREATE TABLE `users` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(100) NOT NULL COMMENT '学生名',
`password` varchar(100) NOT NULL COMMENT '密码',
`role` varchar(100) DEFAULT '管理员' COMMENT '角色',
`addtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '新增时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员';
CREATE TABLE `yonghu` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(200) DEFAULT NULL COMMENT '账户',
`password` varchar(200) DEFAULT NULL COMMENT '密码',
`yonghu_name` varchar(200) DEFAULT NULL COMMENT '用户姓名 Search111 ',
`yonghu_phone` varchar(200) DEFAULT NULL COMMENT '用户手机号',
`yonghu_id_number` varchar(200) DEFAULT NULL COMMENT '用户身份证号',
`yonghu_photo` varchar(200) DEFAULT NULL COMMENT '用户头像',
`sex_types` int(11) DEFAULT NULL COMMENT '性别',
`fangyuan_types` int(11) DEFAULT NULL COMMENT '房源 Search111 ',
`huxing_types` int(11) DEFAULT NULL COMMENT '户型 Search111 ',
`yonghu_email` varchar(200) DEFAULT NULL COMMENT '用户邮箱',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='用户';
CREATE TABLE `zhuangxiufengge_collection` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`zhuangxiufengge_id` int(11) DEFAULT NULL COMMENT '装修风格',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`zhuangxiufengge_collection_types` int(11) DEFAULT NULL COMMENT '类型',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '收藏时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='装修风格收藏';
CREATE TABLE `zhuangxiufengge_liuyan` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`zhuangxiufengge_id` int(11) DEFAULT NULL COMMENT '装修风格',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`zhuangxiufengge_liuyan_text` text COMMENT '留言内容',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '留言时间',
`reply_text` text COMMENT '回复内容',
`update_time` timestamp NULL DEFAULT NULL COMMENT '回复时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='装修风格留言';
CREATE TABLE `zhucai` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键 ',
`zhucai_name` varchar(200) DEFAULT NULL COMMENT '主材名称 Search111 ',
`zhucai_uuid_number` varchar(200) DEFAULT NULL COMMENT '主材编号',
`zhucai_photo` varchar(200) DEFAULT NULL COMMENT '主材照片',
`zhucai_danwei` varchar(200) DEFAULT NULL COMMENT '单位',
`zhucai_shengchanchangjia` varchar(200) DEFAULT NULL COMMENT '生产厂家',
`zhucai_types` int(11) DEFAULT NULL COMMENT '主材类型 Search111',
`pinpai_types` int(11) DEFAULT NULL COMMENT '品牌 Search111 ',
`zhucai_jiage` decimal(10,2) DEFAULT NULL COMMENT '主材价格',
`zhucai_clicknum` int(11) DEFAULT NULL COMMENT '主材热度',
`zhucai_content` text COMMENT '主材详情',
`shangxia_types` int(11) DEFAULT NULL COMMENT '是否上架 ',
`zhucai_delete` int(11) DEFAULT NULL COMMENT '逻辑删除',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '录入时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show1 show2 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='主材';
CREATE TABLE `zhucai_collection` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`zhucai_id` int(11) DEFAULT NULL COMMENT '主材',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`zhucai_collection_types` int(11) DEFAULT NULL COMMENT '类型',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '收藏时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间 show3 photoShow',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='主材收藏';
CREATE TABLE `zhucai_liuyan` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`zhucai_id` int(11) DEFAULT NULL COMMENT '主材',
`yonghu_id` int(11) DEFAULT NULL COMMENT '用户',
`zhucai_liuyan_text` text COMMENT '留言内容',
`insert_time` timestamp NULL DEFAULT NULL COMMENT '留言时间',
`reply_text` text COMMENT '回复内容',
`update_time` timestamp NULL DEFAULT NULL COMMENT '回复时间',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='主材留言';
7.核心代码
7.1 工程安排Controller
java
package com.controller;
/**
* 工程安排
* 后端接口
* @author 计算机编程-吉哥
* @email
*/
@RestController
@Controller
@RequestMapping("/gongchenganpai")
public class GongchenganpaiController {
private static final Logger logger = LoggerFactory.getLogger(GongchenganpaiController.class);
private static final String TABLE_NAME = "gongchenganpai";
@Autowired
private GongchenganpaiService gongchenganpaiService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;//字典
@Autowired
private HetongService hetongService;//合同
@Autowired
private ShouhouService shouhouService;//售后服务
@Autowired
private YonghuService yonghuService;//用户
@Autowired
private YusuanService yusuanService;//预算
@Autowired
private ZhuangxiufenggeService zhuangxiufenggeService;//装修风格
@Autowired
private ZhuangxiufenggeCollectionService zhuangxiufenggeCollectionService;//装修风格收藏
@Autowired
private ZhuangxiufenggeLiuyanService zhuangxiufenggeLiuyanService;//装修风格留言
@Autowired
private ZhucaiService zhucaiService;//主材
@Autowired
private ZhucaiCollectionService zhucaiCollectionService;//主材收藏
@Autowired
private ZhucaiLiuyanService zhucaiLiuyanService;//主材留言
@Autowired
private UsersService usersService;//管理员
/**
* 后端列表
*/
@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("用户".equals(role))
params.put("yonghuId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = gongchenganpaiService.queryPage(params);
//字典表数据转换
List<GongchenganpaiView> list =(List<GongchenganpaiView>)page.getList();
for(GongchenganpaiView 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);
GongchenganpaiEntity gongchenganpai = gongchenganpaiService.selectById(id);
if(gongchenganpai !=null){
//entity转view
GongchenganpaiView view = new GongchenganpaiView();
BeanUtils.copyProperties( gongchenganpai , view );//把实体数据重构到view中
//级联表 用户
//级联表
YonghuEntity yonghu = yonghuService.selectById(gongchenganpai.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setYonghuId(yonghu.getId());
}
//级联表 合同
//级联表
HetongEntity hetong = hetongService.selectById(gongchenganpai.getHetongId());
if(hetong != null){
BeanUtils.copyProperties( hetong , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setHetongId(hetong.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody GongchenganpaiEntity gongchenganpai, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,gongchenganpai:{}",this.getClass().getName(),gongchenganpai.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("用户".equals(role))
gongchenganpai.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<GongchenganpaiEntity> queryWrapper = new EntityWrapper<GongchenganpaiEntity>()
.eq("yonghu_id", gongchenganpai.getYonghuId())
.eq("hetong_id", gongchenganpai.getHetongId())
.eq("gongchenganpai_name", gongchenganpai.getGongchenganpaiName())
.eq("gongchenganpai_fuzeren", gongchenganpai.getGongchenganpaiFuzeren())
.eq("gongchenganpai_lianxifangshi", gongchenganpai.getGongchenganpaiLianxifangshi())
.eq("gongchenganpai_types", gongchenganpai.getGongchenganpaiTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
GongchenganpaiEntity gongchenganpaiEntity = gongchenganpaiService.selectOne(queryWrapper);
if(gongchenganpaiEntity==null){
gongchenganpai.setGongchenganpaiTypes(1);
gongchenganpai.setInsertTime(new Date());
gongchenganpai.setCreateTime(new Date());
gongchenganpaiService.insert(gongchenganpai);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody GongchenganpaiEntity gongchenganpai, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,gongchenganpai:{}",this.getClass().getName(),gongchenganpai.toString());
GongchenganpaiEntity oldGongchenganpaiEntity = gongchenganpaiService.selectById(gongchenganpai.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
gongchenganpai.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
if("".equals(gongchenganpai.getGongchenganpaiFile()) || "null".equals(gongchenganpai.getGongchenganpaiFile())){
gongchenganpai.setGongchenganpaiFile(null);
}
gongchenganpaiService.updateById(gongchenganpai);//根据id更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
List<GongchenganpaiEntity> oldGongchenganpaiList =gongchenganpaiService.selectBatchIds(Arrays.asList(ids));//要删除的数据
gongchenganpaiService.deleteBatchIds(Arrays.asList(ids));
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<GongchenganpaiEntity> gongchenganpaiList = 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){
//循环
GongchenganpaiEntity gongchenganpaiEntity = new GongchenganpaiEntity();
gongchenganpaiList.add(gongchenganpaiEntity);
//把要查询是否重复的字段放入map中
//工程安排编号
if(seachFields.containsKey("gongchenganpaiUuidNumber")){
List<String> gongchenganpaiUuidNumber = seachFields.get("gongchenganpaiUuidNumber");
gongchenganpaiUuidNumber.add(data.get(0));//要改的
}else{
List<String> gongchenganpaiUuidNumber = new ArrayList<>();
gongchenganpaiUuidNumber.add(data.get(0));//要改的
seachFields.put("gongchenganpaiUuidNumber",gongchenganpaiUuidNumber);
}
}
//查询是否重复
//工程安排编号
List<GongchenganpaiEntity> gongchenganpaiEntities_gongchenganpaiUuidNumber = gongchenganpaiService.selectList(new EntityWrapper<GongchenganpaiEntity>().in("gongchenganpai_uuid_number", seachFields.get("gongchenganpaiUuidNumber")));
if(gongchenganpaiEntities_gongchenganpaiUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(GongchenganpaiEntity s:gongchenganpaiEntities_gongchenganpaiUuidNumber){
repeatFields.add(s.getGongchenganpaiUuidNumber());
}
return R.error(511,"数据库的该表中的 [工程安排编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
gongchenganpaiService.insertBatch(gongchenganpaiList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
CommonUtil.checkMap(params);
PageUtils page = gongchenganpaiService.queryPage(params);
//字典表数据转换
List<GongchenganpaiView> list =(List<GongchenganpaiView>)page.getList();
for(GongchenganpaiView 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);
GongchenganpaiEntity gongchenganpai = gongchenganpaiService.selectById(id);
if(gongchenganpai !=null){
//entity转view
GongchenganpaiView view = new GongchenganpaiView();
BeanUtils.copyProperties( gongchenganpai , view );//把实体数据重构到view中
//级联表
YonghuEntity yonghu = yonghuService.selectById(gongchenganpai.getYonghuId());
if(yonghu != null){
BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setYonghuId(yonghu.getId());
}
//级联表
HetongEntity hetong = hetongService.selectById(gongchenganpai.getHetongId());
if(hetong != null){
BeanUtils.copyProperties( hetong , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
view.setHetongId(hetong.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody GongchenganpaiEntity gongchenganpai, HttpServletRequest request){
logger.debug("add方法:,,Controller:{},,gongchenganpai:{}",this.getClass().getName(),gongchenganpai.toString());
Wrapper<GongchenganpaiEntity> queryWrapper = new EntityWrapper<GongchenganpaiEntity>()
.eq("yonghu_id", gongchenganpai.getYonghuId())
.eq("hetong_id", gongchenganpai.getHetongId())
.eq("gongchenganpai_uuid_number", gongchenganpai.getGongchenganpaiUuidNumber())
.eq("gongchenganpai_name", gongchenganpai.getGongchenganpaiName())
.eq("gongchenganpai_fuzeren", gongchenganpai.getGongchenganpaiFuzeren())
.eq("gongchenganpai_lianxifangshi", gongchenganpai.getGongchenganpaiLianxifangshi())
.eq("gongchenganpai_types", gongchenganpai.getGongchenganpaiTypes())
// .notIn("gongchenganpai_types", new Integer[]{102})
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
GongchenganpaiEntity gongchenganpaiEntity = gongchenganpaiService.selectOne(queryWrapper);
if(gongchenganpaiEntity==null){
gongchenganpai.setInsertTime(new Date());
gongchenganpai.setCreateTime(new Date());
gongchenganpaiService.insert(gongchenganpai);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
}
7.2 工程安排Service
java
package com.service;
/**
* 工程安排 服务类
* author 计算机编程-吉哥
*/
public interface GongchenganpaiService extends IService<GongchenganpaiEntity> {
/**
* @param params 查询参数
* @return 带分页的查询出来的数据
*/
PageUtils queryPage(Map<String, Object> params);
}
7.3 工程安排ServiceImpl
java
package com.service.impl;
/**
* 工程安排 服务实现类
* author 计算机编程-吉哥
*/
@Service("gongchenganpaiService")
@Transactional
public class GongchenganpaiServiceImpl extends ServiceImpl<GongchenganpaiDao, GongchenganpaiEntity> implements GongchenganpaiService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
Page<GongchenganpaiView> page =new Query<GongchenganpaiView>(params).getPage();
page.setRecords(baseMapper.selectListView(page,params));
return new PageUtils(page);
}
}
7.4 工程安排DAO
java
package com.dao;
/**
* 工程安排 Dao 接口
*
* @author 计算机编程-吉哥
*/
public interface GongchenganpaiDao extends BaseMapper<GongchenganpaiEntity> {
List<GongchenganpaiView> selectListView(Pagination page,@Param("params")Map<String,Object> params);
}
8.参考文档
你可能还有感兴趣的项目👇🏻👇🏻👇🏻
更多项目推荐:计算机毕业设计项目
如果大家有任何疑虑,请在下方咨询或评论