哪个网站可以在线做高考题,门户系统是什么意思,如何写网站文案,免费网站服务器推荐大家好#xff01;我是程序猿老A#xff0c;感谢您阅读本文#xff0c;欢迎一键三连哦。 #x1f49e;当前专栏#xff1a;微信小程序毕业设计 精彩专栏推荐#x1f447;#x1f3fb;#x1f447;#x1f3fb;#x1f447;#x1f3fb; #x1f380; Python毕业设计…大家好我是程序猿老A感谢您阅读本文欢迎一键三连哦。 当前专栏微信小程序毕业设计 精彩专栏推荐 Python毕业设计 Java毕业设计 开发运行环境
①前端微信小程序开发工具
② 后端Java
框架ssmJDK版本JDK1.8服务器tomcat7数据库mysql 5.7数据库工具Navicat12开发软件eclipse/myeclipse/ideaMaven包Maven3.3.9浏览器谷歌浏览器
演示视频
原版高清演示视频-编号197 https://pan.quark.cn/s/b2f44f423421
源码下载地址
https://download.csdn.net/download/2301_76953549/89227626
论文目录
【如需全文请按文末获取联系】
一、项目简介
微信食堂线上订餐小程序可以实现商品管理商品评价管理商家管理公告管理商品订单管理在线充值等功能。该系统采用了SSM框架Mysql数据库Java语言等技术实现管理员后台采用微信开发者工具来对用户小程序端进行了开发。
二、系统设计
2.1软件功能模块设计
图4.1即为设计的管理员功能结构管理员权限操作的功能包括对用户注册信息对商家信息商品信息公告信息等进行管理。 图4.2即为设计的商家功能结构商家权限操作的功能包括管理商品管理并回复商品评价管理商品订单查看公告等。 图4.3即为设计的用户功能结构用户权限操作的功能包括购买商品查看商家资料查看公告查看商品评价管理商品订单进行账户充值等。
2.2数据库设计
1图4.4即为商品这个实体所拥有的属性值。 2图4.5即为商品订单这个实体所拥有的属性值。
4图4.7即为商家这个实体所拥有的属性值。 5图4.8即为上面介绍的实体中存在的联系。
三、系统项目部分截图
3.1管理员功能实现
商家管理 图5.2 即为编码实现的商家管理界面管理员在商家管理界面中具备更改商家营业执照商家星级类型以及商家联系方式等信息以及删除添加商家等权限。 用户管理 图5.3 即为编码实现的用户管理界面管理员在用户管理界面为用户的账号进行密码重置更改用户的基础信息删除需要删除的用户资料等。
3.2商家功能实现
商品管理 图5.4 即为编码实现的商品管理界面商家在商品管理界面中具备增加商品库存减少商品库存为商品进行下架更改商品信息添加商品等权限。 商品评价管理 图5.5 即为编码实现的商品评价管理界面商家在商品评价管理界面中查看用户对订单商品的评价商家需要回复评价信息。
3.3用户功能实现
商品信息 图5.7 即为编码实现的商品信息界面用户在商品信息界面中购买商品或点击加入购物车按钮把商品保存在购物车里面。 订单确认 图5.8 即为编码实现的订单确认界面用户在订单确认界面中需要确认购买的商品以及收货的地址信息在余额充足的情况下就可以成功支付订单。 我的商品订单 图5.9 即为编码实现的我的商品订单界面用户在我的商品订单界面中可以取餐可以退款可以评价订单。
四、部分核心代码 package com.controller;import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
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.*;
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.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;/*** 商品订单* 后端接口* author* email
*/
RestController
Controller
RequestMapping(/caipinOrder)
public class CaipinOrderController {private static final Logger logger LoggerFactory.getLogger(CaipinOrderController.class);Autowiredprivate CaipinOrderService caipinOrderService;Autowiredprivate TokenService tokenService;Autowiredprivate DictionaryService dictionaryService;//级联表serviceAutowiredprivate AddressService addressService;Autowiredprivate CaipinService caipinService;Autowiredprivate YonghuService yonghuService;
Autowired
private CaipinCommentbackService caipinCommentbackService;
Autowired
private CartService cartService;
Autowired
private ShangjiaService shangjiaService;/*** 后端列表*/RequestMapping(/page)public R page(RequestParam MapString, 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));else if(商家.equals(role))params.put(shangjiaId,request.getSession().getAttribute(userId));if(params.get(orderBy)null || params.get(orderBy)){params.put(orderBy,id);}PageUtils page caipinOrderService.queryPage(params);//字典表数据转换ListCaipinOrderView list (ListCaipinOrderView)page.getList();for(CaipinOrderView 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);CaipinOrderEntity caipinOrder caipinOrderService.selectById(id);if(caipinOrder !null){//entity转viewCaipinOrderView view new CaipinOrderView();BeanUtils.copyProperties( caipinOrder , view );//把实体数据重构到view中//级联表AddressEntity address addressService.selectById(caipinOrder.getAddressId());if(address ! null){BeanUtils.copyProperties( address , view ,new String[]{ id, createTime, insertTime, updateTime, yonghuId});//把级联的数据添加到view中,并排除id和创建时间字段view.setAddressId(address.getId());view.setAddressYonghuId(address.getYonghuId());}//级联表CaipinEntity caipin caipinService.selectById(caipinOrder.getCaipinId());if(caipin ! null){BeanUtils.copyProperties( caipin , view ,new String[]{ id, createTime, insertTime, updateTime});//把级联的数据添加到view中,并排除id和创建时间字段view.setCaipinId(caipin.getId());}//级联表YonghuEntity yonghu yonghuService.selectById(caipinOrder.getYonghuId());if(yonghu ! null){BeanUtils.copyProperties( yonghu , view ,new String[]{ id, createTime, insertTime, updateTime});//把级联的数据添加到view中,并排除id和创建时间字段view.setYonghuId(yonghu.getId());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put(data, view);}else {return R.error(511,查不到数据);}}/*** 后端保存*/RequestMapping(/save)public R save(RequestBody CaipinOrderEntity caipinOrder, HttpServletRequest request){logger.debug(save方法:,,Controller:{},,caipinOrder:{},this.getClass().getName(),caipinOrder.toString());String role String.valueOf(request.getSession().getAttribute(role));if(false)return R.error(511,永远不会进入);else if(用户.equals(role))caipinOrder.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute(userId))));caipinOrder.setInsertTime(new Date());caipinOrder.setCreateTime(new Date());caipinOrderService.insert(caipinOrder);return R.ok();}/*** 后端修改*/RequestMapping(/update)public R update(RequestBody CaipinOrderEntity caipinOrder, HttpServletRequest request){logger.debug(update方法:,,Controller:{},,caipinOrder:{},this.getClass().getName(),caipinOrder.toString());String role String.valueOf(request.getSession().getAttribute(role));
// if(false)
// return R.error(511,永远不会进入);
// else if(用户.equals(role))
// caipinOrder.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute(userId))));//根据字段查询是否有相同数据WrapperCaipinOrderEntity queryWrapper new EntityWrapperCaipinOrderEntity().eq(id,0);logger.info(sql语句:queryWrapper.getSqlSegment());CaipinOrderEntity caipinOrderEntity caipinOrderService.selectOne(queryWrapper);if(caipinOrderEntitynull){caipinOrderService.updateById(caipinOrder);//根据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());caipinOrderService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 批量上传*/RequestMapping(/batchInsert)public R save( String fileName){logger.debug(batchInsert方法:,,Controller:{},,fileName:{},this.getClass().getName(),fileName);try {ListCaipinOrderEntity caipinOrderList new ArrayList();//上传的东西MapString, ListString 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{ListListString dataList PoiUtil.poiImport(file.getPath());//读取xls文件dataList.remove(0);//删除第一行因为第一行是提示for(ListString data:dataList){//循环CaipinOrderEntity caipinOrderEntity new CaipinOrderEntity();
// caipinOrderEntity.setCaipinOrderUuidNumber(data.get(0)); //订单号 要改的
// caipinOrderEntity.setAddressId(Integer.valueOf(data.get(0))); //收货地址 要改的
// caipinOrderEntity.setCaipinId(Integer.valueOf(data.get(0))); //商品 要改的
// caipinOrderEntity.setYonghuId(Integer.valueOf(data.get(0))); //用户 要改的
// caipinOrderEntity.setBuyNumber(Integer.valueOf(data.get(0))); //购买数量 要改的
// caipinOrderEntity.setCaipinOrderTruePrice(data.get(0)); //实付价格 要改的
// caipinOrderEntity.setCaipinOrderTypes(Integer.valueOf(data.get(0))); //订单类型 要改的
// caipinOrderEntity.setCaipinOrderPaymentTypes(Integer.valueOf(data.get(0))); //支付类型 要改的
// caipinOrderEntity.setInsertTime(date);//时间
// caipinOrderEntity.setCreateTime(date);//时间caipinOrderList.add(caipinOrderEntity);//把要查询是否重复的字段放入map中//订单号if(seachFields.containsKey(caipinOrderUuidNumber)){ListString caipinOrderUuidNumber seachFields.get(caipinOrderUuidNumber);caipinOrderUuidNumber.add(data.get(0));//要改的}else{ListString caipinOrderUuidNumber new ArrayList();caipinOrderUuidNumber.add(data.get(0));//要改的seachFields.put(caipinOrderUuidNumber,caipinOrderUuidNumber);}}//查询是否重复//订单号ListCaipinOrderEntity caipinOrderEntities_caipinOrderUuidNumber caipinOrderService.selectList(new EntityWrapperCaipinOrderEntity().in(caipin_order_uuid_number, seachFields.get(caipinOrderUuidNumber)));if(caipinOrderEntities_caipinOrderUuidNumber.size() 0 ){ArrayListString repeatFields new ArrayList();for(CaipinOrderEntity s:caipinOrderEntities_caipinOrderUuidNumber){repeatFields.add(s.getCaipinOrderUuidNumber());}return R.error(511,数据库的该表中的 [订单号] 字段已经存在 存在数据为:repeatFields.toString());}caipinOrderService.insertBatch(caipinOrderList);return R.ok();}}}}catch (Exception e){return R.error(511,批量插入数据异常请联系管理员);}}/*** 前端列表*/IgnoreAuthRequestMapping(/list)public R list(RequestParam MapString, Object params, HttpServletRequest request){logger.debug(list方法:,,Controller:{},,params:{},this.getClass().getName(),JSONObject.toJSONString(params));// 没有指定排序字段就默认id倒序if(StringUtil.isEmpty(String.valueOf(params.get(orderBy)))){params.put(orderBy,id);}PageUtils page caipinOrderService.queryPage(params);//字典表数据转换ListCaipinOrderView list (ListCaipinOrderView)page.getList();for(CaipinOrderView 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);CaipinOrderEntity caipinOrder caipinOrderService.selectById(id);if(caipinOrder !null){//entity转viewCaipinOrderView view new CaipinOrderView();BeanUtils.copyProperties( caipinOrder , view );//把实体数据重构到view中//级联表AddressEntity address addressService.selectById(caipinOrder.getAddressId());if(address ! null){BeanUtils.copyProperties( address , view ,new String[]{ id, createDate});//把级联的数据添加到view中,并排除id和创建时间字段view.setAddressId(address.getId());}//级联表CaipinEntity caipin caipinService.selectById(caipinOrder.getCaipinId());if(caipin ! null){BeanUtils.copyProperties( caipin , view ,new String[]{ id, createDate});//把级联的数据添加到view中,并排除id和创建时间字段view.setCaipinId(caipin.getId());}//级联表YonghuEntity yonghu yonghuService.selectById(caipinOrder.getYonghuId());if(yonghu ! null){BeanUtils.copyProperties( yonghu , view ,new String[]{ id, createDate});//把级联的数据添加到view中,并排除id和创建时间字段view.setYonghuId(yonghu.getId());}//修改对应字典表字段dictionaryService.dictionaryConvert(view, request);return R.ok().put(data, view);}else {return R.error(511,查不到数据);}}/*** 前端保存*/RequestMapping(/add)public R add(RequestBody CaipinOrderEntity caipinOrder, HttpServletRequest request){logger.debug(add方法:,,Controller:{},,caipinOrder:{},this.getClass().getName(),caipinOrder.toString());String role String.valueOf(request.getSession().getAttribute(role));if(用户.equals(role)){CaipinEntity caipinEntity caipinService.selectById(caipinOrder.getCaipinId());if(caipinEntity null){return R.error(511,查不到该物品);}// Double caipinNewMoney caipinEntity.getCaipinNewMoney();if(false){}else if((caipinEntity.getCaipinKucunNumber() -caipinOrder.getBuyNumber())0){return R.error(511,购买数量不能大于库存数量);}else if(caipinEntity.getCaipinNewMoney() null){return R.error(511,物品价格不能为空);}//计算所获得积分Double buyJifen 0.0;Integer userId (Integer) request.getSession().getAttribute(userId);YonghuEntity yonghuEntity yonghuService.selectById(userId);if(yonghuEntity null)return R.error(511,用户不能为空);if(yonghuEntity.getNewMoney() null)return R.error(511,用户金额不能为空);double balance yonghuEntity.getNewMoney() - caipinEntity.getCaipinNewMoney()*caipinOrder.getBuyNumber();//余额buyJifen new BigDecimal(caipinEntity.getCaipinPrice()).multiply(new BigDecimal(caipinOrder.getBuyNumber())).doubleValue();//所获积分if(balance0)return R.error(511,余额不够支付);caipinOrder.setCaipinOrderTypes(3); //设置订单状态为已支付caipinOrder.setCaipinOrderTruePrice(caipinEntity.getCaipinNewMoney()*caipinOrder.getBuyNumber()); //设置实付价格caipinOrder.setYonghuId(userId); //设置订单支付人idcaipinOrder.setCaipinOrderPaymentTypes(1);caipinOrder.setInsertTime(new Date());caipinOrder.setCreateTime(new Date());caipinEntity.setCaipinKucunNumber( caipinEntity.getCaipinKucunNumber() -caipinOrder.getBuyNumber());caipinService.updateById(caipinEntity);caipinOrderService.insert(caipinOrder);//新增订单yonghuEntity.setYonghuSumJifen(yonghuEntity.getYonghuSumJifen() buyJifen); //设置总积分yonghuEntity.setNewMoney(balance);//设置金额if(yonghuEntity.getYonghuSumJifen() 10000)yonghuEntity.setHuiyuandengjiTypes(1);else if(yonghuEntity.getYonghuSumJifen() 100000)yonghuEntity.setHuiyuandengjiTypes(2);else if(yonghuEntity.getYonghuSumJifen() 1000000)yonghuEntity.setHuiyuandengjiTypes(3);yonghuService.updateById(yonghuEntity);return R.ok();}else{return R.error(511,您没有权限支付订单);}}/*** 添加订单*/RequestMapping(/order)public R add(RequestParam MapString, Object params, HttpServletRequest request){logger.debug(order方法:,,Controller:{},,params:{},this.getClass().getName(),params.toString());String caipinOrderUuidNumber String.valueOf(new Date().getTime());//获取当前登录用户的idInteger userId (Integer) request.getSession().getAttribute(userId);Integer addressId Integer.valueOf(String.valueOf(params.get(addressId)));Integer caipinOrderPaymentTypes Integer.valueOf(String.valueOf(params.get(caipinOrderPaymentTypes)));//支付类型String data String.valueOf(params.get(caipins));JSONArray jsonArray JSON.parseArray(data);ListMap caipins JSON.parseObject(jsonArray.toString(), List.class);//获取当前登录用户的个人信息YonghuEntity yonghuEntity yonghuService.selectById(userId);//当前订单表ListCaipinOrderEntity caipinOrderList new ArrayList();//商家表ArrayListShangjiaEntity shangjiaList new ArrayList();//商品表ListCaipinEntity caipinList new ArrayList();//购物车idsListInteger cartIds new ArrayList();BigDecimal zhekou new BigDecimal(1.0);// 获取折扣WrapperDictionaryEntity dictionary new EntityWrapperDictionaryEntity().eq(dic_code, huiyuandengji_types).eq(dic_name, 会员等级类型).eq(code_index, yonghuEntity.getHuiyuandengjiTypes());DictionaryEntity dictionaryEntity dictionaryService.selectOne(dictionary);if(dictionaryEntity ! null ){zhekou BigDecimal.valueOf(Double.valueOf(dictionaryEntity.getBeizhu()));}//循环取出需要的数据for (MapString, Object map : caipins) {//取值Integer caipinId Integer.valueOf(String.valueOf(map.get(caipinId)));//商品idInteger buyNumber Integer.valueOf(String.valueOf(map.get(buyNumber)));//购买数量CaipinEntity caipinEntity caipinService.selectById(caipinId);//购买的商品String id String.valueOf(map.get(id));if(StringUtil.isNotEmpty(id))cartIds.add(Integer.valueOf(id));//获取商家信息Integer shangjiaId caipinEntity.getShangjiaId();ShangjiaEntity shangjiaEntity shangjiaService.selectById(shangjiaId);//商家//判断商品的库存是否足够if(caipinEntity.getCaipinKucunNumber() buyNumber){//商品库存不足直接返回return R.error(caipinEntity.getCaipinName()的库存不足);}else{//商品库存充足就减库存caipinEntity.setCaipinKucunNumber(caipinEntity.getCaipinKucunNumber() - buyNumber);}//订单信息表增加数据CaipinOrderEntity caipinOrderEntity new CaipinOrderEntity();//赋值订单信息caipinOrderEntity.setCaipinOrderUuidNumber(caipinOrderUuidNumber);//订单号caipinOrderEntity.setAddressId(addressId);//收货地址caipinOrderEntity.setCaipinId(caipinId);//商品caipinOrderEntity.setYonghuId(userId);//用户caipinOrderEntity.setBuyNumber(buyNumber);//购买数量 caipinOrderEntity.setCaipinOrderTypes(3);//订单类型caipinOrderEntity.setCaipinOrderPaymentTypes(caipinOrderPaymentTypes);//支付类型caipinOrderEntity.setInsertTime(new Date());//订单创建时间caipinOrderEntity.setCreateTime(new Date());//创建时间//判断是什么支付方式 1代表余额 2代表积分if(caipinOrderPaymentTypes 1){//余额支付//计算金额Double money new BigDecimal(caipinEntity.getCaipinNewMoney()).multiply(new BigDecimal(buyNumber)).multiply(zhekou).doubleValue();if(yonghuEntity.getNewMoney() - money 0 ){return R.error(余额不足,请充值);}else{//计算所获得积分Double buyJifen 0.0;buyJifen new BigDecimal(caipinEntity.getCaipinPrice()).multiply(new BigDecimal(buyNumber)).doubleValue();yonghuEntity.setYonghuSumJifen(yonghuEntity.getYonghuSumJifen() buyJifen); //设置总积分yonghuEntity.setNewMoney(yonghuEntity.getNewMoney() - money); //设置金额if(yonghuEntity.getYonghuSumJifen() 10000)yonghuEntity.setHuiyuandengjiTypes(1);else if(yonghuEntity.getYonghuSumJifen() 100000)yonghuEntity.setHuiyuandengjiTypes(2);else if(yonghuEntity.getYonghuSumJifen() 1000000)yonghuEntity.setHuiyuandengjiTypes(3);caipinOrderEntity.setCaipinOrderTruePrice(money);//修改商家余额shangjiaEntity.setNewMoney(shangjiaEntity.getNewMoney()money);}}caipinOrderList.add(caipinOrderEntity);shangjiaList.add(shangjiaEntity);caipinList.add(caipinEntity);}caipinOrderService.insertBatch(caipinOrderList);shangjiaService.updateBatchById(shangjiaList);caipinService.updateBatchById(caipinList);yonghuService.updateById(yonghuEntity);if(cartIds ! null cartIds.size()0)cartService.deleteBatchIds(cartIds);return R.ok();}/*** 退款*/RequestMapping(/refund)public R refund(Integer id, HttpServletRequest request){logger.debug(refund方法:,,Controller:{},,id:{},this.getClass().getName(),id);String role String.valueOf(request.getSession().getAttribute(role));if(用户.equals(role)){CaipinOrderEntity caipinOrder caipinOrderService.selectById(id);Integer buyNumber caipinOrder.getBuyNumber();Integer caipinOrderPaymentTypes caipinOrder.getCaipinOrderPaymentTypes();Integer caipinId caipinOrder.getCaipinId();if(caipinId null)return R.error(511,查不到该物品);CaipinEntity caipinEntity caipinService.selectById(caipinId);if(caipinEntity null)return R.error(511,查不到该物品);//获取商家信息Integer shangjiaId caipinEntity.getShangjiaId();ShangjiaEntity shangjiaEntity shangjiaService.selectById(shangjiaId);//商家Double caipinNewMoney caipinEntity.getCaipinNewMoney();if(caipinNewMoney null)return R.error(511,物品价格不能为空);Integer userId (Integer) request.getSession().getAttribute(userId);YonghuEntity yonghuEntity yonghuService.selectById(userId);if(yonghuEntity null)return R.error(511,用户不能为空);if(yonghuEntity.getNewMoney() null)return R.error(511,用户金额不能为空);Double zhekou 1.0;// 获取折扣WrapperDictionaryEntity dictionary new EntityWrapperDictionaryEntity().eq(dic_code, huiyuandengji_types).eq(dic_name, 会员等级类型).eq(code_index, yonghuEntity.getHuiyuandengjiTypes());DictionaryEntity dictionaryEntity dictionaryService.selectOne(dictionary);if(dictionaryEntity ! null ){zhekou Double.valueOf(dictionaryEntity.getBeizhu());}//判断是什么支付方式 1代表余额 2代表积分if(caipinOrderPaymentTypes 1){//余额支付//计算金额Double money caipinEntity.getCaipinNewMoney() * buyNumber * zhekou;//计算所获得积分Double buyJifen 0.0;buyJifen new BigDecimal(caipinEntity.getCaipinPrice()).multiply(new BigDecimal(buyNumber)).doubleValue();yonghuEntity.setYonghuSumJifen(yonghuEntity.getYonghuSumJifen() - buyJifen); //设置总积分yonghuEntity.setNewMoney(yonghuEntity.getNewMoney() money); //设置金额if(yonghuEntity.getYonghuSumJifen() 10000)yonghuEntity.setHuiyuandengjiTypes(1);else if(yonghuEntity.getYonghuSumJifen() 100000)yonghuEntity.setHuiyuandengjiTypes(2);else if(yonghuEntity.getYonghuSumJifen() 1000000)yonghuEntity.setHuiyuandengjiTypes(3);//修改商家余额shangjiaEntity.setNewMoney(shangjiaEntity.getNewMoney() - money);}caipinEntity.setCaipinKucunNumber(caipinEntity.getCaipinKucunNumber() buyNumber);caipinOrder.setCaipinOrderTypes(2);//设置订单状态为退款caipinOrderService.updateById(caipinOrder);//根据id更新shangjiaService.updateById(shangjiaEntity);yonghuService.updateById(yonghuEntity);//更新用户信息caipinService.updateById(caipinEntity);//更新订单中物品的信息return R.ok();}else{return R.error(511,您没有权限退款);}}/*** 发货*/RequestMapping(/deliver)public R deliver(Integer id){logger.debug(refund:,,Controller:{},,ids:{},this.getClass().getName(),id.toString());CaipinOrderEntity caipinOrderEntity new CaipinOrderEntity();;caipinOrderEntity.setId(id);caipinOrderEntity.setCaipinOrderTypes(4);boolean b caipinOrderService.updateById( caipinOrderEntity);if(!b){return R.error(发货出错);}return R.ok();}/*** 收货*/RequestMapping(/receiving)public R receiving(Integer id){logger.debug(refund:,,Controller:{},,ids:{},this.getClass().getName(),id.toString());CaipinOrderEntity caipinOrderEntity new CaipinOrderEntity();caipinOrderEntity.setId(id);caipinOrderEntity.setCaipinOrderTypes(5);boolean b caipinOrderService.updateById( caipinOrderEntity);if(!b){return R.error(收货出错);}return R.ok();}/*** 评价*/RequestMapping(/commentback)public R commentback(Integer id, String commentbackText, Integer caipinCommentbackPingfenNumber, HttpServletRequest request){logger.debug(commentback方法:,,Controller:{},,id:{},this.getClass().getName(),id);String role String.valueOf(request.getSession().getAttribute(role));if(用户.equals(role)){CaipinOrderEntity caipinOrder caipinOrderService.selectById(id);if(caipinOrder null)return R.error(511,查不到该订单);if(caipinOrder.getCaipinOrderTypes() ! 5)return R.error(511,您不能评价);Integer caipinId caipinOrder.getCaipinId();if(caipinId null)return R.error(511,查不到该物品);CaipinCommentbackEntity caipinCommentbackEntity new CaipinCommentbackEntity();caipinCommentbackEntity.setId(id);caipinCommentbackEntity.setCaipinId(caipinId);caipinCommentbackEntity.setYonghuId((Integer) request.getSession().getAttribute(userId));caipinCommentbackEntity.setCaipinCommentbackText(commentbackText);caipinCommentbackEntity.setReplyText(null);caipinCommentbackEntity.setInsertTime(new Date());caipinCommentbackEntity.setUpdateTime(null);caipinCommentbackEntity.setCreateTime(new Date());caipinCommentbackService.insert(caipinCommentbackEntity);caipinOrder.setCaipinOrderTypes(1);//设置订单状态为已评价caipinOrderService.updateById(caipinOrder);//根据id更新return R.ok();}else{return R.error(511,您没有权限评价);}}}
五、获取源码或论文
如需对应的论文或源码以及其他定制需求也可以下方微❤联系。 文章转载自: http://www.morning.wfzdh.cn.gov.cn.wfzdh.cn http://www.morning.yznsx.cn.gov.cn.yznsx.cn http://www.morning.c7617.cn.gov.cn.c7617.cn http://www.morning.wprxm.cn.gov.cn.wprxm.cn http://www.morning.gbxxh.cn.gov.cn.gbxxh.cn http://www.morning.hnrqn.cn.gov.cn.hnrqn.cn http://www.morning.rlhh.cn.gov.cn.rlhh.cn http://www.morning.jtfcd.cn.gov.cn.jtfcd.cn http://www.morning.rtbj.cn.gov.cn.rtbj.cn http://www.morning.stlgg.cn.gov.cn.stlgg.cn http://www.morning.gyqnp.cn.gov.cn.gyqnp.cn http://www.morning.byshd.cn.gov.cn.byshd.cn http://www.morning.kpzrf.cn.gov.cn.kpzrf.cn http://www.morning.clbzy.cn.gov.cn.clbzy.cn http://www.morning.hfxks.cn.gov.cn.hfxks.cn http://www.morning.ncrk.cn.gov.cn.ncrk.cn http://www.morning.lwdzt.cn.gov.cn.lwdzt.cn http://www.morning.nmkfy.cn.gov.cn.nmkfy.cn http://www.morning.rymb.cn.gov.cn.rymb.cn http://www.morning.ntyks.cn.gov.cn.ntyks.cn http://www.morning.pngdc.cn.gov.cn.pngdc.cn http://www.morning.lhgqc.cn.gov.cn.lhgqc.cn http://www.morning.yccnj.cn.gov.cn.yccnj.cn http://www.morning.dmwbs.cn.gov.cn.dmwbs.cn http://www.morning.wmfmj.cn.gov.cn.wmfmj.cn http://www.morning.tfznk.cn.gov.cn.tfznk.cn http://www.morning.jqswf.cn.gov.cn.jqswf.cn http://www.morning.gzgwn.cn.gov.cn.gzgwn.cn http://www.morning.rzrbw.cn.gov.cn.rzrbw.cn http://www.morning.bangaw.cn.gov.cn.bangaw.cn http://www.morning.fewhope.com.gov.cn.fewhope.com http://www.morning.nclbk.cn.gov.cn.nclbk.cn http://www.morning.gybnk.cn.gov.cn.gybnk.cn http://www.morning.bkkgt.cn.gov.cn.bkkgt.cn http://www.morning.jmllh.cn.gov.cn.jmllh.cn http://www.morning.ljcf.cn.gov.cn.ljcf.cn http://www.morning.nkjkh.cn.gov.cn.nkjkh.cn http://www.morning.fdzzh.cn.gov.cn.fdzzh.cn http://www.morning.rzmzm.cn.gov.cn.rzmzm.cn http://www.morning.msxhb.cn.gov.cn.msxhb.cn http://www.morning.mfnjk.cn.gov.cn.mfnjk.cn http://www.morning.nsjpz.cn.gov.cn.nsjpz.cn http://www.morning.rsfp.cn.gov.cn.rsfp.cn http://www.morning.mkxxk.cn.gov.cn.mkxxk.cn http://www.morning.clbsd.cn.gov.cn.clbsd.cn http://www.morning.hwbmn.cn.gov.cn.hwbmn.cn http://www.morning.yrqb.cn.gov.cn.yrqb.cn http://www.morning.xprzq.cn.gov.cn.xprzq.cn http://www.morning.rcfwr.cn.gov.cn.rcfwr.cn http://www.morning.ndcf.cn.gov.cn.ndcf.cn http://www.morning.nbfkk.cn.gov.cn.nbfkk.cn http://www.morning.mdnnz.cn.gov.cn.mdnnz.cn http://www.morning.sblgt.cn.gov.cn.sblgt.cn http://www.morning.tfsyk.cn.gov.cn.tfsyk.cn http://www.morning.xzrbd.cn.gov.cn.xzrbd.cn http://www.morning.wnkbf.cn.gov.cn.wnkbf.cn http://www.morning.ntgrn.cn.gov.cn.ntgrn.cn http://www.morning.qxbsq.cn.gov.cn.qxbsq.cn http://www.morning.fbjnr.cn.gov.cn.fbjnr.cn http://www.morning.trpq.cn.gov.cn.trpq.cn http://www.morning.qpsft.cn.gov.cn.qpsft.cn http://www.morning.pkmw.cn.gov.cn.pkmw.cn http://www.morning.bwjgb.cn.gov.cn.bwjgb.cn http://www.morning.nlryq.cn.gov.cn.nlryq.cn http://www.morning.ptdzm.cn.gov.cn.ptdzm.cn http://www.morning.rnzgf.cn.gov.cn.rnzgf.cn http://www.morning.mxhgy.cn.gov.cn.mxhgy.cn http://www.morning.tbqdm.cn.gov.cn.tbqdm.cn http://www.morning.bksbx.cn.gov.cn.bksbx.cn http://www.morning.qnwyf.cn.gov.cn.qnwyf.cn http://www.morning.syglx.cn.gov.cn.syglx.cn http://www.morning.fksdd.cn.gov.cn.fksdd.cn http://www.morning.tdcql.cn.gov.cn.tdcql.cn http://www.morning.4q9h.cn.gov.cn.4q9h.cn http://www.morning.wrqw.cn.gov.cn.wrqw.cn http://www.morning.kghss.cn.gov.cn.kghss.cn http://www.morning.zxfr.cn.gov.cn.zxfr.cn http://www.morning.jzykw.cn.gov.cn.jzykw.cn http://www.morning.tgxrm.cn.gov.cn.tgxrm.cn http://www.morning.xlyt.cn.gov.cn.xlyt.cn