首页 > 其他 > 详细

进阶之路001 增删改查/数据导入导出之新增功能

时间:2020-02-20 21:46:54      阅读:111      评论:0      收藏:0      [点我收藏+]

 

Controller层

@SysLog("参数信息做新增")
@RequestMapping("/save")
@RequiresPermissions("xxx:weeklightlimit:save")
public R save(@RequestBody WeekLightLimitEntity weekLightLimit){
try {
int oltpwr=weekLightLimit.getOltpwr();
int ontpwr=weekLightLimit.getOntpwr();
int noLightUp=weekLightLimit.getNoLightUp();
int noLightDown=weekLightLimit.getNoLightDown();
if(oltpwr>ontpwr||noLightUp<noLightDown){
return R.error("提示信息");
}else {
System.out.println("数据输入正确");
};


Integer deptId=weekLightLimit.getDeptId();


System.out.println(deptId);
List<Integer> deptIdList=weekLightLimitService.findAllDeptId();
System.out.println(deptIdList);
for(Integer list:deptIdList) {
if(deptId==list) {
return R.error("提示信息");
}else {
System.out.println(deptId+"并未配置");
};
};


weekLightLimit.setCreateTime(new Date());
weekLightLimit.setUpdateTime(new Date());
weekLightLimitService.save(weekLightLimit);

}catch(Exception e) {
e.printStackTrace();
}

return R.ok();

}

Service接口实现类

@Override
public boolean save(T entity) {
return retBool(baseMapper.insert(entity));
}

 

进阶之路001 增删改查/数据导入导出之新增功能

原文:https://www.cnblogs.com/pureray-hui/p/12337261.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!