ssm化妆品配方及工艺管理系统源码和论文083
开发工具:idea
数据库mysql5.7+
数据库链接工具:navcat,小海豚等
技术:ssm
-
- 课题的目的和意义
进入21世纪后我国的经济增长在全球脱颖而出,人们的生活质量也在不断地提高,从而带来化妆品行业的高速发展,美妆行业的研发更新速度迫切需要开发化妆品配方及工艺管理系统,然而传统的纯手工或简单的计算工具,已经不适应现代经济高速发展和信息快速增长的要求,因此必须运用现代化管理手段,配备完善的自动化设备,采用全新的计算机软件管理系统,来提高化妆品配方及工艺的研发水平与质量,最大限度地发挥准确、快捷、高效等作用,从而获得好效益。化妆品企业需要应对多元化市场需求的变化,需要更系统地对繁多的配方版本进行管理,以及需要多部门的良好协作,因此需要一个信息化的系统协助企业达到更高层次的配方以及工艺管理;其次,根据系统中的化妆品配方及工艺的数据,可以对化妆品制作的整体过程进行风险评估;随着科学技术和检验水平的不断提高,化妆品原料中的风险物质逐渐被识别出来,企业对化妆品原料风险物质评估也处于不断更新的状态,这样可以持续监控风险,并分析化妆品原料风险物质带来的风险等级,并对风险进行分级管控,预防化妆品开发上市后的风险发生,同时可以对已上市的化妆品的做好风险预判,设定相应的应对处理预案。
最后,化妆品配方及工艺管理系统,避免了研发过程中数据散乱,难以追溯,掌控困难的问题,由系统进行原料,需求,配方,报价的统一管理,系统化地进行流程控制和数据管理。系统不仅可以快速计算配方的各项数据,也可以按规范生成导出成各类文档,节约研发时间,提高合规性,和数据计算结果的准确性。
建立配方系统后,可避免由于人员流动造成知识成果流失,同时系统具备严格的权限和加密机制,确保知识成果不被外泄和非法访问。大大降低了人力管理成本,也大大增加了生产的安全性,可靠性,同时也增强了消费者对化妆品企业的信任感;
package com.controller;
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.StringUtil;
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.HuazhuangpinEntity;
import com.service.HuazhuangpinService;
import com.entity.view.HuazhuangpinView;
import com.utils.PageUtils;
import com.utils.R;
/**
* 化妆品
* 后端接口
* @author
* @email
* @date 2021-03-25
*/
@RestController
@Controller
@RequestMapping("/huazhuangpin")
public class HuazhuangpinController {
private static final Logger logger = LoggerFactory.getLogger(HuazhuangpinController.class);
@Autowired
private HuazhuangpinService huazhuangpinService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
/**
* 后端列表
*/
@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(StringUtil.isNotEmpty(role) && "用户".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
}
PageUtils page = huazhuangpinService.queryPage(params);
//字典表数据转换
List<HuazhuangpinView> list =(List<HuazhuangpinView>)page.getList();
for(HuazhuangpinView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
HuazhuangpinEntity huazhuangpin = huazhuangpinService.selectById(id);
if(huazhuangpin !=null){
//entity转view
HuazhuangpinView view = new HuazhuangpinView();
BeanUtils.copyProperties( huazhuangpin , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody HuazhuangpinEntity huazhuangpin, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,huazhuangpin:{}",this.getClass().getName(),huazhuangpin.toString());
Wrapper<HuazhuangpinEntity> queryWrapper = new EntityWrapper<HuazhuangpinEntity>()
.eq("kzpname", huazhuangpin.getKzpname())
.eq("pinpai_types", huazhuangpin.getPinpaiTypes())
.eq("leixing_types", huazhuangpin.getLeixingTypes())
.eq("gongyi_types", huazhuangpin.getGongyiTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
HuazhuangpinEntity huazhuangpinEntity = huazhuangpinService.selectOne(queryWrapper);
if(huazhuangpinEntity==null){
huazhuangpin.setCreateTime(new Date());
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// huazhuangpin.set
// }
huazhuangpinService.insert(huazhuangpin);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody HuazhuangpinEntity huazhuangpin, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,huazhuangpin:{}",this.getClass().getName(),huazhuangpin.toString());
//根据字段查询是否有相同数据
Wrapper<HuazhuangpinEntity> queryWrapper = new EntityWrapper<HuazhuangpinEntity>()
.notIn("id",huazhuangpin.getId())
.andNew()
.eq("kzpname", huazhuangpin.getKzpname())
.eq("pinpai_types", huazhuangpin.getPinpaiTypes())
.eq("leixing_types", huazhuangpin.getLeixingTypes())
.eq("gongyi_types", huazhuangpin.getGongyiTypes())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
HuazhuangpinEntity huazhuangpinEntity = huazhuangpinService.selectOne(queryWrapper);
if("".equals(huazhuangpin.getImgPhoto()) || "null".equals(huazhuangpin.getImgPhoto())){
huazhuangpin.setImgPhoto(null);
}
if(huazhuangpinEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// huazhuangpin.set
// }
huazhuangpinService.updateById(huazhuangpin);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
huazhuangpinService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}
package com.controller;
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.StringUtil;
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.PeifangEntity;
import com.service.PeifangService;
import com.entity.view.PeifangView;
import com.utils.PageUtils;
import com.utils.R;
/**
* 配方
* 后端接口
* @author
* @email
* @date 2021-03-25
*/
@RestController
@Controller
@RequestMapping("/peifang")
public class PeifangController {
private static final Logger logger = LoggerFactory.getLogger(PeifangController.class);
@Autowired
private PeifangService peifangService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;
//级联表service
/**
* 后端列表
*/
@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(StringUtil.isNotEmpty(role) && "用户".equals(role)){
params.put("yonghuId",request.getSession().getAttribute("userId"));
}
PageUtils page = peifangService.queryPage(params);
//字典表数据转换
List<PeifangView> list =(List<PeifangView>)page.getList();
for(PeifangView c:list){
//修改对应字典表字段
dictionaryService.dictionaryConvert(c);
}
return R.ok().put("data", page);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
PeifangEntity peifang = peifangService.selectById(id);
if(peifang !=null){
//entity转view
PeifangView view = new PeifangView();
BeanUtils.copyProperties( peifang , view );//把实体数据重构到view中
//修改对应字典表字段
dictionaryService.dictionaryConvert(view);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody PeifangEntity peifang, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,peifang:{}",this.getClass().getName(),peifang.toString());
Wrapper<PeifangEntity> queryWrapper = new EntityWrapper<PeifangEntity>()
.eq("pfname", peifang.getPfname())
.eq("gongyi_types", peifang.getGongyiTypes())
.eq("shifou_types", peifang.getShifouTypes())
.eq("peifang_content", peifang.getPeifangContent())
.eq("xiangqing_content", peifang.getXiangqingContent())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
PeifangEntity peifangEntity = peifangService.selectOne(queryWrapper);
if(peifangEntity==null){
peifang.setCreateTime(new Date());
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// peifang.set
// }
peifangService.insert(peifang);
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody PeifangEntity peifang, HttpServletRequest request){
logger.debug("update方法:,,Controller:{},,peifang:{}",this.getClass().getName(),peifang.toString());
//根据字段查询是否有相同数据
Wrapper<PeifangEntity> queryWrapper = new EntityWrapper<PeifangEntity>()
.notIn("id",peifang.getId())
.andNew()
.eq("pfname", peifang.getPfname())
.eq("gongyi_types", peifang.getGongyiTypes())
.eq("shifou_types", peifang.getShifouTypes())
.eq("peifang_content", peifang.getPeifangContent())
.eq("xiangqing_content", peifang.getXiangqingContent())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
PeifangEntity peifangEntity = peifangService.selectOne(queryWrapper);
if(peifangEntity==null){
// String role = String.valueOf(request.getSession().getAttribute("role"));
// if("".equals(role)){
// peifang.set
// }
peifangService.updateById(peifang);//根据id更新
return R.ok();
}else {
return R.error(511,"表中有相同数据");
}
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] ids){
logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
peifangService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
}