Initial commit
This commit is contained in:
BIN
src/.DS_Store
vendored
Normal file
BIN
src/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
src/main/.DS_Store
vendored
Normal file
BIN
src/main/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
src/main/java/.DS_Store
vendored
Normal file
BIN
src/main/java/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
src/main/java/com/.DS_Store
vendored
Normal file
BIN
src/main/java/com/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
src/main/java/com/gxwebsoft/.DS_Store
vendored
Normal file
BIN
src/main/java/com/gxwebsoft/.DS_Store
vendored
Normal file
Binary file not shown.
28
src/main/java/com/gxwebsoft/WebSoftApplication.java
Normal file
28
src/main/java/com/gxwebsoft/WebSoftApplication.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.gxwebsoft;
|
||||
|
||||
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
/**
|
||||
* 启动类
|
||||
* Created by WebSoft on 2018-02-22 11:29:03
|
||||
*/
|
||||
@EnableAsync
|
||||
@EnableTransactionManagement
|
||||
@MapperScan("com.gxwebsoft.**.mapper")
|
||||
@EnableConfigurationProperties(ConfigProperties.class)
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
public class WebSoftApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(WebSoftApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.gxwebsoft.apps.constants;
|
||||
|
||||
public class EquipmentConstants {
|
||||
// 事件类型
|
||||
public static final String EVENT_TYPE_BIND = "电池绑定";
|
||||
public static final String EVENT_TYPE_CHANGE = "电池更换";
|
||||
public static final String EVENT_TYPE_UNBIND = "电池解绑";
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.gxwebsoft.apps.constants;
|
||||
|
||||
public class HualalaConstants {
|
||||
// 集团ID
|
||||
public static final String GROUP_ID = "1528";
|
||||
// 服务器接口
|
||||
public static final String API_URL = "https://www-openapi.hualala.com";
|
||||
// appKey
|
||||
public static final String APP_KEY = "2487";
|
||||
// appSecret
|
||||
public static final String APP_SECRET = "Hgr520dQpEiFe0FV";
|
||||
// version
|
||||
public static final Integer VERSION = 3;
|
||||
// 店铺ID
|
||||
public static final Long shopId = 0L;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.gxwebsoft.apps.constants;
|
||||
|
||||
public class SfExpressConstants {
|
||||
// 开发者id
|
||||
public static final Long DEV_ID = 1651421896L;
|
||||
// 开发者密钥
|
||||
public static final String DEV_KEY = "2f10570c5057570fe0e488a425a6d813";
|
||||
// 正式环境
|
||||
public static final String SERVER_HOST = "https://openic.sf-express.com";
|
||||
// 店铺ID
|
||||
public static final String SHOP_ID = "3243279847393";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.BcAgentService;
|
||||
import com.gxwebsoft.apps.entity.BcAgent;
|
||||
import com.gxwebsoft.apps.param.BcAgentParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代报餐管理控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-24 19:25:59
|
||||
*/
|
||||
@Api(tags = "代报餐管理管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/bc-agent")
|
||||
public class BcAgentController extends BaseController {
|
||||
@Resource
|
||||
private BcAgentService bcAgentService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcAgent:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询代报餐管理")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BcAgent>> page(BcAgentParam param) {
|
||||
// 使用关联查询
|
||||
return success(bcAgentService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcAgent:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部代报餐管理")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BcAgent>> list(BcAgentParam param) {
|
||||
// 使用关联查询
|
||||
return success(bcAgentService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcAgent:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询代报餐管理")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BcAgent> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bcAgentService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcAgent:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加代报餐管理")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BcAgent bcAgent) {
|
||||
if (bcAgentService.save(bcAgent)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcAgent:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改代报餐管理")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BcAgent bcAgent) {
|
||||
if (bcAgentService.updateById(bcAgent)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcAgent:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除代报餐管理")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bcAgentService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcAgent:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加代报餐管理")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BcAgent> list) {
|
||||
if (bcAgentService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcAgent:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改代报餐管理")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BcAgent> batchParam) {
|
||||
if (batchParam.update(bcAgentService, "agent_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcAgent:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除代报餐管理")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bcAgentService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.apps.entity.BcCart;
|
||||
import com.gxwebsoft.apps.entity.BcPlan;
|
||||
import com.gxwebsoft.apps.result.CartResult;
|
||||
import com.gxwebsoft.apps.service.BcPlanService;
|
||||
import com.gxwebsoft.common.core.exception.BusinessException;
|
||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.entity.Goods;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.entity.OrderGoods;
|
||||
import com.gxwebsoft.shop.param.CartParam;
|
||||
import com.gxwebsoft.shop.service.GoodsService;
|
||||
import com.gxwebsoft.shop.service.OrderGoodsService;
|
||||
import com.gxwebsoft.shop.service.OrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Date;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.gxwebsoft.common.core.constants.OrderConstants.PAY_STATUS_SUCCESS;
|
||||
|
||||
/**
|
||||
* 批量报餐
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-11-25 19:04:43
|
||||
*/
|
||||
@Api(tags = "购物车记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/bc-cart")
|
||||
public class BcCartController extends BaseController {
|
||||
@Resource
|
||||
private GoodsService goodsService;
|
||||
@Resource
|
||||
private StringRedisTemplate stringRedisTemplate;
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
@Resource
|
||||
private OrderGoodsService orderGoodsService;
|
||||
|
||||
@Resource
|
||||
private BcPlanService bcPlanService;
|
||||
|
||||
@ApiOperation("添加购物车")
|
||||
@PostMapping("/addCart")
|
||||
public ApiResult<?> addCart(@RequestBody BcCart vo) {
|
||||
final Goods goods = goodsService.getById(vo.getGoodsId());
|
||||
if (goods == null) {
|
||||
return fail("该商品已下架");
|
||||
}
|
||||
// 获取当天菜单
|
||||
final List<BcPlan> bcList = bcPlanService.list(new LambdaQueryWrapper<BcPlan>().eq(BcPlan::getDayTime, vo.getDeliveryTime() + " 00:00:00"));
|
||||
System.out.println("bcList = " + bcList);
|
||||
if (bcList != null && !CollectionUtils.isEmpty(bcList)) {
|
||||
final BcPlan bcPlan = bcList.get(0);
|
||||
final ArrayList<Integer> arrayList = JSONUtil.parseObject(bcPlan.getGoodsIds(), ArrayList.class);
|
||||
if(!arrayList.contains(vo.getGoodsId())) {
|
||||
return fail(vo.getDeliveryTime() + "没有上架" + goods.getGoodsName());
|
||||
}
|
||||
}
|
||||
|
||||
// 1. key = cache10048:cart651:2023-05-04
|
||||
String key = "cache" + getTenantId() + ":cart" + getLoginUserId() + ":" + vo.getDeliveryTime();
|
||||
// 2. 准备数据
|
||||
|
||||
vo.setImage(goods.getImage());
|
||||
vo.setGoodsName(goods.getGoodsName());
|
||||
vo.setComments(goods.getComments());
|
||||
vo.setCategoryId(goods.getCategoryId());
|
||||
vo.setGear(goods.getGear());
|
||||
vo.setUserId(getLoginUserId());
|
||||
// 2. 保存到购物车
|
||||
stringRedisTemplate.opsForHash().put(key, vo.getGoodsId().toString(), JSONObject.toJSONString(vo));
|
||||
//设置过期时间600秒
|
||||
System.out.println("设置过期时间600秒 = " + key);
|
||||
stringRedisTemplate.opsForHash().getOperations().expire(key,60*60*3, TimeUnit.SECONDS);
|
||||
// 3. 查询购物车并返回
|
||||
final List<BcCart> list = getCart(key);
|
||||
final ArrayList<CartResult> cartAll = getCartAll();
|
||||
return success("添加成功", cartAll);
|
||||
}
|
||||
|
||||
@ApiOperation("查看购物车")
|
||||
@PostMapping("/showCart")
|
||||
public ApiResult<?> showCart() {
|
||||
// System.out.println("vo = " + vo);
|
||||
|
||||
// 按预定日期查询
|
||||
// if (vo.getDeliveryTime() != null) {
|
||||
// // key = cache10048:cart651:2023-05-04
|
||||
// String key = "cache" + getTenantId() + ":cart" + getLoginUserId() + ":" + vo.getDeliveryTime();
|
||||
// final List<BcCart> list = getCart(key);
|
||||
// return success("获取成功", list);
|
||||
// }
|
||||
// 查询全部购物车数据
|
||||
return success("获取成功", getCartAll());
|
||||
}
|
||||
|
||||
@ApiOperation("从购物车创建订单")
|
||||
@PostMapping("/createOrder")
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public ApiResult<?> createOrder(@RequestBody CartParam param) {
|
||||
// 1.判断是否代报餐
|
||||
Integer userId = 0;
|
||||
if (param.getAgentUserId() != null) {
|
||||
userId = param.getAgentUserId();
|
||||
} else {
|
||||
userId = getLoginUserId();
|
||||
}
|
||||
// 2.从缓存读取用户的购物车数据
|
||||
final ArrayList<CartResult> cartAll = getCartAll();
|
||||
if (cartAll.size() == 0) {
|
||||
throw new BusinessException("订单不存在");
|
||||
}
|
||||
// 3.批量创建订单
|
||||
Integer finalUserId = userId;
|
||||
final ArrayList<Object> orderIds = new ArrayList<>();
|
||||
cartAll.forEach(d -> {
|
||||
// 过滤空单
|
||||
if (!d.getTotalNum().equals(0)) {
|
||||
System.out.println("批量创建订单d = " + d);
|
||||
Order order = new Order();
|
||||
// 查询今日订单是否存在
|
||||
final Order one = orderService.getOne(new LambdaQueryWrapper<Order>()
|
||||
.eq(Order::getUserId, finalUserId)
|
||||
.eq(Order::getPayStatus,PAY_STATUS_SUCCESS)
|
||||
.eq(Order::getDeliveryTime, Date.valueOf(d.getDeliveryTime())));
|
||||
if(one == null){
|
||||
order.setOrderNo(IdUtil.getSnowflakeNextId());
|
||||
order.setTotalPrice(d.getTotalPrice());
|
||||
order.setOrderPrice(d.getTotalPrice());
|
||||
order.setPayPrice(d.getTotalPrice());
|
||||
order.setDeliveryTime(Date.valueOf(d.getDeliveryTime()));
|
||||
order.setExpirationTime(DateUtil.nextMonth());
|
||||
order.setIsTemporary(param.getIsTemporary());
|
||||
order.setUserId(finalUserId);
|
||||
order.setWeek(DateUtil.dayOfWeek(order.getDeliveryTime()) - 1);
|
||||
orderService.save(order);
|
||||
}else {
|
||||
order.setOrderId(one.getOrderId());
|
||||
}
|
||||
orderIds.add(order.getOrderId());
|
||||
|
||||
// 添加订单商品
|
||||
final List<BcCart> items = d.getItems();
|
||||
final ArrayList<OrderGoods> orderGoods = new ArrayList<>();
|
||||
items.forEach(g -> {
|
||||
if(!g.getTotalNum().equals(0)){
|
||||
final OrderGoods og = new OrderGoods();
|
||||
og.setOrderId(order.getOrderId());
|
||||
og.setGoodsId(g.getGoodsId());
|
||||
og.setGoodsName(g.getGoodsName());
|
||||
og.setImageUrl(g.getImage());
|
||||
og.setTotalNum(g.getTotalNum());
|
||||
og.setCategoryId(g.getCategoryId());
|
||||
og.setGoodsPrice(g.getGoodsPrice());
|
||||
og.setComments(g.getComments());
|
||||
og.setGear(g.getGear());
|
||||
og.setGoodsId(g.getGoodsId());
|
||||
og.setTemporary(param.getIsTemporary());
|
||||
og.setUserId(finalUserId);
|
||||
// og.setDeliveryTime(order.getDeliveryTime());
|
||||
orderGoods.add(og);
|
||||
}
|
||||
});
|
||||
orderGoodsService.saveBatch(orderGoods);
|
||||
}
|
||||
});
|
||||
// 4.清空购物车
|
||||
removeCart();
|
||||
return success("创建成功",orderIds);
|
||||
}
|
||||
|
||||
@ApiOperation("清空购物车")
|
||||
@GetMapping("/clearCart")
|
||||
public ApiResult<?> clearCart() {
|
||||
removeCart();
|
||||
return success("清空成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空购物车
|
||||
*/
|
||||
private void removeCart() {
|
||||
String key = "cache" + getTenantId() + ":cart" + getLoginUserId() + ":";
|
||||
final Set<String> keys = stringRedisTemplate.keys(key + "*");
|
||||
System.out.println("清空购物车keys = " + keys);
|
||||
assert keys != null;
|
||||
stringRedisTemplate.delete(keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取购物车数据(按预定日期)
|
||||
*/
|
||||
private List<BcCart> getCart(String key) {
|
||||
// 获取购物车数据
|
||||
List<Object> values = stringRedisTemplate.opsForHash().values(key);
|
||||
return values.stream().map(item -> JSONUtil.parseObject(JSONUtil.toJSONString(item), BcCart.class)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询全部购物车数据
|
||||
*/
|
||||
private ArrayList<CartResult> getCartAll() {
|
||||
String key = "cache" + getTenantId() + ":cart" + getLoginUserId();
|
||||
Set<String> keys = stringRedisTemplate.keys(key + "*");
|
||||
// System.out.println("keys = " + keys);
|
||||
assert keys != null;
|
||||
final ArrayList<CartResult> list = new ArrayList<>();
|
||||
keys.forEach(d -> {
|
||||
final List<Object> values = stringRedisTemplate.opsForHash().values(d);
|
||||
final CartResult cartResult = new CartResult();
|
||||
final ArrayList<BcCart> dataList = new ArrayList<>();
|
||||
|
||||
values.forEach(item -> {
|
||||
BcCart bcCart = JSONUtil.parseObject(item.toString(), BcCart.class);
|
||||
assert bcCart != null;
|
||||
// System.out.println("cartResult = " + cartResult.getTotalPrice());
|
||||
if (cartResult.getTotalNum() == null) {
|
||||
cartResult.setTotalNum(0);
|
||||
}
|
||||
if (cartResult.getTotalPrice() == null) {
|
||||
cartResult.setTotalPrice(new BigDecimal(0));
|
||||
}
|
||||
cartResult.setTotalNum(cartResult.getTotalNum() + bcCart.getTotalNum());
|
||||
cartResult.setDeliveryTime(bcCart.getDeliveryTime());
|
||||
cartResult.setTotalPrice(cartResult.getTotalPrice().add(bcCart.getGoodsPrice().multiply(BigDecimal.valueOf(bcCart.getTotalNum()))));
|
||||
dataList.add(bcCart);
|
||||
});
|
||||
cartResult.setItems(dataList);
|
||||
list.add(cartResult);
|
||||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.BcCookbookService;
|
||||
import com.gxwebsoft.apps.entity.BcCookbook;
|
||||
import com.gxwebsoft.apps.param.BcCookbookParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 常用菜谱控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-05-05 14:56:54
|
||||
*/
|
||||
@Api(tags = "常用菜谱管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/bc-cookbook")
|
||||
public class BcCookbookController extends BaseController {
|
||||
@Resource
|
||||
private BcCookbookService bcCookbookService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcCookbook:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询常用菜谱")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BcCookbook>> page(BcCookbookParam param) {
|
||||
PageParam<BcCookbook, BcCookbookParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(bcCookbookService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(bcCookbookService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcCookbook:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部常用菜谱")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BcCookbook>> list(BcCookbookParam param) {
|
||||
PageParam<BcCookbook, BcCookbookParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(bcCookbookService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(bcCookbookService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcCookbook:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询常用菜谱")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BcCookbook> get(@PathVariable("id") Integer id) {
|
||||
return success(bcCookbookService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(bcCookbookService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcCookbook:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加常用菜谱")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BcCookbook bcCookbook) {
|
||||
// 记录当前登录用户id、租户id、商户编号
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
bcCookbook.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (bcCookbookService.save(bcCookbook)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcCookbook:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改常用菜谱")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BcCookbook bcCookbook) {
|
||||
if (bcCookbookService.updateById(bcCookbook)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcCookbook:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除常用菜谱")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bcCookbookService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcCookbook:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加常用菜谱")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BcCookbook> list) {
|
||||
if (bcCookbookService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcCookbook:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改常用菜谱")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BcCookbook> batchParam) {
|
||||
if (batchParam.update(bcCookbookService, "cookbook_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcCookbook:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除常用菜谱")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bcCookbookService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.apps.utils.BcUtil;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.BcEquipmentService;
|
||||
import com.gxwebsoft.apps.entity.BcEquipment;
|
||||
import com.gxwebsoft.apps.param.BcEquipmentParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报餐设备管理控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-05-02 10:34:40
|
||||
*/
|
||||
@Api(tags = "报餐设备管理管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/bc-equipment")
|
||||
public class BcEquipmentController extends BaseController {
|
||||
@Resource
|
||||
private BcEquipmentService bcEquipmentService;
|
||||
@Resource
|
||||
private BcUtil bcUtil;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcEquipment:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询报餐设备管理")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BcEquipment>> page(BcEquipmentParam param) {
|
||||
PageParam<BcEquipment, BcEquipmentParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(bcEquipmentService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(bcEquipmentService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcEquipment:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部报餐设备管理")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BcEquipment>> list(BcEquipmentParam param) {
|
||||
PageParam<BcEquipment, BcEquipmentParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(bcEquipmentService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(bcEquipmentService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcEquipment:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询报餐设备管理")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BcEquipment> get(@PathVariable("id") Integer id) {
|
||||
return success(bcEquipmentService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(bcEquipmentService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcEquipment:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加报餐设备管理")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BcEquipment bcEquipment) {
|
||||
// 记录当前登录用户id、租户id、商户编号
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
bcEquipment.setUserId(loginUser.getUserId());
|
||||
bcEquipment.setMerchantCode(getMerchantCode());
|
||||
}
|
||||
if (bcEquipmentService.save(bcEquipment)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcEquipment:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改报餐设备管理")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BcEquipment bcEquipment) {
|
||||
if (bcEquipmentService.updateById(bcEquipment)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcEquipment:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除报餐设备管理")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bcEquipmentService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcEquipment:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加报餐设备管理")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BcEquipment> list) {
|
||||
if (bcEquipmentService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcEquipment:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改报餐设备管理")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BcEquipment> batchParam) {
|
||||
if (batchParam.update(bcEquipmentService, "bc_equipment_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcEquipment:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除报餐设备管理")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bcEquipmentService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcEquipment:list')")
|
||||
@ApiOperation("发送企业微信推送消息")
|
||||
@PostMapping("/addSend")
|
||||
public ApiResult<?> addSend(@RequestBody BcEquipment bcEquipment) {
|
||||
bcUtil.send(bcEquipment.getComments());
|
||||
return success("发送成功");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,323 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.apps.entity.BcExport;
|
||||
import com.gxwebsoft.apps.param.BcExportParam;
|
||||
import com.gxwebsoft.apps.service.BcExportService;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.*;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.param.UserParam;
|
||||
import com.gxwebsoft.common.system.service.UserService;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.entity.OrderGoods;
|
||||
import com.gxwebsoft.shop.service.OrderGoodsService;
|
||||
import com.gxwebsoft.shop.service.OrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.gxwebsoft.common.core.constants.OrderConstants.DELIVERY_STATUS_YES;
|
||||
import static com.gxwebsoft.common.core.constants.OrderConstants.PAY_STATUS_SUCCESS;
|
||||
|
||||
/**
|
||||
* 报餐统计导出控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-06-01 21:47:02
|
||||
*/
|
||||
@Api(tags = "报餐统计导出管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/bc-export")
|
||||
public class BcExportController extends BaseController {
|
||||
@Resource
|
||||
private BcExportService bcExportService;
|
||||
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
|
||||
@Resource
|
||||
private OrderGoodsService orderGoodsService;
|
||||
|
||||
@Resource
|
||||
private UserService userService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcExport:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询报餐统计导出")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BcExport>> page(BcExportParam param) {
|
||||
PageParam<BcExport, BcExportParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(bcExportService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(bcExportService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcExport:list')")
|
||||
@ApiOperation("查询全部报餐统计导出")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BcExport>> list(BcExportParam param) {
|
||||
LinkedList<BcExport> resutl = new LinkedList<>();
|
||||
PageParam<BcExport, BcExportParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
// 查询所有员工信息
|
||||
final UserParam param1 = new UserParam();
|
||||
param1.setOrganizationId(param.getOrganizationId());
|
||||
final List<User> users = userService.listRel(param1);
|
||||
if(CollectionUtils.isEmpty(users)){
|
||||
return success(resutl);
|
||||
}
|
||||
final Set<Integer> userIds = users.stream().map(User::getUserId).collect(Collectors.toSet());
|
||||
|
||||
// 获取所有订单
|
||||
final LambdaQueryWrapper<Order> wrapper = new LambdaQueryWrapper<Order>()
|
||||
.eq(Order::getPayStatus,PAY_STATUS_SUCCESS)
|
||||
.in(Order::getUserId,userIds);
|
||||
|
||||
if(param.getDeliveryTimeStart() == null){
|
||||
System.out.println("默认查询当天 = ");
|
||||
// 今天开始时间 2023-05-01 00:00:00
|
||||
DateTime parse = DateUtil.parse(DateUtil.today());
|
||||
wrapper.eq(Order::getDeliveryTime, parse);
|
||||
}
|
||||
if(StringUtils.hasText(param.getDeliveryTime())){
|
||||
wrapper.eq(Order::getDeliveryTime, param.getDeliveryTime());
|
||||
}
|
||||
if(StringUtils.hasText(param.getDeliveryTimeStart())){
|
||||
wrapper.ge(Order::getDeliveryTime, param.getDeliveryTimeStart());
|
||||
}
|
||||
if(StringUtils.hasText(param.getDeliveryTimeEnd())){
|
||||
wrapper.le(Order::getDeliveryTime, param.getDeliveryTimeEnd());
|
||||
}
|
||||
|
||||
final List<Order> list = orderService.list(wrapper);
|
||||
if(CollectionUtils.isEmpty(list)){
|
||||
return success(resutl);
|
||||
}
|
||||
// 获取所有订单商品
|
||||
final Set<Integer> orderIds = list.stream().map(Order::getOrderId).collect(Collectors.toSet());
|
||||
final List<OrderGoods> orderGoods = orderGoodsService.list(new LambdaQueryWrapper<OrderGoods>().in(OrderGoods::getOrderId, orderIds));
|
||||
|
||||
// 按订单分组
|
||||
final Map<Integer, List<OrderGoods>> orderGoodsCollect = orderGoods.stream().collect(Collectors.groupingBy(OrderGoods::getOrderId));
|
||||
// 按员工分组
|
||||
final Map<Integer, List<Order>> userCollect = list.stream().collect(Collectors.groupingBy(Order::getUserId));
|
||||
// 计算订餐和签到次数
|
||||
int btotalCount = 0;
|
||||
int btotalSingCount = 0;
|
||||
int ltotalCount = 0;
|
||||
int ltotalSingCount = 0;
|
||||
int dtotalCount = 0;
|
||||
int dtotalSingCount = 0;
|
||||
BigDecimal maxTotalPrice = BigDecimal.ZERO;
|
||||
int maxGear10 = 0;
|
||||
int maxGear20 = 0;
|
||||
int maxSignGear10 = 0;
|
||||
int maxSignGear20 = 0;
|
||||
for (Integer userId : userCollect.keySet()) {
|
||||
final List<Order> userList = userCollect.get(userId); // 员工订单
|
||||
final User user = users.stream().filter(u -> u.getUserId().equals(userId)).findFirst().get();
|
||||
BcExport bcExport = new BcExport();
|
||||
int bCount = 0;
|
||||
int bSingCount = 0;
|
||||
int lCount = 0;
|
||||
int lSingCount = 0;
|
||||
int dCount = 0;
|
||||
int dSingCount = 0;
|
||||
int gear10 = 0;
|
||||
int gear20 = 0;
|
||||
int signGear10 = 0;
|
||||
int signGear20 = 0;
|
||||
BigDecimal totalPrice = BigDecimal.ZERO;
|
||||
for (Order order : userList) {
|
||||
// 获取商品
|
||||
totalPrice = totalPrice.add(order.getTotalPrice());
|
||||
final List<OrderGoods> goodsList = orderGoodsCollect.get(order.getOrderId());
|
||||
if(!CollectionUtils.isEmpty(goodsList)){
|
||||
for (OrderGoods goods : goodsList) {
|
||||
// 查询早餐
|
||||
// 查询午餐
|
||||
// 查询晚餐
|
||||
if(goods.getCategoryId().equals(25)){
|
||||
bCount++;
|
||||
if(goods.getDeliveryStatus().equals(DELIVERY_STATUS_YES)){
|
||||
bSingCount++;
|
||||
}
|
||||
}
|
||||
if(goods.getCategoryId().equals(26)){
|
||||
lCount++;
|
||||
// 统计档口
|
||||
if(goods.getGear().equals(10)){
|
||||
gear10++;
|
||||
}
|
||||
if (goods.getGear().equals(20)) {
|
||||
gear20++;
|
||||
}
|
||||
if(goods.getDeliveryStatus().equals(DELIVERY_STATUS_YES)){
|
||||
lSingCount++;
|
||||
// 统计档口
|
||||
if(goods.getGear().equals(10)){
|
||||
signGear10++;
|
||||
}
|
||||
if (goods.getGear().equals(20)) {
|
||||
signGear20++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(goods.getCategoryId().equals(27)){
|
||||
dCount++;
|
||||
if(goods.getDeliveryStatus().equals(DELIVERY_STATUS_YES)){
|
||||
dSingCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
btotalCount += bCount;
|
||||
btotalSingCount += bSingCount;
|
||||
ltotalCount += lCount;
|
||||
ltotalSingCount += lSingCount;
|
||||
dtotalCount += dCount;
|
||||
dtotalSingCount += dSingCount;
|
||||
maxTotalPrice = maxTotalPrice.add(totalPrice);
|
||||
maxGear10 += gear10;
|
||||
maxGear20 += gear20;
|
||||
maxSignGear10 += signGear10;
|
||||
maxSignGear20 += signGear20;
|
||||
|
||||
bcExport.setBreakfastPost(bCount);
|
||||
bcExport.setBreakfastSign(bSingCount);
|
||||
bcExport.setLunchPost(lCount);
|
||||
bcExport.setLunchSign(lSingCount);
|
||||
bcExport.setDinnerPost(dCount);
|
||||
bcExport.setDinnerSign(dSingCount);
|
||||
bcExport.setExpendMoney(totalPrice);
|
||||
bcExport.setGear10(gear10);
|
||||
bcExport.setGear20(gear20);
|
||||
bcExport.setSignGear10(signGear10);
|
||||
bcExport.setSignGear20(signGear20);
|
||||
bcExport.setUserId(userId);
|
||||
bcExport.setOrganizationName(user.getOrganizationName());
|
||||
bcExport.setNickname(user.getNickname());
|
||||
bcExport.setLunchPostText(lCount+"");
|
||||
bcExport.setLunchSignText(lSingCount+"");
|
||||
|
||||
resutl.add(bcExport);
|
||||
|
||||
}
|
||||
BcExport totalBcExport = new BcExport();
|
||||
totalBcExport.setNickname("合计");
|
||||
totalBcExport.setBreakfastPost(btotalCount);
|
||||
totalBcExport.setBreakfastSign(btotalSingCount);
|
||||
totalBcExport.setLunchPost(ltotalCount);
|
||||
totalBcExport.setLunchSign(ltotalSingCount);
|
||||
totalBcExport.setDinnerPost(dtotalCount);
|
||||
totalBcExport.setDinnerSign(dtotalSingCount);
|
||||
totalBcExport.setExpendMoney(maxTotalPrice);
|
||||
totalBcExport.setGear10(maxGear10);
|
||||
totalBcExport.setGear20(maxGear20);
|
||||
totalBcExport.setSignGear10(maxSignGear10);
|
||||
totalBcExport.setSignGear20(maxSignGear20);
|
||||
totalBcExport.setLunchPostText(ltotalCount + "(" + maxGear10 + "/" + maxGear20 + ")");
|
||||
totalBcExport.setLunchSignText(ltotalSingCount + "(" + maxSignGear10 + "/" + maxSignGear20 + ")");
|
||||
totalBcExport.setOrganizationName("");
|
||||
resutl.addFirst(totalBcExport);
|
||||
return success(resutl);
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcExport:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询报餐统计导出")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BcExport> get(@PathVariable("id") Integer id) {
|
||||
return success(bcExportService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(bcExportService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcExport:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加报餐统计导出")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BcExport bcExport) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
bcExport.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (bcExportService.save(bcExport)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcExport:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改报餐统计导出")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BcExport bcExport) {
|
||||
if (bcExportService.updateById(bcExport)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcExport:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除报餐统计导出")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bcExportService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcExport:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加报餐统计导出")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BcExport> list) {
|
||||
if (bcExportService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcExport:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改报餐统计导出")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BcExport> batchParam) {
|
||||
if (batchParam.update(bcExportService, "export_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcExport:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除报餐统计导出")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bcExportService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.apps.entity.BcFood;
|
||||
import com.gxwebsoft.apps.entity.BcPlan;
|
||||
import com.gxwebsoft.apps.param.BcFoodParam;
|
||||
import com.gxwebsoft.apps.param.BcPlanParam;
|
||||
import com.gxwebsoft.apps.service.BcFoodService;
|
||||
import com.gxwebsoft.apps.service.BcPlanService;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.shop.entity.Goods;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.entity.OrderGoods;
|
||||
import com.gxwebsoft.shop.entity.UserReferee;
|
||||
import com.gxwebsoft.shop.param.OrderGoodsParam;
|
||||
import com.gxwebsoft.shop.param.OrderParam;
|
||||
import com.gxwebsoft.shop.param.UserRefereeParam;
|
||||
import com.gxwebsoft.shop.service.GoodsService;
|
||||
import com.gxwebsoft.shop.service.OrderGoodsService;
|
||||
import com.gxwebsoft.shop.service.OrderService;
|
||||
import com.gxwebsoft.shop.service.UserRefereeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import static com.gxwebsoft.common.core.constants.OrderConstants.ORDER_STATUS_DOING;
|
||||
import static com.gxwebsoft.common.core.constants.OrderConstants.PAY_STATUS_SUCCESS;
|
||||
|
||||
/**
|
||||
* 发布菜品明细控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-27 17:59:40
|
||||
*/
|
||||
@Api(tags = "发布菜品明细管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/bc-food")
|
||||
public class BcFoodController extends BaseController {
|
||||
@Resource
|
||||
private BcFoodService bcFoodService;
|
||||
@Resource
|
||||
private BcPlanService bcPlanService;
|
||||
@Resource
|
||||
private GoodsService goodsService;
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
@Resource
|
||||
private OrderGoodsService orderGoodsService;
|
||||
@Resource
|
||||
private UserRefereeService userRefereeService;
|
||||
|
||||
@ApiOperation("查询菜品列表")
|
||||
@GetMapping("/getFoodList")
|
||||
public ApiResult<?> getFoodList(BcPlanParam param) {
|
||||
// 验证签名
|
||||
isCheckSign();
|
||||
BcPlan plan = param.getOne(bcPlanService.listRel(param));
|
||||
if(plan == null){
|
||||
return fail("当日未发布菜品");
|
||||
}
|
||||
// System.out.println("查询菜品列表param = " + param);
|
||||
// System.out.println("plan = " + plan);
|
||||
// json转数组 如:[0,1]转为ArrayList
|
||||
List<Integer> goodsIds = new ArrayList<>();
|
||||
goodsIds = JSONUtil.parseObject(plan.getGoodsIds(), ArrayList.class);
|
||||
final List<Goods> list = goodsService.listByIds(goodsIds);
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("week",plan.getWeek());
|
||||
map.put("list",list);
|
||||
return success(map);
|
||||
}
|
||||
|
||||
@ApiOperation("查询一周菜谱")
|
||||
@GetMapping("/getWeekFood")
|
||||
public ApiResult<?> getWeekFood() {
|
||||
// 验证签名
|
||||
isCheckSign();
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
// 今天日期
|
||||
final DateTime today = DateUtil.parse(DateUtil.today());
|
||||
// 本周一周开始的日期
|
||||
final DateTime dateTime = DateUtil.beginOfWeek(today);
|
||||
// 查询本周菜谱
|
||||
final List<BcPlan> list = bcPlanService.list(new LambdaQueryWrapper<BcPlan>().ge(BcPlan::getDayTime, dateTime).last("limit 0,7"));
|
||||
try {
|
||||
list.forEach(d -> {
|
||||
// json转数组 如:[0,1]转为ArrayList
|
||||
d.setGoodsList(goodsService.listByIds(JSONUtil.parseObject(d.getGoodsIds(), ArrayList.class)));
|
||||
});
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("查询代取餐人员的报餐信息")
|
||||
@GetMapping("/getOthersFood")
|
||||
public ApiResult<?> getOthersFood() {
|
||||
// 验证签名
|
||||
isCheckSign();
|
||||
|
||||
UserRefereeParam param = new UserRefereeParam();
|
||||
param.setDealerId(getLoginUserId());
|
||||
List<UserReferee> list = userRefereeService.listRel(param);
|
||||
// 附加自己
|
||||
final UserReferee userReferee = new UserReferee();
|
||||
userReferee.setUserId(getLoginUserId());
|
||||
userReferee.setNickname(getLoginUser().getNickname());
|
||||
list.add(userReferee);
|
||||
list.forEach(d -> {
|
||||
// 查询他的订单信息
|
||||
OrderParam orderParam = new OrderParam();
|
||||
orderParam.setUserId(d.getUserId());
|
||||
orderParam.setDeliveryTime(DateUtil.beginOfDay(DateUtil.date()).toString());
|
||||
orderParam.setOrderStatus(ORDER_STATUS_DOING);
|
||||
orderParam.setPayStatus(PAY_STATUS_SUCCESS);
|
||||
List<Order> orders = orderService.listRel(orderParam);
|
||||
orders.forEach(o -> {
|
||||
// 查询菜品信息
|
||||
List<OrderGoods> orderGoods = orderGoodsService.list(new LambdaQueryWrapper<OrderGoods>()
|
||||
.eq(OrderGoods::getOrderId,o.getOrderId())
|
||||
.gt(OrderGoods::getTotalNum,0));
|
||||
o.setGoodsList(orderGoods);
|
||||
});
|
||||
d.setOrder(orders);
|
||||
});
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("取消代餐")
|
||||
@GetMapping("/cancel")
|
||||
public ApiResult<?> cancel() {
|
||||
UserRefereeParam param = new UserRefereeParam();
|
||||
param.setDealerId(getLoginUserId());
|
||||
List<UserReferee> list = userRefereeService.listRel(param);
|
||||
list.forEach(d -> {
|
||||
// 查询他的订单信息
|
||||
OrderParam orderParam = new OrderParam();
|
||||
orderParam.setUserId(d.getUserId());
|
||||
orderParam.setDeliveryTime(DateUtil.beginOfDay(DateUtil.date()).toString());
|
||||
orderParam.setPayStatus(PAY_STATUS_SUCCESS);
|
||||
List<Order> orders = orderService.listRel(orderParam);
|
||||
orders.forEach(o -> {
|
||||
// 查询菜品信息
|
||||
OrderGoodsParam goodsParam = new OrderGoodsParam();
|
||||
goodsParam.setOrderId(o.getOrderId());
|
||||
List<OrderGoods> orderGoods = orderGoodsService.listRel(goodsParam);
|
||||
o.setGoodsList(orderGoods);
|
||||
});
|
||||
d.setOrder(orders);
|
||||
});
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@ApiOperation("查询临时报餐信息")
|
||||
@GetMapping("/getTemporaryOrder")
|
||||
public ApiResult<?> getTemporaryOrder(OrderParam param) {
|
||||
// 验证签名
|
||||
isCheckSign();
|
||||
LambdaQueryWrapper<Order> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper
|
||||
.eq(Order::getUserId,getLoginUserId())
|
||||
.eq(Order::getPayStatus,PAY_STATUS_SUCCESS)
|
||||
.eq(Order::getOrderStatus,ORDER_STATUS_DOING)
|
||||
.eq(Order::getDeleted,0)
|
||||
.eq(Order::getIsTemporary,1)
|
||||
.eq(Order::getDeliveryTime,param.getDeliveryTime());
|
||||
Order order = orderService.getOne(lambdaQueryWrapper,false);
|
||||
if(order != null){
|
||||
final List<OrderGoods> goods = orderGoodsService.list(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderId, order.getOrderId()));
|
||||
order.setGoodsList(goods);
|
||||
return success("查询成功",order);
|
||||
}
|
||||
return fail("没有临时报餐数据",null);
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcFood:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询发布菜品明细")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BcFood>> page(BcFoodParam param) {
|
||||
// 使用关联查询
|
||||
return success(bcFoodService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcFood:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部发布菜品明细")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BcFood>> list(BcFoodParam param) {
|
||||
// 使用关联查询
|
||||
return success(bcFoodService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcFood:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询发布菜品明细")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BcFood> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bcFoodService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcFood:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加发布菜品明细")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BcFood bcFood) {
|
||||
// 记录当前登录用户id、租户id、商户编号
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
bcFood.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (bcFoodService.save(bcFood)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcFood:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改发布菜品明细")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BcFood bcFood) {
|
||||
if (bcFoodService.updateById(bcFood)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcFood:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除发布菜品明细")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bcFoodService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcFood:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加发布菜品明细")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BcFood> list) {
|
||||
if (bcFoodService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcFood:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改发布菜品明细")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BcFood> batchParam) {
|
||||
if (batchParam.update(bcFoodService, "bc_food_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcFood:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除发布菜品明细")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bcFoodService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.gxwebsoft.apps.entity.BcPlan;
|
||||
import com.gxwebsoft.apps.param.BcPlanParam;
|
||||
import com.gxwebsoft.apps.service.BcPlanService;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜品发布管理控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-27 17:59:40
|
||||
*/
|
||||
@Api(tags = "菜品发布管理管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/bc-plan")
|
||||
public class BcPlanController extends BaseController {
|
||||
@Resource
|
||||
private BcPlanService bcPlanService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcPlan:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询菜品发布管理")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BcPlan>> page(BcPlanParam param) {
|
||||
// 使用关联查询
|
||||
return success(bcPlanService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcPlan:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部菜品发布管理")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BcPlan>> list(BcPlanParam param) {
|
||||
// 使用关联查询
|
||||
return success(bcPlanService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcPlan:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询菜品发布管理")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BcPlan> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bcPlanService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcPlan:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加菜品发布管理")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BcPlan bcPlan) {
|
||||
// 记录当前登录用户id、租户id、商户编号
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
bcPlan.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if(bcPlanService.count(new LambdaQueryWrapper<BcPlan>().eq(BcPlan::getDayTime, bcPlan.getDayTime())) > 0){
|
||||
return fail("当天已发布过菜品");
|
||||
}
|
||||
bcPlan.setWeek(DateUtil.dayOfWeek(bcPlan.getDayTime()) - 1);
|
||||
if (bcPlanService.save(bcPlan)) {
|
||||
return success("发布成功");
|
||||
}
|
||||
return fail("发布失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcPlan:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改菜品发布管理")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BcPlan bcPlan) {
|
||||
System.out.println("bcPlan = " + bcPlan);
|
||||
final Date dayTime = bcPlan.getDayTime();
|
||||
System.out.println("dayTime = " + dayTime);
|
||||
final int week = DateUtil.dayOfWeek(dayTime);
|
||||
bcPlan.setWeek(week - 1);
|
||||
if (bcPlanService.updateById(bcPlan)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcPlan:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除菜品发布管理")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bcPlanService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcPlan:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加菜品发布管理")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BcPlan> list) {
|
||||
if (bcPlanService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcPlan:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改菜品发布管理")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BcPlan> batchParam) {
|
||||
if (batchParam.update(bcPlanService, "bc_plan_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcPlan:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除菜品发布管理")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bcPlanService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,342 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.apps.entity.BcPlan;
|
||||
import com.gxwebsoft.apps.param.BcPlanParam;
|
||||
import com.gxwebsoft.apps.service.BcPlanService;
|
||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.service.OrganizationService;
|
||||
import com.gxwebsoft.common.system.service.UserService;
|
||||
import com.gxwebsoft.shop.entity.Goods;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.entity.OrderGoods;
|
||||
import com.gxwebsoft.shop.param.OrderGoodsParam;
|
||||
import com.gxwebsoft.shop.service.GoodsService;
|
||||
import com.gxwebsoft.shop.service.OrderGoodsService;
|
||||
import com.gxwebsoft.shop.service.OrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.gxwebsoft.common.core.constants.OrderConstants.*;
|
||||
|
||||
/**
|
||||
* 报餐统计控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-27 17:59:40
|
||||
*/
|
||||
@Api(tags = "报餐统计管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/bc-statistics")
|
||||
public class BcStatisticsController extends BaseController {
|
||||
@Resource
|
||||
private GoodsService goodsService;
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
@Resource
|
||||
private OrderGoodsService orderGoodsService;
|
||||
@Resource
|
||||
private BcPlanService bcPlanService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private OrganizationService organizationService;
|
||||
|
||||
|
||||
@ApiOperation("预定菜品统计")
|
||||
@GetMapping("/baoCanFoodCount")
|
||||
public ApiResult<?> baoCanFoodCount(BcPlanParam param) {
|
||||
// 验证签名
|
||||
isCheckSign();
|
||||
|
||||
BcPlan plan = param.getOne(bcPlanService.listRel(param));
|
||||
System.out.println("1查询菜品列表param = " + plan);
|
||||
if (plan == null) {
|
||||
return fail("当日未发布菜品");
|
||||
}
|
||||
// json转数组 如:[0,1]转为ArrayList
|
||||
ArrayList goodsIds = JSONUtil.parseObject(plan.getGoodsIds(), ArrayList.class);
|
||||
final List<Goods> list = goodsService.listByIds(goodsIds);
|
||||
final ArrayList<Goods> goods = new ArrayList<>();
|
||||
|
||||
// 查询今日有效订单
|
||||
final List<Order> orders = orderService.list(new LambdaQueryWrapper<Order>()
|
||||
.eq(Order::getDeliveryTime, param.getDayTime())
|
||||
.eq(Order::getPayStatus, PAY_STATUS_SUCCESS)
|
||||
.ne(Order::getOrderStatus, ORDER_STATUS_CANCEL)
|
||||
);
|
||||
final List<Integer> orderIds = orders.stream().map(Order::getOrderId).collect(Collectors.toList());
|
||||
|
||||
// 整理餐段菜品数据
|
||||
list.forEach(d -> {
|
||||
if (d.getCategoryId().equals(param.getCategoryId())) {
|
||||
final int DeliveryTimes = orderGoodsService.count(new LambdaQueryWrapper<OrderGoods>()
|
||||
.in(OrderGoods::getOrderId, orderIds)
|
||||
.eq(OrderGoods::getCategoryId, param.getCategoryId())
|
||||
.eq(OrderGoods::getGoodsId, d.getGoodsId())
|
||||
.gt(OrderGoods::getTotalNum, 0)
|
||||
);
|
||||
final int NoDeliveryTimes = orderGoodsService.count(new LambdaQueryWrapper<OrderGoods>()
|
||||
.in(OrderGoods::getOrderId, orderIds)
|
||||
.eq(OrderGoods::getCategoryId, param.getCategoryId())
|
||||
.eq(OrderGoods::getGoodsId, d.getGoodsId())
|
||||
.gt(OrderGoods::getTotalNum, 0)
|
||||
.eq(OrderGoods::getDeliveryStatus, 10)
|
||||
);
|
||||
|
||||
d.setDeliveryTimes(DeliveryTimes);
|
||||
d.setNoDeliveryTimes(NoDeliveryTimes);
|
||||
goods.add(d);
|
||||
}
|
||||
});
|
||||
return success("查询成功", goods);
|
||||
}
|
||||
|
||||
@ApiOperation("预定人员统计")
|
||||
@GetMapping("/baoCanUserCount")
|
||||
public ApiResult<?> baoCanUserCount(BcPlanParam param) {
|
||||
// 验证签名
|
||||
isCheckSign();
|
||||
// 查询今日有效订单
|
||||
final List<Order> list = orderService.list(new LambdaQueryWrapper<Order>()
|
||||
.eq(Order::getDeliveryTime, param.getDayTime())
|
||||
.eq(Order::getPayStatus, PAY_STATUS_SUCCESS)
|
||||
.ne(Order::getOrderStatus, ORDER_STATUS_CANCEL)
|
||||
);
|
||||
final List<Integer> orderIds = list.stream().map(Order::getOrderId).collect(Collectors.toList());
|
||||
// System.out.println("list.size() = " + list.size());
|
||||
final List<OrderGoods> list25 = orderGoodsService.list(new LambdaQueryWrapper<OrderGoods>()
|
||||
.in(OrderGoods::getOrderId, orderIds)
|
||||
.eq(OrderGoods::getCategoryId, param.getCategoryId())
|
||||
.gt(OrderGoods::getTotalNum, 0)
|
||||
.eq(OrderGoods::getDeleted, 0)
|
||||
);
|
||||
final List<Integer> userIds25 = list25.stream().map(OrderGoods::getUserId).collect(Collectors.toList());
|
||||
final List<User> users25 = userService.listByIds(userIds25);
|
||||
return success("查询成功", users25);
|
||||
}
|
||||
|
||||
@ApiOperation("报餐统计")
|
||||
@GetMapping("/baoCanUsers")
|
||||
public ApiResult<?> baoCanUsers(OrderGoodsParam param) {
|
||||
// 验证签名
|
||||
isCheckSign();
|
||||
System.out.println("param = " + param);
|
||||
// 修复订单商品的支付状态
|
||||
// repairPayPriceStatus();
|
||||
|
||||
final HashMap<Object, Object> map = new HashMap<>();
|
||||
|
||||
LambdaQueryWrapper<Order> wrapper = new LambdaQueryWrapper<>();
|
||||
// 默认查询条件
|
||||
wrapper.ge(Order::getPayStatus,PAY_STATUS_SUCCESS)
|
||||
.ne(Order::getOrderStatus, ORDER_STATUS_CANCEL);
|
||||
|
||||
// 按部门查询
|
||||
if(param.getOrganizationId() != null){
|
||||
System.out.println("按部门查询 = ");
|
||||
final List<User> users = userService.list(new LambdaQueryWrapper<User>().eq(User::getOrganizationId,param.getOrganizationId()));
|
||||
final List<Integer> collect = users.stream().map(User::getUserId).collect(Collectors.toList());
|
||||
System.out.println("userIds = " + collect);
|
||||
wrapper.in(Order::getUserId,collect);
|
||||
}
|
||||
|
||||
// 是否选择日期
|
||||
if(param.getDeliveryTime() == null && param.getDeliveryTimeStart() == null && param.getCategoryId() != 0){
|
||||
return success("请选择预定日期",map);
|
||||
}
|
||||
// 按时间范围查询
|
||||
if(param.getDeliveryTimeStart() != null){
|
||||
// 最大只能选择一个月
|
||||
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
try {
|
||||
Date date1 = df.parse(param.getDeliveryTimeStart());
|
||||
Date date2 = df.parse(param.getDeliveryTimeEnd());
|
||||
final boolean after = date1.after(date2);
|
||||
final long between = DateUtil.between(date1, date2, DateUnit.DAY);
|
||||
if(between > 30L){
|
||||
return fail("超出日期查询范围");
|
||||
}
|
||||
System.out.println("between = " + between);
|
||||
System.out.println("after = " + after);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
wrapper.ge(Order::getDeliveryTime,param.getDeliveryTimeStart());
|
||||
wrapper.le(Order::getDeliveryTime,param.getDeliveryTimeEnd());
|
||||
}
|
||||
// 按预定日期查询
|
||||
if(param.getDeliveryTime() != null){
|
||||
wrapper.eq(Order::getDeliveryTime,param.getDeliveryTime());
|
||||
}
|
||||
|
||||
final List<Order> list = orderService.list(wrapper);
|
||||
|
||||
if(list.size() == 0){
|
||||
return success("查询成功",null);
|
||||
}
|
||||
|
||||
System.out.println("报餐统计 = " + list.size());
|
||||
final List<Integer> orderIds = list.stream().map(Order::getOrderId).collect(Collectors.toList());
|
||||
System.out.println("orderIds = " + orderIds.size());
|
||||
|
||||
LambdaQueryWrapper<OrderGoods> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(OrderGoods::getDeleted,0)
|
||||
.gt(OrderGoods::getTotalNum,0)
|
||||
.in(OrderGoods::getOrderId,orderIds);
|
||||
|
||||
if(param.getCategoryId() != null){
|
||||
queryWrapper.eq(OrderGoods::getCategoryId,param.getCategoryId());
|
||||
}
|
||||
if(param.getGear() != null){
|
||||
queryWrapper.eq(OrderGoods::getGear,param.getGear());
|
||||
}
|
||||
// 已报餐
|
||||
final int post = orderGoodsService.count(queryWrapper);
|
||||
|
||||
// 已签到
|
||||
queryWrapper.eq(OrderGoods::getDeliveryStatus,DELIVERY_STATUS_YES);
|
||||
final int sign = orderGoodsService.count(queryWrapper);
|
||||
|
||||
// 未签到
|
||||
int noSign = post - sign;
|
||||
|
||||
map.put("post",post);
|
||||
map.put("sign",sign);
|
||||
map.put("noSign", noSign);
|
||||
return success(map);
|
||||
|
||||
|
||||
//
|
||||
//// 查询今日签到记录
|
||||
// final int sign25 = orderGoodsService.count(new LambdaQueryWrapper<OrderGoods>()
|
||||
// .in(OrderGoods::getOrderId, orderIds)
|
||||
// .eq(OrderGoods::getCategoryId, 25)
|
||||
// .eq(OrderGoods::getDeliveryStatus, 20)
|
||||
// .gt(OrderGoods::getTotalNum, 0)
|
||||
// .eq(OrderGoods::getDeleted, 0)
|
||||
// );
|
||||
// final int sign26 = orderGoodsService.count(new LambdaQueryWrapper<OrderGoods>()
|
||||
// .in(OrderGoods::getOrderId, orderIds)
|
||||
// .eq(OrderGoods::getCategoryId, 26)
|
||||
// .eq(OrderGoods::getDeliveryStatus, 20)
|
||||
// .gt(OrderGoods::getTotalNum, 0)
|
||||
// .eq(OrderGoods::getDeleted, 0)
|
||||
// );
|
||||
// final int sign27 = orderGoodsService.count(new LambdaQueryWrapper<OrderGoods>()
|
||||
// .in(OrderGoods::getOrderId, orderIds)
|
||||
// .eq(OrderGoods::getCategoryId, 27)
|
||||
// .eq(OrderGoods::getDeliveryStatus, 20)
|
||||
// .gt(OrderGoods::getTotalNum, 0)
|
||||
// .eq(OrderGoods::getDeleted, 0)
|
||||
// );
|
||||
//// // 查询今日报餐人数
|
||||
// final int post25 = orderGoodsService.count(new LambdaQueryWrapper<OrderGoods>()
|
||||
// .in(OrderGoods::getOrderId, orderIds)
|
||||
// .eq(OrderGoods::getCategoryId, 25)
|
||||
// .gt(OrderGoods::getTotalNum, 0)
|
||||
// .eq(OrderGoods::getDeleted, 0)
|
||||
// );
|
||||
// final int post26 = orderGoodsService.count(new LambdaQueryWrapper<OrderGoods>()
|
||||
// .in(OrderGoods::getOrderId, orderIds)
|
||||
// .eq(OrderGoods::getCategoryId, 26)
|
||||
// .gt(OrderGoods::getTotalNum, 0)
|
||||
// .eq(OrderGoods::getDeleted, 0)
|
||||
// );
|
||||
// final int post27 = orderGoodsService.count(new LambdaQueryWrapper<OrderGoods>()
|
||||
// .in(OrderGoods::getOrderId, orderIds)
|
||||
// .eq(OrderGoods::getCategoryId, 27)
|
||||
// .gt(OrderGoods::getTotalNum, 0)
|
||||
// .eq(OrderGoods::getDeleted, 0)
|
||||
// );
|
||||
////
|
||||
// map.put("breakfastSignUsers", sign25);
|
||||
// map.put("lunchSignUsers", sign26);
|
||||
// map.put("dinnerSignUsers", sign27);
|
||||
//
|
||||
// map.put("breakfastPostUsers", post25);
|
||||
// map.put("lunchPostUsers", post26);
|
||||
// map.put("dinnerPostUsers", post27);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation("导出报表")
|
||||
@GetMapping("/export")
|
||||
public ApiResult<?> export(OrderGoodsParam param) {
|
||||
return success("导出报表");
|
||||
}
|
||||
|
||||
private void repairPayPriceStatus() {
|
||||
final OrderGoodsParam param = new OrderGoodsParam();
|
||||
param.setUserId(0);
|
||||
final List<OrderGoods> list = orderGoodsService.listRel(param);
|
||||
System.out.println("修复支付状态 = " + list.size());
|
||||
list.forEach(d -> {
|
||||
final Order order = orderService.getById(d.getOrderId());
|
||||
if (order != null) {
|
||||
System.out.println("order = " + order);
|
||||
d.setPayStatus(PAY_STATUS_SUCCESS);
|
||||
d.setUserId(order.getUserId());
|
||||
orderGoodsService.updateById(d);
|
||||
} else {
|
||||
orderGoodsService.removeById(d);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateTimeByOrderGoods() {
|
||||
System.out.println("修复数据 = ");
|
||||
// final Order order = orderService.getById(2467);
|
||||
final LambdaQueryWrapper<Order> wrapper = new LambdaQueryWrapper<>();
|
||||
// wrapper.eq(Order::getTenantId,10048);
|
||||
// wrapper.eq(Order::getDeleted,0);
|
||||
// wrapper.eq(Order::getOrderStatus,10);
|
||||
// wrapper.eq(Order::getDeliveryStatus,10);
|
||||
wrapper.in(Order::getOrderId, 3184);
|
||||
// wrapper.eq(Order::getPayStatus,20);
|
||||
// wrapper.gt(Order::getOrderId,1000);
|
||||
// wrapper.lt(Order::getOrderId,2000);
|
||||
final List<Order> list = orderService.list(wrapper);
|
||||
System.out.println("修复数据list = " + list.size());
|
||||
list.forEach(order -> {
|
||||
final OrderGoodsParam orderGoodsParam = new OrderGoodsParam();
|
||||
orderGoodsParam.setOrderId(order.getOrderId());
|
||||
final List<OrderGoods> goods = orderGoodsService.listRel(orderGoodsParam);
|
||||
goods.forEach(d -> {
|
||||
d.setDeliveryTime(order.getDeliveryTime());
|
||||
d.setPayStatus(order.getPayStatus());
|
||||
orderGoodsService.updateById(d);
|
||||
System.out.println("修复预定时间 = " + d.getOrderId());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("今日上架物品")
|
||||
@GetMapping("/getNoGrounding")
|
||||
public ApiResult<?> getNoGrounding(BcPlanParam param) {
|
||||
final List<BcPlan> list = bcPlanService.list(new LambdaQueryWrapper<BcPlan>().eq(BcPlan::getDayTime, param.getDayTime()));
|
||||
final BcPlan bcPlan = list.get(0);
|
||||
final ArrayList arrayList = JSONUtil.parseObject(bcPlan.getGoodsIds(), ArrayList.class);
|
||||
// final List<Goods> goodsList = goodsService.list(new LambdaQueryWrapper<Goods>().in(Goods::getGoodsId, arrayList));
|
||||
return success("查询成功", arrayList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.BcTemporaryService;
|
||||
import com.gxwebsoft.apps.entity.BcTemporary;
|
||||
import com.gxwebsoft.apps.param.BcTemporaryParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 临时报餐管理控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-24 21:47:57
|
||||
*/
|
||||
@Api(tags = "临时报餐管理管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/bc-temporary")
|
||||
public class BcTemporaryController extends BaseController {
|
||||
@Resource
|
||||
private BcTemporaryService bcTemporaryService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcTemporary:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询临时报餐管理")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BcTemporary>> page(BcTemporaryParam param) {
|
||||
// 使用关联查询
|
||||
return success(bcTemporaryService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcTemporary:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部临时报餐管理")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BcTemporary>> list(BcTemporaryParam param) {
|
||||
// 使用关联查询
|
||||
return success(bcTemporaryService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcTemporary:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询临时报餐管理")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BcTemporary> get(@PathVariable("id") Integer id) {
|
||||
return success(bcTemporaryService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(bcTemporaryService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcTemporary:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加临时报餐管理")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BcTemporary bcTemporary) {
|
||||
bcTemporary.setUserId(getLoginUserId());
|
||||
if (bcTemporaryService.save(bcTemporary)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcTemporary:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("申请临时报餐")
|
||||
@PostMapping("/apply")
|
||||
public ApiResult<?> apply(@RequestBody BcTemporary bcTemporary) {
|
||||
bcTemporary.setUserId(getLoginUserId());
|
||||
final int count = bcTemporaryService.count(new LambdaQueryWrapper<BcTemporary>()
|
||||
.eq(BcTemporary::getUserId, getLoginUserId())
|
||||
.eq(BcTemporary::getStatus, 0)
|
||||
.eq(BcTemporary::getDayTime,DateUtil.today()));
|
||||
if(count > 0){
|
||||
return fail("请勿重复提交");
|
||||
}
|
||||
final DateTime dayTime = DateUtil.parse(DateUtil.today());
|
||||
bcTemporary.setDayTime(dayTime);
|
||||
bcTemporary.setExpirationTime(DateUtil.offsetMinute(DateUtil.parse(DateUtil.now()), 60));
|
||||
if (bcTemporaryService.save(bcTemporary)) {
|
||||
return success("提交成功");
|
||||
}
|
||||
return fail("提交成功");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcTemporary:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改临时报餐管理")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BcTemporary bcTemporary) {
|
||||
// 失效时间为审核通过后半个小时
|
||||
bcTemporary.setExpirationTime(DateUtil.offsetMinute(DateUtil.parse(DateUtil.now()), 60));
|
||||
if (bcTemporaryService.updateById(bcTemporary)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcTemporary:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除临时报餐管理")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bcTemporaryService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcTemporary:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加临时报餐管理")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BcTemporary> list) {
|
||||
if (bcTemporaryService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcTemporary:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改临时报餐管理")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BcTemporary> batchParam) {
|
||||
if (batchParam.update(bcTemporaryService, "temporary_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:bcTemporary:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除临时报餐管理")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bcTemporaryService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.CashierService;
|
||||
import com.gxwebsoft.apps.entity.Cashier;
|
||||
import com.gxwebsoft.apps.param.CashierParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 海牛收银台记录表控制器
|
||||
*
|
||||
* @author WebSoft
|
||||
* @since 2022-11-18 11:47:09
|
||||
*/
|
||||
@Api(tags = "海牛收银台记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/cashier")
|
||||
public class CashierController extends BaseController {
|
||||
@Resource
|
||||
private CashierService cashierService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:cashier:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询海牛收银台记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Cashier>> page(CashierParam param) {
|
||||
PageParam<Cashier, CashierParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(cashierService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(cashierService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:cashier:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部海牛收银台记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Cashier>> list(CashierParam param) {
|
||||
PageParam<Cashier, CashierParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(cashierService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(cashierService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:cashier:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询海牛收银台记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Cashier> get(@PathVariable("id") Integer id) {
|
||||
return success(cashierService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(cashierService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:cashier:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加海牛收银台记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Cashier cashier) {
|
||||
if(getMerchantCode() != null){
|
||||
cashier.setMerchantCode(getMerchantCode());
|
||||
}
|
||||
if (cashierService.save(cashier)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:cashier:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改海牛收银台记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Cashier cashier) {
|
||||
if (cashierService.updateById(cashier)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:cashier:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除海牛收银台记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cashierService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:cashier:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加海牛收银台记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Cashier> list) {
|
||||
if (cashierService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:cashier:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改海牛收银台记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Cashier> batchParam) {
|
||||
if (batchParam.update(cashierService, "cashier_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:cashier:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除海牛收银台记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cashierService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.EquipmentAlarmService;
|
||||
import com.gxwebsoft.apps.entity.EquipmentAlarm;
|
||||
import com.gxwebsoft.apps.param.EquipmentAlarmParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障报警记录控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-12-01 23:49:44
|
||||
*/
|
||||
@Api(tags = "故障报警记录管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/equipment-alarm")
|
||||
public class EquipmentAlarmController extends BaseController {
|
||||
@Resource
|
||||
private EquipmentAlarmService equipmentAlarmService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentAlarm:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询故障报警记录")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<EquipmentAlarm>> page(EquipmentAlarmParam param) {
|
||||
PageParam<EquipmentAlarm, EquipmentAlarmParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
// return success(equipmentAlarmService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
return success(equipmentAlarmService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentAlarm:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部故障报警记录")
|
||||
@GetMapping()
|
||||
public ApiResult<List<EquipmentAlarm>> list(EquipmentAlarmParam param) {
|
||||
PageParam<EquipmentAlarm, EquipmentAlarmParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(equipmentAlarmService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(equipmentAlarmService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentAlarm:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询故障报警记录")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<EquipmentAlarm> get(@PathVariable("id") Integer id) {
|
||||
return success(equipmentAlarmService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(equipmentAlarmService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentAlarm:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加故障报警记录")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody EquipmentAlarm equipmentAlarm) {
|
||||
// 记录当前登录用户id、租户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
equipmentAlarm.setUserId(loginUser.getUserId());
|
||||
equipmentAlarm.setMerchantCode(getMerchantCode());
|
||||
}
|
||||
if (equipmentAlarmService.save(equipmentAlarm)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentAlarm:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改故障报警记录")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody EquipmentAlarm equipmentAlarm) {
|
||||
if (equipmentAlarmService.updateById(equipmentAlarm)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentAlarm:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除故障报警记录")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (equipmentAlarmService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentAlarm:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加故障报警记录")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<EquipmentAlarm> list) {
|
||||
if (equipmentAlarmService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentAlarm:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改故障报警记录")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<EquipmentAlarm> batchParam) {
|
||||
if (batchParam.update(equipmentAlarmService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentAlarm:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除故障报警记录")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (equipmentAlarmService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.alipay.api.DefaultAlipayClient;
|
||||
import com.alipay.api.domain.AlipayOpenAppQrcodeCreateModel;
|
||||
import com.alipay.api.request.AlipayOpenAppQrcodeCreateRequest;
|
||||
import com.alipay.api.response.AlipayOpenAppQrcodeCreateResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.apps.entity.Equipment;
|
||||
import com.gxwebsoft.apps.entity.EquipmentRecord;
|
||||
import com.gxwebsoft.apps.param.EquipmentParam;
|
||||
import com.gxwebsoft.apps.service.EquipmentRecordService;
|
||||
import com.gxwebsoft.apps.service.EquipmentService;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.core.exception.BusinessException;
|
||||
import com.gxwebsoft.common.core.utils.AlipayConfigUtil;
|
||||
import com.gxwebsoft.common.core.web.*;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.shop.entity.Merchant;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.service.MerchantService;
|
||||
import com.gxwebsoft.shop.service.OrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static com.gxwebsoft.apps.constants.EquipmentConstants.EVENT_TYPE_BIND;
|
||||
import static com.gxwebsoft.common.core.constants.OrderConstants.*;
|
||||
|
||||
/**
|
||||
* 设备管理控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-11-30 02:11:16
|
||||
*/
|
||||
@Api(tags = "设备管理管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/equipment")
|
||||
public class EquipmentController extends BaseController {
|
||||
@Resource
|
||||
private EquipmentService equipmentService;
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
@Resource
|
||||
private AlipayConfigUtil alipayConfig;
|
||||
@Resource
|
||||
private MerchantService merchantService;
|
||||
@Resource
|
||||
private EquipmentRecordService equipmentRecordService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipment:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询设备管理")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Equipment>> page(EquipmentParam param) {
|
||||
// 使用关联查询
|
||||
if (getMerchantCode() != null) {
|
||||
param.setMerchantCode(getMerchantCode());
|
||||
}
|
||||
return success(equipmentService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipment:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部设备管理")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Equipment>> list(EquipmentParam param) {
|
||||
PageParam<Equipment, EquipmentParam> page = new PageParam<>(param);
|
||||
// page.setDefaultOrder("create_time desc");
|
||||
// return success(equipmentService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
return success(equipmentService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipment:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询设备管理")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Equipment> get(@PathVariable("id") Integer id) {
|
||||
// return success(equipmentService.getById(id));
|
||||
// 使用关联查询
|
||||
return success(equipmentService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipment:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加设备管理")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Equipment equipment) throws AlipayApiException {
|
||||
// 记录当前登录用户id、租户id
|
||||
User loginUser = getLoginUser();
|
||||
if (getMerchantCode() != null) {
|
||||
equipment.setMerchantCode(getMerchantCode());
|
||||
}
|
||||
if (equipmentService.count(new LambdaQueryWrapper<Equipment>()
|
||||
.eq(Equipment::getEquipmentCode, equipment.getEquipmentCode())) > 0) {
|
||||
return fail("设备编号已存在");
|
||||
}
|
||||
if (equipmentService.save(equipment)) {
|
||||
// 生成二维码
|
||||
String qrcode = createQrcode(equipment);
|
||||
equipment.setQrcode(qrcode);
|
||||
equipmentService.saveOrUpdate(equipment);
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipment:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改设备管理")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Equipment equipment) throws AlipayApiException {
|
||||
if (equipmentService.updateById(equipment)) {
|
||||
// 生成二维码
|
||||
String qrcode = createQrcode(equipment);
|
||||
equipment.setQrcode(qrcode);
|
||||
equipmentService.saveOrUpdate(equipment);
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipment:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("绑定设备")
|
||||
@PutMapping("/bind")
|
||||
public ApiResult<?> bindEquipment(@RequestBody Equipment equipment) {
|
||||
final Integer orderId = equipment.getOrderId();
|
||||
final Order order = orderService.getById(orderId);
|
||||
Equipment one = equipmentService.getOne(new LambdaQueryWrapper<Equipment>().eq(Equipment::getEquipmentCode, equipment.getEquipmentCode()));
|
||||
if(one == null){
|
||||
return fail("设备不存在");
|
||||
}
|
||||
if(!one.getUserId().equals(0)){
|
||||
return fail("该设备已被绑定");
|
||||
}
|
||||
Equipment saveData = new Equipment();
|
||||
saveData.setEquipmentId(one.getEquipmentId());
|
||||
saveData.setUserId(equipment.getUserId());
|
||||
saveData.setOrderId(orderId);
|
||||
if (equipmentService.updateById(saveData)) {
|
||||
// 记录明细
|
||||
EquipmentRecord record = new EquipmentRecord();
|
||||
record.setEquipmentCode(one.getEquipmentCode());
|
||||
record.setUserId(getLoginUserId());
|
||||
record.setEventType(EVENT_TYPE_BIND);
|
||||
record.setComments("订单号:".concat(Long.toString(order.getOrderNo())));
|
||||
record.setMerchantCode(one.getMerchantCode());
|
||||
equipmentRecordService.save(record);
|
||||
// 订单发货
|
||||
order.setDeliveryStatus(DELIVERY_STATUS_YES);
|
||||
order.setOrderStatus(ORDER_STATUS_COMPLETED);
|
||||
order.setReceiptStatus(RECEIPT_STATUS_YES);
|
||||
order.setExpirationTime(DateUtil.nextMonth());
|
||||
order.setEquipmentId(one.getEquipmentId());
|
||||
orderService.updateById(order);
|
||||
return success("绑定成功");
|
||||
}
|
||||
return fail("绑定失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipment:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除设备管理")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (equipmentService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipment:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加设备管理")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Equipment> list) {
|
||||
if (equipmentService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipment:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改设备管理")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Equipment> batchParam) {
|
||||
if (batchParam.update(equipmentService, "equipment_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipment:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除设备管理")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (equipmentService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
// 生成支付宝小程序码
|
||||
private String createQrcode(Equipment equipment) throws AlipayApiException{
|
||||
// 实例化客户端
|
||||
DefaultAlipayClient alipayClient = alipayConfig.alipayClient(getTenantId());
|
||||
|
||||
AlipayOpenAppQrcodeCreateRequest request = new AlipayOpenAppQrcodeCreateRequest();
|
||||
AlipayOpenAppQrcodeCreateModel model = new AlipayOpenAppQrcodeCreateModel();
|
||||
model.setUrlParam("pages/equipment/equipment");
|
||||
System.out.println("equipment = " + equipment);
|
||||
// __id__=2&merchantCode=M311539&merchantId=52
|
||||
// pages/equipment/equipment
|
||||
|
||||
// Merchant merchant = merchantService.getMerchantByCode(equipment.getMerchantCode());
|
||||
// if(merchant == null){
|
||||
// throw new BusinessException("该商户不存在");
|
||||
// }
|
||||
model.setQueryParam("equipmentId=".concat(equipment.getEquipmentId().toString()));
|
||||
model.setDescribe("扫码租赁电池");
|
||||
request.setBizModel(model);
|
||||
AlipayOpenAppQrcodeCreateResponse response = alipayClient.certificateExecute(request);
|
||||
System.out.println(response.getBody());
|
||||
if (response.isSuccess()) {
|
||||
System.out.println("调用成功");
|
||||
final JSONObject jsonObject = JSONObject.parseObject(response.getBody());
|
||||
final String alipay_open_app_qrcode_create_response = jsonObject.getString("alipay_open_app_qrcode_create_response");
|
||||
final JSONObject jsonObject1 = JSONObject.parseObject(alipay_open_app_qrcode_create_response);
|
||||
return jsonObject1.getString("qr_code_url");
|
||||
} else {
|
||||
System.out.println("调用失败");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipment:update')")
|
||||
@ApiOperation("确认收货")
|
||||
@PostMapping("/receipt")
|
||||
public ApiResult<?> receipt(@RequestBody Order order){
|
||||
orderService.updateById(order);
|
||||
return success("确认收货");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.EquipmentFaultService;
|
||||
import com.gxwebsoft.apps.entity.EquipmentFault;
|
||||
import com.gxwebsoft.apps.param.EquipmentFaultParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障电池控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-12-01 18:40:25
|
||||
*/
|
||||
@Api(tags = "故障电池管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/equipment-fault")
|
||||
public class EquipmentFaultController extends BaseController {
|
||||
@Resource
|
||||
private EquipmentFaultService equipmentFaultService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentFault:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询故障电池")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<EquipmentFault>> page(EquipmentFaultParam param) {
|
||||
PageParam<EquipmentFault, EquipmentFaultParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
// return success(equipmentFaultService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
return success(equipmentFaultService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentFault:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部故障电池")
|
||||
@GetMapping()
|
||||
public ApiResult<List<EquipmentFault>> list(EquipmentFaultParam param) {
|
||||
PageParam<EquipmentFault, EquipmentFaultParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(equipmentFaultService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
// return success(equipmentFaultService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentFault:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询故障电池")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<EquipmentFault> get(@PathVariable("id") Integer id) {
|
||||
return success(equipmentFaultService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(equipmentFaultService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentFault:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加故障电池")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody EquipmentFault equipmentFault) {
|
||||
// 记录当前登录用户id、租户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
equipmentFault.setUserId(loginUser.getUserId());
|
||||
equipmentFault.setMerchantCode(getMerchantCode());
|
||||
}
|
||||
if (equipmentFaultService.save(equipmentFault)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentFault:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改故障电池")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody EquipmentFault equipmentFault) {
|
||||
if (equipmentFaultService.updateById(equipmentFault)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentFault:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除故障电池")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (equipmentFaultService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentFault:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加故障电池")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<EquipmentFault> list) {
|
||||
if (equipmentFaultService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentFault:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改故障电池")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<EquipmentFault> batchParam) {
|
||||
if (batchParam.update(equipmentFaultService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentFault:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除故障电池")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (equipmentFaultService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.gxwebsoft.apps.entity.Equipment;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.EquipmentGoodsService;
|
||||
import com.gxwebsoft.apps.entity.EquipmentGoods;
|
||||
import com.gxwebsoft.apps.param.EquipmentGoodsParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电池管理记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-02-28 22:40:50
|
||||
*/
|
||||
@Api(tags = "电池管理记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/equipment-goods")
|
||||
public class EquipmentGoodsController extends BaseController {
|
||||
@Resource
|
||||
private EquipmentGoodsService equipmentGoodsService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentGoods:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询电池管理记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<EquipmentGoods>> page(EquipmentGoodsParam param) {
|
||||
// 使用关联查询
|
||||
return success(equipmentGoodsService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentGoods:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部电池管理记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<EquipmentGoods>> list(EquipmentGoodsParam param) {
|
||||
// 使用关联查询
|
||||
return success(equipmentGoodsService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentGoods:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询电池管理记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<EquipmentGoods> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(equipmentGoodsService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentGoods:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加电池管理记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody EquipmentGoods equipmentGoods) {
|
||||
System.out.println("equipmentGoods = " + equipmentGoods);
|
||||
if (equipmentGoodsService.save(equipmentGoods)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentGoods:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改电池管理记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody EquipmentGoods equipmentGoods) {
|
||||
if (equipmentGoodsService.updateById(equipmentGoods)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentGoods:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除电池管理记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (equipmentGoodsService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentGoods:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加电池管理记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<EquipmentGoods> list) {
|
||||
if (equipmentGoodsService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentGoods:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改电池管理记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<EquipmentGoods> batchParam) {
|
||||
if (batchParam.update(equipmentGoodsService, "goods_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentGoods:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除电池管理记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (equipmentGoodsService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.EquipmentOrderService;
|
||||
import com.gxwebsoft.apps.entity.EquipmentOrder;
|
||||
import com.gxwebsoft.apps.param.EquipmentOrderParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-14 21:24:31
|
||||
*/
|
||||
@Api(tags = "订单记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/equipment-order")
|
||||
public class EquipmentOrderController extends BaseController {
|
||||
@Resource
|
||||
private EquipmentOrderService equipmentOrderService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrder:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询订单记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<EquipmentOrder>> page(EquipmentOrderParam param) {
|
||||
// PageParam<EquipmentOrder, EquipmentOrderParam> page = new PageParam<>(param);
|
||||
// page.setDefaultOrder("create_time desc");
|
||||
// return success(equipmentOrderService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
return success(equipmentOrderService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrder:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部订单记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<EquipmentOrder>> list(EquipmentOrderParam param) {
|
||||
PageParam<EquipmentOrder, EquipmentOrderParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(equipmentOrderService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(equipmentOrderService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrder:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询订单记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<EquipmentOrder> get(@PathVariable("id") Integer id) {
|
||||
return success(equipmentOrderService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(equipmentOrderService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrder:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加订单记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody EquipmentOrder equipmentOrder) {
|
||||
// 记录当前登录用户id、租户id、商户编号
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
equipmentOrder.setUserId(loginUser.getUserId());
|
||||
equipmentOrder.setMerchantCode(getMerchantCode());
|
||||
}
|
||||
if (equipmentOrderService.save(equipmentOrder)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrder:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改订单记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody EquipmentOrder equipmentOrder) {
|
||||
if (equipmentOrderService.updateById(equipmentOrder)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrder:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除订单记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (equipmentOrderService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrder:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加订单记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<EquipmentOrder> list) {
|
||||
if (equipmentOrderService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrder:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改订单记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<EquipmentOrder> batchParam) {
|
||||
if (batchParam.update(equipmentOrderService, "order_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrder:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除订单记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (equipmentOrderService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.EquipmentOrderGoodsService;
|
||||
import com.gxwebsoft.apps.entity.EquipmentOrderGoods;
|
||||
import com.gxwebsoft.apps.param.EquipmentOrderGoodsParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电池管理记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-05-11 19:10:13
|
||||
*/
|
||||
@Api(tags = "电池管理记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/equipment-order-goods")
|
||||
public class EquipmentOrderGoodsController extends BaseController {
|
||||
@Resource
|
||||
private EquipmentOrderGoodsService equipmentOrderGoodsService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrderGoods:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询电池管理记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<EquipmentOrderGoods>> page(EquipmentOrderGoodsParam param) {
|
||||
PageParam<EquipmentOrderGoods, EquipmentOrderGoodsParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(equipmentOrderGoodsService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(equipmentOrderGoodsService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrderGoods:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部电池管理记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<EquipmentOrderGoods>> list(EquipmentOrderGoodsParam param) {
|
||||
// PageParam<EquipmentOrderGoods, EquipmentOrderGoodsParam> page = new PageParam<>(param);
|
||||
// page.setDefaultOrder("create_time desc");
|
||||
// System.out.println("param = " + param);
|
||||
// final EquipmentOrderGoods eog = equipmentOrderGoodsService.getById(param.getGoodsId());
|
||||
// System.out.println("eog = " + eog);
|
||||
// eog.setOrderId(param.getOrderId());
|
||||
// equipmentOrderGoodsService.updateById(eog);
|
||||
//
|
||||
// final List<EquipmentOrderGoods> list = equipmentOrderGoodsService.list(page.getOrderWrapper());
|
||||
//
|
||||
// return success(equipmentOrderGoodsService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
return success(equipmentOrderGoodsService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrderGoods:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询电池管理记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<EquipmentOrderGoods> get(@PathVariable("id") Integer id) {
|
||||
return success(equipmentOrderGoodsService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(equipmentOrderGoodsService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrderGoods:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加电池管理记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody EquipmentOrderGoods equipmentOrderGoods) {
|
||||
// 记录当前登录用户id、租户id、商户编号
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
equipmentOrderGoods.setUserId(loginUser.getUserId());
|
||||
equipmentOrderGoods.setMerchantCode(getMerchantCode());
|
||||
}
|
||||
if (equipmentOrderGoodsService.save(equipmentOrderGoods)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrderGoods:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改电池管理记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody EquipmentOrderGoods equipmentOrderGoods) {
|
||||
if (equipmentOrderGoodsService.updateById(equipmentOrderGoods)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrderGoods:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除电池管理记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (equipmentOrderGoodsService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrderGoods:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加电池管理记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<EquipmentOrderGoods> list) {
|
||||
if (equipmentOrderGoodsService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrderGoods:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改电池管理记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<EquipmentOrderGoods> batchParam) {
|
||||
if (batchParam.update(equipmentOrderGoodsService, "order_goods_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentOrderGoods:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除电池管理记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (equipmentOrderGoodsService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.EquipmentRecordService;
|
||||
import com.gxwebsoft.apps.entity.EquipmentRecord;
|
||||
import com.gxwebsoft.apps.param.EquipmentRecordParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 前世今生控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-12-03 01:23:53
|
||||
*/
|
||||
@Api(tags = "前世今生管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/equipment-record")
|
||||
public class EquipmentRecordController extends BaseController {
|
||||
@Resource
|
||||
private EquipmentRecordService equipmentRecordService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentRecord:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询前世今生")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<EquipmentRecord>> page(EquipmentRecordParam param) {
|
||||
PageParam<EquipmentRecord, EquipmentRecordParam> page = new PageParam<>(param);
|
||||
// 搜索条件
|
||||
if (getMerchantCode() != null) {
|
||||
param.setMerchantCode(getMerchantCode());
|
||||
}
|
||||
// page.setDefaultOrder("create_time desc");
|
||||
// return success(equipmentRecordService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
return success(equipmentRecordService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentRecord:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部前世今生")
|
||||
@GetMapping()
|
||||
public ApiResult<List<EquipmentRecord>> list(EquipmentRecordParam param) {
|
||||
PageParam<EquipmentRecord, EquipmentRecordParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
// return success(equipmentRecordService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
return success(equipmentRecordService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentRecord:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询前世今生")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<EquipmentRecord> get(@PathVariable("id") Integer id) {
|
||||
// return success(equipmentRecordService.getById(id));
|
||||
// 使用关联查询
|
||||
return success(equipmentRecordService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentRecord:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加前世今生")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody EquipmentRecord equipmentRecord) {
|
||||
// 记录当前登录用户id、租户id、商户编号
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
equipmentRecord.setUserId(loginUser.getUserId());
|
||||
equipmentRecord.setMerchantCode(getMerchantCode());
|
||||
}
|
||||
if (equipmentRecordService.save(equipmentRecord)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentRecord:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改前世今生")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody EquipmentRecord equipmentRecord) {
|
||||
if (equipmentRecordService.updateById(equipmentRecord)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentRecord:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除前世今生")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (equipmentRecordService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentRecord:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加前世今生")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<EquipmentRecord> list) {
|
||||
if (equipmentRecordService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentRecord:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改前世今生")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<EquipmentRecord> batchParam) {
|
||||
if (batchParam.update(equipmentRecordService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:equipmentRecord:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除前世今生")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (equipmentRecordService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.HualalaCardBenefitsService;
|
||||
import com.gxwebsoft.apps.entity.HualalaCardBenefits;
|
||||
import com.gxwebsoft.apps.param.HualalaCardBenefitsParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员权益控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-08 12:22:50
|
||||
*/
|
||||
@Api(tags = "会员权益管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/hualala-card-benefits")
|
||||
public class HualalaCardBenefitsController extends BaseController {
|
||||
@Resource
|
||||
private HualalaCardBenefitsService hualalaCardBenefitsService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCardBenefits:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询会员权益")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<HualalaCardBenefits>> page(HualalaCardBenefitsParam param) {
|
||||
PageParam<HualalaCardBenefits, HualalaCardBenefitsParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(hualalaCardBenefitsService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(hualalaCardBenefitsService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCardBenefits:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部会员权益")
|
||||
@GetMapping()
|
||||
public ApiResult<List<HualalaCardBenefits>> list(HualalaCardBenefitsParam param) {
|
||||
PageParam<HualalaCardBenefits, HualalaCardBenefitsParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(hualalaCardBenefitsService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(hualalaCardBenefitsService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCardBenefits:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询会员权益")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<HualalaCardBenefits> get(@PathVariable("id") Integer id) {
|
||||
return success(hualalaCardBenefitsService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(hualalaCardBenefitsService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCardBenefits:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加会员权益")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody HualalaCardBenefits hualalaCardBenefits) {
|
||||
if (hualalaCardBenefitsService.save(hualalaCardBenefits)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCardBenefits:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改会员权益")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody HualalaCardBenefits hualalaCardBenefits) {
|
||||
if (hualalaCardBenefitsService.updateById(hualalaCardBenefits)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCardBenefits:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除会员权益")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (hualalaCardBenefitsService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCardBenefits:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加会员权益")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<HualalaCardBenefits> list) {
|
||||
if (hualalaCardBenefitsService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCardBenefits:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改会员权益")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<HualalaCardBenefits> batchParam) {
|
||||
if (batchParam.update(hualalaCardBenefitsService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCardBenefits:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除会员权益")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (hualalaCardBenefitsService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.HualalaCardService;
|
||||
import com.gxwebsoft.apps.entity.HualalaCard;
|
||||
import com.gxwebsoft.apps.param.HualalaCardParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-08 12:22:50
|
||||
*/
|
||||
@Api(tags = "管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/hualala-card")
|
||||
public class HualalaCardController extends BaseController {
|
||||
@Resource
|
||||
private HualalaCardService hualalaCardService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCard:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<HualalaCard>> page(HualalaCardParam param) {
|
||||
PageParam<HualalaCard, HualalaCardParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(hualalaCardService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(hualalaCardService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCard:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部")
|
||||
@GetMapping()
|
||||
public ApiResult<List<HualalaCard>> list(HualalaCardParam param) {
|
||||
PageParam<HualalaCard, HualalaCardParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(hualalaCardService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(hualalaCardService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCard:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<HualalaCard> get(@PathVariable("id") Integer id) {
|
||||
return success(hualalaCardService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(hualalaCardService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCard:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody HualalaCard hualalaCard) {
|
||||
// 记录当前登录用户id、租户id、商户编号
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
hualalaCard.setUserId(loginUser.getUserId());
|
||||
hualalaCard.setMerchantCode(getMerchantCode());
|
||||
}
|
||||
if (hualalaCardService.save(hualalaCard)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCard:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody HualalaCard hualalaCard) {
|
||||
if (hualalaCardService.updateById(hualalaCard)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCard:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (hualalaCardService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCard:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<HualalaCard> list) {
|
||||
if (hualalaCardService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCard:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<HualalaCard> batchParam) {
|
||||
if (batchParam.update(hualalaCardService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCard:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (hualalaCardService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
240
src/main/java/com/gxwebsoft/apps/controller/HualalaCart.java
Normal file
240
src/main/java/com/gxwebsoft/apps/controller/HualalaCart.java
Normal file
@@ -0,0 +1,240 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.gxwebsoft.apps.entity.HualalaFood;
|
||||
import com.gxwebsoft.apps.entity.HualalaShop;
|
||||
import com.gxwebsoft.apps.entity.ItemVo;
|
||||
import com.gxwebsoft.apps.result.*;
|
||||
import com.gxwebsoft.apps.service.HualalaFoodService;
|
||||
import com.gxwebsoft.apps.service.HualalaService;
|
||||
import com.gxwebsoft.apps.service.HualalaShopService;
|
||||
import com.gxwebsoft.common.core.utils.CacheClient;
|
||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.entity.OrderGoods;
|
||||
import com.gxwebsoft.shop.param.OrderParam;
|
||||
import com.gxwebsoft.shop.service.OrderGoodsService;
|
||||
import com.gxwebsoft.shop.service.OrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.val;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.gxwebsoft.common.core.constants.OrderConstants.PAY_STATUS_SUCCESS;
|
||||
import static com.gxwebsoft.common.core.constants.RedisConstants.*;
|
||||
|
||||
/**
|
||||
* 哗啦啦-购物车
|
||||
* 教程参考 https://blog.csdn.net/qq_34383510/article/details/127824628
|
||||
* @author 科技小王子
|
||||
* @since 2022-11-25 12:55:33
|
||||
*/
|
||||
@Api(tags = "哗啦啦-购物车")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/hualala-cart")
|
||||
public class HualalaCart extends BaseController {
|
||||
|
||||
@Resource
|
||||
private StringRedisTemplate stringRedisTemplate;
|
||||
@Resource
|
||||
private CacheClient cacheClient;
|
||||
@Resource
|
||||
private HualalaService hualalaService;
|
||||
@Resource
|
||||
private HualalaFoodService hualalaFoodService;
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
@Resource
|
||||
private OrderGoodsService orderGoodsService;
|
||||
@Resource
|
||||
private HualalaShopService hualalaShopService;
|
||||
|
||||
@ApiOperation("我的购物车")
|
||||
@GetMapping()
|
||||
public ApiResult<?> cart(ItemVo param) {
|
||||
String key = getKey(param.getShopId());
|
||||
|
||||
return success("查询成功",showCart(key));
|
||||
}
|
||||
|
||||
@ApiOperation("添加购物车")
|
||||
@PostMapping("/addCart")
|
||||
public ApiResult<?> addCart(@RequestBody ItemVo param) {
|
||||
String key = getKey(param.getShopId());
|
||||
cacheClient.hPut(key,param.getFoodId().toString(),JSONUtil.toJSONString(param));
|
||||
|
||||
return success("添加成功",showCart(key));
|
||||
}
|
||||
|
||||
@ApiOperation("生成订单并清空购物车")
|
||||
@PostMapping("/createOrder")
|
||||
public ApiResult<?> createOrder(@RequestBody Order order){
|
||||
String key = getKey(order.getShopId().toString());
|
||||
// 记录当前登录用户id、租户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
order.setUserId(loginUser.getUserId());
|
||||
}
|
||||
order.setMerchantCode(order.getShopId().toString());
|
||||
order.setPayMethod("通联支付");
|
||||
if (orderService.save(order)) {
|
||||
// 添加订单商品
|
||||
List<Object> hValues = cacheClient.hValues(key);
|
||||
hValues.forEach(d -> {
|
||||
JSONObject json = JSONObject.parseObject(d.toString());
|
||||
OrderGoods orderGoods = new OrderGoods();
|
||||
orderGoods.setOrderId(order.getOrderId());
|
||||
orderGoods.setGoodsName(json.getString("foodName"));
|
||||
orderGoods.setImageUrl(json.getString("imge"));
|
||||
orderGoods.setTotalNum(Integer.valueOf(json.getString("num")));
|
||||
orderGoods.setGoodsId(Integer.valueOf(json.getString("foodId")));
|
||||
orderGoods.setGoodsSkuId(json.getString("foodUnitID"));
|
||||
orderGoods.setUserId(getLoginUserId());
|
||||
BigDecimal totalPrice = new BigDecimal(json.getString("price"));
|
||||
orderGoods.setTotalPrice(totalPrice);
|
||||
orderGoods.setTenantId(getTenantId());
|
||||
orderGoodsService.save(orderGoods);
|
||||
});
|
||||
|
||||
// 清空购物车
|
||||
cacheClient.delete(key);
|
||||
return success("订单创建成功",order);
|
||||
}
|
||||
return fail("订单创建失败");
|
||||
}
|
||||
|
||||
@ApiOperation("通联支付")
|
||||
@PostMapping("/allinPay")
|
||||
public ApiResult<?> allinPay(@RequestBody Order order){
|
||||
Order orderInfo = orderService.getById(order.getOrderId());
|
||||
System.out.println("orderInfo = " + orderInfo);
|
||||
final HualalaShop shop = hualalaShopService.getByIdRel(orderInfo.getShopId());
|
||||
final String payMerchantNo = shop.getPayMerchantNo();
|
||||
final String paySecret = shop.getPaySecret();
|
||||
System.out.println("payMerchantNo = " + payMerchantNo);
|
||||
System.out.println("paySecret = " + paySecret);
|
||||
|
||||
// 正式接口
|
||||
String url = "https://interface.allinpaygx.com/api/access/payInterface/unifiedPay";
|
||||
// 测试接口
|
||||
// String url = "https://interfacetest.allinpaygx.com/api/access/payInterface/unifiedPay";
|
||||
// System.out.println("接口地址 = " + url);
|
||||
// map传参数
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 计算金额
|
||||
final BigDecimal orderPrice = orderInfo.getOrderPrice().multiply(new BigDecimal(100));
|
||||
final int amount = Integer.parseInt(orderPrice.stripTrailingZeros().toPlainString());
|
||||
map.put("merchantNo", payMerchantNo); // 正式商户
|
||||
// map.put("merchantNo", "113201120053"); // 测试商户:113201120053
|
||||
map.put("merchantOrderNo", orderInfo.getOrderNo());
|
||||
map.put("amount",String.valueOf(amount));
|
||||
map.put("notifyUrl","https://open.gxwebsoft.com/api/apps/hualala-cart/payNotify");
|
||||
map.put("payType","W06S");
|
||||
// 附加签名
|
||||
String sign = getSign(map,paySecret);
|
||||
System.out.println("sign = " + sign);
|
||||
map.put("sign",sign);
|
||||
System.out.println("请求参数 = " + map);
|
||||
String result = HttpUtil.post(url,map);
|
||||
System.out.println("result = " + result);
|
||||
JSONObject resultObj = JSON.parseObject(result);
|
||||
JSONObject payinfo = JSON.parseObject(resultObj.getString("payinfo"));
|
||||
System.out.println("payinfo = " + payinfo);
|
||||
return success("支付参数",payinfo);
|
||||
}
|
||||
|
||||
public static String getSign(Map<String, Object> treeMap, String paySecret) {
|
||||
// String secret = paySecret; // 正式秘钥
|
||||
// String secret = "aceb62c896d849c89d1c8b9a4416d1a7"; // 测试秘钥
|
||||
TreeMap<String, String> tMap = new TreeMap<>();
|
||||
for (Map.Entry<String, Object> entry : treeMap.entrySet()) {
|
||||
if (!StrUtil.isEmpty(entry.getValue().toString()) && !entry.getKey().equals("sign")) {
|
||||
tMap.put(entry.getKey(), entry.getValue().toString());
|
||||
}
|
||||
}
|
||||
StringBuffer buf = new StringBuffer();
|
||||
for (String key : tMap.keySet()) {
|
||||
buf.append(key).append(treeMap.get(key));
|
||||
}
|
||||
buf.append(paySecret);
|
||||
System.out.println("buf = " + buf);
|
||||
return DigestUtil.md5Hex(buf.toString()).toUpperCase();
|
||||
}
|
||||
|
||||
@ApiOperation("通联支付")
|
||||
@PostMapping("/payNotify")
|
||||
public String payNotify(@RequestParam Map<String, String> params){
|
||||
// 支付成功
|
||||
if (orderService.allinPay(params)) {
|
||||
return "success";
|
||||
}
|
||||
return "error";
|
||||
|
||||
}
|
||||
|
||||
@ApiOperation("交易查询")
|
||||
@PostMapping("/findOrderInfo")
|
||||
public ApiResult<?> findOrderInfo(@RequestBody Order order){
|
||||
final Order data = orderService.getByOutTradeNo(order.getOrderNo().toString());
|
||||
return success("查询结果",data);
|
||||
}
|
||||
|
||||
|
||||
// 获取Key
|
||||
private String getKey(String shopId) {
|
||||
return HLL_CART_FOOD_KEY.concat(shopId).concat(":").concat(getLoginUserId().toString());
|
||||
}
|
||||
|
||||
private OperateVo showCart(String key){
|
||||
// 获取购物车数据
|
||||
List<Object> values = cacheClient.hValues(key);
|
||||
// System.out.println("values = " + values);
|
||||
List<ItemVo> collect = values.stream().map(item -> JSONUtil.parseObject(JSONUtil.toJSONString(item), ItemVo.class)).collect(Collectors.toList());
|
||||
// System.out.println("collect = " + collect);
|
||||
|
||||
// 封装数据结果
|
||||
OperateVo operateVo = new OperateVo();
|
||||
operateVo.setTotalNum(0);
|
||||
operateVo.setTotalPrice(BigDecimal.valueOf(0));
|
||||
operateVo.setItems(collect);
|
||||
collect.forEach(d -> {
|
||||
// System.out.println("operateVo.getTotalNum() + d.getNum() = " + operateVo.getTotalNum() + d.getNum());
|
||||
operateVo.setTotalNum(operateVo.getTotalNum()+d.getNum());
|
||||
operateVo.setTotalPrice(operateVo.getTotalPrice().add(d.getPrice().multiply(BigDecimal.valueOf(d.getNum()))));
|
||||
});
|
||||
// System.out.println("operateVo = " + operateVo);
|
||||
return operateVo;
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("通联支付2")
|
||||
@PostMapping("/test")
|
||||
public ApiResult<?> test(){
|
||||
final Order order = orderService.getByOutTradeNo("2023030149684157");
|
||||
order.setPayStatus(PAY_STATUS_SUCCESS);
|
||||
order.setPayPrice(order.getTotalPrice());
|
||||
orderService.updateById(order);
|
||||
return success("成功",order);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.HualalaCartFoodService;
|
||||
import com.gxwebsoft.apps.entity.HualalaCartFood;
|
||||
import com.gxwebsoft.apps.param.HualalaCartFoodParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 购物车商品控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-14 14:46:44
|
||||
*/
|
||||
@Api(tags = "购物车商品管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/hualala-cart-food")
|
||||
public class HualalaCartFoodController extends BaseController {
|
||||
@Resource
|
||||
private HualalaCartFoodService hualalaCartFoodService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCartFood:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询购物车商品")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<HualalaCartFood>> page(HualalaCartFoodParam param) {
|
||||
PageParam<HualalaCartFood, HualalaCartFoodParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(hualalaCartFoodService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(hualalaCartFoodService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCartFood:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部购物车商品")
|
||||
@GetMapping()
|
||||
public ApiResult<List<HualalaCartFood>> list(HualalaCartFoodParam param) {
|
||||
PageParam<HualalaCartFood, HualalaCartFoodParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(hualalaCartFoodService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(hualalaCartFoodService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCartFood:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询购物车商品")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<HualalaCartFood> get(@PathVariable("id") Integer id) {
|
||||
return success(hualalaCartFoodService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(hualalaCartFoodService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCartFood:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加购物车商品")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody HualalaCartFood hualalaCartFood) {
|
||||
if (hualalaCartFoodService.save(hualalaCartFood)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCartFood:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改购物车商品")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody HualalaCartFood hualalaCartFood) {
|
||||
if (hualalaCartFoodService.updateById(hualalaCartFood)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCartFood:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除购物车商品")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (hualalaCartFoodService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCartFood:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加购物车商品")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<HualalaCartFood> list) {
|
||||
if (hualalaCartFoodService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCartFood:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改购物车商品")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<HualalaCartFood> batchParam) {
|
||||
if (batchParam.update(hualalaCartFoodService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaCartFood:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除购物车商品")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (hualalaCartFoodService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,384 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.gxwebsoft.apps.entity.HualalaFood;
|
||||
import com.gxwebsoft.apps.entity.HualalaFoodCategory;
|
||||
import com.gxwebsoft.apps.entity.HualalaShop;
|
||||
import com.gxwebsoft.apps.entity.ItemVo;
|
||||
import com.gxwebsoft.apps.param.*;
|
||||
import com.gxwebsoft.apps.result.AllShopResult;
|
||||
import com.gxwebsoft.apps.result.FoodCategoryResult;
|
||||
import com.gxwebsoft.apps.result.OpenFoodResult;
|
||||
import com.gxwebsoft.apps.result.ShopBaseInfoResult;
|
||||
import com.gxwebsoft.apps.service.HualalaFoodCategoryService;
|
||||
import com.gxwebsoft.apps.service.HualalaFoodService;
|
||||
import com.gxwebsoft.apps.service.HualalaService;
|
||||
import com.gxwebsoft.apps.service.HualalaShopService;
|
||||
import com.gxwebsoft.common.core.utils.CacheClient;
|
||||
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.shop.entity.Merchant;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.entity.OrderGoods;
|
||||
import com.gxwebsoft.shop.mapper.OrderGoodsMapper;
|
||||
import com.gxwebsoft.shop.param.MerchantParam;
|
||||
import com.gxwebsoft.shop.param.OrderParam;
|
||||
import com.gxwebsoft.shop.service.OrderGoodsService;
|
||||
import com.gxwebsoft.shop.service.OrderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.val;
|
||||
import org.springframework.data.geo.Point;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.gxwebsoft.common.core.constants.RedisConstants.*;
|
||||
|
||||
/**
|
||||
* 哗啦啦接口
|
||||
* 桂小厨GO
|
||||
* AppID:wx445232847c503f1b
|
||||
* AppSecret:eb81fbcac21da949d819143b43d18636
|
||||
* 桂小厨+
|
||||
* AppID:wx445232847c503f1b
|
||||
* AppSecret:eb81fbcac21da949d819143b43d18636
|
||||
* @author 科技小王子
|
||||
* @since 2022-11-25 12:55:33
|
||||
*/
|
||||
@Api(tags = "哗啦啦接口")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/hualala")
|
||||
public class HualalaController extends BaseController {
|
||||
@Resource
|
||||
private HualalaService hualalaService;
|
||||
@Resource
|
||||
private HualalaShopService hualalaShopService;
|
||||
@Resource
|
||||
private StringRedisTemplate stringRedisTemplate;
|
||||
@Resource
|
||||
private CacheClient cacheClient;
|
||||
@Resource
|
||||
private HualalaFoodService hualalaFoodService;
|
||||
@Resource
|
||||
private HualalaFoodCategoryService hualalaFoodCategoryService;
|
||||
@Resource
|
||||
private OrderService orderService;
|
||||
@Resource
|
||||
private OrderGoodsService orderGoodsService;
|
||||
@Resource
|
||||
private OrderGoodsMapper orderGoodsMapper;
|
||||
|
||||
@ApiOperation("哗啦啦万能接口")
|
||||
@PostMapping()
|
||||
public ApiResult<?> post(@RequestBody HualalaParam hualalaParam) {
|
||||
// 接口
|
||||
String apiUrl = hualalaParam.getApiUrl();
|
||||
// 请求参数
|
||||
HashMap<String, Object> params = hualalaParam.getParams();
|
||||
// 执行请求
|
||||
JSONObject response = hualalaService.doPost(apiUrl, params);
|
||||
return success("请求成功",response);
|
||||
}
|
||||
|
||||
@ApiOperation("查询集团店铺列表")
|
||||
@PostMapping("/getAllShop")
|
||||
public ApiResult<?> getAllShop(@RequestBody Map<String, Object> params) {
|
||||
// 请求缓存数据
|
||||
AllShopResult cache = cacheClient.get(getAllShop, AllShopResult.class);
|
||||
if(cache != null){
|
||||
return success("请求成功",cache.getShopInfoList());
|
||||
}
|
||||
|
||||
// 执行请求解析data数据
|
||||
JSONObject response = hualalaService.doPost("/doc/getAllShop", params);
|
||||
AllShopResult result = JSONObject.parseObject(response.getString("data"), AllShopResult.class);
|
||||
cacheClient.set(getAllShop,result);
|
||||
|
||||
List<HualalaShop> shopInfoList = result.getShopInfoList();
|
||||
// 过滤非桂小厨品牌门店
|
||||
List<HualalaShop> shops = shopInfoList.stream().filter(d -> d.getBrandName().equals("桂小厨")).collect(Collectors.toList());
|
||||
shops.forEach(d -> {
|
||||
d.setCreateTime(null);
|
||||
d.setTenantId(getTenantId());
|
||||
cacheClient.geoAdd(haulalaGeoKey,d.getMapLongitudeValueBaiDu(),d.getMapLatitudeValueBaiDu(),d.getShopId().toString());
|
||||
});
|
||||
hualalaShopService.saveBatch(shops);
|
||||
return success("缓存成功",shops);
|
||||
|
||||
|
||||
// try {
|
||||
// // 执行请求解析data数据
|
||||
// JSONObject response = hualalaService.doPost("/doc/getAllShop", params);
|
||||
// AllShopResult result = JSONObject.parseObject(response.getString("data"), AllShopResult.class);
|
||||
// cacheClient.set(getAllShop,result,1L,TimeUnit.DAYS);
|
||||
// return success("请求成功",result);
|
||||
// } catch (Exception e) {
|
||||
// throw new RuntimeException();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询店铺信息")
|
||||
@PostMapping("/getBaseInfo")
|
||||
public ApiResult<?> getBaseInfo(@RequestBody Map<String, Object> params) {
|
||||
// 请求缓存数据
|
||||
String key = getBaseInfo.concat(":").concat(params.get("shopId").toString());
|
||||
Merchant merchant = cacheClient.get(key, Merchant.class);
|
||||
if(merchant != null){
|
||||
return success("请求成功",merchant);
|
||||
}
|
||||
try {
|
||||
// 执行请求解析data数据
|
||||
JSONObject response = hualalaService.doPost("/doc/getBaseInfo", params);
|
||||
ShopBaseInfoResult result = JSONObject.parseObject(response.getString("data"), ShopBaseInfoResult.class);
|
||||
cacheClient.set(key,result);
|
||||
return success("缓存成功",result);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询店铺菜品分类")
|
||||
@PostMapping("/getFoodClassCategory")
|
||||
public ApiResult<?> getFoodClassCategory(@RequestBody Map<String, Object> params) {
|
||||
// 只查询外卖菜品
|
||||
params.put("type",1);
|
||||
// 请求缓存数据
|
||||
String key = getFoodClassCategory.concat(":").concat(params.get("shopId").toString());
|
||||
FoodCategoryResult cache = cacheClient.get(key, FoodCategoryResult.class);
|
||||
if(cache != null){
|
||||
return success("请求成功",cache);
|
||||
}
|
||||
|
||||
try {
|
||||
// 执行请求解析data数据
|
||||
JSONObject response = hualalaService.doPost("/doc/getFoodClassCategory", params);
|
||||
FoodCategoryResult result = JSONObject.parseObject(response.getString("data"), FoodCategoryResult.class);
|
||||
cacheClient.set(key,result);
|
||||
return success("缓存成功",result);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("查询店铺菜品列表")
|
||||
@PostMapping("/getOpenFood")
|
||||
public ApiResult<?> getOpenFood(@RequestBody Map<String, Object> params) {
|
||||
// 请求缓存数据
|
||||
String key = getOpenFood.concat(":").concat(params.get("shopId").toString());
|
||||
OpenFoodResult cache = cacheClient.get(key, OpenFoodResult.class);
|
||||
if(cache != null){
|
||||
// 计算加入购物车的商品数量
|
||||
List<HualalaFood> foodList = cache.getFoodList();
|
||||
foodList.forEach(d -> {
|
||||
String cartKey = HLL_CART_FOOD_KEY.concat(d.getShopId()).concat(":").concat(getLoginUserId().toString());
|
||||
ItemVo item = cacheClient.hGet(cartKey, d.getFoodId(), ItemVo.class);
|
||||
if(item != null){
|
||||
d.setCartNum(item.getNum());
|
||||
}
|
||||
});
|
||||
// List<HualalaFood> foods = CommonUtil.toTreeData(cache.getFoodList(), null, HualalaFood::getParentFoodId, HualalaFood::getFoodOnlineCategoryId, HualalaFood::setChildren);
|
||||
Map<String, List<HualalaFood>> collect = foodList.stream().collect(Collectors.groupingBy(HualalaFood::getFoodOnlineCategoryId));
|
||||
return success("请求成功",collect);
|
||||
}
|
||||
|
||||
// 执行请求解析当前店铺的菜品数据
|
||||
JSONObject response = hualalaService.doPost("/doc/getOpenFood", params);
|
||||
OpenFoodResult result = JSONObject.parseObject(response.getString("data"), OpenFoodResult.class);
|
||||
// 筛选出外卖菜品
|
||||
List<HualalaFood> foodList = result.getFoodList();
|
||||
List<HualalaFood> foodList2 = foodList.stream().filter(d -> d.getTakeawayTag().equals("2")).collect(Collectors.toList());
|
||||
// 筛选出可以点单的菜品
|
||||
List<HualalaFood> foods = foodList2.stream().filter(d -> d.getIsSingleSale().equals(1)).collect(Collectors.toList());
|
||||
// 存入redis
|
||||
result.setFoodList(foods);
|
||||
result.setCount(foods.size());
|
||||
cacheClient.set(key,result);
|
||||
hualalaFoodService.saveBatch(foods);
|
||||
return success("缓存成功",result.getFoodList());
|
||||
}
|
||||
|
||||
// @ApiOperation("查询店铺菜品列表(备份)")
|
||||
// @PostMapping("/getOpenFood2")
|
||||
// public ApiResult<?> getOpenFood2(@RequestBody Map<String, Object> params) {
|
||||
// // 请求缓存数据
|
||||
// String key = getOpenFood.concat(":").concat(params.get("shopId").toString());
|
||||
// OpenFoodResult cache = cacheClient.get(key, OpenFoodResult.class);
|
||||
// if(cache != null){
|
||||
// // 计算加入购物车的商品数量
|
||||
// List<HualalaFood> foodList = cache.getFoodList();
|
||||
// foodList.forEach(d -> {
|
||||
// String cartKey = HLL_CART_FOOD_KEY.concat(d.getShopId()).concat(":").concat(getLoginUserId().toString());
|
||||
// ItemVo item = cacheClient.hGet(cartKey, d.getFoodId(), ItemVo.class);
|
||||
// if(item != null){
|
||||
// d.setCartNum(item.getNum());
|
||||
// }
|
||||
// });
|
||||
// return success("请求成功",foodList);
|
||||
// }
|
||||
// try {
|
||||
// // 执行请求解析当前店铺的菜品数据
|
||||
// JSONObject response = hualalaService.doPost("/doc/getOpenFood", params);
|
||||
// OpenFoodResult result = JSONObject.parseObject(response.getString("data"), OpenFoodResult.class);
|
||||
// // 筛选出外卖菜品
|
||||
// List<HualalaFood> foodList = result.getFoodList();
|
||||
// List<HualalaFood> foodList2 = foodList.stream().filter(d -> d.getTakeawayTag().equals("2")).collect(Collectors.toList());
|
||||
// // 筛选出可以点单的菜品
|
||||
// List<HualalaFood> foods = foodList2.stream().filter(d -> d.getIsSingleSale().equals(1)).collect(Collectors.toList());
|
||||
// // 存入redis
|
||||
// result.setFoodList(foods);
|
||||
// result.setCount(foods.size());
|
||||
// cacheClient.set(key,result);
|
||||
// return success("缓存成功",result.getFoodList());
|
||||
// } catch (Exception e) {
|
||||
// throw new RuntimeException();
|
||||
// }
|
||||
// }
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualala:list')")
|
||||
@ApiOperation("保存菜品到redis(已废弃)")
|
||||
@PostMapping("/setOpenFoodToRedis")
|
||||
public ApiResult<?> setOpenFoodToRedis(@RequestBody HualalaFoodParam food) {
|
||||
System.out.println("food = " + food);
|
||||
String key = "cache:getOpenFood:shop-"+food.getShopId()+":category-"+food.getFoodCategoryCode()+":"+food.getFoodId();
|
||||
// stringRedisTemplate.opsForHash().put(key,food.getFoodId(),food.getData().toString());
|
||||
return success("请求成功",food);
|
||||
// 请求缓存数据
|
||||
// String key = getOpenFood + params.get("shopId");
|
||||
// String jsonStr = stringRedisTemplate.opsForValue().get(key);
|
||||
// if(StrUtil.isNotBlank(jsonStr)){
|
||||
// return success("请求成功",JSON.parseObject(jsonStr));
|
||||
// }
|
||||
// try {
|
||||
// // 执行请求解析data数据
|
||||
// JSONObject response = hualalaService.doPost("/doc/getOpenFood", params);
|
||||
// stringRedisTemplate.opsForValue().set(key, response.getString("data"),1,TimeUnit.DAYS);
|
||||
// return success("请求成功",JSON.parseObject(response.getString("data")));
|
||||
// } catch (Exception e) {
|
||||
// throw new RuntimeException();
|
||||
// }
|
||||
}
|
||||
|
||||
@ApiOperation("根据定位查询附近的门店列表")
|
||||
@PostMapping("/getListByGeo")
|
||||
public ApiResult<List<HualalaShop>> getListByGeo(@RequestBody HualalaShopParam param) {
|
||||
return success(hualalaShopService.listByGeo(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualala:list')")
|
||||
@ApiOperation("把商户坐标写入redis缓存")
|
||||
@PostMapping("/geoAdd")
|
||||
public ApiResult<?> geoAdd(){
|
||||
String key1 = "shop:geo:guixiaochu";
|
||||
stringRedisTemplate.opsForGeo().add(key1,new Point(108.321614,22.815124),"76230180");
|
||||
stringRedisTemplate.opsForGeo().add(key1,new Point(108.335703,22.813917),"76230181");
|
||||
stringRedisTemplate.opsForGeo().add(key1,new Point(108.370343,22.830116),"76230179");
|
||||
stringRedisTemplate.opsForGeo().add(key1,new Point(108.292017,22.869498),"76258872");
|
||||
stringRedisTemplate.opsForGeo().add(key1,new Point(108.393005,22.81194),"76230126");
|
||||
stringRedisTemplate.opsForGeo().add(key1,new Point(108.325202,22.785341),"76230178");
|
||||
return success("添加完毕");
|
||||
}
|
||||
|
||||
@ApiOperation("推送订单")
|
||||
@PostMapping("/pushOrder")
|
||||
public ApiResult<?> pushOrder(@RequestBody OrderParam param){
|
||||
Integer orderId = param.getOrderId();
|
||||
Order orderInfo = orderService.getById(orderId);
|
||||
System.out.println("orderInfo = " + orderInfo);
|
||||
final List<OrderGoods> goodsInfo = orderGoodsMapper.selectByOrderId(orderId);
|
||||
System.out.println("goodsInfo = " + goodsInfo);
|
||||
// 菜品信息
|
||||
ArrayList<Object> orderItem = new ArrayList<>();
|
||||
goodsInfo.forEach(goods -> {
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("foodID",goods.getGoodsId()); // 菜品id
|
||||
item.put("foodName",goods.getGoodsName()); // 菜品名称
|
||||
item.put("foodUnit","份"); // 规格名称
|
||||
item.put("foodUnitID",goods.getGoodsSkuId()); // 菜品规格id
|
||||
item.put("isSetFood",0); // 是/否套餐,0:非套餐 1:套餐
|
||||
item.put("isBatching",0); // 0:正常菜,1:主菜,2:配菜,3:加价做法
|
||||
item.put("foodCount",goods.getTotalNum()); // 菜品数量
|
||||
item.put("originPrice",goods.getTotalPrice()); // 菜品原价
|
||||
item.put("takeoutPackagingFee","0"); // 打包费
|
||||
item.put("isDiscount",0); // 是/否打折 ,0:不是 1:是
|
||||
item.put("duePrice",goods.getTotalPrice()); // TODO 菜品成售价
|
||||
orderItem.add(item);
|
||||
});
|
||||
|
||||
// 支付信息
|
||||
ArrayList<Object> payInfo = new ArrayList<>();
|
||||
JSONObject payItem = new JSONObject();
|
||||
payItem.put("paymentSubjectID",Long.valueOf("51010440")); // 科目id
|
||||
payItem.put("paymentSubjectName","微信小程序实收"); // 科目名称
|
||||
payItem.put("dueAmount",orderInfo.getPayPrice()); // TODO 实收金额
|
||||
payItem.put("paymentStatus",20); // 支付状态,15:未支付;20:已支付
|
||||
payItem.put("payWay",70); // 支付方式,70:商家自定义科目
|
||||
payInfo.add(payItem);
|
||||
|
||||
// 用户信息
|
||||
JSONObject userInfo = new JSONObject();
|
||||
userInfo.put("userName","邓莉莉");
|
||||
userInfo.put("userMobile","15878179339");
|
||||
userInfo.put("shopMpID","wxa4e2b8bc9c14c743");
|
||||
userInfo.put("userSex","0"); // 用户性别, 1:先生 0:女士 2:不显示,不传默认0 女士
|
||||
|
||||
// 订单信息
|
||||
JSONObject order = new JSONObject();
|
||||
order.put("orderSubType",20); // 订单类型 20: 外送
|
||||
order.put("orderStatus",20); // 订单状态 20:已付款
|
||||
order.put("discountTotalAmount","0"); // TODO 优惠金额
|
||||
order.put("dinners",1); // 用餐人数
|
||||
// 期望送达时间
|
||||
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMddHHmm");
|
||||
order.put("orderTime",sdf1.format(orderInfo.getCreateTime()));
|
||||
order.put("orderItem",orderItem); // 菜品信息
|
||||
order.put("takeoutAddress","南宁市良庆区五象大道401号五象航洋城1号楼1226室"); // TODO 外送地址
|
||||
order.put("deliveryAmount","8.00"); // TODO 配送费
|
||||
order.put("serviceAmount","0"); // 服务费,必传0
|
||||
order.put("channelKey","399_weixin"); // 渠道:微信小程序
|
||||
order.put("isAlreadyPaid","1"); // 是/否支付
|
||||
order.put("orderMode",1); // 1:先付,2:后付
|
||||
order.put("OrderRemark","测试订单(不需要制作及发货)"); // TODO 订单备注
|
||||
order.put("payment",payInfo); // 支付信息
|
||||
order.put("userInfo",userInfo); // 用户信息
|
||||
|
||||
HashMap<String,Object> params = new HashMap<>();
|
||||
params.put("shopID",Long.valueOf("76220517")); // 店铺ID
|
||||
params.put("isCheackOut",0); // 0 :默认 不需要收银台数据 1: 需要收银台数据
|
||||
params.put("isThirdPay",2); // 只有单纯核销哗啦啦会员卡时传1,其它都传2
|
||||
params.put("bankCode","weChat"); // 支付方式,weChat微信 aliPay支付宝,非哗啦啦支付传weChat
|
||||
params.put("order",order); // 订单信息
|
||||
params.put("isSentMsg",1); // 下单后pos是/否显示订单,下单带支付科目信息先付传1,下单不带支付科目信息先付传0,后付传1
|
||||
params.put("msgType",120); // 消息类型,240: 堂食、闪吃,120:外送,121:自提 ,与order中orderSubType要对应
|
||||
params.put("thirdOrderID",orderInfo.getOrderNo()); // 三方订单号,作用:十分钟内对相同的thirdOrderID进行去重处理,仅开放平台使用做去重处理,不会传到pos及报表
|
||||
|
||||
// 执行订单推送
|
||||
// JSONObject response = hualalaService.doPost("/order/submitordernew", params);
|
||||
// System.out .println("response = " + response);
|
||||
|
||||
// 同步配送平台
|
||||
// JSONObject result = hualalaService.doExpress(orderInfo);
|
||||
|
||||
return success("推送成功",null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.HualalaFoodCategoryService;
|
||||
import com.gxwebsoft.apps.entity.HualalaFoodCategory;
|
||||
import com.gxwebsoft.apps.param.HualalaFoodCategoryParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜品分类控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-12 09:49:46
|
||||
*/
|
||||
@Api(tags = "菜品分类管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/hualala-food-category")
|
||||
public class HualalaFoodCategoryController extends BaseController {
|
||||
@Resource
|
||||
private HualalaFoodCategoryService hualalaFoodCategoryService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFoodCategory:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询菜品分类")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<HualalaFoodCategory>> page(HualalaFoodCategoryParam param) {
|
||||
PageParam<HualalaFoodCategory, HualalaFoodCategoryParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(hualalaFoodCategoryService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(hualalaFoodCategoryService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFoodCategory:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部菜品分类")
|
||||
@GetMapping()
|
||||
public ApiResult<List<HualalaFoodCategory>> list(HualalaFoodCategoryParam param) {
|
||||
PageParam<HualalaFoodCategory, HualalaFoodCategoryParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(hualalaFoodCategoryService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(hualalaFoodCategoryService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFoodCategory:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询菜品分类")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<HualalaFoodCategory> get(@PathVariable("id") Integer id) {
|
||||
return success(hualalaFoodCategoryService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(hualalaFoodCategoryService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFoodCategory:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加菜品分类")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody HualalaFoodCategory hualalaFoodCategory) {
|
||||
if (hualalaFoodCategoryService.save(hualalaFoodCategory)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFoodCategory:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改菜品分类")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody HualalaFoodCategory hualalaFoodCategory) {
|
||||
if (hualalaFoodCategoryService.updateById(hualalaFoodCategory)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFoodCategory:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除菜品分类")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (hualalaFoodCategoryService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFoodCategory:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加菜品分类")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<HualalaFoodCategory> list) {
|
||||
if (hualalaFoodCategoryService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFoodCategory:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改菜品分类")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<HualalaFoodCategory> batchParam) {
|
||||
if (batchParam.update(hualalaFoodCategoryService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFoodCategory:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除菜品分类")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (hualalaFoodCategoryService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.HualalaFoodService;
|
||||
import com.gxwebsoft.apps.entity.HualalaFood;
|
||||
import com.gxwebsoft.apps.param.HualalaFoodParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜品分类控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-12 15:34:55
|
||||
*/
|
||||
@Api(tags = "菜品分类管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/hualala-food")
|
||||
public class HualalaFoodController extends BaseController {
|
||||
@Resource
|
||||
private HualalaFoodService hualalaFoodService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFood:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询菜品分类")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<HualalaFood>> page(HualalaFoodParam param) {
|
||||
PageParam<HualalaFood, HualalaFoodParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(hualalaFoodService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(hualalaFoodService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFood:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部菜品分类")
|
||||
@GetMapping()
|
||||
public ApiResult<List<HualalaFood>> list(HualalaFoodParam param) {
|
||||
PageParam<HualalaFood, HualalaFoodParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(hualalaFoodService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(hualalaFoodService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFood:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询菜品分类")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<HualalaFood> get(@PathVariable("id") Integer id) {
|
||||
return success(hualalaFoodService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(hualalaFoodService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFood:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加菜品分类")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody HualalaFood hualalaFood) {
|
||||
if (hualalaFoodService.save(hualalaFood)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFood:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改菜品分类")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody HualalaFood hualalaFood) {
|
||||
if (hualalaFoodService.updateById(hualalaFood)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFood:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除菜品分类")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (hualalaFoodService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFood:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加菜品分类")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<HualalaFood> list) {
|
||||
if (hualalaFoodService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFood:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改菜品分类")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<HualalaFood> batchParam) {
|
||||
if (batchParam.update(hualalaFoodService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaFood:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除菜品分类")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (hualalaFoodService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.HualalaShopService;
|
||||
import com.gxwebsoft.apps.entity.HualalaShop;
|
||||
import com.gxwebsoft.apps.param.HualalaShopParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 哗啦啦门店管理控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-12 18:24:44
|
||||
*/
|
||||
@Api(tags = "哗啦啦门店管理管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/hualala-shop")
|
||||
public class HualalaShopController extends BaseController {
|
||||
@Resource
|
||||
private HualalaShopService hualalaShopService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaShop:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询哗啦啦门店管理")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<HualalaShop>> page(HualalaShopParam param) {
|
||||
PageParam<HualalaShop, HualalaShopParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(hualalaShopService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(hualalaShopService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaShop:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部哗啦啦门店管理")
|
||||
@GetMapping()
|
||||
public ApiResult<List<HualalaShop>> list(HualalaShopParam param) {
|
||||
PageParam<HualalaShop, HualalaShopParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(hualalaShopService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(hualalaShopService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaShop:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询哗啦啦门店管理")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<HualalaShop> get(@PathVariable("id") Integer id) {
|
||||
return success(hualalaShopService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(hualalaShopService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaShop:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加哗啦啦门店管理")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody HualalaShop hualalaShop) {
|
||||
if (hualalaShopService.save(hualalaShop)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaShop:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改哗啦啦门店管理")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody HualalaShop hualalaShop) {
|
||||
if (hualalaShopService.updateById(hualalaShop)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaShop:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除哗啦啦门店管理")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (hualalaShopService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaShop:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加哗啦啦门店管理")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<HualalaShop> list) {
|
||||
if (hualalaShopService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaShop:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改哗啦啦门店管理")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<HualalaShop> batchParam) {
|
||||
if (batchParam.update(hualalaShopService, "shop_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:hualalaShop:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除哗啦啦门店管理")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (hualalaShopService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
140
src/main/java/com/gxwebsoft/apps/controller/LinkController.java
Normal file
140
src/main/java/com/gxwebsoft/apps/controller/LinkController.java
Normal file
@@ -0,0 +1,140 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.LinkService;
|
||||
import com.gxwebsoft.apps.entity.Link;
|
||||
import com.gxwebsoft.apps.param.LinkParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 常用链接推荐记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-11-25 12:55:33
|
||||
*/
|
||||
@Api(tags = "常用链接推荐记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/link")
|
||||
public class LinkController extends BaseController {
|
||||
@Resource
|
||||
private LinkService linkService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:link:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询常用链接推荐记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<Link>> page(LinkParam param) {
|
||||
PageParam<Link, LinkParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return success(linkService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(linkService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:link:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部常用链接推荐记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<Link>> list(LinkParam param) {
|
||||
PageParam<Link, LinkParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||
return success(linkService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(linkService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:link:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询常用链接推荐记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<Link> get(@PathVariable("id") Integer id) {
|
||||
return success(linkService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(linkService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:link:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加常用链接推荐记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody Link link) {
|
||||
// 记录当前登录用户id、租户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
link.setUserId(loginUser.getUserId());
|
||||
link.setMerchantCode(getMerchantCode());
|
||||
}
|
||||
if (linkService.save(link)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:link:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改常用链接推荐记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody Link link) {
|
||||
if (linkService.updateById(link)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:link:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除常用链接推荐记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (linkService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:link:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加常用链接推荐记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<Link> list) {
|
||||
if (linkService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:link:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改常用链接推荐记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<Link> batchParam) {
|
||||
if (batchParam.update(linkService, "link_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:link:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除常用链接推荐记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (linkService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
115
src/main/java/com/gxwebsoft/apps/controller/SfExpress.java
Normal file
115
src/main/java/com/gxwebsoft/apps/controller/SfExpress.java
Normal file
@@ -0,0 +1,115 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.val;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.util.Date;
|
||||
|
||||
public class SfExpress {
|
||||
|
||||
//开发者id
|
||||
private final Long devId= 1651421896L;
|
||||
//开发者密钥
|
||||
private final String devKey="2f10570c5057570fe0e488a425a6d813";
|
||||
//正式环境
|
||||
private final String serverHost="https://openic.sf-express.com";
|
||||
//店铺ID
|
||||
private final String shopId="3243279847393";
|
||||
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
SfExpress api = new SfExpress();
|
||||
String postData = api.orderOnlineByJson();
|
||||
String sign = generateOpenSign(postData,api.devId, api.devKey);
|
||||
String url = api.serverHost.concat("/open/api/external/createorder?sign=").concat(sign);
|
||||
String result = HttpUtil.post(url,postData);
|
||||
System.out.println("result = " + result);
|
||||
val resultObj = JSON.parseObject(result);
|
||||
JSONObject resultData = JSON.parseObject(resultObj.getString("result"));
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static String generateOpenSign(String postData, Long appId, String appKey) throws Exception {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(postData);
|
||||
sb.append("&" + appId + "&" + appKey);
|
||||
System.out.println("sb = " + sb);
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
byte[] md5 = md.digest(sb.toString().getBytes("utf-8"));
|
||||
int i;
|
||||
StringBuffer buf = new StringBuffer("");
|
||||
for (int offset = 0; offset < md5.length; offset++) {
|
||||
i = md5[offset];
|
||||
if (i < 0) {
|
||||
i += 256;
|
||||
}
|
||||
if (i < 16) {
|
||||
buf.append("0");
|
||||
}
|
||||
buf.append(Integer.toHexString(i));
|
||||
}
|
||||
|
||||
return Base64.encodeBase64String(buf.toString().getBytes("utf-8"));
|
||||
}
|
||||
|
||||
//即时查询接口
|
||||
public String orderOnlineByJson() throws Exception{
|
||||
// 组装应用级参数
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("dev_id",devId);
|
||||
json.put("shop_id",shopId);
|
||||
json.put("shop_order_id", RandomUtil.randomNumbers(16));
|
||||
json.put("order_source","1");
|
||||
long timestamp = new Date().getTime();
|
||||
json.put("order_time",timestamp/1000);
|
||||
json.put("push_time",timestamp/1000);
|
||||
json.put("version",19);
|
||||
JSONObject receive = new JSONObject();
|
||||
receive.put("user_name","顺丰同城");
|
||||
receive.put("user_phone","18978189563");
|
||||
receive.put("user_address","北京市海淀区学清嘉创大厦A座15层");
|
||||
receive.put("user_lng","116.354787");
|
||||
receive.put("user_lat","40.030613");
|
||||
json.put("receive",receive);
|
||||
JSONObject orderDetail = new JSONObject();
|
||||
orderDetail.put("total_price",100);
|
||||
orderDetail.put("product_type",1);
|
||||
orderDetail.put("weight_gram",100);
|
||||
orderDetail.put("product_num",1);
|
||||
orderDetail.put("product_type_num",1);
|
||||
json.put("order_detail",orderDetail);
|
||||
return json.toString();
|
||||
}
|
||||
//中文转Unicode
|
||||
/**
|
||||
* @Title: unicodeEncode
|
||||
* @Description: unicode编码 将中文字符转换成Unicode字符
|
||||
* @param string
|
||||
* @return
|
||||
*/
|
||||
public String unicodeEncode(String string) {
|
||||
char[] utfBytes = string.toCharArray();
|
||||
String unicodeBytes = "";
|
||||
for (int i = 0; i < utfBytes.length; i++) {
|
||||
String hexB = Integer.toHexString(utfBytes[i]);
|
||||
if (hexB.length() <= 2) {
|
||||
hexB = "00" + hexB;
|
||||
}
|
||||
unicodeBytes = unicodeBytes + "\\u" + hexB;
|
||||
}
|
||||
return unicodeBytes;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
package com.gxwebsoft.apps.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.apps.service.TestDataService;
|
||||
import com.gxwebsoft.apps.entity.TestData;
|
||||
import com.gxwebsoft.apps.param.TestDataParam;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import com.gxwebsoft.common.core.web.PageResult;
|
||||
import com.gxwebsoft.common.core.web.PageParam;
|
||||
import com.gxwebsoft.common.core.web.BatchParam;
|
||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.shop.entity.Order;
|
||||
import com.gxwebsoft.shop.entity.OrderGoods;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试数据表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-02-01 12:13:46
|
||||
*/
|
||||
@Api(tags = "测试数据表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/apps/test-data")
|
||||
public class TestDataController extends BaseController {
|
||||
@Resource
|
||||
private TestDataService testDataService;
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:testData:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("分页查询测试数据表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<TestData>> page(TestDataParam param) {
|
||||
PageParam<TestData, TestDataParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(testDataService.page(page, page.getWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(testDataService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:testData:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("查询全部测试数据表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<TestData>> list(TestDataParam param) {
|
||||
PageParam<TestData, TestDataParam> page = new PageParam<>(param);
|
||||
page.setDefaultOrder("create_time desc");
|
||||
return success(testDataService.list(page.getOrderWrapper()));
|
||||
// 使用关联查询
|
||||
//return success(testDataService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:testData:list')")
|
||||
@OperationLog
|
||||
@ApiOperation("根据id查询测试数据表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<TestData> get(@PathVariable("id") Integer id) {
|
||||
return success(testDataService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(testDataService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:testData:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("添加测试数据表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody TestData testData) {
|
||||
if (testDataService.save(testData)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:testData:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("修改测试数据表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody TestData testData) {
|
||||
if (testDataService.updateById(testData)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:testData:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("删除测试数据表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (testDataService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:testData:save')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量添加测试数据表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<TestData> list) {
|
||||
if (testDataService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:testData:update')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量修改测试数据表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<TestData> batchParam) {
|
||||
if (batchParam.update(testDataService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('apps:testData:remove')")
|
||||
@OperationLog
|
||||
@ApiOperation("批量删除测试数据表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (testDataService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
65
src/main/java/com/gxwebsoft/apps/entity/BcAgent.java
Normal file
65
src/main/java/com/gxwebsoft/apps/entity/BcAgent.java
Normal file
@@ -0,0 +1,65 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 代报餐管理
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-24 19:25:59
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "BcAgent对象", description = "代报餐管理")
|
||||
@TableName("apps_bc_agent")
|
||||
public class BcAgent implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@TableId(value = "agent_id", type = IdType.AUTO)
|
||||
private Integer agentId;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "代报餐用户ID")
|
||||
private Integer parentId;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0待处理, 1已完成")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "加入时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "被代报餐职员")
|
||||
@TableField(exist = false)
|
||||
private User user;
|
||||
|
||||
@ApiModelProperty(value = "代报餐人员")
|
||||
@TableField(exist = false)
|
||||
private User parentUser;
|
||||
|
||||
@ApiModelProperty(value = "被代报餐职员")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "代报餐人员")
|
||||
@TableField(exist = false)
|
||||
private String parentName;
|
||||
|
||||
}
|
||||
64
src/main/java/com/gxwebsoft/apps/entity/BcCart.java
Normal file
64
src/main/java/com/gxwebsoft/apps/entity/BcCart.java
Normal file
@@ -0,0 +1,64 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 报餐系统购物车
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-27 17:59:40
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "报餐系统购物车", description = "报餐系统购物车")
|
||||
@Data
|
||||
public class BcCart implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "预定日期")
|
||||
@TableField(exist = false)
|
||||
private String deliveryTime;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
@TableField(exist = false)
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "商品价格")
|
||||
@TableField(exist = false)
|
||||
private BigDecimal goodsPrice;
|
||||
|
||||
@ApiModelProperty(value = "商品数量")
|
||||
@TableField(exist = false)
|
||||
private Integer totalNum;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
@TableField(exist = false)
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(value = "商品描述")
|
||||
@TableField(exist = false)
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "商品封面图")
|
||||
@TableField(exist = false)
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "商品分类")
|
||||
@TableField(exist = false)
|
||||
private Integer categoryId;
|
||||
|
||||
@ApiModelProperty(value = "物品档口")
|
||||
@TableField(exist = false)
|
||||
private Integer gear;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
@TableField(exist = false)
|
||||
private Integer userId;
|
||||
|
||||
}
|
||||
61
src/main/java/com/gxwebsoft/apps/entity/BcCookbook.java
Normal file
61
src/main/java/com/gxwebsoft/apps/entity/BcCookbook.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 常用菜谱
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-05-05 14:56:54
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "BcCookbook对象", description = "常用菜谱")
|
||||
@TableName("apps_bc_cookbook")
|
||||
public class BcCookbook implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@TableId(value = "cookbook_id", type = IdType.AUTO)
|
||||
private Integer cookbookId;
|
||||
|
||||
@ApiModelProperty(value = "菜品计划")
|
||||
private Integer planId;
|
||||
|
||||
@ApiModelProperty(value = "餐段 早餐 午餐 晚餐")
|
||||
private String period;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0待发布, 1已发布")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "发布人")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
79
src/main/java/com/gxwebsoft/apps/entity/BcEquipment.java
Normal file
79
src/main/java/com/gxwebsoft/apps/entity/BcEquipment.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 报餐设备管理
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-05-02 10:34:40
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "BcEquipment对象", description = "报餐设备管理")
|
||||
@TableName("apps_bc_equipment")
|
||||
public class BcEquipment implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "设备ID")
|
||||
@TableId(value = "bc_equipment_id", type = IdType.AUTO)
|
||||
private Integer bcEquipmentId;
|
||||
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String equipmentName;
|
||||
|
||||
@ApiModelProperty(value = "设备编码")
|
||||
private String equipmentCode;
|
||||
|
||||
@ApiModelProperty(value = "所属档口")
|
||||
private Integer gear;
|
||||
|
||||
@ApiModelProperty(value = "职员工号")
|
||||
private Integer staffId;
|
||||
|
||||
@ApiModelProperty(value = "二维码")
|
||||
private String qrcode;
|
||||
|
||||
@ApiModelProperty(value = "设备详情")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
112
src/main/java/com/gxwebsoft/apps/entity/BcExport.java
Normal file
112
src/main/java/com/gxwebsoft/apps/entity/BcExport.java
Normal file
@@ -0,0 +1,112 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 报餐统计导出
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-06-01 21:47:02
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "BcExport对象", description = "报餐统计导出")
|
||||
@TableName("apps_bc_export")
|
||||
public class BcExport implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@TableId(value = "export_id", type = IdType.AUTO)
|
||||
private Integer exportId;
|
||||
|
||||
@ApiModelProperty(value = "机构名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty(value = "昵称")
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "实际消费的金额(不含退款)")
|
||||
private BigDecimal expendMoney;
|
||||
|
||||
@ApiModelProperty(value = "早餐报餐次数")
|
||||
private Integer breakfastPost;
|
||||
|
||||
@ApiModelProperty(value = "早餐签到次数")
|
||||
private Integer breakfastSign;
|
||||
|
||||
@ApiModelProperty(value = "午餐报餐次数")
|
||||
private Integer lunchPost;
|
||||
|
||||
@ApiModelProperty(value = "午餐签到次数")
|
||||
private Integer lunchSign;
|
||||
|
||||
@ApiModelProperty(value = "晚餐报餐次数")
|
||||
private Integer dinnerPost;
|
||||
|
||||
@ApiModelProperty(value = "晚餐签到次数")
|
||||
private Integer dinnerSign;
|
||||
|
||||
@ApiModelProperty(value = "食堂档口")
|
||||
private Integer gear10;
|
||||
|
||||
@ApiModelProperty(value = "物品档口")
|
||||
private Integer gear20;
|
||||
|
||||
@ApiModelProperty(value = "食堂档口")
|
||||
private Integer signGear10;
|
||||
|
||||
@ApiModelProperty(value = "物品档口")
|
||||
private Integer signGear20;
|
||||
|
||||
@ApiModelProperty(value = "商品价格(单价)")
|
||||
private BigDecimal goodsPrice;
|
||||
|
||||
@ApiModelProperty(value = "午餐报餐次数")
|
||||
private String lunchPostText;
|
||||
|
||||
@ApiModelProperty(value = "午餐报餐次数")
|
||||
private String lunchSignText;
|
||||
|
||||
@ApiModelProperty(value = "发货时间")
|
||||
private Date deliveryTime;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0待发布, 1已发布")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "机构id")
|
||||
private Integer organizationId;
|
||||
|
||||
@ApiModelProperty(value = "发布人")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
61
src/main/java/com/gxwebsoft/apps/entity/BcFood.java
Normal file
61
src/main/java/com/gxwebsoft/apps/entity/BcFood.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 发布菜品明细
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-27 17:59:40
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "BcFood对象", description = "发布菜品明细")
|
||||
@TableName("apps_bc_food")
|
||||
public class BcFood implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@TableId(value = "bc_food_id", type = IdType.AUTO)
|
||||
private Integer bcFoodId;
|
||||
|
||||
@ApiModelProperty(value = "菜品计划")
|
||||
private Integer planId;
|
||||
|
||||
@ApiModelProperty(value = "餐段 早餐 午餐 晚餐")
|
||||
private String period;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0待发布, 1已发布")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "发布人")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
}
|
||||
79
src/main/java/com/gxwebsoft/apps/entity/BcPlan.java
Normal file
79
src/main/java/com/gxwebsoft/apps/entity/BcPlan.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.gxwebsoft.shop.entity.Goods;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜品发布管理
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-27 17:59:40
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "BcPlan对象", description = "菜品发布管理")
|
||||
@TableName("apps_bc_plan")
|
||||
public class BcPlan implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@TableId(value = "bc_plan_id", type = IdType.AUTO)
|
||||
private Integer bcPlanId;
|
||||
|
||||
@ApiModelProperty(value = "发布日期")
|
||||
private Date dayTime;
|
||||
|
||||
@ApiModelProperty(value = "0星期日 1星期一 2星期二 3星期三 4星期四 5星期五 6星期六")
|
||||
private Integer week;
|
||||
|
||||
@ApiModelProperty(value = "发布类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "餐段")
|
||||
private String period;
|
||||
|
||||
@ApiModelProperty(value = "多天菜品是否重复")
|
||||
private Integer isRepeat;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0待发布, 1已发布")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "菜品ID")
|
||||
private String goodsIds;
|
||||
|
||||
@ApiModelProperty(value = "商品列表")
|
||||
@TableField(exist = false)
|
||||
private List<Goods> goodsList;
|
||||
|
||||
@ApiModelProperty(value = "发布人")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
}
|
||||
80
src/main/java/com/gxwebsoft/apps/entity/BcTemporary.java
Normal file
80
src/main/java/com/gxwebsoft/apps/entity/BcTemporary.java
Normal file
@@ -0,0 +1,80 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Value;
|
||||
|
||||
/**
|
||||
* 临时报餐管理
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-24 21:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "BcTemporary对象", description = "临时报餐管理")
|
||||
@TableName("apps_bc_temporary")
|
||||
public class BcTemporary implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "自增ID")
|
||||
@TableId(value = "temporary_id", type = IdType.AUTO)
|
||||
private Integer temporaryId;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "工单ID")
|
||||
private Integer parentId;
|
||||
|
||||
@ApiModelProperty(value = "申请状态")
|
||||
private Integer applyStatus;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0待处理, 1已完成")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "加入时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "报餐日期")
|
||||
private Date dayTime;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "失效时间")
|
||||
private Date expirationTime;
|
||||
|
||||
@ApiModelProperty(value = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@ApiModelProperty(value = "代报餐人员")
|
||||
@TableField(exist = false)
|
||||
private String dealerName;
|
||||
|
||||
@ApiModelProperty(value = "被代报餐职员")
|
||||
@TableField(exist = false)
|
||||
private User user;
|
||||
|
||||
@ApiModelProperty(value = "代报餐人员")
|
||||
@TableField(exist = false)
|
||||
private User parentUser;
|
||||
|
||||
}
|
||||
95
src/main/java/com/gxwebsoft/apps/entity/Cashier.java
Normal file
95
src/main/java/com/gxwebsoft/apps/entity/Cashier.java
Normal file
@@ -0,0 +1,95 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 海牛收银台记录表
|
||||
*
|
||||
* @author WebSoft
|
||||
* @since 2022-11-18 11:47:09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "Cashier对象", description = "海牛收银台记录表")
|
||||
@TableName("apps_cashier")
|
||||
public class Cashier implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "cashier_id", type = IdType.AUTO)
|
||||
private Integer cashierId;
|
||||
|
||||
@ApiModelProperty(value = "客户ID")
|
||||
private String buyerId;
|
||||
|
||||
@ApiModelProperty(value = "设备ID")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "支付标识")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "返回消息")
|
||||
private String msg;
|
||||
|
||||
@ApiModelProperty(value = "客户端交易订单编号")
|
||||
private String outTradeNo;
|
||||
|
||||
@ApiModelProperty(value = "数量")
|
||||
private String amount;
|
||||
|
||||
@ApiModelProperty(value = "支付时间")
|
||||
private String payTime;
|
||||
|
||||
@ApiModelProperty(value = "支付方式")
|
||||
private String payType;
|
||||
|
||||
@ApiModelProperty(value = "交易金额")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@ApiModelProperty(value = "实收金额")
|
||||
private BigDecimal receiptAmount;
|
||||
|
||||
@ApiModelProperty(value = "第三方交易手续费")
|
||||
private BigDecimal feeAmount;
|
||||
|
||||
@ApiModelProperty(value = "第三方结算金额")
|
||||
private BigDecimal settleAmount;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
private String mobile;
|
||||
|
||||
@ApiModelProperty(value = "订单备注")
|
||||
private String orderRemark;
|
||||
|
||||
@ApiModelProperty(value = "订单状态")
|
||||
private String orderStatus;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
148
src/main/java/com/gxwebsoft/apps/entity/Equipment.java
Normal file
148
src/main/java/com/gxwebsoft/apps/entity/Equipment.java
Normal file
@@ -0,0 +1,148 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备管理
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-11-30 02:11:16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "Equipment对象", description = "设备管理")
|
||||
@TableName("apps_equipment")
|
||||
public class Equipment implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "设备ID")
|
||||
@TableId(value = "equipment_id", type = IdType.AUTO)
|
||||
private Integer equipmentId;
|
||||
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String equipmentName;
|
||||
|
||||
@ApiModelProperty(value = "设备编码")
|
||||
private String equipmentCode;
|
||||
|
||||
@ApiModelProperty("设备分类")
|
||||
private String equipmentCategory;
|
||||
|
||||
@ApiModelProperty(value = "分类ID")
|
||||
private Integer categoryId;
|
||||
|
||||
@ApiModelProperty(value = "头像")
|
||||
private String equipmentAvatar;
|
||||
|
||||
@ApiModelProperty(value = "电池型号")
|
||||
private String batteryModel;
|
||||
|
||||
@ApiModelProperty(value = "BMS")
|
||||
private String bms;
|
||||
|
||||
@ApiModelProperty(value = "商品详情")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "是否激活")
|
||||
private String isCtive;
|
||||
|
||||
@ApiModelProperty(value = "工作状态")
|
||||
private String workingStatus;
|
||||
|
||||
@ApiModelProperty(value = "租赁状态")
|
||||
private String leaseStatus;
|
||||
|
||||
@ApiModelProperty(value = "电池状态")
|
||||
private String batteryStatus;
|
||||
|
||||
@ApiModelProperty(value = "电池电量")
|
||||
private String batteryPower;
|
||||
|
||||
@ApiModelProperty(value = "是否在线")
|
||||
private String isOnline;
|
||||
|
||||
@ApiModelProperty(value = "总电压")
|
||||
private String totalVoltage;
|
||||
|
||||
@ApiModelProperty(value = "BMS板供应商")
|
||||
private String bmsBrand;
|
||||
|
||||
@ApiModelProperty(value = "剩余容量")
|
||||
private String surplusCapacity;
|
||||
|
||||
@ApiModelProperty(value = "ICCID")
|
||||
private String iccid;
|
||||
|
||||
@ApiModelProperty(value = "设备激活时间")
|
||||
private Date ctiveTime;
|
||||
|
||||
@ApiModelProperty(value = "电池出厂时间")
|
||||
private Date batteryDeliveryTime;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户编号")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "所属商户ID")
|
||||
@TableField(exist = false)
|
||||
private Integer merchantId;
|
||||
|
||||
@ApiModelProperty(value = "所属商户名称")
|
||||
@TableField(exist = false)
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "订单ID")
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "电池租金")
|
||||
private BigDecimal batteryRent;
|
||||
|
||||
@ApiModelProperty(value = "电池押金")
|
||||
private BigDecimal batteryDeposit;
|
||||
|
||||
@ApiModelProperty(value = "电池保险")
|
||||
private BigDecimal batteryInsurance;
|
||||
|
||||
@ApiModelProperty(value = "设备价格")
|
||||
private BigDecimal batteryPrice;
|
||||
|
||||
@ApiModelProperty(value = "二维码")
|
||||
private String qrcode;
|
||||
|
||||
@ApiModelProperty(value = "绑定的用户")
|
||||
@TableField(exist = false)
|
||||
private User user;
|
||||
}
|
||||
72
src/main/java/com/gxwebsoft/apps/entity/EquipmentAlarm.java
Normal file
72
src/main/java/com/gxwebsoft/apps/entity/EquipmentAlarm.java
Normal file
@@ -0,0 +1,72 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 故障报警记录
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-12-01 23:49:44
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "EquipmentAlarm对象", description = "故障报警记录")
|
||||
@TableName("apps_equipment_alarm")
|
||||
public class EquipmentAlarm implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "记录ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "设备编码")
|
||||
private String equipmentCode;
|
||||
|
||||
@ApiModelProperty(value = "报警类型")
|
||||
private String alarmType;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "处理时间")
|
||||
private Date handleTime;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "所属商户名称")
|
||||
@TableField(exist = false)
|
||||
private String merchantName;
|
||||
|
||||
}
|
||||
75
src/main/java/com/gxwebsoft/apps/entity/EquipmentFault.java
Normal file
75
src/main/java/com/gxwebsoft/apps/entity/EquipmentFault.java
Normal file
@@ -0,0 +1,75 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 故障电池
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-12-01 18:40:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "EquipmentFault对象", description = "故障电池")
|
||||
@TableName("apps_equipment_fault")
|
||||
public class EquipmentFault implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "记录ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "设备编号")
|
||||
private String equipmentCode;
|
||||
|
||||
@ApiModelProperty(value = "故障原因")
|
||||
private String faultType;
|
||||
|
||||
@ApiModelProperty(value = "上传图片")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "处理时间")
|
||||
private Date handleTime;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "所属商户名称")
|
||||
@TableField(exist = false)
|
||||
private String merchantName;
|
||||
|
||||
}
|
||||
120
src/main/java/com/gxwebsoft/apps/entity/EquipmentGoods.java
Normal file
120
src/main/java/com/gxwebsoft/apps/entity/EquipmentGoods.java
Normal file
@@ -0,0 +1,120 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 电池管理记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-02-28 22:40:50
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "EquipmentGoods对象", description = "电池管理记录表")
|
||||
@TableName("apps_equipment_goods")
|
||||
public class EquipmentGoods implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
@TableId(value = "goods_id", type = IdType.AUTO)
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(value = "下单类型")
|
||||
private String equipmentCategory;
|
||||
|
||||
@ApiModelProperty(value = "商品封面图")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "二维码")
|
||||
private String qrcode;
|
||||
|
||||
@ApiModelProperty(value = "分类ID")
|
||||
private Integer categoryId;
|
||||
|
||||
@ApiModelProperty(value = "电池型号")
|
||||
private String batteryModel;
|
||||
|
||||
@ApiModelProperty(value = "库存总量")
|
||||
private Integer stockTotal;
|
||||
|
||||
@ApiModelProperty(value = "商品卖点")
|
||||
private String sellingPoint;
|
||||
|
||||
@ApiModelProperty(value = "商品详情")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "电池租金")
|
||||
private BigDecimal batteryRent;
|
||||
|
||||
@ApiModelProperty(value = "电池价格")
|
||||
private BigDecimal batteryPrice;
|
||||
|
||||
@ApiModelProperty(value = "电池押金")
|
||||
private BigDecimal batteryDeposit;
|
||||
|
||||
@ApiModelProperty(value = "电池保险")
|
||||
private BigDecimal batteryInsurance;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "首付款")
|
||||
private BigDecimal downPayment;
|
||||
|
||||
@ApiModelProperty(value = "分期期数")
|
||||
private BigDecimal periods;
|
||||
|
||||
@ApiModelProperty(value = "每期还款")
|
||||
private BigDecimal repayment;
|
||||
|
||||
@ApiModelProperty(value = "手续费")
|
||||
private BigDecimal serviceCharges;
|
||||
|
||||
@ApiModelProperty(value = "分期方式")
|
||||
private Integer periodsType;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "商户名称")
|
||||
@TableField(exist = false)
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "订单ID")
|
||||
@TableField(exist = false)
|
||||
private Integer orderId;
|
||||
|
||||
}
|
||||
202
src/main/java/com/gxwebsoft/apps/entity/EquipmentOrder.java
Normal file
202
src/main/java/com/gxwebsoft/apps/entity/EquipmentOrder.java
Normal file
@@ -0,0 +1,202 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 订单记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-14 21:24:31
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "EquipmentOrder对象", description = "订单记录表")
|
||||
@TableName("apps_equipment_order")
|
||||
public class EquipmentOrder implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "订单ID")
|
||||
@TableId(value = "order_id", type = IdType.AUTO)
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "订单标题")
|
||||
private String subject;
|
||||
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderNo;
|
||||
|
||||
@ApiModelProperty(value = "商品总金额(不含优惠折扣)")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@ApiModelProperty(value = "订单金额(含优惠折扣)")
|
||||
private BigDecimal orderPrice;
|
||||
|
||||
@ApiModelProperty(value = "优惠券ID")
|
||||
private Integer couponId;
|
||||
|
||||
@ApiModelProperty(value = "优惠券抵扣金额")
|
||||
private BigDecimal couponMoney;
|
||||
|
||||
@ApiModelProperty(value = "积分抵扣金额")
|
||||
private BigDecimal pointsMoney;
|
||||
|
||||
@ApiModelProperty(value = "积分抵扣数量")
|
||||
private Integer pointsNum;
|
||||
|
||||
@ApiModelProperty(value = "实际付款金额(包含运费)")
|
||||
private BigDecimal payPrice;
|
||||
|
||||
@ApiModelProperty(value = "第三方支付实收金额")
|
||||
private BigDecimal receiptAmount;
|
||||
|
||||
@ApiModelProperty(value = "后台修改的订单金额(差价)")
|
||||
private BigDecimal updatePrice;
|
||||
|
||||
@ApiModelProperty(value = "买家留言")
|
||||
private String buyerRemark;
|
||||
|
||||
@ApiModelProperty(value = "支付方式(废弃)")
|
||||
private Integer payType;
|
||||
|
||||
@ApiModelProperty(value = "支付方式(余额10/微信20/支付宝30/通联支付40/其他支付50)")
|
||||
private String payMethod;
|
||||
|
||||
@ApiModelProperty(value = "付款状态(10未付款 20已付款)")
|
||||
private Integer payStatus;
|
||||
|
||||
@ApiModelProperty(value = "付款时间")
|
||||
private Date payTime;
|
||||
|
||||
@ApiModelProperty(value = "第三方交易记录ID")
|
||||
private String tradeId;
|
||||
|
||||
@ApiModelProperty(value = "配送方式(10快递配送 20门店自提)")
|
||||
private Integer deliveryType;
|
||||
|
||||
@ApiModelProperty(value = "自提门店ID")
|
||||
private Integer extractShopId;
|
||||
|
||||
@ApiModelProperty(value = "核销店员ID")
|
||||
private Integer extractClerkId;
|
||||
|
||||
@ApiModelProperty(value = "运费金额")
|
||||
private BigDecimal expressPrice;
|
||||
|
||||
@ApiModelProperty(value = "物流公司ID (废弃)")
|
||||
private Integer expressId;
|
||||
|
||||
@ApiModelProperty(value = "物流单号 (废弃)")
|
||||
private String expressNo;
|
||||
|
||||
@ApiModelProperty(value = "发货状态(10未发货 20已发货 30部分发货)")
|
||||
private Integer deliveryStatus;
|
||||
|
||||
@ApiModelProperty(value = "发货时间")
|
||||
private Date deliveryTime;
|
||||
|
||||
@ApiModelProperty(value = "收货状态(10未收货 20已收货)")
|
||||
private Integer receiptStatus;
|
||||
|
||||
@ApiModelProperty(value = "收货时间")
|
||||
private Date receiptTime;
|
||||
|
||||
@ApiModelProperty(value = "订单状态(10进行中 20取消 21待取消 30已完成)")
|
||||
private Integer orderStatus;
|
||||
|
||||
@ApiModelProperty(value = "赠送的积分数量")
|
||||
private Integer pointsBonus;
|
||||
|
||||
@ApiModelProperty(value = "商家备注")
|
||||
private String merchantRemark;
|
||||
|
||||
@ApiModelProperty(value = "订单是否已结算(0未结算 1已结算)")
|
||||
private Integer isSettled;
|
||||
|
||||
@ApiModelProperty(value = "续租订单的关联单号")
|
||||
private Integer rentOrderId;
|
||||
|
||||
@ApiModelProperty(value = "微信支付交易号(废弃)")
|
||||
private String transactionId;
|
||||
|
||||
@ApiModelProperty(value = "是否已评价(0否 1是)")
|
||||
private Integer isComment;
|
||||
|
||||
@ApiModelProperty(value = "订单来源(10普通订单 20砍价订单 30秒杀订单)")
|
||||
private Integer orderSource;
|
||||
|
||||
@ApiModelProperty(value = "来源记录ID")
|
||||
private Integer orderSourceId;
|
||||
|
||||
@ApiModelProperty(value = "来源记录的参数 (json格式)")
|
||||
private String orderSourceData;
|
||||
|
||||
@ApiModelProperty(value = "电池租金")
|
||||
private BigDecimal batteryRent;
|
||||
|
||||
@ApiModelProperty(value = "电池押金")
|
||||
private BigDecimal batteryDeposit;
|
||||
|
||||
@ApiModelProperty(value = "保险")
|
||||
private BigDecimal batteryInsurance;
|
||||
|
||||
@ApiModelProperty(value = "购买月份数量")
|
||||
private Integer month;
|
||||
|
||||
@ApiModelProperty(value = "服务到期时间")
|
||||
private Date expirationTime;
|
||||
|
||||
@ApiModelProperty(value = "来源客户端 (APP、H5、小程序等)")
|
||||
private String platform;
|
||||
|
||||
@ApiModelProperty(value = "是否续费订单")
|
||||
private Integer isRenew;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "所属门店ID")
|
||||
private Integer shopId;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
private Integer goodsId;
|
||||
|
||||
@ApiModelProperty(value = "电池商品ID")
|
||||
private Integer equipmentId;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
119
src/main/java/com/gxwebsoft/apps/entity/EquipmentOrderGoods.java
Normal file
119
src/main/java/com/gxwebsoft/apps/entity/EquipmentOrderGoods.java
Normal file
@@ -0,0 +1,119 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 电池管理记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-05-11 19:10:13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "EquipmentOrderGoods对象", description = "电池管理记录表")
|
||||
@TableName("apps_equipment_order_goods")
|
||||
public class EquipmentOrderGoods implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "商品ID")
|
||||
@TableId(value = "order_goods_id", type = IdType.AUTO)
|
||||
private Integer orderGoodsId;
|
||||
|
||||
@ApiModelProperty(value = "商品名称")
|
||||
private String goodsName;
|
||||
|
||||
@ApiModelProperty(value = "下单类型")
|
||||
private String equipmentCategory;
|
||||
|
||||
@ApiModelProperty(value = "商品封面图")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "二维码")
|
||||
private String qrcode;
|
||||
|
||||
@ApiModelProperty(value = "分类ID")
|
||||
private Integer categoryId;
|
||||
|
||||
@ApiModelProperty(value = "电池型号")
|
||||
private String batteryModel;
|
||||
|
||||
@ApiModelProperty(value = "商品卖点")
|
||||
private String sellingPoint;
|
||||
|
||||
@ApiModelProperty(value = "库存总量")
|
||||
private Integer stockTotal;
|
||||
|
||||
@ApiModelProperty(value = "商品详情")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "电池租金")
|
||||
private BigDecimal batteryRent;
|
||||
|
||||
@ApiModelProperty(value = "电池价格")
|
||||
private BigDecimal batteryPrice;
|
||||
|
||||
@ApiModelProperty(value = "电池押金")
|
||||
private BigDecimal batteryDeposit;
|
||||
|
||||
@ApiModelProperty(value = "电池保险")
|
||||
private BigDecimal batteryInsurance;
|
||||
|
||||
@ApiModelProperty(value = "首付款")
|
||||
private BigDecimal downPayment;
|
||||
|
||||
@ApiModelProperty(value = "分期期数")
|
||||
private BigDecimal periods;
|
||||
|
||||
@ApiModelProperty(value = "分期还款")
|
||||
private BigDecimal repayment;
|
||||
|
||||
@ApiModelProperty(value = "手续费")
|
||||
private BigDecimal serviceCharges;
|
||||
|
||||
@ApiModelProperty(value = "分期方式 10按周 20按月")
|
||||
private Integer periodsType;
|
||||
|
||||
@ApiModelProperty(value = "订单编号")
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
79
src/main/java/com/gxwebsoft/apps/entity/EquipmentRecord.java
Normal file
79
src/main/java/com/gxwebsoft/apps/entity/EquipmentRecord.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 前世今生
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-12-03 01:23:53
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "EquipmentRecord对象", description = "前世今生")
|
||||
@TableName("apps_equipment_record")
|
||||
public class EquipmentRecord implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "记录ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "设备编码")
|
||||
private String equipmentCode;
|
||||
|
||||
@ApiModelProperty(value = "事件类型")
|
||||
private String eventType;
|
||||
|
||||
@ApiModelProperty(value = "请求参数")
|
||||
private String params;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "订单ID")
|
||||
private Integer orderId;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
@ApiModelProperty(value = "所属商户名称")
|
||||
@TableField(exist = false)
|
||||
private String merchantName;
|
||||
|
||||
@ApiModelProperty(value = "用户昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
}
|
||||
70
src/main/java/com/gxwebsoft/apps/entity/Hualala.java
Normal file
70
src/main/java/com/gxwebsoft/apps/entity/Hualala.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 常用链接推荐记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-11-25 12:55:33
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "Link对象", description = "常用链接推荐记录表")
|
||||
@TableName("apps_hualala")
|
||||
public class Hualala implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "当前请求的时间戳(毫秒)")
|
||||
@TableField(exist = false)
|
||||
private Long timestamp;
|
||||
|
||||
@ApiModelProperty(value = "服务器接口")
|
||||
@TableField(exist = false)
|
||||
private String apiUrl = "https://www-openapi.hualala.com";
|
||||
|
||||
@ApiModelProperty(value = "开发者Key")
|
||||
@TableField(exist = false)
|
||||
private String appKey = "2487";
|
||||
|
||||
@ApiModelProperty(value = "appSecret")
|
||||
@TableField(exist = false)
|
||||
private String appSecret = "Hgr520dQpEiFe0FV";
|
||||
|
||||
@ApiModelProperty(value = "集团ID")
|
||||
@TableField(exist = false)
|
||||
private String groupID = "1528";
|
||||
|
||||
@ApiModelProperty(value = "店铺ID")
|
||||
@TableField(exist = false)
|
||||
private String shopID = "76288809";
|
||||
|
||||
@ApiModelProperty(value = "签名")
|
||||
@TableField(exist = false)
|
||||
private String signature;
|
||||
|
||||
@ApiModelProperty(value = "版本号,固定传 3")
|
||||
@TableField(exist = false)
|
||||
private Integer version = 3;
|
||||
|
||||
@ApiModelProperty(value = "业务参数 格式为jsonString")
|
||||
@TableField(exist = false)
|
||||
private String requestBody;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
131
src/main/java/com/gxwebsoft/apps/entity/HualalaCard.java
Normal file
131
src/main/java/com/gxwebsoft/apps/entity/HualalaCard.java
Normal file
@@ -0,0 +1,131 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-08 12:22:50
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "HualalaCard对象", description = "")
|
||||
@TableName("apps_hualala_card")
|
||||
public class HualalaCard implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "groupID")
|
||||
private String groupId;
|
||||
|
||||
@ApiModelProperty(value = "shopID")
|
||||
private String shopId;
|
||||
|
||||
@ApiModelProperty(value = "网速会员id")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "会员卡ID")
|
||||
private String cardId;
|
||||
|
||||
private String cardTypeId;
|
||||
|
||||
@ApiModelProperty(value = "会员卡等级ID")
|
||||
private String cardLevelId;
|
||||
|
||||
@ApiModelProperty(value = "会员卡等级名称")
|
||||
private String cardLevelName;
|
||||
|
||||
@ApiModelProperty(value = "卡状态 10:正常 20:挂失中 30:冻结 40:注销(作废)50:已过期")
|
||||
private String cardStatus;
|
||||
|
||||
private String customerId;
|
||||
|
||||
@ApiModelProperty(value = "会员卡入会店铺字段")
|
||||
private String createShopId;
|
||||
|
||||
@ApiModelProperty(value = "入会店铺名称")
|
||||
private String createShopName;
|
||||
|
||||
@ApiModelProperty(value = "卡号")
|
||||
private String cardNo;
|
||||
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private String customerName;
|
||||
|
||||
@ApiModelProperty(value = " 手机号")
|
||||
private String customerMobile;
|
||||
|
||||
@ApiModelProperty(value = "性别 0:女 1:男 2:未知")
|
||||
private Integer customerSex;
|
||||
|
||||
@ApiModelProperty(value = "生日")
|
||||
private String customerBirthday;
|
||||
|
||||
@ApiModelProperty(value = "卡余额")
|
||||
private BigDecimal cardBalance;
|
||||
|
||||
@ApiModelProperty(value = "积分余额")
|
||||
private BigDecimal pointBalance;
|
||||
|
||||
@ApiModelProperty(value = "累计储值金额")
|
||||
private BigDecimal saveMoneyTotal;
|
||||
|
||||
@ApiModelProperty(value = "累计消费金额")
|
||||
private BigDecimal consumptionTotal;
|
||||
|
||||
@ApiModelProperty(value = "累计消费次数")
|
||||
private Integer consumptionCount;
|
||||
|
||||
@ApiModelProperty(value = "当前等级积分")
|
||||
private Integer grade;
|
||||
|
||||
@ApiModelProperty(value = "下一等级积分")
|
||||
private Integer nextLevelGrade;
|
||||
|
||||
@ApiModelProperty(value = "有效期至(yyyyMMddHHmmss) 0:表示永久有效")
|
||||
private String expireTime;
|
||||
|
||||
@ApiModelProperty(value = "最后一次交易时间")
|
||||
private String lastTransTime;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 会员权益
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-08 12:22:50
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "HualalaCardBenefits对象", description = "会员权益")
|
||||
@TableName("apps_hualala_card_benefits")
|
||||
public class HualalaCardBenefits implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "会员等级名称")
|
||||
private String cardLevelName;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "封面图")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "内容")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
16
src/main/java/com/gxwebsoft/apps/entity/HualalaCart.java
Normal file
16
src/main/java/com/gxwebsoft/apps/entity/HualalaCart.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 购物车
|
||||
*/
|
||||
@Data
|
||||
public class HualalaCart {
|
||||
List<HualalaFood> items;// 商品列表
|
||||
BigDecimal totalPrice; // 总结
|
||||
int totalNum; // 总数
|
||||
}
|
||||
78
src/main/java/com/gxwebsoft/apps/entity/HualalaCartFood.java
Normal file
78
src/main/java/com/gxwebsoft/apps/entity/HualalaCartFood.java
Normal file
@@ -0,0 +1,78 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 购物车商品
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-14 14:46:44
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "HualalaCartFood对象", description = "购物车商品")
|
||||
@TableName("apps_hualala_cart_food")
|
||||
public class HualalaCartFood implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "总数量")
|
||||
private Integer foodId;
|
||||
|
||||
@ApiModelProperty(value = "菜品名称")
|
||||
private String foodName;
|
||||
|
||||
@ApiModelProperty(value = "skuId")
|
||||
private String skuId;
|
||||
|
||||
@ApiModelProperty(value = "店铺id")
|
||||
private Integer shopId;
|
||||
|
||||
@ApiModelProperty(value = "店铺名称")
|
||||
private String shopName;
|
||||
|
||||
@ApiModelProperty(value = "店铺标志")
|
||||
private String shopLogo;
|
||||
|
||||
@ApiModelProperty(value = "商品图")
|
||||
private String coverUrl;
|
||||
|
||||
@ApiModelProperty(value = "已放入购物车数量")
|
||||
@TableField(exist = false)
|
||||
private Long num;
|
||||
|
||||
@ApiModelProperty(value = "售价")
|
||||
private BigDecimal sellPrice;
|
||||
|
||||
@ApiModelProperty(value = "库存")
|
||||
private Integer stock;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
300
src/main/java/com/gxwebsoft/apps/entity/HualalaFood.java
Normal file
300
src/main/java/com/gxwebsoft/apps/entity/HualalaFood.java
Normal file
@@ -0,0 +1,300 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜品分类
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-12 15:34:55
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "HualalaFood对象", description = "菜品分类")
|
||||
@TableName("apps_hualala_food")
|
||||
public class HualalaFood implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "菜品ID")
|
||||
private String foodId;
|
||||
|
||||
@ApiModelProperty(value = "菜品Key")
|
||||
private String foodKey;
|
||||
|
||||
@ApiModelProperty(value = "集团ID")
|
||||
private String groupId;
|
||||
|
||||
@ApiModelProperty(value = "店铺ID")
|
||||
private String shopId;
|
||||
|
||||
@ApiModelProperty(value = "菜品条目数")
|
||||
private String foodCount;
|
||||
|
||||
@ApiModelProperty(value = "加入购物车数量")
|
||||
@TableField(exist = false)
|
||||
private Integer cartNum;
|
||||
|
||||
@ApiModelProperty(value = "售价")
|
||||
@TableField(exist = false)
|
||||
private BigDecimal sellPrice;
|
||||
|
||||
@ApiModelProperty("子菜单")
|
||||
@TableField(exist = false)
|
||||
private List<HualalaFood> children;
|
||||
//
|
||||
// @ApiModelProperty(value = "pos菜品分类ID")
|
||||
// private String foodCategoryId;
|
||||
//
|
||||
// @ApiModelProperty(value = "pos菜品分类Key")
|
||||
// private String foodCategoryKey;
|
||||
//
|
||||
// @ApiModelProperty(value = "pos菜品分类名称")
|
||||
// private String foodCategoryName;
|
||||
|
||||
@ApiModelProperty(value = "线上菜品分类ID")
|
||||
private String foodOnlineCategoryId;
|
||||
|
||||
@ApiModelProperty(value = "线上菜品分类Key")
|
||||
private String foodOnlineCategoryKey;
|
||||
|
||||
@ApiModelProperty(value = "线上菜品分类名称")
|
||||
private String foodOnlineCategoryName;
|
||||
|
||||
@ApiModelProperty(value = "是/否是配料,false:不是 true:是")
|
||||
private Integer isBatching;
|
||||
|
||||
@ApiModelProperty(value = "是/否可单独销售 0:不单独销售(默认) 1:可单独销售")
|
||||
private Integer isSingleSale;
|
||||
|
||||
@ApiModelProperty(value = "此菜品关联的收入科目key,例如冷菜收入、热菜收入、酒水收入")
|
||||
private String foodSubjectKey;
|
||||
|
||||
@ApiModelProperty(value = "对应出品部门Key列表")
|
||||
private String departmentKeyLst;
|
||||
|
||||
@ApiModelProperty(value = "配菜的分类key,在这里选择配菜")
|
||||
private String batchingFoodCategoryKey;
|
||||
|
||||
@ApiModelProperty(value = "菜品名称")
|
||||
private String foodName;
|
||||
|
||||
@ApiModelProperty(value = "菜品编号 可用于与三方菜品数据做映射")
|
||||
private String foodCode;
|
||||
|
||||
@ApiModelProperty(value = "菜品别名")
|
||||
private String foodAliasName;
|
||||
|
||||
@ApiModelProperty(value = "菜品注记码")
|
||||
private String foodMnemonicCode;
|
||||
|
||||
@ApiModelProperty(value = "配菜的分类key,在这里选择配菜")
|
||||
private Integer isDiscount;
|
||||
|
||||
@ApiModelProperty(value = "规格")
|
||||
private Object units;
|
||||
|
||||
@ApiModelProperty(value = "起售")
|
||||
private String minOrderCount;
|
||||
|
||||
@ApiModelProperty(value = "分类编号")
|
||||
private String foodCategoryCode;
|
||||
|
||||
@ApiModelProperty(value = "分类英文名")
|
||||
private String foodCategoryEnName;
|
||||
|
||||
@ApiModelProperty(value = "分类分组名称")
|
||||
private String foodCategoryGroupName;
|
||||
|
||||
@ApiModelProperty(value = "0:堂食 1:堂食,外送,自提 2:外送,自提 3:自提 4:外送 5:堂食,自提 6:堂食,外送")
|
||||
private String takeawayTag;
|
||||
|
||||
@ApiModelProperty(value = "菜品图片")
|
||||
private String imgePath;
|
||||
|
||||
@ApiModelProperty(value = "结算系数")
|
||||
private String settlementProportion;
|
||||
|
||||
@ApiModelProperty(value = "分类显示排序值")
|
||||
private Integer sortIndex;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
// private Integer isComments;
|
||||
//
|
||||
// private Integer isActive;
|
||||
//
|
||||
// private Integer isOpen;
|
||||
//
|
||||
// private Integer isSetFood;
|
||||
//
|
||||
// private Object setFoodDetailJson;
|
||||
//
|
||||
// private Integer isTempFood;
|
||||
//
|
||||
// private String py;
|
||||
//
|
||||
//
|
||||
// private String tasteList;
|
||||
//
|
||||
// private Object tasteGroupList;
|
||||
//
|
||||
// private Object makingMethodList;
|
||||
//
|
||||
// private Object makingMethodGroupList;
|
||||
//
|
||||
// private Integer isSpecialty;
|
||||
//
|
||||
// private Integer isRecommend;
|
||||
//
|
||||
// private Integer isNews;
|
||||
//
|
||||
// private String hotTag;
|
||||
//
|
||||
// private String salesCount;
|
||||
//
|
||||
// private Integer isNeedConfirmFoodNumber;
|
||||
//
|
||||
// private String takeoutPackagingFee;
|
||||
//
|
||||
// private String incrementUnit;
|
||||
|
||||
// private Integer isHasImage;
|
||||
//
|
||||
// private String imageHwp;
|
||||
//
|
||||
// private String starLevel;
|
||||
//
|
||||
// private String foodTagIds;
|
||||
//
|
||||
private String parentFoodId;
|
||||
//
|
||||
// private String foodEnName;
|
||||
//
|
||||
// private Integer isAutoAdd;
|
||||
//
|
||||
// private Integer isCanRefund;
|
||||
//
|
||||
// private Integer setPerson;
|
||||
//
|
||||
// private Integer tasteIsRequired;
|
||||
//
|
||||
// private Integer tasteIsMultiple;
|
||||
//
|
||||
// private Integer makingMethodIsRequired;
|
||||
//
|
||||
// private Integer makingMethodIsMultiple;
|
||||
//
|
||||
// private String initClickAmount;
|
||||
//
|
||||
// private String actualClickAmount;
|
||||
//
|
||||
// private String recentClickAmount;
|
||||
//
|
||||
// private String clickAlertMess;
|
||||
//
|
||||
// private String sourceFoodId;
|
||||
//
|
||||
// private String salesCommission;
|
||||
//
|
||||
// private String foodKeyElementLst;
|
||||
//
|
||||
// private String foodSortIndex;
|
||||
//
|
||||
// private String actionTime;
|
||||
//
|
||||
// private String foodSubjectName;
|
||||
//
|
||||
// private String foodSubjectCode;
|
||||
//
|
||||
// private String departmentId;
|
||||
//
|
||||
// private String departmentKey;
|
||||
//
|
||||
// private String popularity;
|
||||
//
|
||||
// private String detailSplit;
|
||||
//
|
||||
// private String batchingIsFoodNumberRate;
|
||||
|
||||
// @ApiModelProperty(value = "特价")
|
||||
// private String specialPrice;
|
||||
//
|
||||
// @ApiModelProperty(value = "特价2")
|
||||
// private String specialPrice2;
|
||||
//
|
||||
// @ApiModelProperty(value = "特价2")
|
||||
// private String specialPrice3;
|
||||
//
|
||||
// @ApiModelProperty(value = "特价2")
|
||||
// private String specialPrice4;
|
||||
//
|
||||
// @ApiModelProperty(value = "特价2")
|
||||
// private String specialPrice5;
|
||||
//
|
||||
// @ApiModelProperty(value = "特价2")
|
||||
// private String specialPrice6;
|
||||
//
|
||||
// @ApiModelProperty(value = "特价2")
|
||||
// private String onlineWmPrice;
|
||||
//
|
||||
// @ApiModelProperty(value = "标签ids")
|
||||
// private String tagIds;
|
||||
//
|
||||
// @ApiModelProperty(value = "标签名称")
|
||||
// private String tagNames;
|
||||
//
|
||||
// @ApiModelProperty(value = "礼品券ID")
|
||||
// private String giftItemId;
|
||||
//
|
||||
// @ApiModelProperty(value = "礼品券有效期")
|
||||
// private String giftValidPeriod;
|
||||
//
|
||||
// @ApiModelProperty(value = "菜品分类说明")
|
||||
// private String description;
|
||||
//
|
||||
// @ApiModelProperty(value = "记录状态")
|
||||
// private String action;
|
||||
|
||||
// @ApiModelProperty(value = "封面图")
|
||||
// private String image;
|
||||
//
|
||||
// @ApiModelProperty(value = "内容")
|
||||
// private String content;
|
||||
//
|
||||
// @ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
// private Integer sortNumber;
|
||||
//
|
||||
// @ApiModelProperty(value = "备注")
|
||||
// private String comments;
|
||||
|
||||
// private String workingLunchTag;
|
||||
//
|
||||
// private String adsId;
|
||||
|
||||
}
|
||||
111
src/main/java/com/gxwebsoft/apps/entity/HualalaFoodCategory.java
Normal file
111
src/main/java/com/gxwebsoft/apps/entity/HualalaFoodCategory.java
Normal file
@@ -0,0 +1,111 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 菜品分类
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-12 09:49:46
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "HualalaFoodCategory对象", description = "菜品分类")
|
||||
@TableName("apps_hualala_food_category")
|
||||
public class HualalaFoodCategory implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "是/否配料分类 0:不是(默认) 1:是")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String foodCategoryName;
|
||||
|
||||
@ApiModelProperty(value = "收入名称")
|
||||
private String foodSubjectName;
|
||||
|
||||
@ApiModelProperty(value = "菜品Key")
|
||||
private String foodKey;
|
||||
|
||||
@ApiModelProperty(value = "菜品条目数")
|
||||
private String foodCount;
|
||||
|
||||
@ApiModelProperty(value = "分类ID")
|
||||
private String foodCategoryId;
|
||||
|
||||
@ApiModelProperty(value = "分类ID")
|
||||
private String foodCategoryGroupName;
|
||||
|
||||
@ApiModelProperty(value = "分类Key")
|
||||
private String foodCategoryKey;
|
||||
|
||||
@ApiModelProperty(value = "记录状态")
|
||||
private String action;
|
||||
|
||||
@ApiModelProperty(value = "结算系数")
|
||||
private String settlementProportion;
|
||||
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
private Integer isActive;
|
||||
|
||||
@ApiModelProperty(value = "是/否配料分类 0:不是(默认) 1:是")
|
||||
private Integer isBatching;
|
||||
|
||||
@ApiModelProperty(value = "是/否可单独销售 0:不单独销售(默认) 1:可单独销售")
|
||||
private Integer isSingleSale;
|
||||
|
||||
@ApiModelProperty(value = "分类显示排序值")
|
||||
private Integer sortIndex;
|
||||
|
||||
@ApiModelProperty(value = "介绍页id")
|
||||
private Integer adsId;
|
||||
|
||||
@ApiModelProperty(value = "店铺ID")
|
||||
private String shopId;
|
||||
|
||||
@ApiModelProperty(value = "封面图")
|
||||
private String image;
|
||||
|
||||
@ApiModelProperty(value = "内容")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "商户编码")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
117
src/main/java/com/gxwebsoft/apps/entity/HualalaShop.java
Normal file
117
src/main/java/com/gxwebsoft/apps/entity/HualalaShop.java
Normal file
@@ -0,0 +1,117 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 哗啦啦门店管理
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-12 18:24:44
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "HualalaShop对象", description = "哗啦啦门店管理")
|
||||
@TableName("apps_hualala_shop")
|
||||
public class HualalaShop implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "id")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "店铺ID")
|
||||
private Long shopId;
|
||||
|
||||
@ApiModelProperty(value = "店铺名称")
|
||||
private String shopName;
|
||||
|
||||
@ApiModelProperty(value = "店铺logo")
|
||||
private String logoUrl;
|
||||
|
||||
@ApiModelProperty(value = "所在城市ID")
|
||||
private String shopCity;
|
||||
|
||||
@ApiModelProperty(value = "所在城市")
|
||||
private String shopCityName;
|
||||
|
||||
@ApiModelProperty(value = "营业时间")
|
||||
private String shopOpenTime;
|
||||
|
||||
@ApiModelProperty(value = "店内电话")
|
||||
private String shopPhone;
|
||||
|
||||
@ApiModelProperty(value = "HLL")
|
||||
private String acspType;
|
||||
|
||||
@ApiModelProperty(value = "1")
|
||||
private String action;
|
||||
|
||||
@ApiModelProperty(value = "20230111104803")
|
||||
private String actionTime;
|
||||
|
||||
@ApiModelProperty(value = "品牌ID")
|
||||
private String brandId;
|
||||
|
||||
@ApiModelProperty(value = "品牌名称")
|
||||
private String brandName;
|
||||
|
||||
@ApiModelProperty(value = "1")
|
||||
private String businessModel;
|
||||
|
||||
@ApiModelProperty(value = "图片")
|
||||
private String imagePath;
|
||||
|
||||
@ApiModelProperty(value = "22.7913010")
|
||||
private Double mapLatitudeValueBaiDu;
|
||||
|
||||
@ApiModelProperty(value = "108.3312800")
|
||||
private Double mapLongitudeValueBaiDu;
|
||||
|
||||
@ApiModelProperty(value = "0")
|
||||
private Integer operationMode;
|
||||
|
||||
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "小通云缴商户号")
|
||||
private String payMerchantNo;
|
||||
|
||||
@ApiModelProperty(value = "小通云缴秘钥")
|
||||
private String paySecret;
|
||||
|
||||
@ApiModelProperty(value = "客户ID")
|
||||
private Integer customerId;
|
||||
|
||||
@ApiModelProperty(value = "距离")
|
||||
@TableField(exist = false)
|
||||
private Double distance;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
20
src/main/java/com/gxwebsoft/apps/entity/ItemVo.java
Normal file
20
src/main/java/com/gxwebsoft/apps/entity/ItemVo.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 操作购物车信息
|
||||
*/
|
||||
@Data
|
||||
public class ItemVo {
|
||||
private String userId; // 用户ID
|
||||
private String shopId; // 店铺ID
|
||||
private Integer foodId; // 菜品ID
|
||||
private Integer num; // 数量
|
||||
private BigDecimal price; // 售价
|
||||
private String imge; // 菜品图片
|
||||
private String foodName; // 菜品名称
|
||||
private String foodUnitID; // 规格ID
|
||||
}
|
||||
79
src/main/java/com/gxwebsoft/apps/entity/Link.java
Normal file
79
src/main/java/com/gxwebsoft/apps/entity/Link.java
Normal file
@@ -0,0 +1,79 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 常用链接推荐记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-11-25 12:55:33
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "Link对象", description = "常用链接推荐记录表")
|
||||
@TableName("apps_link")
|
||||
public class Link implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "链接ID")
|
||||
@TableId(value = "link_id", type = IdType.AUTO)
|
||||
private Integer linkId;
|
||||
|
||||
@ApiModelProperty(value = "链接名称")
|
||||
private String linkName;
|
||||
|
||||
@ApiModelProperty(value = "链接图标")
|
||||
private String linkIcon;
|
||||
|
||||
@ApiModelProperty(value = "路由地址")
|
||||
private String linkPath;
|
||||
|
||||
@ApiModelProperty(value = "组件路径")
|
||||
private String linkComponent;
|
||||
|
||||
@ApiModelProperty(value = "链接类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "点击次数")
|
||||
private Integer clicks;
|
||||
|
||||
@ApiModelProperty(value = "推荐理由")
|
||||
private String comments;
|
||||
|
||||
@ApiModelProperty(value = "文章排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@ApiModelProperty(value = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@ApiModelProperty(value = "商户编号")
|
||||
private String merchantCode;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
47
src/main/java/com/gxwebsoft/apps/entity/TestData.java
Normal file
47
src/main/java/com/gxwebsoft/apps/entity/TestData.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package com.gxwebsoft.apps.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 测试数据表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-02-01 12:13:46
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "TestData对象", description = "测试数据表")
|
||||
@TableName("apps_test_data")
|
||||
public class TestData implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(value = "内容")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@ApiModelProperty(value = "注册时间")
|
||||
private Date createTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/apps/mapper/BcAgentMapper.java
Normal file
37
src/main/java/com/gxwebsoft/apps/mapper/BcAgentMapper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.BcAgent;
|
||||
import com.gxwebsoft.apps.param.BcAgentParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代报餐管理Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-24 19:25:59
|
||||
*/
|
||||
public interface BcAgentMapper extends BaseMapper<BcAgent> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BcAgent>
|
||||
*/
|
||||
List<BcAgent> selectPageRel(@Param("page") IPage<BcAgent> page,
|
||||
@Param("param") BcAgentParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BcAgent> selectListRel(@Param("param") BcAgentParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.BcCookbook;
|
||||
import com.gxwebsoft.apps.param.BcCookbookParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 常用菜谱Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-05-05 14:56:54
|
||||
*/
|
||||
public interface BcCookbookMapper extends BaseMapper<BcCookbook> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BcCookbook>
|
||||
*/
|
||||
List<BcCookbook> selectPageRel(@Param("page") IPage<BcCookbook> page,
|
||||
@Param("param") BcCookbookParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BcCookbook> selectListRel(@Param("param") BcCookbookParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.BcEquipment;
|
||||
import com.gxwebsoft.apps.param.BcEquipmentParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报餐设备管理Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-05-02 10:34:40
|
||||
*/
|
||||
public interface BcEquipmentMapper extends BaseMapper<BcEquipment> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BcEquipment>
|
||||
*/
|
||||
List<BcEquipment> selectPageRel(@Param("page") IPage<BcEquipment> page,
|
||||
@Param("param") BcEquipmentParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BcEquipment> selectListRel(@Param("param") BcEquipmentParam param);
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/apps/mapper/BcExportMapper.java
Normal file
37
src/main/java/com/gxwebsoft/apps/mapper/BcExportMapper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.BcExport;
|
||||
import com.gxwebsoft.apps.param.BcExportParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 报餐统计导出Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-06-01 21:47:02
|
||||
*/
|
||||
public interface BcExportMapper extends BaseMapper<BcExport> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BcExport>
|
||||
*/
|
||||
List<BcExport> selectPageRel(@Param("page") IPage<BcExport> page,
|
||||
@Param("param") BcExportParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BcExport> selectListRel(@Param("param") BcExportParam param);
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/apps/mapper/BcFoodMapper.java
Normal file
37
src/main/java/com/gxwebsoft/apps/mapper/BcFoodMapper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.BcFood;
|
||||
import com.gxwebsoft.apps.param.BcFoodParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 发布菜品明细Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-27 17:59:40
|
||||
*/
|
||||
public interface BcFoodMapper extends BaseMapper<BcFood> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BcFood>
|
||||
*/
|
||||
List<BcFood> selectPageRel(@Param("page") IPage<BcFood> page,
|
||||
@Param("param") BcFoodParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BcFood> selectListRel(@Param("param") BcFoodParam param);
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/apps/mapper/BcPlanMapper.java
Normal file
37
src/main/java/com/gxwebsoft/apps/mapper/BcPlanMapper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.BcPlan;
|
||||
import com.gxwebsoft.apps.param.BcPlanParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜品发布管理Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-27 17:59:40
|
||||
*/
|
||||
public interface BcPlanMapper extends BaseMapper<BcPlan> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BcPlan>
|
||||
*/
|
||||
List<BcPlan> selectPageRel(@Param("page") IPage<BcPlan> page,
|
||||
@Param("param") BcPlanParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BcPlan> selectListRel(@Param("param") BcPlanParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.BcTemporary;
|
||||
import com.gxwebsoft.apps.param.BcTemporaryParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 临时报餐管理Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-24 21:47:57
|
||||
*/
|
||||
public interface BcTemporaryMapper extends BaseMapper<BcTemporary> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<BcTemporary>
|
||||
*/
|
||||
List<BcTemporary> selectPageRel(@Param("page") IPage<BcTemporary> page,
|
||||
@Param("param") BcTemporaryParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<BcTemporary> selectListRel(@Param("param") BcTemporaryParam param);
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/apps/mapper/CashierMapper.java
Normal file
37
src/main/java/com/gxwebsoft/apps/mapper/CashierMapper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.Cashier;
|
||||
import com.gxwebsoft.apps.param.CashierParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 海牛收银台记录表Mapper
|
||||
*
|
||||
* @author WebSoft
|
||||
* @since 2022-11-18 11:47:09
|
||||
*/
|
||||
public interface CashierMapper extends BaseMapper<Cashier> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<Cashier>
|
||||
*/
|
||||
List<Cashier> selectPageRel(@Param("page") IPage<Cashier> page,
|
||||
@Param("param") CashierParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<Cashier> selectListRel(@Param("param") CashierParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.EquipmentAlarm;
|
||||
import com.gxwebsoft.apps.param.EquipmentAlarmParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障报警记录Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-12-01 23:49:44
|
||||
*/
|
||||
public interface EquipmentAlarmMapper extends BaseMapper<EquipmentAlarm> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<EquipmentAlarm>
|
||||
*/
|
||||
List<EquipmentAlarm> selectPageRel(@Param("page") IPage<EquipmentAlarm> page,
|
||||
@Param("param") EquipmentAlarmParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<EquipmentAlarm> selectListRel(@Param("param") EquipmentAlarmParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.EquipmentFault;
|
||||
import com.gxwebsoft.apps.param.EquipmentFaultParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 故障电池Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-12-01 18:40:25
|
||||
*/
|
||||
public interface EquipmentFaultMapper extends BaseMapper<EquipmentFault> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<EquipmentFault>
|
||||
*/
|
||||
List<EquipmentFault> selectPageRel(@Param("page") IPage<EquipmentFault> page,
|
||||
@Param("param") EquipmentFaultParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<EquipmentFault> selectListRel(@Param("param") EquipmentFaultParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.EquipmentGoods;
|
||||
import com.gxwebsoft.apps.param.EquipmentGoodsParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电池管理记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-02-28 22:40:50
|
||||
*/
|
||||
public interface EquipmentGoodsMapper extends BaseMapper<EquipmentGoods> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<EquipmentGoods>
|
||||
*/
|
||||
List<EquipmentGoods> selectPageRel(@Param("page") IPage<EquipmentGoods> page,
|
||||
@Param("param") EquipmentGoodsParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<EquipmentGoods> selectListRel(@Param("param") EquipmentGoodsParam param);
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/apps/mapper/EquipmentMapper.java
Normal file
37
src/main/java/com/gxwebsoft/apps/mapper/EquipmentMapper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.Equipment;
|
||||
import com.gxwebsoft.apps.param.EquipmentParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备管理Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-11-30 02:11:16
|
||||
*/
|
||||
public interface EquipmentMapper extends BaseMapper<Equipment> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<Equipment>
|
||||
*/
|
||||
List<Equipment> selectPageRel(@Param("page") IPage<Equipment> page,
|
||||
@Param("param") EquipmentParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<Equipment> selectListRel(@Param("param") EquipmentParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.EquipmentOrderGoods;
|
||||
import com.gxwebsoft.apps.param.EquipmentOrderGoodsParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电池管理记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-05-11 19:10:13
|
||||
*/
|
||||
public interface EquipmentOrderGoodsMapper extends BaseMapper<EquipmentOrderGoods> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<EquipmentOrderGoods>
|
||||
*/
|
||||
List<EquipmentOrderGoods> selectPageRel(@Param("page") IPage<EquipmentOrderGoods> page,
|
||||
@Param("param") EquipmentOrderGoodsParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<EquipmentOrderGoods> selectListRel(@Param("param") EquipmentOrderGoodsParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.EquipmentOrder;
|
||||
import com.gxwebsoft.apps.param.EquipmentOrderParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-04-14 21:24:31
|
||||
*/
|
||||
public interface EquipmentOrderMapper extends BaseMapper<EquipmentOrder> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<EquipmentOrder>
|
||||
*/
|
||||
List<EquipmentOrder> selectPageRel(@Param("page") IPage<EquipmentOrder> page,
|
||||
@Param("param") EquipmentOrderParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<EquipmentOrder> selectListRel(@Param("param") EquipmentOrderParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.EquipmentRecord;
|
||||
import com.gxwebsoft.apps.param.EquipmentRecordParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 前世今生Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-12-03 01:23:53
|
||||
*/
|
||||
public interface EquipmentRecordMapper extends BaseMapper<EquipmentRecord> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<EquipmentRecord>
|
||||
*/
|
||||
List<EquipmentRecord> selectPageRel(@Param("page") IPage<EquipmentRecord> page,
|
||||
@Param("param") EquipmentRecordParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<EquipmentRecord> selectListRel(@Param("param") EquipmentRecordParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.HualalaCardBenefits;
|
||||
import com.gxwebsoft.apps.param.HualalaCardBenefitsParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员权益Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-08 12:22:50
|
||||
*/
|
||||
public interface HualalaCardBenefitsMapper extends BaseMapper<HualalaCardBenefits> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<HualalaCardBenefits>
|
||||
*/
|
||||
List<HualalaCardBenefits> selectPageRel(@Param("page") IPage<HualalaCardBenefits> page,
|
||||
@Param("param") HualalaCardBenefitsParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<HualalaCardBenefits> selectListRel(@Param("param") HualalaCardBenefitsParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.HualalaCard;
|
||||
import com.gxwebsoft.apps.param.HualalaCardParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-08 12:22:50
|
||||
*/
|
||||
public interface HualalaCardMapper extends BaseMapper<HualalaCard> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<HualalaCard>
|
||||
*/
|
||||
List<HualalaCard> selectPageRel(@Param("page") IPage<HualalaCard> page,
|
||||
@Param("param") HualalaCardParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<HualalaCard> selectListRel(@Param("param") HualalaCardParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.HualalaCartFood;
|
||||
import com.gxwebsoft.apps.param.HualalaCartFoodParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 购物车商品Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-14 14:46:44
|
||||
*/
|
||||
public interface HualalaCartFoodMapper extends BaseMapper<HualalaCartFood> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<HualalaCartFood>
|
||||
*/
|
||||
List<HualalaCartFood> selectPageRel(@Param("page") IPage<HualalaCartFood> page,
|
||||
@Param("param") HualalaCartFoodParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<HualalaCartFood> selectListRel(@Param("param") HualalaCartFoodParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.HualalaFoodCategory;
|
||||
import com.gxwebsoft.apps.param.HualalaFoodCategoryParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜品分类Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-12 09:49:46
|
||||
*/
|
||||
public interface HualalaFoodCategoryMapper extends BaseMapper<HualalaFoodCategory> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<HualalaFoodCategory>
|
||||
*/
|
||||
List<HualalaFoodCategory> selectPageRel(@Param("page") IPage<HualalaFoodCategory> page,
|
||||
@Param("param") HualalaFoodCategoryParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<HualalaFoodCategory> selectListRel(@Param("param") HualalaFoodCategoryParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.HualalaFood;
|
||||
import com.gxwebsoft.apps.param.HualalaFoodParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜品分类Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-12 15:34:55
|
||||
*/
|
||||
public interface HualalaFoodMapper extends BaseMapper<HualalaFood> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<HualalaFood>
|
||||
*/
|
||||
List<HualalaFood> selectPageRel(@Param("page") IPage<HualalaFood> page,
|
||||
@Param("param") HualalaFoodParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<HualalaFood> selectListRel(@Param("param") HualalaFoodParam param);
|
||||
|
||||
}
|
||||
20
src/main/java/com/gxwebsoft/apps/mapper/HualalaMapper.java
Normal file
20
src/main/java/com/gxwebsoft/apps/mapper/HualalaMapper.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.Hualala;
|
||||
import com.gxwebsoft.apps.entity.Link;
|
||||
import com.gxwebsoft.apps.param.LinkParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 哗啦啦Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-11-25 12:55:33
|
||||
*/
|
||||
public interface HualalaMapper extends BaseMapper<Hualala> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.HualalaShop;
|
||||
import com.gxwebsoft.apps.param.HualalaShopParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 哗啦啦门店管理Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-01-12 18:24:44
|
||||
*/
|
||||
public interface HualalaShopMapper extends BaseMapper<HualalaShop> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<HualalaShop>
|
||||
*/
|
||||
List<HualalaShop> selectPageRel(@Param("page") IPage<HualalaShop> page,
|
||||
@Param("param") HualalaShopParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<HualalaShop> selectListRel(@Param("param") HualalaShopParam param);
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/apps/mapper/LinkMapper.java
Normal file
37
src/main/java/com/gxwebsoft/apps/mapper/LinkMapper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.Link;
|
||||
import com.gxwebsoft.apps.param.LinkParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 常用链接推荐记录表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2022-11-25 12:55:33
|
||||
*/
|
||||
public interface LinkMapper extends BaseMapper<Link> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<Link>
|
||||
*/
|
||||
List<Link> selectPageRel(@Param("page") IPage<Link> page,
|
||||
@Param("param") LinkParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<Link> selectListRel(@Param("param") LinkParam param);
|
||||
|
||||
}
|
||||
37
src/main/java/com/gxwebsoft/apps/mapper/TestDataMapper.java
Normal file
37
src/main/java/com/gxwebsoft/apps/mapper/TestDataMapper.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.gxwebsoft.apps.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.gxwebsoft.apps.entity.TestData;
|
||||
import com.gxwebsoft.apps.param.TestDataParam;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 测试数据表Mapper
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2023-02-01 12:13:46
|
||||
*/
|
||||
public interface TestDataMapper extends BaseMapper<TestData> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page 分页对象
|
||||
* @param param 查询参数
|
||||
* @return List<TestData>
|
||||
*/
|
||||
List<TestData> selectPageRel(@Param("page") IPage<TestData> page,
|
||||
@Param("param") TestDataParam param);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param param 查询参数
|
||||
* @return List<User>
|
||||
*/
|
||||
List<TestData> selectListRel(@Param("param") TestDataParam param);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.apps.mapper.BcAgentMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.nickname,c.nickname as parentName
|
||||
FROM apps_bc_agent a
|
||||
LEFT JOIN sys_user b ON a.user_id = b.user_id
|
||||
LEFT JOIN sys_user c ON a.parent_id = c.user_id
|
||||
<where>
|
||||
<if test="param.agentId != null">
|
||||
AND a.agent_id = #{param.agentId}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.parentId != null">
|
||||
AND a.parent_id = #{param.parentId}
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
AND b.deleted = 0 AND c.deleted = 0
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.BcAgent">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.apps.entity.BcAgent">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.apps.mapper.BcCookbookMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM apps_bc_cookbook a
|
||||
<where>
|
||||
<if test="param.cookbookId != null">
|
||||
AND a.cookbook_id = #{param.cookbookId}
|
||||
</if>
|
||||
<if test="param.planId != null">
|
||||
AND a.plan_id = #{param.planId}
|
||||
</if>
|
||||
<if test="param.period != null">
|
||||
AND a.period LIKE CONCAT('%', #{param.period}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.BcCookbook">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.apps.entity.BcCookbook">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.apps.mapper.BcEquipmentMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM apps_bc_equipment a
|
||||
<where>
|
||||
<if test="param.bcEquipmentId != null">
|
||||
AND a.bc_equipment_id = #{param.bcEquipmentId}
|
||||
</if>
|
||||
<if test="param.equipmentName != null">
|
||||
AND a.equipment_name LIKE CONCAT('%', #{param.equipmentName}, '%')
|
||||
</if>
|
||||
<if test="param.equipmentCode != null">
|
||||
AND a.equipment_code LIKE CONCAT('%', #{param.equipmentCode}, '%')
|
||||
</if>
|
||||
<if test="param.qrcode != null">
|
||||
AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%')
|
||||
</if>
|
||||
<if test="param.content != null">
|
||||
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.merchantCode != null">
|
||||
AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%')
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.BcEquipment">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.apps.entity.BcEquipment">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.apps.mapper.BcExportMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM apps_bc_export a
|
||||
<where>
|
||||
<if test="param.exportId != null">
|
||||
AND a.export_id = #{param.exportId}
|
||||
</if>
|
||||
<if test="param.organizationName != null">
|
||||
AND a.organization_name LIKE CONCAT('%', #{param.organizationName}, '%')
|
||||
</if>
|
||||
<if test="param.expendMoney != null">
|
||||
AND a.expend_money = #{param.expendMoney}
|
||||
</if>
|
||||
<if test="param.breakfastPost != null">
|
||||
AND a.breakfast_post = #{param.breakfastPost}
|
||||
</if>
|
||||
<if test="param.breakfastSign != null">
|
||||
AND a.breakfast_sign = #{param.breakfastSign}
|
||||
</if>
|
||||
<if test="param.lunchPost != null">
|
||||
AND a.lunch_post = #{param.lunchPost}
|
||||
</if>
|
||||
<if test="param.lunchSign != null">
|
||||
AND a.lunch_sign = #{param.lunchSign}
|
||||
</if>
|
||||
<if test="param.dinnerPost != null">
|
||||
AND a.dinner_post = #{param.dinnerPost}
|
||||
</if>
|
||||
<if test="param.dinnerSign != null">
|
||||
AND a.dinner_sign = #{param.dinnerSign}
|
||||
</if>
|
||||
<if test="param.goodsPrice != null">
|
||||
AND a.goods_price = #{param.goodsPrice}
|
||||
</if>
|
||||
<if test="param.deliveryTime != null">
|
||||
AND a.delivery_time LIKE CONCAT('%', #{param.deliveryTime}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.orderId != null">
|
||||
AND a.order_id = #{param.orderId}
|
||||
</if>
|
||||
<if test="param.organizationId != null">
|
||||
AND a.organization_id = #{param.organizationId}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.BcExport">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.apps.entity.BcExport">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
57
src/main/java/com/gxwebsoft/apps/mapper/xml/BcFoodMapper.xml
Normal file
57
src/main/java/com/gxwebsoft/apps/mapper/xml/BcFoodMapper.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.apps.mapper.BcFoodMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.nickname
|
||||
FROM apps_bc_food a
|
||||
LEFT JOIN sys_user b ON a.user_id = b.user_id
|
||||
<where>
|
||||
<if test="param.bcFoodId != null">
|
||||
AND a.bc_food_id = #{param.bcFoodId}
|
||||
</if>
|
||||
<if test="param.planId != null">
|
||||
AND a.plan_id = #{param.planId}
|
||||
</if>
|
||||
<if test="param.period != null">
|
||||
AND a.period LIKE CONCAT('%', #{param.period}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.keywords != null">
|
||||
AND ( b.nickname LIKE CONCAT('%', #{param.keywords}, '%') )
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.BcFood">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.apps.entity.BcFood">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
67
src/main/java/com/gxwebsoft/apps/mapper/xml/BcPlanMapper.xml
Normal file
67
src/main/java/com/gxwebsoft/apps/mapper/xml/BcPlanMapper.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.apps.mapper.BcPlanMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.nickname
|
||||
FROM apps_bc_plan a
|
||||
LEFT JOIN sys_user b ON a.user_id = b.user_id
|
||||
<where>
|
||||
<if test="param.bcPlanId != null">
|
||||
AND a.bc_plan_id = #{param.bcPlanId}
|
||||
</if>
|
||||
<if test="param.dayTime != null">
|
||||
AND a.day_time LIKE CONCAT('%', #{param.dayTime}, '%')
|
||||
</if>
|
||||
<if test="param.week != null">
|
||||
AND a.week = #{param.week}
|
||||
</if>
|
||||
<if test="param.type != null">
|
||||
AND a.type LIKE CONCAT('%', #{param.type}, '%')
|
||||
</if>
|
||||
<if test="param.expirationTime != null">
|
||||
AND a.expiration_time LIKE CONCAT('%', #{param.expirationTime}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.day_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.day_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.oldTime != null">
|
||||
AND a.day_time = #{param.oldTime}
|
||||
</if>
|
||||
|
||||
<if test="param.keywords != null">
|
||||
AND ( b.nickname LIKE CONCAT('%', #{param.keywords}, '%') OR a.day_time LIKE CONCAT('%', #{param.keywords}, '%') )
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.BcPlan">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.apps.entity.BcPlan">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.apps.mapper.BcTemporaryMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.nickname
|
||||
FROM apps_bc_temporary a
|
||||
LEFT JOIN sys_user b ON a.user_id = b.user_id
|
||||
<where>
|
||||
<if test="param.temporaryId != null">
|
||||
AND a.temporary_id = #{param.temporaryId}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.parentId != null">
|
||||
AND a.parent_id = #{param.parentId}
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.applyStatus != null">
|
||||
AND a.apply_status = #{param.applyStatus}
|
||||
</if>
|
||||
<if test="param.dayTime != null">
|
||||
AND a.expiration_time >= #{param.dayTime}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.BcTemporary">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.apps.entity.BcTemporary">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,86 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.apps.mapper.CashierMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*
|
||||
FROM apps_cashier a
|
||||
<where>
|
||||
<if test="param.cashierId != null">
|
||||
AND a.cashier_id = #{param.cashierId}
|
||||
</if>
|
||||
<if test="param.buyerId != null">
|
||||
AND a.buyer_id LIKE CONCAT('%', #{param.buyerId}, '%')
|
||||
</if>
|
||||
<if test="param.merchantCode != null">
|
||||
AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%')
|
||||
</if>
|
||||
<if test="param.code != null">
|
||||
AND a.code LIKE CONCAT('%', #{param.code}, '%')
|
||||
</if>
|
||||
<if test="param.msg != null">
|
||||
AND a.msg LIKE CONCAT('%', #{param.msg}, '%')
|
||||
</if>
|
||||
<if test="param.outTradeNo != null">
|
||||
AND a.out_trade_no LIKE CONCAT('%', #{param.outTradeNo}, '%')
|
||||
</if>
|
||||
<if test="param.amount != null">
|
||||
AND a.amount LIKE CONCAT('%', #{param.amount}, '%')
|
||||
</if>
|
||||
<if test="param.payTime != null">
|
||||
AND a.pay_time LIKE CONCAT('%', #{param.payTime}, '%')
|
||||
</if>
|
||||
<if test="param.payType != null">
|
||||
AND a.pay_type LIKE CONCAT('%', #{param.payType}, '%')
|
||||
</if>
|
||||
<if test="param.totalAmount != null">
|
||||
AND a.total_amount = #{param.totalAmount}
|
||||
</if>
|
||||
<if test="param.receiptAmount != null">
|
||||
AND a.receipt_amount = #{param.receiptAmount}
|
||||
</if>
|
||||
<if test="param.feeAmount != null">
|
||||
AND a.fee_amount = #{param.feeAmount}
|
||||
</if>
|
||||
<if test="param.settleAmount != null">
|
||||
AND a.settle_amount = #{param.settleAmount}
|
||||
</if>
|
||||
<if test="param.merchantName != null">
|
||||
AND a.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%')
|
||||
</if>
|
||||
<if test="param.mobile != null">
|
||||
AND a.mobile LIKE CONCAT('%', #{param.mobile}, '%')
|
||||
</if>
|
||||
<if test="param.orderRemark != null">
|
||||
AND a.order_remark LIKE CONCAT('%', #{param.orderRemark}, '%')
|
||||
</if>
|
||||
<if test="param.orderStatus != null">
|
||||
AND a.order_status LIKE CONCAT('%', #{param.orderStatus}, '%')
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.Cashier">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.apps.entity.Cashier">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.apps.mapper.EquipmentAlarmMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,
|
||||
b.merchant_name,b.merchant_code
|
||||
FROM apps_equipment_alarm a
|
||||
LEFT JOIN shop_merchant b ON a.merchant_code = b.merchant_code
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.equipmentCode != null">
|
||||
AND a.equipment_code LIKE CONCAT('%', #{param.equipmentCode}, '%')
|
||||
</if>
|
||||
<if test="param.alarmType != null">
|
||||
AND a.alarm_type LIKE CONCAT('%', #{param.alarmType}, '%')
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.handleTime != null">
|
||||
AND a.handle_time LIKE CONCAT('%', #{param.handleTime}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.merchantCode != null">
|
||||
AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%')
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.merchantName != null">
|
||||
AND b.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%')
|
||||
</if>
|
||||
<if test="param.merchantCode != null">
|
||||
AND b.merchant_code = #{param.merchantCode}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.EquipmentAlarm">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.apps.entity.EquipmentAlarm">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.apps.mapper.EquipmentFaultMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,
|
||||
b.merchant_name,b.merchant_code
|
||||
FROM apps_equipment_fault a
|
||||
LEFT JOIN shop_merchant b ON a.merchant_code = b.merchant_code
|
||||
<where>
|
||||
<if test="param.id != null">
|
||||
AND a.id = #{param.id}
|
||||
</if>
|
||||
<if test="param.equipmentCode != null">
|
||||
AND a.equipment_code = #{param.equipmentCode}
|
||||
</if>
|
||||
<if test="param.faultType != null">
|
||||
AND a.fault_type LIKE CONCAT('%', #{param.faultType}, '%')
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.handleTime != null">
|
||||
AND a.handle_time LIKE CONCAT('%', #{param.handleTime}, '%')
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.merchantCode != null">
|
||||
AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%')
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.merchantName != null">
|
||||
AND b.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%')
|
||||
</if>
|
||||
<if test="param.merchantCode != null">
|
||||
AND b.merchant_code = #{param.merchantCode}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.EquipmentFault">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.apps.entity.EquipmentFault">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,94 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.apps.mapper.EquipmentGoodsMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,
|
||||
b.merchant_name,b.merchant_code
|
||||
FROM apps_equipment_goods a
|
||||
LEFT JOIN shop_merchant b ON a.merchant_code = b.merchant_code
|
||||
<where>
|
||||
<if test="param.goodsId != null">
|
||||
AND a.goods_id = #{param.goodsId}
|
||||
</if>
|
||||
<if test="param.equipmentCategory != null">
|
||||
AND a.equipment_category LIKE CONCAT('%', #{param.equipment_category}, '%')
|
||||
</if>
|
||||
<if test="param.image != null">
|
||||
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||
</if>
|
||||
<if test="param.goodsName != null">
|
||||
AND a.goods_name LIKE CONCAT('%', #{param.goodsName}, '%')
|
||||
</if>
|
||||
<if test="param.qrcode != null">
|
||||
AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%')
|
||||
</if>
|
||||
<if test="param.categoryId != null">
|
||||
AND a.category_id = #{param.categoryId}
|
||||
</if>
|
||||
<if test="param.batteryModel != null">
|
||||
AND a.battery_model LIKE CONCAT('%', #{param.batteryModel}, '%')
|
||||
</if>
|
||||
<if test="param.content != null">
|
||||
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||
</if>
|
||||
<if test="param.batteryRent != null">
|
||||
AND a.battery_rent = #{param.batteryRent}
|
||||
</if>
|
||||
<if test="param.batteryPrice != null">
|
||||
AND a.battery_price = #{param.batteryPrice}
|
||||
</if>
|
||||
<if test="param.batteryDeposit != null">
|
||||
AND a.battery_deposit = #{param.batteryDeposit}
|
||||
</if>
|
||||
<if test="param.batteryInsurance != null">
|
||||
AND a.battery_insurance = #{param.batteryInsurance}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.merchantCode != null">
|
||||
AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%')
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.merchantCode != null">
|
||||
AND a.merchant_code <= #{param.merchantCode}
|
||||
</if>
|
||||
<if test="param.merchantName != null">
|
||||
AND b.merchant_name <= #{param.merchantName}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.EquipmentGoods">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.apps.entity.EquipmentGoods">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
121
src/main/java/com/gxwebsoft/apps/mapper/xml/EquipmentMapper.xml
Normal file
121
src/main/java/com/gxwebsoft/apps/mapper/xml/EquipmentMapper.xml
Normal file
@@ -0,0 +1,121 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.gxwebsoft.apps.mapper.EquipmentMapper">
|
||||
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,
|
||||
b.merchant_name,b.merchant_code
|
||||
FROM apps_equipment a
|
||||
LEFT JOIN shop_merchant b ON a.merchant_code = b.merchant_code
|
||||
<where>
|
||||
<if test="param.equipmentId != null">
|
||||
AND a.equipment_id = #{param.equipmentId}
|
||||
</if>
|
||||
<if test="param.equipmentName != null">
|
||||
AND a.equipment_name LIKE CONCAT('%', #{param.equipmentName}, '%')
|
||||
</if>
|
||||
<if test="param.equipmentCode != null">
|
||||
AND a.equipment_code LIKE CONCAT('%', #{param.equipmentCode}, '%')
|
||||
</if>
|
||||
<if test="param.equipmentCategory != null">
|
||||
AND a.equipment_category LIKE CONCAT('%', #{param.equipmentCategory}, '%')
|
||||
</if>
|
||||
<if test="param.equipmentAvatar != null">
|
||||
AND a.equipment_avatar LIKE CONCAT('%', #{param.equipmentAvatar}, '%')
|
||||
</if>
|
||||
<if test="param.batteryModel != null">
|
||||
AND a.battery_model LIKE CONCAT('%', #{param.batteryModel}, '%')
|
||||
</if>
|
||||
<if test="param.bms != null">
|
||||
AND a.bms LIKE CONCAT('%', #{param.bms}, '%')
|
||||
</if>
|
||||
<if test="param.content != null">
|
||||
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||
</if>
|
||||
<if test="param.isCtive != null">
|
||||
AND a.is_ctive LIKE CONCAT('%', #{param.isCtive}, '%')
|
||||
</if>
|
||||
<if test="param.workingStatus != null">
|
||||
AND a.working_status LIKE CONCAT('%', #{param.workingStatus}, '%')
|
||||
</if>
|
||||
<if test="param.leaseStatus != null">
|
||||
AND a.lease_status LIKE CONCAT('%', #{param.leaseStatus}, '%')
|
||||
</if>
|
||||
<if test="param.batteryStatus != null">
|
||||
AND a.battery_status LIKE CONCAT('%', #{param.batteryStatus}, '%')
|
||||
</if>
|
||||
<if test="param.batteryPower != null">
|
||||
AND a.battery_power LIKE CONCAT('%', #{param.batteryPower}, '%')
|
||||
</if>
|
||||
<if test="param.isOnline != null">
|
||||
AND a.is_online LIKE CONCAT('%', #{param.isOnline}, '%')
|
||||
</if>
|
||||
<if test="param.totalVoltage != null">
|
||||
AND a.total_voltage LIKE CONCAT('%', #{param.totalVoltage}, '%')
|
||||
</if>
|
||||
<if test="param.bmsBrand != null">
|
||||
AND a.bms_brand LIKE CONCAT('%', #{param.bmsBrand}, '%')
|
||||
</if>
|
||||
<if test="param.surplusCapacity != null">
|
||||
AND a.surplus_capacity LIKE CONCAT('%', #{param.surplusCapacity}, '%')
|
||||
</if>
|
||||
<if test="param.iccid != null">
|
||||
AND a.iccid LIKE CONCAT('%', #{param.iccid}, '%')
|
||||
</if>
|
||||
<if test="param.ctiveTime != null">
|
||||
AND a.ctive_time LIKE CONCAT('%', #{param.ctiveTime}, '%')
|
||||
</if>
|
||||
<if test="param.batteryDeliveryTime != null">
|
||||
AND a.battery_delivery_time LIKE CONCAT('%', #{param.batteryDeliveryTime}, '%')
|
||||
</if>
|
||||
<if test="param.orderId != null">
|
||||
AND a.order_id = #{param.orderId}
|
||||
</if>
|
||||
<if test="param.userId != null">
|
||||
AND a.user_id = #{param.userId}
|
||||
</if>
|
||||
<if test="param.merchantCode != null">
|
||||
AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%')
|
||||
</if>
|
||||
<if test="param.sortNumber != null">
|
||||
AND a.sort_number = #{param.sortNumber}
|
||||
</if>
|
||||
<if test="param.comments != null">
|
||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||
</if>
|
||||
<if test="param.status != null">
|
||||
AND a.status = #{param.status}
|
||||
</if>
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
<if test="param.createTimeStart != null">
|
||||
AND a.create_time >= #{param.createTimeStart}
|
||||
</if>
|
||||
<if test="param.createTimeEnd != null">
|
||||
AND a.create_time <= #{param.createTimeEnd}
|
||||
</if>
|
||||
<if test="param.merchantName != null">
|
||||
AND b.merchant_name LIKE CONCAT('%', #{param.merchantName}, '%')
|
||||
</if>
|
||||
<if test="param.merchantCode != null">
|
||||
AND b.merchant_code = #{param.merchantCode}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectPageRel" resultType="com.gxwebsoft.apps.entity.Equipment">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
<!-- 查询全部 -->
|
||||
<select id="selectListRel" resultType="com.gxwebsoft.apps.entity.Equipment">
|
||||
<include refid="selectSql"></include>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user