diff --git a/bweb/src/main/java/com/bweb/controller/SecMenuController.java b/bweb/src/main/java/com/bweb/controller/SecMenuController.java index bec13a5..9f68e21 100644 --- a/bweb/src/main/java/com/bweb/controller/SecMenuController.java +++ b/bweb/src/main/java/com/bweb/controller/SecMenuController.java @@ -1,17 +1,12 @@ package com.bweb.controller; import com.alibaba.fastjson.JSONObject; -import com.github.pagehelper.PageHelper; -import com.github.pagehelper.PageInfo; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; -import com.hfkj.common.utils.HttpUtils; -import com.hfkj.common.utils.HttpsUtils; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.SecMenu; import com.hfkj.entity.SecRoleMenuRel; -import com.hfkj.model.MenuTreeModel; import com.hfkj.model.ResponseData; import com.hfkj.service.SecMenuService; import com.hfkj.service.SecRoleMenuRelService; @@ -26,7 +21,6 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.*; -import java.util.function.Function; import java.util.stream.Collectors; /** @@ -174,39 +168,10 @@ public class SecMenuController { try { // 查询角色菜单权限 - Map roleMenu = secMenuService.queryRoleMenu(roleId, SecMenuTypeEnum.type1).stream() - .collect(Collectors.toMap(SecMenu::getId, Function.identity())); + List roleMenuList = secRoleMenuRelService.getRelListByRole(roleId); - // 系统菜单叶节点 - List menuLeafList = new ArrayList<>(); - - // 角色菜单叶节点 - List roleLeafList = new ArrayList<>(); - - // 获取全部菜单 - List menuList = secMenuService.getAllList(); - - // 获取最顶层菜单 - List topLevelMenuList = menuList.stream() - .filter(o -> o.getMenuPSid() == null) - .sorted(Comparator.comparing(SecMenu::getMenuSort)) - .collect(Collectors.toList()); - // 递归获取系统菜单叶子节点 - for (SecMenu topLevelMenu : topLevelMenuList) { - if (topLevelMenu.getMenuType().equals(SecMenuTypeEnum.type1.getCode())) { - recursionMenu(menuList, topLevelMenu.getId(), menuLeafList); - } - } - - // 筛选角色菜单叶节点 - for (String leaf : menuLeafList) { - SecMenu menu = roleMenu.get(Long.parseLong(leaf)); - if (menu != null) { - roleLeafList.add(""+menu.getId()); - } - } - - return ResponseMsgUtil.success(roleLeafList); + return ResponseMsgUtil.success(roleMenuList.stream().map(SecRoleMenuRel::getMenuId).collect(Collectors.toList()) + .stream().map(Object::toString).collect(Collectors.toList())); } catch (Exception e) { log.error("error!",e); @@ -247,11 +212,11 @@ public class SecMenuController { for (SecMenu topLevelMenu : topLevelMenuList) { if (topLevelMenu.getMenuType().equals(SecMenuTypeEnum.type1.getCode())) { - map = new LinkedHashMap<>(); + map = new HashMap<>(); map.put("key", ""+topLevelMenu.getId()); map.put("title", topLevelMenu.getMenuName()); // 获取下级菜单 - map.put("children", recursionMenu(menuList, topLevelMenu.getId(), new ArrayList<>())); + map.put("children", recursionMenu(menuList, topLevelMenu.getId())); mapList.add(map); } } @@ -270,7 +235,7 @@ public class SecMenuController { * @param parentMenuId 父级菜单id * @return */ - public List> recursionMenu(List dataSource, Long parentMenuId, List leaf) { + public List> recursionMenu(List dataSource, Long parentMenuId) { List> mapList = new ArrayList<>(); Map map; @@ -280,13 +245,12 @@ public class SecMenuController { .collect(Collectors.toList()); for (SecMenu menu : collect) { if (menu.getMenuType().equals(SecMenuTypeEnum.type1.getCode())) { - map = new LinkedHashMap<>(); + map = new HashMap<>(); map.put("key", ""+menu.getId()); map.put("title", menu.getMenuName()); // 获取下级菜单 - List> recursioned = recursionMenu(dataSource, menu.getId(), leaf); + List> recursioned = recursionMenu(dataSource, menu.getId()); if (recursioned.isEmpty()) { - leaf.add(""+menu.getId()); map.put("isLeaf", true); } else { map.put("children", recursioned); @@ -297,5 +261,4 @@ public class SecMenuController { return mapList; } - } diff --git a/bweb/src/main/java/com/bweb/controller/TestController.java b/bweb/src/main/java/com/bweb/controller/TestController.java index 10b66ee..34801df 100644 --- a/bweb/src/main/java/com/bweb/controller/TestController.java +++ b/bweb/src/main/java/com/bweb/controller/TestController.java @@ -1,19 +1,22 @@ package com.bweb.controller; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.DateUtil; import com.hfkj.common.utils.OrderUtil; import com.hfkj.common.utils.ResponseMsgUtil; -import com.hfkj.entity.CouponDiscountGoodsRel; -import com.hfkj.entity.GoodsMsg; -import com.hfkj.entity.GoodsSpecs; +import com.hfkj.entity.*; import com.hfkj.model.ResponseData; import com.hfkj.service.discount.CouponDiscountService; +import com.hfkj.service.goods.BsOrderGoodsService; import com.hfkj.service.goods.GoodsMsgService; import com.hfkj.service.goods.GoodsSpecsService; import com.hfkj.service.hlt.HltCanteenService; import com.hfkj.service.hlt.HuiLianTongUnionCardService; +import com.hfkj.service.order.BsOrderChildService; +import com.hfkj.sysenum.order.OrderLogisticsStatusEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; @@ -44,6 +47,13 @@ public class TestController { @Resource private CouponDiscountService couponDiscountService; + @Resource + private BsOrderChildService orderChildService; + @Resource + private BsOrderGoodsService orderGoodsService; + @Resource + private BsOrderGoodsService bsOrderGoodsService; + @RequestMapping(value="/canteenConsume",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "食堂消费") @@ -100,4 +110,63 @@ public class TestController { return ResponseMsgUtil.exception(e); } } + + @RequestMapping(value="/orderGoodsUpdate",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "商品更新") + public ResponseData orderGoodsUpdate() { + try { + + + List orderGoodsList = orderGoodsService.getList(); + + for (BsOrderGoods goods : orderGoodsList) { + BsOrderChild child = orderChildService.getDetail(goods.getChildOrderNo()); + goods.setStatus(child.getStatus()); + goods.setUpdateTime(new Date()); + orderGoodsService.update(goods); + } + + return ResponseMsgUtil.success("成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/orderGoodsConfirmReceipt",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "商品确认收货") + public ResponseData orderGoodsConfirmReceipt() { + try { + + Map map = new HashMap<>(); + + map.put("logisticsStatus" , "SIGN"); + map.put("status" , 2); + + List orderGoodsList = orderGoodsService.getList(map); + + for (BsOrderGoods goods : orderGoodsList) { + + // 判断时间是否是十天前 + + if (DateUtil.differentDays(goods.getCreateTime() , new Date()) > 9) { + bsOrderGoodsService.confirmReceipt(goods.getId()); + goods.setStatus(3); + goods.setUpdateTime(new Date()); + orderGoodsService.update(goods); + } + } + + return ResponseMsgUtil.success("成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + } diff --git a/bweb/src/main/java/com/bweb/controller/file/FileController.java b/bweb/src/main/java/com/bweb/controller/file/FileController.java new file mode 100644 index 0000000..ef5c13b --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/file/FileController.java @@ -0,0 +1,106 @@ +package com.bweb.controller.file; + +import com.bweb.controller.cms.CmsContentController; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.FileRecords; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.service.file.FileRecordsService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value="/file") +@Api(value="文件操作") +public class FileController { + + Logger log = LoggerFactory.getLogger(CmsContentController.class); + + @Resource + private FileRecordsService fileRecordsService; + + @Resource + private UserCenter userCenter; + + + @RequestMapping(value="/getFileRecordsList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询列表") + public ResponseData getFileRecordsList( HttpServletRequest request) { + try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); + + Map map = new HashMap<>(); + map.put("opId", userModel.getAccount().getId()); + return ResponseMsgUtil.success(fileRecordsService.getList(map)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/findFileRecords",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询详情") + public ResponseData findFileRecords( + @RequestParam(value = "id" , required = true) Long id) { + try { + + return ResponseMsgUtil.success(fileRecordsService.queryDetail(id)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getDownLoad",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "下载") + public ResponseData getDownLoad( + @RequestParam(value = "id" , required = true) Long id) { + try { + + FileRecords fileRecords = fileRecordsService.queryDetail(id); + if (fileRecords.getStatus() != 1) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "当前状态错误!"); + } + + fileRecords.setStatus(1); + fileRecords.setUpdateTime(new Date()); + fileRecords.setDownloadStatus(1); + fileRecords.setDownloadTime(new Date()); + fileRecordsService.update(fileRecords); + + return ResponseMsgUtil.success(fileRecords.getFileUrl()); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/cweb/src/main/java/com/cweb/config/AuthConfig.java b/cweb/src/main/java/com/cweb/config/AuthConfig.java index a39b69e..409f3c6 100644 --- a/cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -93,6 +93,7 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/wxMsg/*") .excludePathPatterns("/cinema/*") .excludePathPatterns("/starbucks/*") + .excludePathPatterns("/c/*") ; } diff --git a/cweb/src/main/java/com/cweb/controller/CommonController.java b/cweb/src/main/java/com/cweb/controller/CommonController.java index 82f9f74..20212a2 100644 --- a/cweb/src/main/java/com/cweb/controller/CommonController.java +++ b/cweb/src/main/java/com/cweb/controller/CommonController.java @@ -7,11 +7,14 @@ import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.RedisUtil; import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsOrderGoods; import com.hfkj.entity.GoodsLogistics; +import com.hfkj.entity.GoodsUserAddress; import com.hfkj.model.ResponseData; import com.hfkj.qianzhu.channel.QianZhuService; import com.hfkj.service.CommonService; import com.hfkj.service.goods.BsOrderGoodsService; +import com.hfkj.service.goods.GoodsUserAddressService; import com.hfkj.service.hlt.HuiLianTongUnionCardService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -42,6 +45,9 @@ public class CommonController { @Resource private BsOrderGoodsService bsOrderGoodsService; + @Resource + private GoodsUserAddressService addressService; + @RequestMapping(value = "/test", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "test") @@ -111,7 +117,19 @@ public class CommonController { Map params = new HashMap<>(); - GoodsLogistics logistics = (GoodsLogistics) bsOrderGoodsService.getLogisticsMsg(logisticsNo); + BsOrderGoods orderGoods = bsOrderGoodsService.findGoodsOrderLogisticsNo(logisticsNo); + + if (orderGoods == null) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无物流信息!"); + } + + GoodsUserAddress userAddress = addressService.queryDetail(orderGoods.getDeliveryAddressId()); + + if (userAddress == null) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无物流信息!"); + } + + GoodsLogistics logistics = (GoodsLogistics) bsOrderGoodsService.getLogisticsMsg(logisticsNo , userAddress.getPhone()); params.put("logistics", logistics); JSONArray object = JSONArray.parseArray(logistics.getLogisticsTraceDetails()); diff --git a/cweb/src/main/java/com/cweb/controller/goods/DeliveryAddressController.java b/cweb/src/main/java/com/cweb/controller/goods/DeliveryAddressController.java index 33f5b58..d63deee 100644 --- a/cweb/src/main/java/com/cweb/controller/goods/DeliveryAddressController.java +++ b/cweb/src/main/java/com/cweb/controller/goods/DeliveryAddressController.java @@ -91,9 +91,7 @@ public class DeliveryAddressController { deliveryAddress.setUpdateTime(new Date()); deliveryAddressService.create(deliveryAddress); - - - return ResponseMsgUtil.success("新增成功"); + return ResponseMsgUtil.success(deliveryAddress); } catch (Exception e) { log.error("GoodsDetailController --> insertPrice() error!", e); diff --git a/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java b/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java index 46df46f..4fb0575 100644 --- a/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java +++ b/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java @@ -2,10 +2,16 @@ package com.cweb.controller.qianZhu; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.DateUtil; +import com.hfkj.common.utils.PageUtil; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsProductConfig; import com.hfkj.model.ResponseData; +import com.hfkj.model.goods.GoodsModel; import com.hfkj.qianzhu.channel.CinemaService; import com.hfkj.service.BsProductConfigService; import com.hfkj.sysenum.order.OrderChildProductTypeEnum; @@ -22,9 +28,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; -import java.util.Comparator; -import java.util.HashMap; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; @Controller @@ -41,6 +45,7 @@ public class CinemaController { @ResponseBody @ApiOperation(value = "根据城市分页查询影片") public ResponseData filmsPagedQuery(@RequestParam(value = "cityId", required = false) Integer cityId, + @RequestParam(value = "name", required = false) String name, @RequestParam(value = "cityCode", required = false) String cityCode, @RequestParam(value = "cinemaId", required = false) String cinemaId, @RequestParam(name = "pageNum", required = true) Integer pageNum, @@ -58,10 +63,42 @@ public class CinemaController { if (cinemaId != null) { params.put("cinemaId", cinemaId); } - params.put("pageIndex", pageNum); - params.put("pageSize", pageSize); + params.put("pageIndex", 1); + params.put("pageSize", 499); + + JSONObject object = CinemaService.filmsPagedQuery(params); + + JSONArray array = object.getJSONArray("data"); + + + + List list = new ArrayList<>(); + + for (Object o : array) { + JSONObject item = (JSONObject) o; + list.add(item); + } - return ResponseMsgUtil.success(CinemaService.filmsPagedQuery(params)); + if (list.isEmpty()) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无数据!"); + } + + if (name != null) { + list = list.stream() + .filter(s -> s.getString("name").contains(name)) // 使用contains方法进行模糊查询 + .collect(Collectors.toList()); // 将结果收集到列表中 + } + + + list = list.stream().sorted( + // 根据对象中的ID进行升序排序 小到大 + Comparator.comparingLong( + e -> DateUtil.timesTamp(JSONObject.parseObject(e.toString()).getString("publishDate")) + ) + // 放开下面的注释,使用reversed()方法,就是降序 大到小 + .reversed() + ).collect(Collectors.toList()); + return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum, list.size(), pageSize, new PageInfo<>(list))); } catch (Exception e) { log.error("error!",e); diff --git a/cweb/src/main/java/com/cweb/controller/qianZhu/StarbucksController.java b/cweb/src/main/java/com/cweb/controller/qianZhu/StarbucksController.java index d781a1b..715571a 100644 --- a/cweb/src/main/java/com/cweb/controller/qianZhu/StarbucksController.java +++ b/cweb/src/main/java/com/cweb/controller/qianZhu/StarbucksController.java @@ -26,10 +26,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.math.BigDecimal; import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -84,7 +81,7 @@ public class StarbucksController { // 查询产品 Map map = new HashMap<>(); map.put("pageIndex", 1); - map.put("pageSize", 100000); + map.put("pageSize", 200); JSONObject object = StarbucksService.starbucksProducts(map); if (object.getJSONObject("data") != null) { JSONArray jsonArray = object.getJSONObject("data").getJSONArray("items"); @@ -96,29 +93,40 @@ public class StarbucksController { // 中杯售卖价 BigDecimal tallPrice = StarbucksUtil.calculatePrice(productConfig.getDiscount() , item.getBigDecimal("salesTallPrice")); + List priceList = new ArrayList<>(); // 判断如果卖家 大于 原价 展示原价 if (tallPrice.compareTo(item.getBigDecimal("marketTallPrice")) > 0) { item.put("tallPrice" , item.getBigDecimal("marketTallPrice")); + priceList.add(item.getBigDecimal("marketTallPrice")); } else { item.put("tallPrice" , tallPrice); + priceList.add(tallPrice); } // 大杯销售价 BigDecimal grandePrice = StarbucksUtil.calculatePrice(productConfig.getDiscount() , item.getBigDecimal("salesGrandePrice")); if (grandePrice.compareTo(item.getBigDecimal("marketGrandePrice")) > 0) { item.put("grandePrice" , item.getBigDecimal("marketGrandePrice")); + priceList.add(item.getBigDecimal("marketGrandePrice")); } else { item.put("grandePrice" , grandePrice); + priceList.add(grandePrice); } // 超大杯销售价 BigDecimal ventiPrice = StarbucksUtil.calculatePrice(productConfig.getDiscount() , item.getBigDecimal("salesVentiPrice")); if (ventiPrice.compareTo(item.getBigDecimal("marketVentiPrice")) > 0) { item.put("ventiPrice" , item.getBigDecimal("marketVentiPrice")); + priceList.add(item.getBigDecimal("marketVentiPrice")); } else { item.put("ventiPrice" , ventiPrice); + priceList.add(ventiPrice); } + Collections.sort(priceList); + item.put("tallPrice" ,priceList.get(0)); + + List dataList = new ArrayList<>(); JSONObject jsonObject ; diff --git a/order/src/main/java/com/order/controller/OrderController.java b/order/src/main/java/com/order/controller/OrderController.java index b52897f..548984d 100644 --- a/order/src/main/java/com/order/controller/OrderController.java +++ b/order/src/main/java/com/order/controller/OrderController.java @@ -35,6 +35,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * @className: OrderController @@ -57,6 +58,7 @@ public class OrderController { @ApiOperation(value = "创建订单") public ResponseData create(@RequestBody OrderModel body) { try { + System.out.println("body" + body.toString()); // 用户session UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); if (userSession == null) { @@ -202,5 +204,37 @@ public class OrderController { } + @RequestMapping(value="/orderNum",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "订单数量") + public ResponseData orderNum() { + try { + + // 用户session + UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); + + Map map = new HashMap<>(); + map.put("userId" , userSession.getUser().getId()); + + List bsOrder = orderService.getOrderList(map); + + Map> collect = bsOrder.stream().collect(Collectors.groupingBy(BsOrder::getOrderStatus)); + + List countRecords = collect.keySet().stream().map(key -> { + JSONObject goodObject = new JSONObject(true); + goodObject.put("name", OrderStatusEnum.getData(key).getName()); + goodObject.put("status", key); + goodObject.put("num",collect.get(key).size()); + return goodObject; + }).collect(Collectors.toList()); + + return ResponseMsgUtil.success(countRecords); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/order/src/main/java/com/order/controller/business/BsOrderDownloadController.java b/order/src/main/java/com/order/controller/business/BsOrderDownloadController.java new file mode 100644 index 0000000..dec5a23 --- /dev/null +++ b/order/src/main/java/com/order/controller/business/BsOrderDownloadController.java @@ -0,0 +1,11 @@ +package com.order.controller.business; + +import io.swagger.annotations.Api; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +@RequestMapping(value="/orderDownload") +@Api(value="订单下载管理") +public class BsOrderDownloadController { +} diff --git a/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java b/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java index 87dcc58..f4884d5 100644 --- a/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java +++ b/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java @@ -1,6 +1,8 @@ package com.order.controller.business; +import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSONArray; + import com.alibaba.fastjson.JSONObject; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -9,30 +11,41 @@ import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.security.SessionObject; import com.hfkj.common.security.UserCenter; -import com.hfkj.common.utils.OrderUtil; +import com.hfkj.common.utils.DateUtil; import com.hfkj.common.utils.ResponseMsgUtil; -import com.hfkj.entity.BsOrderGoods; -import com.hfkj.entity.GoodsLogistics; +import com.hfkj.config.CommonSysConst; +import com.hfkj.entity.*; import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; +import com.hfkj.model.UserSessionObject; +import com.hfkj.model.order.orderExport.OrderGoodsExportModel; +import com.hfkj.service.file.FileRecordsService; import com.hfkj.service.goods.BsOrderGoodsService; +import com.hfkj.service.goods.GoodsUserAddressService; import com.hfkj.service.order.BsOrderService; import com.hfkj.sysenum.SecUserObjectTypeEnum; -import com.hfkj.sysenum.order.OrderGoodsStatusEnum; +import com.hfkj.sysenum.fileRecords.FileRecordsEnum; +import com.hfkj.sysenum.order.*; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; +import java.io.File; +import java.math.BigDecimal; +import java.util.*; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; @Controller @RequestMapping(value="/orderGoods") @@ -50,6 +63,15 @@ public class BsOrderGoodsController { @Resource private BsOrderService orderService; + @Resource + private FileRecordsService fileRecordsService; + + @Resource + private GoodsUserAddressService addressService; + + @Resource + private BsOrderGoodsService orderGoodsService; + @RequestMapping(value="/getListGoods",method = RequestMethod.GET) @ResponseBody @@ -62,8 +84,10 @@ public class BsOrderGoodsController { @RequestParam(value = "userPhone" , required = false) String userPhone, @RequestParam(value = "goodsSpecsName" , required = false) String goodsSpecsName, @RequestParam(value = "goodsName" , required = false) String goodsName, + @RequestParam(value = "logisticsStatus" , required = false) String logisticsStatus, @RequestParam(value = "payType" , required = false) Integer payType, @RequestParam(value = "status" , required = false) Integer status, + @RequestParam(value = "merId" , required = false) Long merId, @RequestParam(value = "createTimeS" , required = false) Long createTimeS, @RequestParam(value = "createTimeE" , required = false) Long createTimeE, @RequestParam(value = "pageNum" , required = true) Integer pageNum, @@ -74,7 +98,9 @@ public class BsOrderGoodsController { SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); Map map = new HashMap<>(); - + if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) { + map.put("merId", merId); + } if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { map.put("merId", userModel.getAccount().getObjectId()); } @@ -85,12 +111,12 @@ public class BsOrderGoodsController { map.put("orderNo", orderNo); map.put("childOrderNo", childOrderNo); map.put("userPhone", userPhone); + map.put("logisticsStatus", logisticsStatus); map.put("goodsSpecsName", goodsSpecsName); map.put("goodsName", goodsName); map.put("payType", payType); map.put("createTimeS", createTimeS); map.put("createTimeE", createTimeE); - map.put("status", status); PageHelper.startPage(pageNum, pageSize); @@ -102,6 +128,157 @@ public class BsOrderGoodsController { } } + + @RequestMapping(value="/exportGoodsOrder",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "导出商品订单") + public ResponseData exportGoodsOrder(@RequestParam(value = "logisticsNo" , required = false) String logisticsNo, + @RequestParam(value = "goodsType" , required = false) Long goodsType, + @RequestParam(value = "goodsBrand" , required = false) Long goodsBrand, + @RequestParam(value = "orderNo" , required = false) String orderNo, + @RequestParam(value = "childOrderNo" , required = false) String childOrderNo, + @RequestParam(value = "userPhone" , required = false) String userPhone, + @RequestParam(value = "goodsSpecsName" , required = false) String goodsSpecsName, + @RequestParam(value = "goodsName" , required = false) String goodsName, + @RequestParam(value = "logisticsStatus" , required = false) String logisticsStatus, + @RequestParam(value = "payType" , required = false) Integer payType, + @RequestParam(value = "status" , required = false) Integer status, + @RequestParam(value = "merId" , required = false) Long merId, + @RequestParam(value = "createTimeS" , required = false) Long createTimeS, + @RequestParam(value = "createTimeE" , required = false) Long createTimeE, HttpServletRequest request) { + // 插入下载记录 + FileRecords fileRecords = new FileRecords(); + + + + try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); + + + + + Map map = new HashMap<>(); + if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) { + map.put("merId", merId); + } + if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { + map.put("merId", userModel.getAccount().getObjectId()); + } + + map.put("logisticsNo", logisticsNo); + map.put("goodsType", goodsType); + map.put("goodsBrand", goodsBrand); + map.put("orderNo", orderNo); + map.put("childOrderNo", childOrderNo); + map.put("userPhone", userPhone); + map.put("logisticsStatus", logisticsStatus); + map.put("goodsSpecsName", goodsSpecsName); + map.put("goodsName", goodsName); + map.put("payType", payType); + map.put("createTimeS", createTimeS); + map.put("createTimeE", createTimeE); + map.put("status", status); + + String dataSting = ""; + if (createTimeE != null) { + dataSting = DateUtil.date2String(DateUtil.long2Date(createTimeS) , DateUtil.YMDHMS) + "-" + DateUtil.date2String(DateUtil.long2Date(createTimeE) , DateUtil.YMDHMS); + } else { + dataSting = DateUtil.date2String(new Date(), DateUtil.YMDHMS); + } + + String fileUrl = CommonSysConst.getSysConfig().getFileUrl(); + String filePath = "/temporary/" + userModel.getAccount().getId() + "/" ; + String pathName = filePath + FileRecordsEnum.status1.getName() + "交易数据导出" + dataSting +".xlsx"; + + if (fileRecordsService.findExported(map.toString() , userModel.getAccount().getId())) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "相同导出内容请勿重复点击!"); + } + + fileRecords.setCreateTime(new Date()); + fileRecords.setBusinessType(FileRecordsEnum.status1.getCode()); + fileRecords.setDownloadConditions(map.toString()); + fileRecords.setOpId(userModel.getAccount().getId()); + fileRecords.setOpName(userModel.getAccount().getUserName()); + fileRecords.setStatus(2); + fileRecords.setDownloadStatus(2); + fileRecords.setFileUrl(CommonSysConst.getSysConfig().getDomainName() + "/filesystem" + pathName); + fileRecords.setType("2"); + fileRecords.setTitle(FileRecordsEnum.status1.getName() + "交易数据导出" + dataSting + ".xls"); + fileRecordsService.create(fileRecords); + + // 创建线程 + ThreadPoolExecutor executor = new ThreadPoolExecutor( + 2, // 核心线程数 + 5, // 最大线程数 + 1, // 线程空闲时间 + TimeUnit.MINUTES, // 时间单位 + new ArrayBlockingQueue<>(5), // 任务队列 + new ThreadPoolExecutor.CallerRunsPolicy() // 拒绝策略 + ); + + // 提交任务给线程池 + executor.execute(() -> { + + try { + List list = bsOrderGoodsService.getList(map); + List goodsExportModels = new ArrayList<>(); + + for (BsOrderGoods bsOrderGoods : list) { + OrderGoodsExportModel orderGoodsExportModel = new OrderGoodsExportModel(); + + BeanUtils.copyProperties(orderGoodsExportModel, bsOrderGoods); + if (bsOrderGoods.getIntegralDiscountPrice() != null) { + orderGoodsExportModel.setIntegralDiscountPrice(BigDecimal.valueOf(bsOrderGoods.getIntegralDiscountPrice()).divide(new BigDecimal(100))); + } + if (bsOrderGoods.getPayChannel() != null) { + orderGoodsExportModel.setPayChannel(OrderPayChannelEnum.getData(bsOrderGoods.getPayChannel()).getName()); + } + if (bsOrderGoods.getPayType() != null) { + orderGoodsExportModel.setPayType(OrderPayTypeEnum.getData(bsOrderGoods.getPayType()).getName()); + } + if (bsOrderGoods.getStatus() != null) { + orderGoodsExportModel.setTradeStatus(OrderChildStatusEnum.getData(bsOrderGoods.getStatus()).getName()); + } + goodsExportModels.add(orderGoodsExportModel); + } + + File file = new File(fileUrl + filePath); + if (!file.exists()) { + file.mkdirs(); + } + + EasyExcel.write(fileUrl+pathName) + .head(OrderGoodsExportModel.class) + .sheet(fileRecords.getTitle()) + .doWrite(goodsExportModels); + + fileRecords.setStatus(1); + fileRecords.setUpdateTime(new Date()); + fileRecordsService.update(fileRecords); + } catch (Exception e) { + fileRecords.setStatus(3); + fileRecords.setUpdateTime(new Date()); + fileRecords.setExt1(e.toString()); + fileRecordsService.update(fileRecords); + log.error("error!",e); + } + }); + + // 关闭线程池 + executor.shutdown(); + return ResponseMsgUtil.success(fileRecords); + + } catch (Exception e) { + fileRecords.setStatus(3); + fileRecords.setUpdateTime(new Date()); + fileRecordsService.update(fileRecords); + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/updateLogisticsNo",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "更新物流订单号") @@ -126,14 +303,12 @@ public class BsOrderGoodsController { goodsOrder.setLogisticsNo(logisticsNo); goodsOrder.setUpdateTime(new Date()); - if (goodsOrder.getStatus() == OrderGoodsStatusEnum.status1.getCode()) { - goodsOrder.setStatus(OrderGoodsStatusEnum.status2.getCode()); - } // 删除缓存 orderService.cacheDelete(goodsOrder.getOrderNo()); bsOrderGoodsService.cacheDelete(goodsOrder.getLogisticsNo()); bsOrderGoodsService.update(goodsOrder); + getLogisticsMsg(goodsOrder.getId()); return ResponseMsgUtil.success("更新成功!"); } catch (Exception e) { @@ -147,19 +322,31 @@ public class BsOrderGoodsController { @ApiOperation(value = "查询物流") public ResponseData getLogisticsMsg(@RequestParam(value = "id" , required = false) Long id) { try { - Map map = new HashMap<>(); + Map map = new HashMap<>(); BsOrderGoods orderGoods = bsOrderGoodsService.queryDetail(id); - if (orderGoods == null || orderGoods.getLogisticsNo() == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂未发货!"); + + if (orderGoods == null) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无物流信息!"); } - GoodsLogistics logistics = (GoodsLogistics) bsOrderGoodsService.getLogisticsMsg(orderGoods.getLogisticsNo()); + GoodsUserAddress userAddress = addressService.queryDetail(orderGoods.getDeliveryAddressId()); - orderGoods.setLogisticsStatus(logistics.getLogisticsStatus()); - orderGoods.setLogisticsStatusDesc(logistics.getLogisticsStatusDesc()); - bsOrderGoodsService.update(orderGoods); + if (userAddress == null) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无物流信息!"); + } + + GoodsLogistics logistics = (GoodsLogistics) bsOrderGoodsService.getLogisticsMsg(orderGoods.getLogisticsNo() , userAddress.getPhone()); + if (logistics.getLogisticsStatus() != null) { + orderGoods.setLogisticsStatus(logistics.getLogisticsStatus()); + orderGoods.setLogisticsStatusDesc(logistics.getLogisticsStatusDesc()); + } else { + orderGoods.setLogisticsStatus(OrderLogisticsStatusEnum.statusWAIT_ACCEPT.getCode()); + orderGoods.setLogisticsStatusDesc(OrderLogisticsStatusEnum.statusWAIT_ACCEPT.getName()); + } + + bsOrderGoodsService.update(orderGoods); map.put("logistics", logistics); JSONArray object = JSONArray.parseArray(logistics.getLogisticsTraceDetails()); map.put("logisticsTraceDetails", object); @@ -186,4 +373,39 @@ public class BsOrderGoodsController { return ResponseMsgUtil.exception(e); } } + + @RequestMapping(value="/updateShippingAddress",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "更新收货地址") + public ResponseData updateShippingAddress(@RequestParam(value = "orderNo" , required = true) String orderNo, + @RequestParam(value = "addressId" , required = true) Long addressId) { + try { + + GoodsUserAddress deliveryAddress = addressService.queryDetail(addressId); + + if (deliveryAddress == null) { + log.error("GoodsDetailController -> findGoodsDetailById() error!"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到相信息"); + } + + BsOrderGoods orderGoods = orderGoodsService.findGoodsOrder(orderNo); + + if (orderGoods == null) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "未找到相信息"); + } + + orderGoods.setDeliveryAddressId(deliveryAddress.getId()); + orderGoods.setUpdateTime(new Date()); + orderGoods.setDeliveryAddress(deliveryAddress.getAddress()); + + orderGoodsService.update(orderGoods); + + return ResponseMsgUtil.success("成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/order/src/main/java/com/order/controller/business/BsOrderStarbucksController.java b/order/src/main/java/com/order/controller/business/BsOrderStarbucksController.java index 442eef1..f33bbe9 100644 --- a/order/src/main/java/com/order/controller/business/BsOrderStarbucksController.java +++ b/order/src/main/java/com/order/controller/business/BsOrderStarbucksController.java @@ -1,18 +1,15 @@ package com.order.controller.business; import com.github.pagehelper.PageInfo; -import com.hfkj.common.security.SessionObject; -import com.hfkj.common.security.UserCenter; + import com.hfkj.common.utils.PageUtil; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsOrderChild; import com.hfkj.entity.BsOrderStarbucks; import com.hfkj.model.ResponseData; -import com.hfkj.model.SecUserSessionObject; import com.hfkj.model.order.OrderStarbucksModel; import com.hfkj.service.goods.BsOrderStarbucksService; import com.hfkj.service.order.BsOrderChildService; -import com.hfkj.sysenum.SecUserObjectTypeEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -89,7 +86,7 @@ public class BsOrderStarbucksController { starbucksModel.setStoreAddress(starbucks.get(0).getStoreAddress()); starbucksModel.setStoreName(starbucks.get(0).getStoreName()); starbucksModel.setUserPhone(starbucks.get(0).getUserPhone()); - + starbucksModel.setPayType(starbucks.get(0).getPayType()); starbucksModelList.add(starbucksModel); } diff --git a/schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java b/schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java new file mode 100644 index 0000000..0e02148 --- /dev/null +++ b/schedule/src/main/java/com/hfkj/schedule/OrderGoodsSchedule.java @@ -0,0 +1,100 @@ +package com.hfkj.schedule; + +import com.alibaba.fastjson.JSONArray; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.DateUtil; +import com.hfkj.entity.BsOrderGoods; +import com.hfkj.entity.GoodsLogistics; +import com.hfkj.entity.GoodsUserAddress; +import com.hfkj.service.goods.BsOrderGoodsService; +import com.hfkj.service.goods.GoodsUserAddressService; +import com.hfkj.sysenum.order.OrderLogisticsStatusEnum; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.Scheduled; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @ClassName OrderGoodsSchedule + * @Author Sum1Dream + * @Description 实物订单定时任务 + * @Date 2024/8/12 下午3:00 + **/ +@Configuration +public class OrderGoodsSchedule { + + private static Logger log = LoggerFactory.getLogger(OrderGoodsSchedule.class); + + @Resource + private BsOrderGoodsService orderGoodsService; + @Resource + private BsOrderGoodsService bsOrderGoodsService; + + @Resource + private GoodsUserAddressService addressService; + + //每日凌晨12点5秒执行一次 + @Scheduled(cron = "5 0 0 * * ?") + public void orderGoodsConfirmReceipt() { + Map map = new HashMap<>(); + + map.put("logisticsStatus" , "SIGN"); + map.put("status" , 2); + + List orderGoodsList = orderGoodsService.getList(map); + + for (BsOrderGoods goods : orderGoodsList) { + + // 判断时间是否是十天前 + + if (DateUtil.differentDays(goods.getCreateTime() , new Date()) > 10) { + bsOrderGoodsService.confirmReceipt(goods.getId()); + } + } + } + + @Scheduled(cron = "30 0 0 * * ?") + public void getLogisticsMsg() { + Map objectMap = new HashMap<>(); + + objectMap.put("status" , 2); + + List orderGoodsList = orderGoodsService.getList(objectMap); + + for (BsOrderGoods goods : orderGoodsList) { + + if (goods == null) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无物流信息!"); + } + + GoodsUserAddress userAddress = addressService.queryDetail(goods.getDeliveryAddressId()); + + if (userAddress == null) { + throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "暂无物流信息!"); + } + + GoodsLogistics logistics = (GoodsLogistics) bsOrderGoodsService.getLogisticsMsg(goods.getLogisticsNo() , userAddress.getPhone()); + + if (logistics.getLogisticsStatus() != null) { + goods.setLogisticsStatus(logistics.getLogisticsStatus()); + goods.setLogisticsStatusDesc(logistics.getLogisticsStatusDesc()); + } else { + goods.setLogisticsStatus(OrderLogisticsStatusEnum.statusWAIT_ACCEPT.getCode()); + goods.setLogisticsStatusDesc(OrderLogisticsStatusEnum.statusWAIT_ACCEPT.getName()); + } + + goods.setUpdateTime(new Date()); + + bsOrderGoodsService.update(goods); + + } + } +} diff --git a/service/src/main/java/com/hfkj/common/utils/OrderUtil.java b/service/src/main/java/com/hfkj/common/utils/OrderUtil.java index 17ccbd4..87f98e0 100644 --- a/service/src/main/java/com/hfkj/common/utils/OrderUtil.java +++ b/service/src/main/java/com/hfkj/common/utils/OrderUtil.java @@ -71,13 +71,14 @@ public class OrderUtil { * @return * @throws Exception */ - public static JSONObject getLogisticsMsg(String num) { + public static JSONObject getLogisticsMsg(String num , String mobile) { String appcode = "f9ace4c915054ca697a76fb9a4e1e8c0"; Map headers = new HashMap<>(); headers.put("Authorization", "APPCODE " + appcode); Map querys = new HashMap<>(); querys.put("number", num); + querys.put("mobile", mobile); return HttpsUtils.doGet("https://express3.market.alicloudapi.com/express3" , querys ,headers); } diff --git a/service/src/main/java/com/hfkj/common/utils/StarbucksUtil.java b/service/src/main/java/com/hfkj/common/utils/StarbucksUtil.java index 31802fd..fb55d72 100644 --- a/service/src/main/java/com/hfkj/common/utils/StarbucksUtil.java +++ b/service/src/main/java/com/hfkj/common/utils/StarbucksUtil.java @@ -36,36 +36,61 @@ public class StarbucksUtil { for (String cup : cpuS) { JSONObject obj = new JSONObject(); - switch (cup) { - case "中杯": - obj.put("cpu", "中杯"); - obj.put("notSelect", tall); - obj.put("select", tallSelect); - obj.put("volume", "355ml"); - obj.put("price", tallPrice); - break; - case "大杯": - obj.put("cpu", "大杯"); - obj.put("notSelect", grande); - obj.put("select", grandeSelect); - obj.put("volume", "473ml"); - obj.put("price", grandePrice); - break; - case "超大杯": - obj.put("cpu", "超大杯"); - obj.put("notSelect", venti); - obj.put("select", ventiSelect); - obj.put("volume", "473ml"); - obj.put("price", ventiPrice); - break; - default: - obj.put("cpu", "特殊杯"); - obj.put("notSelect", venti); - obj.put("select", ventiSelect); - obj.put("volume", "∞ml"); - obj.put("price", ventiPrice); - break; + if (cup.equals("中杯") && tallPrice.compareTo(new BigDecimal(1000)) < 0) { + obj.put("cpu" , "中杯"); + obj.put("notSelect" , tall); + obj.put("select" , tallSelect); + obj.put("volume" , "355ml"); + obj.put("price", tallPrice); + } else if (cup.equals("大杯") && grandePrice.compareTo(new BigDecimal(1000)) < 0) { + obj.put("cpu" , "大杯"); + obj.put("notSelect" , grande); + obj.put("select" , grandeSelect); + obj.put("volume" , "473ml"); + obj.put("price", grandePrice); + } else if (cup.equals("超大杯") && ventiPrice.compareTo(new BigDecimal(1000)) < 0) { + obj.put("cpu" , "超大杯"); + obj.put("notSelect" , venti); + obj.put("select" , ventiSelect); + obj.put("volume" , "592ml"); + obj.put("price", ventiPrice); + } else { + obj.put("cpu" , "特殊杯"); + obj.put("notSelect" , venti); + obj.put("select" , ventiSelect); + obj.put("volume" , "∞ml"); + obj.put("price", ventiPrice); } +// switch (cup) { +// case "中杯": +// obj.put("cpu", "中杯"); +// obj.put("notSelect", tall); +// obj.put("select", tallSelect); +// obj.put("volume", "355ml"); +// obj.put("price", tallPrice); +// break; +// case "大杯": +// obj.put("cpu", "大杯"); +// obj.put("notSelect", grande); +// obj.put("select", grandeSelect); +// obj.put("volume", "473ml"); +// obj.put("price", grandePrice); +// break; +// case "超大杯": +// obj.put("cpu", "超大杯"); +// obj.put("notSelect", venti); +// obj.put("select", ventiSelect); +// obj.put("volume", "592ml"); +// obj.put("price", ventiPrice); +// break; +// default: +// obj.put("cpu", "特殊杯"); +// obj.put("notSelect", venti); +// obj.put("select", ventiSelect); +// obj.put("volume", "∞ml"); +// obj.put("price", ventiPrice); +// break; +// } list.add(obj); } diff --git a/service/src/main/java/com/hfkj/dao/FileRecordsMapper.java b/service/src/main/java/com/hfkj/dao/FileRecordsMapper.java new file mode 100644 index 0000000..12a5d16 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/FileRecordsMapper.java @@ -0,0 +1,142 @@ +package com.hfkj.dao; + +import com.hfkj.entity.FileRecords; +import com.hfkj.entity.FileRecordsExample; +import java.util.List; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface FileRecordsMapper extends FileRecordsMapperExt { + @SelectProvider(type=FileRecordsSqlProvider.class, method="countByExample") + long countByExample(FileRecordsExample example); + + @DeleteProvider(type=FileRecordsSqlProvider.class, method="deleteByExample") + int deleteByExample(FileRecordsExample example); + + @Delete({ + "delete from file_records", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into file_records (title, `type`, ", + "download_conditions, file_url, ", + "business_type, create_time, ", + "update_time, download_time, ", + "download_status, `status`, ", + "op_id, op_name, ext_1, ", + "ext_2, ext_3)", + "values (#{title,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, ", + "#{downloadConditions,jdbcType=VARCHAR}, #{fileUrl,jdbcType=VARCHAR}, ", + "#{businessType,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{downloadTime,jdbcType=TIMESTAMP}, ", + "#{downloadStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ", + "#{opId,jdbcType=BIGINT}, #{opName,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(FileRecords record); + + @InsertProvider(type=FileRecordsSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(FileRecords record); + + @SelectProvider(type=FileRecordsSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR), + @Result(column="type", property="type", jdbcType=JdbcType.VARCHAR), + @Result(column="download_conditions", property="downloadConditions", jdbcType=JdbcType.VARCHAR), + @Result(column="file_url", property="fileUrl", jdbcType=JdbcType.VARCHAR), + @Result(column="business_type", property="businessType", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="download_time", property="downloadTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="download_status", property="downloadStatus", jdbcType=JdbcType.INTEGER), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT), + @Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(FileRecordsExample example); + + @Select({ + "select", + "id, title, `type`, download_conditions, file_url, business_type, create_time, ", + "update_time, download_time, download_status, `status`, op_id, op_name, ext_1, ", + "ext_2, ext_3", + "from file_records", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR), + @Result(column="type", property="type", jdbcType=JdbcType.VARCHAR), + @Result(column="download_conditions", property="downloadConditions", jdbcType=JdbcType.VARCHAR), + @Result(column="file_url", property="fileUrl", jdbcType=JdbcType.VARCHAR), + @Result(column="business_type", property="businessType", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="download_time", property="downloadTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="download_status", property="downloadStatus", jdbcType=JdbcType.INTEGER), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="op_id", property="opId", jdbcType=JdbcType.BIGINT), + @Result(column="op_name", property="opName", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + FileRecords selectByPrimaryKey(Long id); + + @UpdateProvider(type=FileRecordsSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") FileRecords record, @Param("example") FileRecordsExample example); + + @UpdateProvider(type=FileRecordsSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") FileRecords record, @Param("example") FileRecordsExample example); + + @UpdateProvider(type=FileRecordsSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(FileRecords record); + + @Update({ + "update file_records", + "set title = #{title,jdbcType=VARCHAR},", + "`type` = #{type,jdbcType=VARCHAR},", + "download_conditions = #{downloadConditions,jdbcType=VARCHAR},", + "file_url = #{fileUrl,jdbcType=VARCHAR},", + "business_type = #{businessType,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "download_time = #{downloadTime,jdbcType=TIMESTAMP},", + "download_status = #{downloadStatus,jdbcType=INTEGER},", + "`status` = #{status,jdbcType=INTEGER},", + "op_id = #{opId,jdbcType=BIGINT},", + "op_name = #{opName,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(FileRecords record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/FileRecordsMapperExt.java b/service/src/main/java/com/hfkj/dao/FileRecordsMapperExt.java new file mode 100644 index 0000000..c5f839f --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/FileRecordsMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface FileRecordsMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/FileRecordsSqlProvider.java b/service/src/main/java/com/hfkj/dao/FileRecordsSqlProvider.java new file mode 100644 index 0000000..b2ff009 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/FileRecordsSqlProvider.java @@ -0,0 +1,388 @@ +package com.hfkj.dao; + +import com.hfkj.entity.FileRecords; +import com.hfkj.entity.FileRecordsExample.Criteria; +import com.hfkj.entity.FileRecordsExample.Criterion; +import com.hfkj.entity.FileRecordsExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class FileRecordsSqlProvider { + + public String countByExample(FileRecordsExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("file_records"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(FileRecordsExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("file_records"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(FileRecords record) { + SQL sql = new SQL(); + sql.INSERT_INTO("file_records"); + + if (record.getTitle() != null) { + sql.VALUES("title", "#{title,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=VARCHAR}"); + } + + if (record.getDownloadConditions() != null) { + sql.VALUES("download_conditions", "#{downloadConditions,jdbcType=VARCHAR}"); + } + + if (record.getFileUrl() != null) { + sql.VALUES("file_url", "#{fileUrl,jdbcType=VARCHAR}"); + } + + if (record.getBusinessType() != null) { + sql.VALUES("business_type", "#{businessType,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getDownloadTime() != null) { + sql.VALUES("download_time", "#{downloadTime,jdbcType=TIMESTAMP}"); + } + + if (record.getDownloadStatus() != null) { + sql.VALUES("download_status", "#{downloadStatus,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getOpId() != null) { + sql.VALUES("op_id", "#{opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.VALUES("op_name", "#{opName,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(FileRecordsExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("title"); + sql.SELECT("`type`"); + sql.SELECT("download_conditions"); + sql.SELECT("file_url"); + sql.SELECT("business_type"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("download_time"); + sql.SELECT("download_status"); + sql.SELECT("`status`"); + sql.SELECT("op_id"); + sql.SELECT("op_name"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("file_records"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + FileRecords record = (FileRecords) parameter.get("record"); + FileRecordsExample example = (FileRecordsExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("file_records"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getTitle() != null) { + sql.SET("title = #{record.title,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=VARCHAR}"); + } + + if (record.getDownloadConditions() != null) { + sql.SET("download_conditions = #{record.downloadConditions,jdbcType=VARCHAR}"); + } + + if (record.getFileUrl() != null) { + sql.SET("file_url = #{record.fileUrl,jdbcType=VARCHAR}"); + } + + if (record.getBusinessType() != null) { + sql.SET("business_type = #{record.businessType,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getDownloadTime() != null) { + sql.SET("download_time = #{record.downloadTime,jdbcType=TIMESTAMP}"); + } + + if (record.getDownloadStatus() != null) { + sql.SET("download_status = #{record.downloadStatus,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getOpId() != null) { + sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("file_records"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("title = #{record.title,jdbcType=VARCHAR}"); + sql.SET("`type` = #{record.type,jdbcType=VARCHAR}"); + sql.SET("download_conditions = #{record.downloadConditions,jdbcType=VARCHAR}"); + sql.SET("file_url = #{record.fileUrl,jdbcType=VARCHAR}"); + sql.SET("business_type = #{record.businessType,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("download_time = #{record.downloadTime,jdbcType=TIMESTAMP}"); + sql.SET("download_status = #{record.downloadStatus,jdbcType=INTEGER}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("op_id = #{record.opId,jdbcType=BIGINT}"); + sql.SET("op_name = #{record.opName,jdbcType=VARCHAR}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + FileRecordsExample example = (FileRecordsExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(FileRecords record) { + SQL sql = new SQL(); + sql.UPDATE("file_records"); + + if (record.getTitle() != null) { + sql.SET("title = #{title,jdbcType=VARCHAR}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=VARCHAR}"); + } + + if (record.getDownloadConditions() != null) { + sql.SET("download_conditions = #{downloadConditions,jdbcType=VARCHAR}"); + } + + if (record.getFileUrl() != null) { + sql.SET("file_url = #{fileUrl,jdbcType=VARCHAR}"); + } + + if (record.getBusinessType() != null) { + sql.SET("business_type = #{businessType,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getDownloadTime() != null) { + sql.SET("download_time = #{downloadTime,jdbcType=TIMESTAMP}"); + } + + if (record.getDownloadStatus() != null) { + sql.SET("download_status = #{downloadStatus,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getOpId() != null) { + sql.SET("op_id = #{opId,jdbcType=BIGINT}"); + } + + if (record.getOpName() != null) { + sql.SET("op_name = #{opName,jdbcType=VARCHAR}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, FileRecordsExample example, boolean includeExamplePhrase) { + if (example == null) { + return; + } + + String parmPhrase1; + String parmPhrase1_th; + String parmPhrase2; + String parmPhrase2_th; + String parmPhrase3; + String parmPhrase3_th; + if (includeExamplePhrase) { + parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } else { + parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } + + StringBuilder sb = new StringBuilder(); + List oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsOrderGoods.java b/service/src/main/java/com/hfkj/entity/BsOrderGoods.java index 25871e9..2517b9a 100644 --- a/service/src/main/java/com/hfkj/entity/BsOrderGoods.java +++ b/service/src/main/java/com/hfkj/entity/BsOrderGoods.java @@ -165,7 +165,7 @@ public class BsOrderGoods implements Serializable { private Integer payType; /** - * 1:待发货 2:已发货 3:配送中 4:已送达 5:已取消 6:退货中 7:已退货 8:待支付 0:删除 + * bs_order_child订单表同步 */ private Integer status; diff --git a/service/src/main/java/com/hfkj/entity/FileRecords.java b/service/src/main/java/com/hfkj/entity/FileRecords.java new file mode 100644 index 0000000..9e7883e --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/FileRecords.java @@ -0,0 +1,305 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * file_records + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class FileRecords implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 标题 + */ + private String title; + + /** + * 1:上传。2:下载 + */ + private String type; + + /** + * 下载条件 + */ + private String downloadConditions; + + /** + * 文件地址 + */ + private String fileUrl; + + /** + * 业务类型:1:实物产品 2:虚拟产品 3:肯德基 4:星巴克 5:支付订单 6:物流上传订单 7: 物流下载订单 + */ + private Integer businessType; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 下载时间 + */ + private Date downloadTime; + + /** + * 是否下载 :1 已下载 2:未下载 0:下载失败 + */ + private Integer downloadStatus; + + /** + * 状态:1 成功 2:导出中 3:失败 + */ + private Integer status; + + /** + * 操作人 + */ + private Long opId; + + /** + * 操作人名称 + */ + private String opName; + + /** + * ext_1 + */ + private String ext1; + + /** + * ext_2 + */ + private String ext2; + + /** + * ext_3 + */ + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getDownloadConditions() { + return downloadConditions; + } + + public void setDownloadConditions(String downloadConditions) { + this.downloadConditions = downloadConditions; + } + + public String getFileUrl() { + return fileUrl; + } + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + public Integer getBusinessType() { + return businessType; + } + + public void setBusinessType(Integer businessType) { + this.businessType = businessType; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public Date getDownloadTime() { + return downloadTime; + } + + public void setDownloadTime(Date downloadTime) { + this.downloadTime = downloadTime; + } + + public Integer getDownloadStatus() { + return downloadStatus; + } + + public void setDownloadStatus(Integer downloadStatus) { + this.downloadStatus = downloadStatus; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Long getOpId() { + return opId; + } + + public void setOpId(Long opId) { + this.opId = opId; + } + + public String getOpName() { + return opName; + } + + public void setOpName(String opName) { + this.opName = opName; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + FileRecords other = (FileRecords) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getDownloadConditions() == null ? other.getDownloadConditions() == null : this.getDownloadConditions().equals(other.getDownloadConditions())) + && (this.getFileUrl() == null ? other.getFileUrl() == null : this.getFileUrl().equals(other.getFileUrl())) + && (this.getBusinessType() == null ? other.getBusinessType() == null : this.getBusinessType().equals(other.getBusinessType())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getDownloadTime() == null ? other.getDownloadTime() == null : this.getDownloadTime().equals(other.getDownloadTime())) + && (this.getDownloadStatus() == null ? other.getDownloadStatus() == null : this.getDownloadStatus().equals(other.getDownloadStatus())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getOpId() == null ? other.getOpId() == null : this.getOpId().equals(other.getOpId())) + && (this.getOpName() == null ? other.getOpName() == null : this.getOpName().equals(other.getOpName())) + && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) + && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode()); + result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getDownloadConditions() == null) ? 0 : getDownloadConditions().hashCode()); + result = prime * result + ((getFileUrl() == null) ? 0 : getFileUrl().hashCode()); + result = prime * result + ((getBusinessType() == null) ? 0 : getBusinessType().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getDownloadTime() == null) ? 0 : getDownloadTime().hashCode()); + result = prime * result + ((getDownloadStatus() == null) ? 0 : getDownloadStatus().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getOpId() == null) ? 0 : getOpId().hashCode()); + result = prime * result + ((getOpName() == null) ? 0 : getOpName().hashCode()); + result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); + result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); + result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", title=").append(title); + sb.append(", type=").append(type); + sb.append(", downloadConditions=").append(downloadConditions); + sb.append(", fileUrl=").append(fileUrl); + sb.append(", businessType=").append(businessType); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", downloadTime=").append(downloadTime); + sb.append(", downloadStatus=").append(downloadStatus); + sb.append(", status=").append(status); + sb.append(", opId=").append(opId); + sb.append(", opName=").append(opName); + sb.append(", ext1=").append(ext1); + sb.append(", ext2=").append(ext2); + sb.append(", ext3=").append(ext3); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/FileRecordsExample.java b/service/src/main/java/com/hfkj/entity/FileRecordsExample.java new file mode 100644 index 0000000..abe87d7 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/FileRecordsExample.java @@ -0,0 +1,1263 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class FileRecordsExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public FileRecordsExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andTitleIsNull() { + addCriterion("title is null"); + return (Criteria) this; + } + + public Criteria andTitleIsNotNull() { + addCriterion("title is not null"); + return (Criteria) this; + } + + public Criteria andTitleEqualTo(String value) { + addCriterion("title =", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotEqualTo(String value) { + addCriterion("title <>", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleGreaterThan(String value) { + addCriterion("title >", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleGreaterThanOrEqualTo(String value) { + addCriterion("title >=", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLessThan(String value) { + addCriterion("title <", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLessThanOrEqualTo(String value) { + addCriterion("title <=", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleLike(String value) { + addCriterion("title like", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotLike(String value) { + addCriterion("title not like", value, "title"); + return (Criteria) this; + } + + public Criteria andTitleIn(List values) { + addCriterion("title in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotIn(List values) { + addCriterion("title not in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleBetween(String value1, String value2) { + addCriterion("title between", value1, value2, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotBetween(String value1, String value2) { + addCriterion("title not between", value1, value2, "title"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(String value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(String value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(String value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(String value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(String value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(String value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLike(String value) { + addCriterion("`type` like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotLike(String value) { + addCriterion("`type` not like", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(String value1, String value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(String value1, String value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsIsNull() { + addCriterion("download_conditions is null"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsIsNotNull() { + addCriterion("download_conditions is not null"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsEqualTo(String value) { + addCriterion("download_conditions =", value, "downloadConditions"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsNotEqualTo(String value) { + addCriterion("download_conditions <>", value, "downloadConditions"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsGreaterThan(String value) { + addCriterion("download_conditions >", value, "downloadConditions"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsGreaterThanOrEqualTo(String value) { + addCriterion("download_conditions >=", value, "downloadConditions"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsLessThan(String value) { + addCriterion("download_conditions <", value, "downloadConditions"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsLessThanOrEqualTo(String value) { + addCriterion("download_conditions <=", value, "downloadConditions"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsLike(String value) { + addCriterion("download_conditions like", value, "downloadConditions"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsNotLike(String value) { + addCriterion("download_conditions not like", value, "downloadConditions"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsIn(List values) { + addCriterion("download_conditions in", values, "downloadConditions"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsNotIn(List values) { + addCriterion("download_conditions not in", values, "downloadConditions"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsBetween(String value1, String value2) { + addCriterion("download_conditions between", value1, value2, "downloadConditions"); + return (Criteria) this; + } + + public Criteria andDownloadConditionsNotBetween(String value1, String value2) { + addCriterion("download_conditions not between", value1, value2, "downloadConditions"); + return (Criteria) this; + } + + public Criteria andFileUrlIsNull() { + addCriterion("file_url is null"); + return (Criteria) this; + } + + public Criteria andFileUrlIsNotNull() { + addCriterion("file_url is not null"); + return (Criteria) this; + } + + public Criteria andFileUrlEqualTo(String value) { + addCriterion("file_url =", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlNotEqualTo(String value) { + addCriterion("file_url <>", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlGreaterThan(String value) { + addCriterion("file_url >", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlGreaterThanOrEqualTo(String value) { + addCriterion("file_url >=", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlLessThan(String value) { + addCriterion("file_url <", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlLessThanOrEqualTo(String value) { + addCriterion("file_url <=", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlLike(String value) { + addCriterion("file_url like", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlNotLike(String value) { + addCriterion("file_url not like", value, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlIn(List values) { + addCriterion("file_url in", values, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlNotIn(List values) { + addCriterion("file_url not in", values, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlBetween(String value1, String value2) { + addCriterion("file_url between", value1, value2, "fileUrl"); + return (Criteria) this; + } + + public Criteria andFileUrlNotBetween(String value1, String value2) { + addCriterion("file_url not between", value1, value2, "fileUrl"); + return (Criteria) this; + } + + public Criteria andBusinessTypeIsNull() { + addCriterion("business_type is null"); + return (Criteria) this; + } + + public Criteria andBusinessTypeIsNotNull() { + addCriterion("business_type is not null"); + return (Criteria) this; + } + + public Criteria andBusinessTypeEqualTo(Integer value) { + addCriterion("business_type =", value, "businessType"); + return (Criteria) this; + } + + public Criteria andBusinessTypeNotEqualTo(Integer value) { + addCriterion("business_type <>", value, "businessType"); + return (Criteria) this; + } + + public Criteria andBusinessTypeGreaterThan(Integer value) { + addCriterion("business_type >", value, "businessType"); + return (Criteria) this; + } + + public Criteria andBusinessTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("business_type >=", value, "businessType"); + return (Criteria) this; + } + + public Criteria andBusinessTypeLessThan(Integer value) { + addCriterion("business_type <", value, "businessType"); + return (Criteria) this; + } + + public Criteria andBusinessTypeLessThanOrEqualTo(Integer value) { + addCriterion("business_type <=", value, "businessType"); + return (Criteria) this; + } + + public Criteria andBusinessTypeIn(List values) { + addCriterion("business_type in", values, "businessType"); + return (Criteria) this; + } + + public Criteria andBusinessTypeNotIn(List values) { + addCriterion("business_type not in", values, "businessType"); + return (Criteria) this; + } + + public Criteria andBusinessTypeBetween(Integer value1, Integer value2) { + addCriterion("business_type between", value1, value2, "businessType"); + return (Criteria) this; + } + + public Criteria andBusinessTypeNotBetween(Integer value1, Integer value2) { + addCriterion("business_type not between", value1, value2, "businessType"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andDownloadTimeIsNull() { + addCriterion("download_time is null"); + return (Criteria) this; + } + + public Criteria andDownloadTimeIsNotNull() { + addCriterion("download_time is not null"); + return (Criteria) this; + } + + public Criteria andDownloadTimeEqualTo(Date value) { + addCriterion("download_time =", value, "downloadTime"); + return (Criteria) this; + } + + public Criteria andDownloadTimeNotEqualTo(Date value) { + addCriterion("download_time <>", value, "downloadTime"); + return (Criteria) this; + } + + public Criteria andDownloadTimeGreaterThan(Date value) { + addCriterion("download_time >", value, "downloadTime"); + return (Criteria) this; + } + + public Criteria andDownloadTimeGreaterThanOrEqualTo(Date value) { + addCriterion("download_time >=", value, "downloadTime"); + return (Criteria) this; + } + + public Criteria andDownloadTimeLessThan(Date value) { + addCriterion("download_time <", value, "downloadTime"); + return (Criteria) this; + } + + public Criteria andDownloadTimeLessThanOrEqualTo(Date value) { + addCriterion("download_time <=", value, "downloadTime"); + return (Criteria) this; + } + + public Criteria andDownloadTimeIn(List values) { + addCriterion("download_time in", values, "downloadTime"); + return (Criteria) this; + } + + public Criteria andDownloadTimeNotIn(List values) { + addCriterion("download_time not in", values, "downloadTime"); + return (Criteria) this; + } + + public Criteria andDownloadTimeBetween(Date value1, Date value2) { + addCriterion("download_time between", value1, value2, "downloadTime"); + return (Criteria) this; + } + + public Criteria andDownloadTimeNotBetween(Date value1, Date value2) { + addCriterion("download_time not between", value1, value2, "downloadTime"); + return (Criteria) this; + } + + public Criteria andDownloadStatusIsNull() { + addCriterion("download_status is null"); + return (Criteria) this; + } + + public Criteria andDownloadStatusIsNotNull() { + addCriterion("download_status is not null"); + return (Criteria) this; + } + + public Criteria andDownloadStatusEqualTo(Integer value) { + addCriterion("download_status =", value, "downloadStatus"); + return (Criteria) this; + } + + public Criteria andDownloadStatusNotEqualTo(Integer value) { + addCriterion("download_status <>", value, "downloadStatus"); + return (Criteria) this; + } + + public Criteria andDownloadStatusGreaterThan(Integer value) { + addCriterion("download_status >", value, "downloadStatus"); + return (Criteria) this; + } + + public Criteria andDownloadStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("download_status >=", value, "downloadStatus"); + return (Criteria) this; + } + + public Criteria andDownloadStatusLessThan(Integer value) { + addCriterion("download_status <", value, "downloadStatus"); + return (Criteria) this; + } + + public Criteria andDownloadStatusLessThanOrEqualTo(Integer value) { + addCriterion("download_status <=", value, "downloadStatus"); + return (Criteria) this; + } + + public Criteria andDownloadStatusIn(List values) { + addCriterion("download_status in", values, "downloadStatus"); + return (Criteria) this; + } + + public Criteria andDownloadStatusNotIn(List values) { + addCriterion("download_status not in", values, "downloadStatus"); + return (Criteria) this; + } + + public Criteria andDownloadStatusBetween(Integer value1, Integer value2) { + addCriterion("download_status between", value1, value2, "downloadStatus"); + return (Criteria) this; + } + + public Criteria andDownloadStatusNotBetween(Integer value1, Integer value2) { + addCriterion("download_status not between", value1, value2, "downloadStatus"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andOpIdIsNull() { + addCriterion("op_id is null"); + return (Criteria) this; + } + + public Criteria andOpIdIsNotNull() { + addCriterion("op_id is not null"); + return (Criteria) this; + } + + public Criteria andOpIdEqualTo(Long value) { + addCriterion("op_id =", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotEqualTo(Long value) { + addCriterion("op_id <>", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdGreaterThan(Long value) { + addCriterion("op_id >", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdGreaterThanOrEqualTo(Long value) { + addCriterion("op_id >=", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdLessThan(Long value) { + addCriterion("op_id <", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdLessThanOrEqualTo(Long value) { + addCriterion("op_id <=", value, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdIn(List values) { + addCriterion("op_id in", values, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotIn(List values) { + addCriterion("op_id not in", values, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdBetween(Long value1, Long value2) { + addCriterion("op_id between", value1, value2, "opId"); + return (Criteria) this; + } + + public Criteria andOpIdNotBetween(Long value1, Long value2) { + addCriterion("op_id not between", value1, value2, "opId"); + return (Criteria) this; + } + + public Criteria andOpNameIsNull() { + addCriterion("op_name is null"); + return (Criteria) this; + } + + public Criteria andOpNameIsNotNull() { + addCriterion("op_name is not null"); + return (Criteria) this; + } + + public Criteria andOpNameEqualTo(String value) { + addCriterion("op_name =", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotEqualTo(String value) { + addCriterion("op_name <>", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameGreaterThan(String value) { + addCriterion("op_name >", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameGreaterThanOrEqualTo(String value) { + addCriterion("op_name >=", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLessThan(String value) { + addCriterion("op_name <", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLessThanOrEqualTo(String value) { + addCriterion("op_name <=", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameLike(String value) { + addCriterion("op_name like", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotLike(String value) { + addCriterion("op_name not like", value, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameIn(List values) { + addCriterion("op_name in", values, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotIn(List values) { + addCriterion("op_name not in", values, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameBetween(String value1, String value2) { + addCriterion("op_name between", value1, value2, "opName"); + return (Criteria) this; + } + + public Criteria andOpNameNotBetween(String value1, String value2) { + addCriterion("op_name not between", value1, value2, "opName"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/model/order/OrderStarbucksModel.java b/service/src/main/java/com/hfkj/model/order/OrderStarbucksModel.java index 56c49b0..e5c03e0 100644 --- a/service/src/main/java/com/hfkj/model/order/OrderStarbucksModel.java +++ b/service/src/main/java/com/hfkj/model/order/OrderStarbucksModel.java @@ -17,4 +17,6 @@ public class OrderStarbucksModel extends BsOrderChild{ private String storeName; private String userPhone; + + private Integer payType; } diff --git a/service/src/main/java/com/hfkj/model/order/orderExport/OrderGoodsExportModel.java b/service/src/main/java/com/hfkj/model/order/orderExport/OrderGoodsExportModel.java new file mode 100644 index 0000000..dc67d5e --- /dev/null +++ b/service/src/main/java/com/hfkj/model/order/orderExport/OrderGoodsExportModel.java @@ -0,0 +1,116 @@ +package com.hfkj.model.order.orderExport; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.write.style.ColumnWidth; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * @ClassName OrderGoodsExportModel + * @Author Sum1Dream + * @Description 实物订单导出 + * @Date 2024/8/12 下午5:07 + **/ +@Data +public class OrderGoodsExportModel { + + @ColumnWidth(50) + @ExcelProperty("商品名称") + public String goodsName; + + @ColumnWidth(20) + @ExcelProperty("商户名称") + public String merName; + + @ColumnWidth(20) + @ExcelProperty("类型名称") + public String goodsTypeName; + + @ColumnWidth(20) + @ExcelProperty("品牌名称") + public String goodsBrandName; + + @ColumnWidth(20) + @ExcelProperty("用户手机号") + public String userPhone; + + @ColumnWidth(40) + @ExcelProperty("订单号") + public String orderNo; + + @ColumnWidth(15) + @ExcelProperty("子订单号") + public String childOrderNo; + + @ColumnWidth(20) + @ExcelProperty("物流单号") + public String logisticsNo; + + @ColumnWidth(30) + @ExcelProperty("商品规格") + public String goodsSpecsName; + + @ColumnWidth(20) + @ExcelProperty("商品价格") + public BigDecimal goodsPrice; + + @ColumnWidth(20) + @ExcelProperty("购买数量") + public Integer goodsCount; + + @ColumnWidth(20) + @ExcelProperty({"交易信息", "订单金额"}) + public BigDecimal totalPrice; + + @ColumnWidth(20) + @ExcelProperty({"交易信息", "总优惠"}) + public BigDecimal totalDeductionPrice; + + @ColumnWidth(20) + @ExcelProperty({"交易信息", "优惠券优惠"}) + public BigDecimal couponDiscountPrice; + + @ColumnWidth(20) + @ExcelProperty({"交易信息", "积分抵扣"}) + public BigDecimal integralDiscountPrice; + + @ColumnWidth(20) + @ExcelProperty({"交易信息", "实付金额"}) + public BigDecimal payRealPrice; + + @ColumnWidth(20) + @ExcelProperty({"交易信息", "支付渠道"}) + public String payChannel; + + @ColumnWidth(20) + @ExcelProperty({"交易信息", "支付方式"}) + public String payType; + + @ColumnWidth(20) + @ExcelProperty({"交易信息", "支付单号"}) + public String paySerialNo; + + @ColumnWidth(20) + @ExcelProperty({"交易信息", "交易状态"}) + public String tradeStatus; + + @ColumnWidth(20) + @ExcelProperty({"交易信息", "创建时间"}) + public Date createTime; + + @ColumnWidth(20) + @ExcelProperty({"交易信息", "支付时间"}) + public Date payTime; + + @ColumnWidth(20) + @ExcelProperty("物流状态") + public String logisticsStatusDesc; + + @ColumnWidth(20) + @ExcelProperty("完成时间") + public Date finishTime; + + +} diff --git a/service/src/main/java/com/hfkj/qianzhu/channel/StarbucksService.java b/service/src/main/java/com/hfkj/qianzhu/channel/StarbucksService.java index adf7df0..cdca58f 100644 --- a/service/src/main/java/com/hfkj/qianzhu/channel/StarbucksService.java +++ b/service/src/main/java/com/hfkj/qianzhu/channel/StarbucksService.java @@ -103,14 +103,17 @@ public class StarbucksService { * @Author: Sum1Dream * @Date: 2024/8/1 下午2:21 */ - public static JSONObject starbucksOrdersPay(Map map) throws Exception { - - JSONObject object = QianZhuService.requestH5("starbucksOrders.pay" , map); + public static JSONObject starbucksOrdersPay(Map map) { + try { + JSONObject object = QianZhuService.requestH5("starbucksOrders.pay" , map); - if (object.getBoolean("success")) { - return object; - } else { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + if (object.getBoolean("success")) { + return object; + } else { + return null; + } + } catch (Exception e) { + return null; } } diff --git a/service/src/main/java/com/hfkj/service/cms/impl/CmsContentServiceImpl.java b/service/src/main/java/com/hfkj/service/cms/impl/CmsContentServiceImpl.java index d28f9d8..17bf8b2 100644 --- a/service/src/main/java/com/hfkj/service/cms/impl/CmsContentServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/cms/impl/CmsContentServiceImpl.java @@ -63,7 +63,7 @@ public class CmsContentServiceImpl implements CmsContentService { if (StringUtils.isNotBlank(MapUtils.getString(map, "platformCode"))) { criteria.andPlatformCodeEqualTo(MapUtils.getString(map, "platformCode")); } - + example.setOrderByClause("create_time desc"); return cmsContentMapper.selectByExample(example); } } diff --git a/service/src/main/java/com/hfkj/service/file/FileRecordsService.java b/service/src/main/java/com/hfkj/service/file/FileRecordsService.java new file mode 100644 index 0000000..cdf83f6 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/file/FileRecordsService.java @@ -0,0 +1,83 @@ +package com.hfkj.service.file; + +import com.hfkj.entity.FileRecords; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName FileRecordsService + * @Author Sum1Dream + * @Description 文件记录 + * @Date 2024/8/12 下午2:04 + **/ +public interface FileRecordsService { + + /** + * @MethodName create + * @Description: 创建 + * @param fileRecords + * @Author: Sum1Dream + * @Date: 2024/8/12 下午2:06 + */ + void create(FileRecords fileRecords); + + /** + * @MethodName update + * @Description: 更新 + * @param fileRecords + * @Author: Sum1Dream + * @Date: 2024/8/12 下午2:06 + */ + void update(FileRecords fileRecords); + + /** + * @MethodName delete + * @Description: 删除 + * @param id + * @param fullDelete + * @Author: Sum1Dream + * @Date: 2024/8/12 下午2:06 + */ + void delete(Long id , Boolean fullDelete); + + /** + * @MethodName queryDetail + * @Description: 查询详情 + * @param id + * @return: com.hfkj.entity.FileRecords + * @Author: Sum1Dream + * @Date: 2024/8/12 下午2:07 + */ + FileRecords queryDetail(Long id); + + /** + * @MethodName queryDetailByMap + * @Description: 查询 + * @param map + * @return: com.hfkj.entity.FileRecords + * @Author: Sum1Dream + * @Date: 2024/8/12 下午2:07 + */ + FileRecords queryDetailByMap(Map map); + + /** + * @MethodName getList + * @Description: 查询列表 + * @param map + * @return: java.util.List + * @Author: Sum1Dream + * @Date: 2024/8/12 下午2:07 + */ + List getList(Map map); + + /** + * @MethodName findExported + * @Description: 是否可以导出 + * @param content + * @return: java.lang.Boolean + * @Author: Sum1Dream + * @Date: 2024/8/14 下午5:03 + */ + Boolean findExported(String content , Long opId); +} diff --git a/service/src/main/java/com/hfkj/service/file/impl/FileRecordsServiceImpl.java b/service/src/main/java/com/hfkj/service/file/impl/FileRecordsServiceImpl.java new file mode 100644 index 0000000..cc5798a --- /dev/null +++ b/service/src/main/java/com/hfkj/service/file/impl/FileRecordsServiceImpl.java @@ -0,0 +1,71 @@ +package com.hfkj.service.file.impl; + +import com.hfkj.dao.FileRecordsMapper; +import com.hfkj.entity.FileRecords; +import com.hfkj.entity.FileRecordsExample; +import com.hfkj.service.file.FileRecordsService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +@Service("fileRecordsService") +public class FileRecordsServiceImpl implements FileRecordsService { + + @Resource + private FileRecordsMapper fileRecordsMapper; + + @Override + public void create(FileRecords fileRecords) { + fileRecordsMapper.insert(fileRecords); + } + + @Override + public void update(FileRecords fileRecords) { + fileRecordsMapper.updateByPrimaryKeySelective(fileRecords); + } + + @Override + public void delete(Long id, Boolean fullDelete) { + fileRecordsMapper.deleteByPrimaryKey(id); + } + + @Override + public FileRecords queryDetail(Long id) { + return fileRecordsMapper.selectByPrimaryKey(id); + } + + @Override + public FileRecords queryDetailByMap(Map map) { + return null; + } + + @Override + public List getList(Map map) { + + FileRecordsExample example = new FileRecordsExample(); + FileRecordsExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getLong(map, "opId") != null) { + criteria.andOpIdEqualTo(MapUtils.getLong(map, "opId")); + } + example.setOrderByClause("create_time desc"); + return fileRecordsMapper.selectByExample(example); + } + + @Override + public Boolean findExported(String content , Long opId) { + + FileRecordsExample example = new FileRecordsExample(); + FileRecordsExample.Criteria criteria = example.createCriteria(); + + criteria.andDownloadConditionsEqualTo(content).andOpIdEqualTo(opId).andStatusEqualTo(2); + + List list = fileRecordsMapper.selectByExample(example); + + return !list.isEmpty(); + } +} diff --git a/service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java b/service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java index 0e600a0..c478dba 100644 --- a/service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java +++ b/service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java @@ -58,6 +58,16 @@ public interface BsOrderGoodsService { */ BsOrderGoods findGoodsOrder(String orderNo); + /** + * @MethodName findGoodsOrderLogisticsNo + * @Description: 根据物流单好查询 + * @param logisticsNo + * @return: com.hfkj.entity.BsOrderGoods + * @Author: Sum1Dream + * @Date: 2024/8/13 上午9:50 + */ + BsOrderGoods findGoodsOrderLogisticsNo(String logisticsNo); + /** * @MethodName findGoodsOrderByChild * @Description: @@ -87,6 +97,7 @@ public interface BsOrderGoodsService { * @return java.util.List */ List getList(Map map); + List getList(); /** * @Author Sum1Dream @@ -126,7 +137,7 @@ public interface BsOrderGoodsService { * @Param [num] * @Return com.alibaba.fastjson.JSONObject */ - Object getLogisticsMsg(String logisticsNo); + Object getLogisticsMsg(String logisticsNo , String mobile); /** * 更新缓存 diff --git a/service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java index d565c88..5970ce6 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/BsOrderGoodsServiceImpl.java @@ -15,15 +15,13 @@ import com.hfkj.entity.GoodsLogisticsExample; import com.hfkj.model.order.OrderModel; import com.hfkj.service.goods.BsOrderGoodsService; import com.hfkj.service.order.BsOrderService; +import com.hfkj.sysenum.order.OrderChildStatusEnum; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; @Service("bsOrderGoodsService") public class BsOrderGoodsServiceImpl implements BsOrderGoodsService { @@ -31,7 +29,7 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService { // 缓存前缀KEY public final static String CACHE_KEY = "LOGISTICS:"; // 订单缓存时间 7天 - public final static Integer CACHE_TIME = 60*60*6; + public final static Integer CACHE_TIME = 60*30; @Resource private BsOrderGoodsMapper bsOrderGoodsMapper; @@ -70,7 +68,21 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService { @Override public BsOrderGoods findGoodsOrder(String orderNo) { BsOrderGoodsExample example = new BsOrderGoodsExample(); - example.createCriteria().andStatusNotEqualTo(0).andOrderNoEqualTo(orderNo); + example.createCriteria().andOrderNoEqualTo(orderNo); + + List list = bsOrderGoodsMapper.selectByExample(example); + + if (!list.isEmpty()) { + return list.get(0); + } + + return null; + } + + @Override + public BsOrderGoods findGoodsOrderLogisticsNo(String logisticsNo) { + BsOrderGoodsExample example = new BsOrderGoodsExample(); + example.createCriteria().andStatusNotEqualTo(0).andLogisticsNoEqualTo(logisticsNo); List list = bsOrderGoodsMapper.selectByExample(example); @@ -84,7 +96,7 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService { @Override public BsOrderGoods findGoodsOrderByChild(String orderChildNo) { BsOrderGoodsExample example = new BsOrderGoodsExample(); - example.createCriteria().andStatusNotEqualTo(0).andChildOrderNoEqualTo(orderChildNo); + example.createCriteria().andChildOrderNoEqualTo(orderChildNo); List list = bsOrderGoodsMapper.selectByExample(example); @@ -125,6 +137,14 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService { if (StringUtils.isNotBlank(MapUtils.getString(map, "userPhone"))) { criteria.andUserPhoneEqualTo(MapUtils.getString(map, "userPhone")); } + if (StringUtils.isNotBlank(MapUtils.getString(map, "logisticsStatus"))) { + if (MapUtils.getString(map , "logisticsStatus").equals("待发货")) { + criteria.andLogisticsStatusIsNull(); + } else { + criteria.andLogisticsStatusEqualTo(MapUtils.getString(map, "logisticsStatus")); + } + + } if (MapUtils.getLong(map, "goodsType") != null) { criteria.andGoodsTypeIdEqualTo(MapUtils.getLong(map, "goodsType")); } @@ -160,6 +180,13 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService { return bsOrderGoodsMapper.selectByExample(example); } + @Override + public List getList() { + BsOrderGoodsExample example = new BsOrderGoodsExample(); + + return bsOrderGoodsMapper.selectByExample(example); + } + @Override public GoodsLogistics findGoodsLogistics(Long orderGoodsId) { GoodsLogisticsExample example = new GoodsLogisticsExample(); @@ -227,10 +254,10 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService { } @Override - public Object getLogisticsMsg(String logisticsNo) { + public Object getLogisticsMsg(String logisticsNo , String mobile) { Object data = redisUtil.get(CACHE_KEY + logisticsNo); if (data == null) { - JSONObject jsonObjects = OrderUtil.getLogisticsMsg(logisticsNo); + JSONObject jsonObjects = OrderUtil.getLogisticsMsg(logisticsNo , mobile); if (jsonObjects == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "暂未发货!"); } @@ -270,9 +297,11 @@ public class BsOrderGoodsServiceImpl implements BsOrderGoodsService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前状态,不支持确认收货!"); } - orderGoods.setStatus(9); + // 子订单完成 orderService.childOrderComplete(orderGoods.getChildOrderNo()); + orderGoods.setStatus(OrderChildStatusEnum.status3.getCode()); + orderGoods.setUpdateTime(new Date()); update(orderGoods); // 删除缓存 orderService.cacheDelete(orderGoods.getOrderNo()); diff --git a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java index ea20595..db8104c 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java @@ -239,7 +239,7 @@ public class OrderCreateService { orderGoods.setGoodsSpecsName(goodsSpecs.getName()); orderGoods.setGoodsSpecsOriginalPrice(goodsSpecs.getOriginalPrice()); orderGoods.setGoodsCount(orderChild.getProductCount()); - orderGoods.setStatus(OrderGoodsStatusEnum.status8.getCode()); + orderGoods.setStatus(orderChild.getStatus()); orderGoods.setDeliveryAddress(address.getAddress()); orderGoods.setDeliveryAddressId(address.getId()); orderGoods.setCreateTime(new Date()); @@ -361,7 +361,7 @@ public class OrderCreateService { // 查询星巴克产品 Map map = new HashMap<>(); map.put("pageIndex", 1); - map.put("pageSize", 100000); + map.put("pageSize", 200); JSONObject jsonObject = StarbucksService.starbucksProducts(map); if (jsonObject.getJSONObject("data") == null) { throw ErrorHelp.genException(SysCode.System , ErrorCode.REQ_PARAMS_ERROR ); @@ -445,16 +445,16 @@ public class OrderCreateService { orderChild.setMerId(productConfig.getMerId()); orderChild.setProductName("星巴克"); orderChild.setProductCount(1); - orderChild.setProductSpecName(String.valueOf(productSpecName.toString())); + orderChild.setProductSpecName(productSpecName.toString()); // 星巴克创建订单 // 获取token Map mapToken = new HashMap<>(); mapToken.put("platformUniqueId" , order.getOrderNo()); mapToken.put("nickname" , order.getUserName()); - mapToken.put("mobile" , order.getUserPhone()); + mapToken.put("mobile" , object.getString("phone")); StarbucksService.getTokenV2(mapToken); - // 查询产品 + // 预下单 Map mapOrder = new HashMap<>(); mapOrder.put("storeCode", object.getString("storeCode")); mapOrder.put("customerMobile", object.getString("phone")); diff --git a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java index cb3026c..e565a71 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java @@ -76,7 +76,7 @@ public class OrderPaySuccessService { } else if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type3.getCode())) { cinema(order, childOrder); } else if (childOrder.getProductType().equals(OrderChildProductTypeEnum.type4.getCode())) { - starbucks(childOrder); + starbucks(order , childOrder); } } catch (Exception e) { @@ -224,14 +224,16 @@ public class OrderPaySuccessService { goodsOrder.setPaySerialNo(order.getPaySerialNo()); goodsOrder.setPayTime(order.getPayTime()); goodsOrder.setUpdateTime(new Date()); - goodsOrder.setStatus(1); - + goodsOrder.setStatus(childOrder.getStatus()); + bsOrderGoodsService.update(goodsOrder); } catch (Exception e) { - goodsOrder.setExceptionStatus(true); + if (goodsOrder == null) { + goodsOrder = new BsOrderGoods(); + } goodsOrder.setExceptionMsg(e.getMessage()); + bsOrderGoodsService.update(goodsOrder); } - bsOrderGoodsService.update(goodsOrder); } public void cinema(OrderModel order,BsOrderChild childOrder) { @@ -288,12 +290,21 @@ public class OrderPaySuccessService { } - public void starbucks(BsOrderChild childOrder) throws Exception { + public void starbucks(OrderModel order,BsOrderChild childOrder) { // 推送订单 // 查询星巴克订单 Map map = new HashMap<>(); map.put("orderNo", childOrder.getChannelOrderNo()); StarbucksService.starbucksOrdersPay(map); + + Map params = new HashMap<>(); + params.put("orderNo", childOrder.getOrderNo()); + List orderStarbucks = bsOrderStarbucksService.getList(params); + + for (BsOrderStarbucks bsOrderStarbucks : orderStarbucks) { + bsOrderStarbucks.setPayType(order.getPayType()); + bsOrderStarbucksService.update(bsOrderStarbucks); + } } diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderChildServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderChildServiceImpl.java index 84ab6bd..d0acfb1 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderChildServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderChildServiceImpl.java @@ -12,8 +12,10 @@ import com.hfkj.service.BsProductConfigService; import com.hfkj.service.goods.*; import com.hfkj.service.goods.impl.BsOrderStarbucksServiceImpl; import com.hfkj.service.order.BsOrderChildService; +import com.hfkj.service.order.BsOrderService; import com.hfkj.sysenum.order.OrderChildProductTypeEnum; import com.hfkj.sysenum.order.OrderChildStatusEnum; +import com.hfkj.sysenum.order.OrderLogisticsStatusEnum; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; @@ -48,6 +50,9 @@ public class BsOrderChildServiceImpl implements BsOrderChildService { @Resource private BsProductConfigService bsProductConfigService; + @Resource + private BsOrderService orderService; + @Override public void editData(BsOrderChild data) { data.setUpdateTime(new Date()); @@ -113,6 +118,16 @@ public class BsOrderChildServiceImpl implements BsOrderChildService { object.put("orderGoodsId", orderGoods.getId()); childModel.setBusiness(object); + if (orderGoods.getLogisticsStatus() != null && orderGoods.getLogisticsStatus().equals(OrderLogisticsStatusEnum.statusSIGN.getCode())) { + // 子订单完成 + orderService.childOrderComplete(orderGoods.getChildOrderNo()); + orderGoods.setStatus(OrderChildStatusEnum.status3.getCode()); + orderGoods.setUpdateTime(new Date()); + orderGoodsService.update(orderGoods); + // 删除缓存 + orderService.cacheDelete(orderGoods.getOrderNo()); + } + } } else if (childModel.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) { childModel.setBusiness(goodsVpdService.queryDetailBySpecsId(childModel.getProductSpecId())); diff --git a/service/src/main/java/com/hfkj/sysenum/fileRecords/FileRecordsEnum.java b/service/src/main/java/com/hfkj/sysenum/fileRecords/FileRecordsEnum.java new file mode 100644 index 0000000..e22f5b8 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/fileRecords/FileRecordsEnum.java @@ -0,0 +1,59 @@ +package com.hfkj.sysenum.fileRecords; + + +import lombok.Getter; + +import java.util.Objects; + +@Getter +public enum FileRecordsEnum { + /** + * 实物订单 + */ + status1(1, "实物订单"), + + /** + * 虚拟订单 + */ + status2(2, "虚拟订单"), + + /** + * 肯德基订单 + */ + status3(3, "肯德基订单"), + + /** + * 星巴克订单 + */ + status4(4, "星巴克订单"), + + /** + * 财务对账订单 + */ + status5(5, "财务对账订单"), + + /** + * 物流订单上传订单 + */ + status6(6, "物流订单上传订单"), + + status7(7, "物流订单下载订单"), + ; + + private final int code; + + private final String name; + + + FileRecordsEnum(int code, String name) { + this.code = code; + this.name = name; + } + + public static FileRecordsEnum getData(Integer type) { + for (FileRecordsEnum ele : values()) { + if (Objects.equals(type,ele.getCode())) return ele; + } + return null; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/order/OrderLogisticsStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/order/OrderLogisticsStatusEnum.java new file mode 100644 index 0000000..0b66dde --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/order/OrderLogisticsStatusEnum.java @@ -0,0 +1,32 @@ +package com.hfkj.sysenum.order; + +import lombok.Getter; + +@Getter +public enum OrderLogisticsStatusEnum { + + statusDELIVERING("派件中" , "DELIVERING"), + + statusTRANSPORT("运输中", "TRANSPORT"), + + statusAGENT_SIGN("已代签收", "AGENT_SIGN"), + + statusSIGN("已签收", "SIGN"), + + statusACCEPT("已揽收", "ACCEPT"), + + statusFAILED("包裹异常", "FAILED"), + + statusWAIT_ACCEPT("待揽收", "WAIT_ACCEPT"), + ; + + private final String code; + + private final String name; + + + OrderLogisticsStatusEnum(String name, String code) { + this.code = code; + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/order/OrderStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/order/OrderStatusEnum.java index f86ef6f..291685c 100644 --- a/service/src/main/java/com/hfkj/sysenum/order/OrderStatusEnum.java +++ b/service/src/main/java/com/hfkj/sysenum/order/OrderStatusEnum.java @@ -2,6 +2,8 @@ package com.hfkj.sysenum.order; import lombok.Getter; +import java.util.Objects; + /** * 交易订单状态 * @className: OrderChildProductType @@ -45,4 +47,11 @@ public enum OrderStatusEnum { this.code = code; this.name = name; } + + public static OrderStatusEnum getData(Integer type) { + for (OrderStatusEnum ele : values()) { + if (Objects.equals(type,ele.getCode())) return ele; + } + return null; + } } diff --git a/service/src/main/resources/dev/commonConfig.properties b/service/src/main/resources/dev/commonConfig.properties index 39d0775..68885ed 100644 --- a/service/src/main/resources/dev/commonConfig.properties +++ b/service/src/main/resources/dev/commonConfig.properties @@ -58,12 +58,12 @@ huiftShopCode=50041b27-f985-dcb0-1cc0-f106b09bf1fe huiftSignSecret=DB4D8069A9AC6DDF9D75667EE5CF182A #QIANZHU -qianZhuUrl=https://live-test.qianzhu8.com -qianzhuH5url=https://nf-test.qianzhu8.com/gateway -qinzhuUrlToken=https://live-test.qianzhu8.com/gateway -qianZhuPlatformId=10376 -qianZhuSecret=ktxb49sh2jfhgn8g -qianZhuCinemaNotify=https://phgcs.dctpay.com/order/cinemaNotify/notify +qianZhuUrl=https://live.qianzhu8.com +qianzhuH5url=https://nf.qianzhu8.com/gateway +qinzhuUrlToken=https://live.qianzhu8.com/gateway +qianZhuPlatformId=10710 +qianZhuSecret=pgmh5j1cbq2brm08 +qianZhuCinemaNotify=https://phg.dctpay.com/order/cinemaNotify/notify #CT ctNotifyUrl = 1