| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "金汇微心愿分类列表", response = JinhuiMicroVolunteeringTypeVO.class) |
| | | @GetMapping("/micro/type/getList") |
| | | public R volunteeringTypeGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize) { |
| | | return jinhuiCommunityService.volunteeringTypeGetList(pageNum, pageSize); |
| | | } |
| | | |
| | | /********************************************************************************************************* |
| | | * |
| | | * |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /******************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇商城商品订单 |
| | | * |
| | | * |
| | | ********************************************************************************************************/ |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单列表", response = JinhuiShoppingOrderVO.class) |
| | | @GetMapping("/orderGetList") |
| | | public R orderGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "goodsId", required = false)String goodsId, |
| | | @RequestParam(value = "orderNumber", required = false)String orderNumber, |
| | | @RequestParam(value = "goodName", required = false)String goodName, |
| | | @RequestParam(value = "name", required = false)String name, |
| | | @RequestParam(value = "cancelType", required = false)String cancelType) |
| | | { |
| | | return jinhuiCommunityService.orderGetList(pageNum,pageSize,getUserId()+"", |
| | | goodsId,orderNumber,goodName,name,cancelType); |
| | | } |
| | | |
| | | /** |
| | | * 分页详情 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单详情", response = JinhuiShoppingOrderVO.class) |
| | | @GetMapping("/orderGetDetails") |
| | | public R orderGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.orderGetDetails(id); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单新增") |
| | | @PostMapping("/orderAddData") |
| | | public R orderAddData(@RequestBody JinhuiShoppingOrderVO item) |
| | | { |
| | | return jinhuiCommunityService.orderAddData(item); |
| | | } |
| | | |
| | | /** |
| | | * 取消 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单取消") |
| | | @GetMapping("/orderCancelOrder") |
| | | public R orderCancelOrder(@RequestParam("orderId") String orderId) |
| | | { |
| | | return jinhuiCommunityService.orderCancelOrder(orderId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单删除") |
| | | @DeleteMapping("/orderExpurgateData") |
| | | public R orderExpurgateData(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.orderExpurgateData(id); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "空间分类") |
| | | private String intendantType; |
| | | |
| | | |
| | | @ApiModelProperty(value = "空间分类名称") |
| | | private String intendantName; |
| | | |
| | | @ApiModelProperty(value = "空间介绍") |
| | | private String content; |
| | | |
| | |
| | | public R shoppingExpurgateData(@RequestParam("id") String id); |
| | | |
| | | |
| | | /******************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇商城商品订单 |
| | | * |
| | | * |
| | | ********************************************************************************************************/ |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/jinhuiShopping/orderGetList") |
| | | public R orderGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "userId", required = false)String userId, |
| | | @RequestParam(value = "goodsId", required = false)String goodsId, |
| | | @RequestParam(value = "orderNumber", required = false)String orderNumber, |
| | | @RequestParam(value = "goodName", required = false)String goodName, |
| | | @RequestParam(value = "name", required = false)String name, |
| | | @RequestParam(value = "cancelType", required = false)String cancelType); |
| | | |
| | | /** |
| | | * 分页详情 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/jinhuiShopping/orderGetDetails") |
| | | public R orderGetDetails(@RequestParam("id") String id); |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/jinhuiShopping/orderAddData") |
| | | public R orderAddData(@RequestBody JinhuiShoppingOrderVO item); |
| | | |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/jinhuiShopping/orderEditData") |
| | | public R orderEditData(@RequestBody JinhuiShoppingOrderVO item); |
| | | |
| | | |
| | | /** |
| | | * 取消 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/jinhuiShopping/orderCancelOrder") |
| | | public R orderCancelOrder(@RequestParam("orderId") String orderId); |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/jinhuiShopping/orderExpurgateData") |
| | | public R orderExpurgateData(@RequestParam("id") String id); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /******************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇商城商品订单 |
| | | * |
| | | * |
| | | ********************************************************************************************************/ |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单列表", response = JinhuiShoppingOrderVO.class) |
| | | @GetMapping("/orderGetList") |
| | | public R orderGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "goodsId", required = false)String goodsId, |
| | | @RequestParam(value = "orderNumber", required = false)String orderNumber, |
| | | @RequestParam(value = "goodName", required = false)String goodName, |
| | | @RequestParam(value = "name", required = false)String name, |
| | | @RequestParam(value = "cancelType", required = false)String cancelType) |
| | | { |
| | | return jinhuiCommunityService.orderGetList(pageNum,pageSize,null, |
| | | goodsId,orderNumber,goodName,name,cancelType); |
| | | } |
| | | |
| | | /** |
| | | * 分页详情 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单详情", response = JinhuiShoppingOrderVO.class) |
| | | @GetMapping("/orderGetDetails") |
| | | public R orderGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.orderGetDetails(id); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param |
| | | * @return |
| | | */ |
| | | // @ApiOperation(value = "订单编辑") |
| | | // @PostMapping("/orderEditData") |
| | | // public R orderEditData(@RequestBody JinhuiShoppingOrderVO item) |
| | | // { |
| | | // return jinhuiCommunityService.orderEditData(item); |
| | | // } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单核销") |
| | | @GetMapping("/orderCheck") |
| | | public R orderEditData(@RequestParam("id") String id) |
| | | { |
| | | |
| | | if(StringUtils.isEmpty(id)) |
| | | { |
| | | return R.fail("订单id不能为空"); |
| | | } |
| | | |
| | | JinhuiShoppingOrderVO vo=new JinhuiShoppingOrderVO(); |
| | | vo.setId(id); |
| | | vo.setCancelType("1"); |
| | | return jinhuiCommunityService.orderEditData(vo); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "订单删除") |
| | | @DeleteMapping("/orderExpurgateData") |
| | | public R orderExpurgateData(@RequestParam("id") String id) |
| | | { |
| | | return jinhuiCommunityService.orderExpurgateData(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiShoppingOrderVO; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiShoppingVO; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiShopping; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiShoppingOrderService; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiShoppingService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/jinhuiShopping") |
| | | public class JinhuiShoppingApi extends BaseController { |
| | | public class JinhuiShoppingApi extends BaseController |
| | | { |
| | | |
| | | @Resource |
| | | private JinhuiShoppingService shoppingService; |
| | | |
| | | |
| | | @Resource |
| | | private JinhuiShoppingOrderService orderService; |
| | | /** |
| | | * 分页查询 |
| | | * |
| | |
| | | return shoppingService.expurgateData(id); |
| | | } |
| | | |
| | | |
| | | /******************************************************************************************************** |
| | | * |
| | | * |
| | | * 金汇商城商品订单 |
| | | * |
| | | * |
| | | ********************************************************************************************************/ |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/orderGetList") |
| | | public R orderGetList(@RequestParam("pageNum") int pageNum, |
| | | @RequestParam("pageSize") int pageSize, |
| | | @RequestParam(value = "userId", required = false)String userId, |
| | | @RequestParam(value = "goodsId", required = false)String goodsId, |
| | | @RequestParam(value = "orderNumber", required = false)String orderNumber, |
| | | @RequestParam(value = "goodName", required = false)String goodName, |
| | | @RequestParam(value = "name", required = false)String name, |
| | | @RequestParam(value = "cancelType", required = false)String cancelType) |
| | | { |
| | | return orderService.getList(pageNum,pageSize,userId,goodsId,orderNumber,goodName,name,cancelType); |
| | | } |
| | | |
| | | /** |
| | | * 分页详情 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/orderGetDetails") |
| | | public R orderGetDetails(@RequestParam("id") String id) |
| | | { |
| | | return R.ok(orderService.getDetails(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/orderAddData") |
| | | public R orderAddData(@RequestBody JinhuiShoppingOrderVO item) |
| | | { |
| | | return orderService.addData(item); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/orderEditData") |
| | | public R orderEditData(@RequestBody JinhuiShoppingOrderVO item) |
| | | { |
| | | return orderService.editData(item); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 取消 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @GetMapping("/orderCancelOrder") |
| | | public R orderCancelOrder(@RequestParam("orderId") String orderId) |
| | | { |
| | | return orderService.cancelOrder(orderId); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @DeleteMapping("/orderExpurgateData") |
| | | public R orderExpurgateData(@RequestParam("id") String id) |
| | | { |
| | | return orderService.expurgateData(id); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | IPage<JinhuiShoppingOrder> getList(Page page, |
| | | @Param("userId") String userId, |
| | | @Param("goodsId") String goodsId, |
| | | @Param("orderNumber") String orderNumber, |
| | | @Param("goodName") String goodName, |
| | |
| | | @ApiModelProperty(value = "空间分类") |
| | | private String intendantType; |
| | | |
| | | @ApiModelProperty(value = "空间分类名称") |
| | | private String intendantName; |
| | | |
| | | @ApiModelProperty(value = "空间介绍") |
| | | private String content; |
| | | |
| | |
| | | * @param |
| | | * @return |
| | | */ |
| | | R getList(int pageNum,int pageSize,String goodsId,String orderNumber, |
| | | R getList(int pageNum,int pageSize,String userId,String goodsId,String orderNumber, |
| | | String goodName,String name,String cancelType); |
| | | |
| | | JinhuiShoppingOrder getDetails(String id); |
| | |
| | | |
| | | R editData(JinhuiShoppingOrderVO item); |
| | | |
| | | R cancelOrder(String orderId); |
| | | |
| | | |
| | | |
| | | R expurgateData(String id); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiCoinGeneralTableVO; |
| | | import com.panzhihua.service_jinhui_community.dao.JinhuiCoinGeneralTableDao; |
| | | import com.panzhihua.service_jinhui_community.dao.JinhuiComConvenientServiceCategoriesDao; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiCoinGeneralTable; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiComConvenientServiceCategories; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiCoinGeneralTableService; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiComConvenientServiceCategoriesService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Override |
| | | public R addData(JinhuiInterspaceApplyForVO item) |
| | | { |
| | | item.setState("1"); |
| | | int num= baseMapper.addData(item); |
| | | if(num>0) |
| | | { |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiCoinGeneralTableVO; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiGoldCoinRecordVO; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiShoppingOrderVO; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiShoppingVO; |
| | | import com.panzhihua.service_jinhui_community.dao.JinhuiShoppingDao; |
| | | import com.panzhihua.service_jinhui_community.dao.JinhuiShoppingOrderDao; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiCoinGeneralTable; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiShopping; |
| | | import com.panzhihua.service_jinhui_community.entity.JinhuiShoppingOrder; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiCoinGeneralTableService; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiGoldCoinRecordService; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiShoppingOrderService; |
| | | import com.panzhihua.service_jinhui_community.service.JinhuiShoppingService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | |
| | | @Slf4j |
| | |
| | | JinhuiShoppingOrder> implements JinhuiShoppingOrderService |
| | | { |
| | | |
| | | @Resource |
| | | private JinhuiShoppingService shoppingService; |
| | | |
| | | @Resource |
| | | private JinhuiCoinGeneralTableService tableService; |
| | | |
| | | @Resource |
| | | private JinhuiGoldCoinRecordService goldCoinRecordService; |
| | | |
| | | @Override |
| | | public R getList(int pageNum,int pageSize,String goodsId,String orderNumber, |
| | | public R getList(int pageNum,int pageSize,String userId,String goodsId,String orderNumber, |
| | | String goodName,String name,String cancelType) |
| | | { |
| | | Page page = new Page<JinhuiShopping>(pageNum,pageSize); |
| | | return R.ok(baseMapper.getList(page,goodsId,orderNumber,goodName,name,cancelType)); |
| | | return R.ok(baseMapper.getList(page,userId,goodsId,orderNumber,goodName,name,cancelType)); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public R addData(JinhuiShoppingOrderVO item) |
| | | { |
| | | JinhuiCoinGeneralTable generalTable=tableService.getDetails(item.getUserId()); |
| | | JinhuiShopping goods=shoppingService.getDetails(item.getGoodsId()); |
| | | |
| | | int allMoney=0; |
| | | int getMoney=Integer.valueOf(goods.getGoodPrice()); |
| | | |
| | | |
| | | if(generalTable==null) |
| | | { |
| | | return R.fail("金汇币不足!"); |
| | | } |
| | | |
| | | if(!StringUtils.isEmpty(generalTable.getGoldCoin())) |
| | | { |
| | | allMoney=Integer.valueOf(generalTable.getGoldCoin()); |
| | | } |
| | | if(getMoney>allMoney) |
| | | { |
| | | return R.fail("金汇币不足!"); |
| | | } |
| | | |
| | | item.setPalyMoney(goods.getGoodPrice()); |
| | | int num= baseMapper.addData(item); |
| | | if(num>0) |
| | | { |
| | | //修改个人金汇币总额 |
| | | allMoney=allMoney-getMoney; |
| | | JinhuiCoinGeneralTableVO generalTableVO=new JinhuiCoinGeneralTableVO(); |
| | | generalTableVO.setId(generalTable.getId()); |
| | | generalTableVO.setGoldCoin(allMoney+""); |
| | | tableService.editData(generalTableVO); |
| | | |
| | | //增加兑换记录 |
| | | JinhuiGoldCoinRecordVO recordVO=new JinhuiGoldCoinRecordVO(); |
| | | recordVO.setTitle("兑换商品"); |
| | | recordVO.setType("2"); |
| | | recordVO.setUserId(item.getUserId()); |
| | | recordVO.setGoldCoin(getMoney+""); |
| | | goldCoinRecordService.addData(recordVO); |
| | | |
| | | return R.ok(); |
| | | } |
| | | return R.fail("添加失败"); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R expurgateData(String id) { |
| | | public R cancelOrder(String orderId) |
| | | { |
| | | JinhuiShoppingOrder order=baseMapper.getDetails(orderId); |
| | | |
| | | if(!StringUtils.equals("0",order.getCancelType())) |
| | | { |
| | | return R.fail("订单不是待核销状态"); |
| | | } |
| | | |
| | | JinhuiShoppingOrderVO orderVO=new JinhuiShoppingOrderVO(); |
| | | orderVO.setId(orderId); |
| | | orderVO.setCancelType("2"); |
| | | int num=baseMapper.editData(orderVO); |
| | | if(num>0) |
| | | { |
| | | JinhuiCoinGeneralTable generalTable=tableService.getDetails(order.getUserId()); |
| | | |
| | | int allMoney=0; |
| | | int getMoney=Integer.valueOf(order.getPalyMoney()); |
| | | |
| | | if(!StringUtils.isEmpty(generalTable.getGoldCoin())) |
| | | { |
| | | allMoney=Integer.valueOf(generalTable.getGoldCoin()); |
| | | } |
| | | |
| | | //修改个人金汇币总额 |
| | | allMoney=allMoney+getMoney; |
| | | JinhuiCoinGeneralTableVO generalTableVO=new JinhuiCoinGeneralTableVO(); |
| | | generalTableVO.setId(generalTable.getId()); |
| | | generalTableVO.setGoldCoin(allMoney+""); |
| | | tableService.editData(generalTableVO); |
| | | |
| | | //增加兑换记录 |
| | | JinhuiGoldCoinRecordVO recordVO=new JinhuiGoldCoinRecordVO(); |
| | | recordVO.setTitle("商品订单取消"); |
| | | recordVO.setType("3"); |
| | | recordVO.setUserId(order.getUserId()); |
| | | recordVO.setGoldCoin(getMoney+""); |
| | | goldCoinRecordService.addData(recordVO); |
| | | |
| | | return R.ok(); |
| | | } |
| | | return R.fail("取消失败"); |
| | | } |
| | | |
| | | @Override |
| | | public R expurgateData(String id) |
| | | { |
| | | JinhuiShoppingOrder order=baseMapper.getDetails(id); |
| | | |
| | | if(StringUtils.equals("0",order.getCancelType())) |
| | | { |
| | | return R.fail("待核销订单不能删除"); |
| | | } |
| | | |
| | | int num= baseMapper.expurgateData(id); |
| | | if(num>0) |
| | | { |
| | |
| | | intendant, |
| | | intendant_phone, |
| | | intendant_type, |
| | | (select intendant_name from jinhui_intendant_type where jinhui_interspace.intendant_type=jinhui_intendant_type.id) as intendantName, |
| | | content, |
| | | address, |
| | | lon, |
| | |
| | | intendant, |
| | | intendant_phone, |
| | | intendant_type, |
| | | (select intendant_name from jinhui_intendant_type where jinhui_interspace.intendant_type=jinhui_intendant_type.id) as intendantName, |
| | | content, |
| | | address, |
| | | lon, |
| | |
| | | LEFT JOIN jinhui_shopping js ON js.id = jso.goods_id |
| | | <where> |
| | | 1=1 |
| | | <if test="userId !=null and userId !='' "> |
| | | and jso.user_id=#{userId} |
| | | </if> |
| | | <if test="goodsId !=null and goodsId !='' "> |
| | | and jso.goods_id=#{goodsId} |
| | | </if> |