diff --git a/bweb/lib/open-platform-sdk-1.0.21.jar b/bweb/lib/open-platform-sdk-1.0.21.jar new file mode 100644 index 0000000..0cbe24f Binary files /dev/null and b/bweb/lib/open-platform-sdk-1.0.21.jar differ diff --git a/bweb/pom.xml b/bweb/pom.xml index 57b112a..6df9864 100644 --- a/bweb/pom.xml +++ b/bweb/pom.xml @@ -18,6 +18,19 @@ service PACKT-SNAPSHOT + + + commons-codec + commons-codec + 1.11 + + + meituan.skd + meituan-open-sdk + system + 1.0.21 + ${basedir}/lib/open-platform-sdk-1.0.21.jar + @@ -26,6 +39,13 @@ src/main/resources/${env} false + + ${basedir}/lib + BOOT-INF/lib/ + + **/*.jar + + diff --git a/bweb/src/main/java/com/bweb/controller/FileUploadController.java b/bweb/src/main/java/com/bweb/controller/FileUploadController.java index eaf109d..898b421 100644 --- a/bweb/src/main/java/com/bweb/controller/FileUploadController.java +++ b/bweb/src/main/java/com/bweb/controller/FileUploadController.java @@ -101,7 +101,7 @@ public class FileUploadController { } @RequestMapping(value = "/fileUpload", method = RequestMethod.POST) - @ApiOperation(value = "上传文件(超过500KB压缩)") + @ApiOperation(value = "上传文件(超过1000KB压缩)") @ResponseBody public ResponseData fileUpload(@RequestParam(value = "files" , required = false) MultipartFile files, HttpServletRequest request, @@ -139,7 +139,7 @@ public class FileUploadController { fileNames.add(childPath + "/" + fileName); // 图片压缩 InputStream fis = new FileInputStream(destDirName + File.separator + fileName); - if (fis.available() > 500000) { + if (fis.available() > 1000000) { Thumbnails.of(new FileInputStream(destDirName + File.separator + fileName)).scale(0.5).toFile(new File(destDirName + File.separator + fileName)); } PutObjectResult putObjectResult = HuaWeiYunObs.putObject(CommonSysConst.getSysConfig().getObsBucketName(), diff --git a/bweb/src/main/java/com/bweb/controller/TestController.java b/bweb/src/main/java/com/bweb/controller/TestController.java index 10b66ee..3713e00 100644 --- a/bweb/src/main/java/com/bweb/controller/TestController.java +++ b/bweb/src/main/java/com/bweb/controller/TestController.java @@ -1,19 +1,23 @@ package com.bweb.controller; +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.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.common.utils.*; +import com.hfkj.entity.*; +import com.hfkj.meituan.MeiTuanService; 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.goods.GoodsUserAddressService; 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; @@ -26,6 +30,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; +import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -44,6 +49,16 @@ public class TestController { @Resource private CouponDiscountService couponDiscountService; + @Resource + private BsOrderChildService orderChildService; + @Resource + private BsOrderGoodsService orderGoodsService; + @Resource + private BsOrderGoodsService bsOrderGoodsService; + + @Resource + private GoodsUserAddressService addressService; + @RequestMapping(value="/canteenConsume",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "食堂消费") @@ -100,4 +115,189 @@ 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); + } + } + + @RequestMapping(value="/getLogisticsMsg",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询物流") + public ResponseData getLogisticsMsg(@RequestParam(value = "id" , required = false) Long id) { + try { + Map map = new HashMap<>(); + + BsOrderGoods orderGoods = bsOrderGoodsService.queryDetail(id); + + 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(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); + + return ResponseMsgUtil.success(map); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询汇联通工会卡消费记录") + public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "businessType", required = true) String businessType, + @RequestParam(name = "cardNo", required = true) String cardNo) { + try { + + + JSONObject consumptionRecord = HuiLianTongUnionCardService.queryConsumptionRecordByBusiness(businessType, cardNo, 1661498490000L, 1882423290000L, 1, 10000); + if (StringUtils.isBlank(consumptionRecord.getString("data"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, ""); + } + + JSONArray array = HuiLianTongUnionCardService.resolveResponse(consumptionRecord.getString("data")).getJSONArray( + "records"); + + return ResponseMsgUtil.success(array); + + } catch (Exception e) { + log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/queryTransJournal", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询汇联通工会卡消费记录") + public ResponseData queryTransJournal(@RequestParam(name = "tranType", required = true) String tranType, + @RequestParam(name = "cardNo", required = true) String cardNo, + @RequestParam(value = "pageNum" , required = true) Integer pageNum, + @RequestParam(value = "pageSize" , required = true) Integer pageSize) { + try { + + + JSONObject consumptionRecord = HuiLianTongUnionCardService.queryTransJournal(cardNo , tranType); + if (StringUtils.isBlank(consumptionRecord.getString("data"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, ""); + } + + JSONArray array = HuiLianTongUnionCardService.resolveResponse(consumptionRecord.getString("data")).getJSONArray( + "journals"); + + List list = new ArrayList<>(); + + for (Object object : array) { + JSONObject journal = (JSONObject) object; + journal.put("tranAmount", journal.getBigDecimal("tranAmount").divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)); + list.add(journal); + } + + return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum, list.size(), pageSize, new PageInfo<>(list))); + + } catch (Exception e) { + log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/loginFree", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "H5免登接口") + public ResponseData loginFree(@RequestParam(name = "staffPhone", required = true) String staffPhone, + @RequestParam(name = "productType", required = true) String productType) { + try { + + Map map = new HashMap<>(); + Map staffInfo = new HashMap<>(); + + staffInfo.put("staffPhone", staffPhone); + + map.put("staffInfo", staffInfo); + map.put("ts", new Date().getTime()); + map.put("entId", 104310L); + map.put("productType", productType); + map.put("nonce" , RandomStringGeneratorUtil.generateRandomString(36)); + return ResponseMsgUtil.success(MeiTuanService.loginFree(map)); + + } catch (Exception e) { + log.error("HighUserCardController --> getHuiLianTongCardConsume() 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 dc60b0b..d5f0c63 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; @@ -22,6 +25,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -41,19 +45,36 @@ public class CommonController { @Resource private BsOrderGoodsService bsOrderGoodsService; + @Resource + private GoodsUserAddressService addressService; + @RequestMapping(value = "/test", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "test") public ResponseData test() { try { - - JSONObject refundObj = HuiLianTongUnionCardService.refund("R240805090735776", "240803201355633339"); + /* String goodsDesc = ""; + String tranDesc = ""; + String businessType = "HiSen_phg_goods"; + String instCode = "11101608"; + // 工会卡支付 + JSONObject consumption = HuiLianTongUnionCardService.consumption("240803201355633339_1", "8800030115015087807", new BigDecimal("27.40"), businessType, instCode, goodsDesc, tranDesc); + if (!consumption.getString("respCode").equals("0000")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); + } + // 响应参数 + JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(consumption.getString("data")); + if (consumptionResult.getBoolean("success") != true) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message")); + } +*/ + JSONObject refundObj = HuiLianTongUnionCardService.refund("R240816093659997", "240808134614258487"); if (!refundObj.getString("respCode").equals("0000")) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refundObj.getString("respMessage")); } JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(refundObj.getString("data")); - if (!(consumptionResult.getBoolean("success") || Objects.equals(consumptionResult.getString("message"), "原交易已撤销,不可再次操作"))) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!"+consumptionResult.getString("message")); + if (consumptionResult.getBoolean("success") != true) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "交易失败!"+consumptionResult.getString("message")); } return ResponseMsgUtil.success(consumptionResult); @@ -96,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..cd2f0a1 100644 --- a/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java +++ b/cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java @@ -2,15 +2,22 @@ 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; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.jacoco.agent.rt.internal_035b120.core.internal.flow.IFrame; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; @@ -22,9 +29,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,8 +46,12 @@ 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(value = "like", required = false) Integer like, + @RequestParam(value = "grade", required = false) Integer grade, + @RequestParam(value = "publishDate", required = false) Integer publishDate, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize ) { @@ -58,10 +67,118 @@ 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; + if (item.getString("grade") == null) { + item.put("grade" , "0"); + } + list.add(item); + } + + 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()); // 将结果收集到列表中 + } - return ResponseMsgUtil.success(CinemaService.filmsPagedQuery(params)); + + + if (publishDate != null) { + if (publishDate == 1) { + list = list.stream().sorted( + // 根据对象中的ID进行升序排序 小到大 + Comparator.comparingLong( + e -> DateUtil.timesTamp(JSONObject.parseObject(e.toString()).getString("publishDate")) + ) + // 放开下面的注释,使用reversed()方法,就是降序 大到小 +// .reversed() + ).collect(Collectors.toList()); + } + if (publishDate == 2) { + list = list.stream().sorted( + // 根据对象中的ID进行升序排序 小到大 + Comparator.comparingLong( + e -> DateUtil.timesTamp(JSONObject.parseObject(e.toString()).getString("publishDate")) + ) + // 放开下面的注释,使用reversed()方法,就是降序 大到小 + .reversed() + ).collect(Collectors.toList()); + } + + } + +// if (like != null) { +// if (like == 1) { +// list = list.stream().sorted( +// // 根据对象中的ID进行升序排序 小到大 +// Comparator.comparingLong( +// e -> JSONObject.parseObject(e.toString()).getLong("like") +// ) +// // 放开下面的注释,使用reversed()方法,就是降序 大到小 +//// .reversed() +// ).collect(Collectors.toList()); +// } +// if (like == 2) { +// list = list.stream().sorted( +// // 根据对象中的ID进行升序排序 小到大 +// Comparator.comparingLong( +// e -> JSONObject.parseObject(e.toString()).getLong("like") +// ) +// // 放开下面的注释,使用reversed()方法,就是降序 大到小 +// .reversed() +// ).collect(Collectors.toList()); +// } +// +// } + + if (grade != null) { + if (grade == 1) { + list = list.stream().sorted( + // 根据对象中的ID进行升序排序 小到大 + Comparator.comparingDouble( + e -> JSONObject.parseObject(e.toString()).getDouble("grade") + ) + // 放开下面的注释,使用reversed()方法,就是降序 大到小 +// .reversed() + ).collect(Collectors.toList()); + } + if (grade == 2) { + list = list.stream().sorted( + // 根据对象中的ID进行升序排序 小到大 + Comparator.comparingDouble( + e -> JSONObject.parseObject(e.toString()).getDouble("grade") + ) + // 放开下面的注释,使用reversed()方法,就是降序 大到小 + .reversed() + ).collect(Collectors.toList()); + } + + } + +// list = list.stream().sorted( +// // 根据对象中的ID进行升序排序 小到大 +// Comparator.comparingDouble( +// e -> JSONObject.parseObject(e.toString()).getDouble("grade") +// ) +// // 放开下面的注释,使用reversed()方法,就是降序 大到小 +// .reversed() +// ).collect(Collectors.toList()); + return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum, list.size(), pageSize, new PageInfo<>(list))); } catch (Exception e) { log.error("error!",e); @@ -327,7 +444,7 @@ public class CinemaController { if (areaPrices != null) { - String[] areaName = new String[]{"特价" , "优选" , "最佳"}; + String[] areaName = new String[]{"特价" , "优选" , "最佳" , "中心" , "" , ""}; for (int i = 0; i < areaPrices.size(); i++) { JSONObject priceObject = (JSONObject) areaPrices.get(i); @@ -337,7 +454,9 @@ public class CinemaController { } else { priceObject.put("salePrice" , priceObject.getBigDecimal("price")); } + priceObject.put("areaName" , areaName[i]); + } } diff --git a/order/src/main/java/com/order/controller/OrderAfterSalesApplyController.java b/order/src/main/java/com/order/controller/OrderAfterSalesApplyController.java index ee8a6db..a3b2bb6 100644 --- a/order/src/main/java/com/order/controller/OrderAfterSalesApplyController.java +++ b/order/src/main/java/com/order/controller/OrderAfterSalesApplyController.java @@ -226,6 +226,9 @@ public class OrderAfterSalesApplyController { @RequestParam(value = "childOrderNo" , required = false) String childOrderNo, @RequestParam(value = "applyNo" , required = false) String applyNo, @RequestParam(value = "status" , required = false) Integer status, + @RequestParam(value = "productType" , required = false) String productType, + @RequestParam(value = "productName" , required = false) String productName, + @RequestParam(value = "orderNo" , required = false) String orderNo, @RequestParam(value = "createTimeS" , required = false) Long createTimeS, @RequestParam(value = "createTimeE" , required = false) Long createTimeE, @RequestParam(value = "pageNum" , required = true) Integer pageNum, @@ -249,6 +252,9 @@ public class OrderAfterSalesApplyController { param.put("childOrderNo", childOrderNo); param.put("applyNo", applyNo); param.put("status", status); + param.put("productType", productType); + param.put("productName", productName); + param.put("orderNo", orderNo); param.put("createTimeS", createTimeS); param.put("createTimeE", createTimeE); diff --git a/order/src/main/java/com/order/controller/OrderController.java b/order/src/main/java/com/order/controller/OrderController.java index e1b1536..39e16ad 100644 --- a/order/src/main/java/com/order/controller/OrderController.java +++ b/order/src/main/java/com/order/controller/OrderController.java @@ -31,10 +31,8 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * @className: OrderController @@ -87,7 +85,6 @@ public class OrderController { body.setUserName(userSession.getUser().getName()); body.setUserPhone(userSession.getUser().getPhone()); - return ResponseMsgUtil.success(orderService.create(body)); } catch (Exception e) { @@ -204,5 +201,65 @@ 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); + } + } + + @RequestMapping(value="/deleteOrder",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除订单") + public ResponseData deleteOrder(@RequestBody JSONObject body) { + try { + + if (body == null|| StringUtils.isBlank(body.getString("orderNo"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + BsOrder bsOrder = orderService.getDetail(body.getString("orderNo")); + + if (bsOrder.getOrderStatus() != OrderStatusEnum.status5.getCode()) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前状态不可删除!"); + } + + bsOrder.setOrderStatus(OrderStatusEnum.status0.getCode()); + bsOrder.setUpdateTime(new Date()); + + orderService.deleteOrder(bsOrder); + + 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/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..339b078 100644 --- a/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java +++ b/order/src/main/java/com/order/controller/business/BsOrderGoodsController.java @@ -1,7 +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; import com.hfkj.common.exception.ErrorCode; @@ -9,30 +10,38 @@ 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.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; @Controller @RequestMapping(value="/orderGoods") @@ -50,6 +59,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 +80,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 +94,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 +107,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 +124,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 +299,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 +318,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 +369,65 @@ 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); + } + } + + @RequestMapping(value="/goodsOrderCount",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "待收货数量") + public ResponseData goodsOrderCount(HttpServletRequest request) { + try { + SessionObject sessionObject = userCenter.getSessionObject(request); + SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); + + Map map = new HashMap<>(); + + if (userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type2.getCode())) { + map.put("merId", userModel.getAccount().getObjectId()); + } + + map.put("logisticsStatus", "待发货"); + map.put("status", 2); + + + return ResponseMsgUtil.success(bsOrderGoodsService.getList(map).size()); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/order/src/main/java/com/order/controller/business/OrderCouponController.java b/order/src/main/java/com/order/controller/business/OrderCouponController.java index cb3cb98..edd135a 100644 --- a/order/src/main/java/com/order/controller/business/OrderCouponController.java +++ b/order/src/main/java/com/order/controller/business/OrderCouponController.java @@ -7,19 +7,24 @@ import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.DateUtil; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.config.CommonSysConst; import com.hfkj.entity.BsOrderCoupon; +import com.hfkj.entity.FileRecords; import com.hfkj.model.ResponseData; import com.hfkj.model.SecUserSessionObject; import com.hfkj.model.order.OrderCouponModel; import com.hfkj.service.coupon.BsOrderCouponNoService; import com.hfkj.service.coupon.BsOrderCouponService; +import com.hfkj.service.file.FileRecordsService; import com.hfkj.sysenum.SecUserObjectTypeEnum; +import com.hfkj.sysenum.fileRecords.FileRecordsEnum; import com.hfkj.sysenum.order.OrderChildStatusEnum; import com.hfkj.sysenum.order.OrderCouponNoStatusEnum; import com.hfkj.sysenum.order.OrderPayChannelEnum; import com.hfkj.sysenum.order.OrderPayTypeEnum; +import com.order.utils.excel.OrderCouponExcelMergeHandler; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; @@ -29,6 +34,7 @@ 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 org.thymeleaf.util.DateUtils; import javax.annotation.Resource; import java.io.File; @@ -51,6 +57,8 @@ public class OrderCouponController { private BsOrderCouponNoService orderCouponNoService; @Resource private UserCenter userCenter; + @Resource + private FileRecordsService fileRecordsService; @RequestMapping(value="/queryCouNo",method = RequestMethod.GET) @ResponseBody @@ -147,6 +155,8 @@ public class OrderCouponController { @RequestParam(value = "couStatus" , required = false) Integer couStatus, @RequestParam(value = "createTimeS" , required = false) Long createTimeS, @RequestParam(value = "createTimeE" , required = false) Long createTimeE) { + FileRecords fileRecords = new FileRecords(); + try { Map param = new HashMap<>(); SecUserSessionObject userSessionObject = userCenter.getSessionModel(SecUserSessionObject.class); @@ -154,6 +164,8 @@ public class OrderCouponController { } else if (SecUserObjectTypeEnum.type2.getCode() == userSessionObject.getAccount().getObjectType()) { param.put("merId", userSessionObject.getAccount().getObjectId()); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); } param.put("orderNo", orderNo); param.put("userPhone", userPhone); @@ -165,8 +177,22 @@ public class OrderCouponController { param.put("couStatus", couStatus); param.put("createTimeS", createTimeS); param.put("createTimeE", createTimeE); - List orderList = orderCouponService.getOrderList(param); + // 下载记录 + fileRecords.setCreateTime(new Date()); + fileRecords.setBusinessType(FileRecordsEnum.status2.getCode()); + fileRecords.setDownloadConditions(param.toString()); + fileRecords.setOpId(userSessionObject.getAccount().getId()); + fileRecords.setOpName(userSessionObject.getAccount().getUserName()); + fileRecords.setStatus(2); + fileRecords.setDownloadStatus(2); + fileRecords.setTitle(FileRecordsEnum.status2.getName() + DateUtil.date2String(new Date(System.currentTimeMillis()),DateUtil.YMDHMS) + ".xlsx"); + fileRecords.setFileUrl(CommonSysConst.getSysConfig().getDomainName() + "/filesystem/temporary/" + fileRecords.getTitle()); + fileRecords.setType("2"); + fileRecordsService.create(fileRecords); + + // 查询数据 + List orderList = orderCouponService.getOrderList(param); for (OrderCouponModel coupon : orderList) { if (coupon.getPayChannel() != null) { coupon.setPayChannel(OrderPayChannelEnum.getData(Integer.valueOf(coupon.getPayChannel())).getName()); @@ -179,26 +205,35 @@ public class OrderCouponController { coupon.setExceptionStatus(Boolean.getBoolean(coupon.getExceptionStatus())?"是":"否"); } + // 文件存放地址 String fileUrl = CommonSysConst.getSysConfig().getFileUrl() + "/temporary/"; - String pathName = System.currentTimeMillis()+".xlsx"; File file = new File(fileUrl); if (!file.exists()) { file.mkdirs(); } - //设置第几列开始合并 - int[] mergeColumnIndex = {0,1,2,17}; - //设置第几行开始合并 + // 需要合并的列 + int[] mergeColumnIndex = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18}; + // 需要从第几行开始合并 int mergeRowIndex = 1; - EasyExcel.write(fileUrl+pathName) + // 生成excel文件 + EasyExcel.write(fileUrl+fileRecords.getTitle()) .head(OrderCouponModel.class) .sheet("虚拟商品订单") - //.registerWriteHandler(new ExcelFillCellMergeStrategyUtils(mergeRowIndex, mergeColumnIndex)) + .registerWriteHandler(new OrderCouponExcelMergeHandler(mergeRowIndex, mergeColumnIndex)) .doWrite(orderList); - return ResponseMsgUtil.success(pathName); + fileRecords.setStatus(1); + fileRecords.setUpdateTime(new Date()); + fileRecordsService.update(fileRecords); + return ResponseMsgUtil.success(fileRecords); } catch (Exception e) { + fileRecords.setStatus(3); + fileRecords.setUpdateTime(new Date()); + fileRecords.setExt1(e.toString()); + fileRecordsService.update(fileRecords); + log.error("error!",e); return ResponseMsgUtil.exception(e); } diff --git a/order/src/main/java/com/order/utils/excel/OrderCouponExcelMergeHandler.java b/order/src/main/java/com/order/utils/excel/OrderCouponExcelMergeHandler.java new file mode 100644 index 0000000..c6f6ebe --- /dev/null +++ b/order/src/main/java/com/order/utils/excel/OrderCouponExcelMergeHandler.java @@ -0,0 +1,120 @@ +package com.order.utils.excel; + +import com.alibaba.excel.metadata.CellData; +import com.alibaba.excel.metadata.Head; +import com.alibaba.excel.write.handler.CellWriteHandler; +import com.alibaba.excel.write.metadata.holder.WriteSheetHolder; +import com.alibaba.excel.write.metadata.holder.WriteTableHolder; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.util.CellRangeAddress; + +import java.util.List; + +/** + * @className: ExcelMergeHandler + * @author: HuRui + * @date: 2024/8/17 + **/ +public class OrderCouponExcelMergeHandler implements CellWriteHandler { + + private int[] mergeColumnIndex; + private int mergeRowIndex; + + public OrderCouponExcelMergeHandler() { + } + + /** + * 构造函数 + * + * @param mergeRowIndex 合并开始的行索引 + * @param mergeColumnIndex 要合并的列索引数组 + */ + public OrderCouponExcelMergeHandler(int mergeRowIndex, int[] mergeColumnIndex) { + this.mergeRowIndex = mergeRowIndex; + this.mergeColumnIndex = mergeColumnIndex; + } + + @Override + public void beforeCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Head head, Integer integer, Integer integer1, Boolean aBoolean) { + + } + + @Override + public void afterCellCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Cell cell, Head head, Integer integer, Boolean aBoolean) { + + } + + + /** + * 当前单元格向上合并 + * + * @param writeSheetHolder 当前工作表持有者 + * @param cell 当前单元格 + * @param curRowIndex 当前行索引 + * @param curColIndex 当前列索引 + */ + private void mergeWithPrevRow(WriteSheetHolder writeSheetHolder, Cell cell, int curRowIndex, int curColIndex) { + // 获取当前行的当前列的数据和上一行的当前列列数据,通过上一行数据是否相同进行合并 + Object curData = cell.getCellTypeEnum() == CellType.STRING ? cell.getStringCellValue() : cell.getNumericCellValue(); + // 获取前一个单元格的数据 + Cell preCell = cell.getSheet().getRow(curRowIndex - 1).getCell(curColIndex); + Object preData = preCell.getCellTypeEnum() == CellType.STRING ? preCell.getStringCellValue() : preCell.getNumericCellValue(); + + // 当前交易单号 + Cell curOrderNo = cell.getSheet().getRow(curRowIndex).getCell(0); + // 上一条交易单号 + Cell preOrderNo = cell.getSheet().getRow(curRowIndex - 1).getCell(0); + + // 判断当前单元格和前一个单元格的数据以及主键是否相同 + if (curData.equals(preData) && curOrderNo.getStringCellValue().equals(preOrderNo.getStringCellValue())) { + // 获取工作表 + Sheet sheet = writeSheetHolder.getSheet(); + // 获取已合并的区域 + List mergeRegions = sheet.getMergedRegions(); + boolean isMerged = false; + // 检查前一个单元格是否已经被合并 + for (int i = 0; i < mergeRegions.size() && !isMerged; i++) { + CellRangeAddress cellRangeAddr = mergeRegions.get(i); + // 若上一个单元格已经被合并,则先移出原有的合并单元,再重新添加合并单元 + if (cellRangeAddr.isInRange(curRowIndex - 1, curColIndex)) { + sheet.removeMergedRegion(i); + cellRangeAddr.setLastRow(curRowIndex); + sheet.addMergedRegion(cellRangeAddr); + isMerged = true; + } + } + // 如果前一个单元格未被合并,则新增合并区域 + if (!isMerged) { + CellRangeAddress cellRangeAddress = new CellRangeAddress(curRowIndex - 1, curRowIndex, curColIndex, curColIndex); + sheet.addMergedRegion(cellRangeAddress); + } + } + } + + @Override + public void afterCellDataConverted(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, CellData cellData, Cell cell, Head head, Integer integer, Boolean aBoolean) { + + } + + @Override + public void afterCellDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, List list, Cell cell, Head head, Integer integer, Boolean aBoolean) { + // 当前行索引 + int curRowIndex = cell.getRowIndex(); + // 当前列索引 + int curColIndex = cell.getColumnIndex(); + // 如果当前行大于合并开始行 + if (curRowIndex > mergeRowIndex) { + // 当前列在需要合并的列中 + for (int columnIndex : mergeColumnIndex) { + if (curColIndex == columnIndex) { + // 进行合并操作 + mergeWithPrevRow(writeSheetHolder, cell, curRowIndex, curColIndex); + break; + } + } + } + } +} diff --git a/order/src/main/resources/dev/logback.xml b/order/src/main/resources/dev/logback.xml index b8a7284..c88e0aa 100644 --- a/order/src/main/resources/dev/logback.xml +++ b/order/src/main/resources/dev/logback.xml @@ -246,4 +246,26 @@ + + + log/MeiTuanLog.log + + log/MeiTuanLog/MeiTuanLog.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + diff --git a/order/src/main/resources/prod/logback.xml b/order/src/main/resources/prod/logback.xml index 814ac71..06969bc 100644 --- a/order/src/main/resources/prod/logback.xml +++ b/order/src/main/resources/prod/logback.xml @@ -245,4 +245,26 @@ + + + log/MeiTuanLog.log + + log/MeiTuanLog/MeiTuanLog.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + 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/lib/open-platform-sdk-1.0.21.jar b/service/lib/open-platform-sdk-1.0.21.jar new file mode 100644 index 0000000..0cbe24f Binary files /dev/null and b/service/lib/open-platform-sdk-1.0.21.jar differ diff --git a/service/pom.xml b/service/pom.xml index 594c1dd..7945b8d 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -20,6 +20,7 @@ 2.9.9 + org.springframework.boot @@ -248,6 +249,20 @@ ocr_api20210707 1.1.1 + + + commons-codec + commons-codec + 1.11 + + + + meituan.skd + meituan-open-sdk + system + 1.0.21 + ${basedir}/lib/open-platform-sdk-1.0.21.jar + @@ -255,6 +270,15 @@ src/main/resources/${env} false + + ${basedir}/lib + BOOT-INF/lib/ + + **/*.jar + + + + diff --git a/service/src/main/java/com/hfkj/common/utils/HttpsUtils.java b/service/src/main/java/com/hfkj/common/utils/HttpsUtils.java index 8f70b22..3de6e31 100644 --- a/service/src/main/java/com/hfkj/common/utils/HttpsUtils.java +++ b/service/src/main/java/com/hfkj/common/utils/HttpsUtils.java @@ -48,7 +48,7 @@ public class HttpsUtils { private static PoolingHttpClientConnectionManager connMgr; private static RequestConfig requestConfig; - private static final int MAX_TIMEOUT = 7000; + private static final int MAX_TIMEOUT = 1000 * 25; static { // 设置连接池 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/RandomStringGeneratorUtil.java b/service/src/main/java/com/hfkj/common/utils/RandomStringGeneratorUtil.java new file mode 100644 index 0000000..4b0bb74 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/RandomStringGeneratorUtil.java @@ -0,0 +1,23 @@ +package com.hfkj.common.utils; + +import java.util.Random; + +/** + * @ClassName RandomStringGeneratorUtil + * @Author Sum1Dream + * @Description 生成随机数 + * @Date 2024/8/27 上午11:33 + **/ +public class RandomStringGeneratorUtil { + + public static String generateRandomString(int stringLength) { + char[] chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".toCharArray(); + StringBuilder sb = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < stringLength; i++) { + char c = chars[random.nextInt(chars.length)]; + sb.append(c); + } + return sb.toString(); + } +} diff --git a/service/src/main/java/com/hfkj/config/CommonSysConfig.java b/service/src/main/java/com/hfkj/config/CommonSysConfig.java index 54b6e89..90afb4f 100644 --- a/service/src/main/java/com/hfkj/config/CommonSysConfig.java +++ b/service/src/main/java/com/hfkj/config/CommonSysConfig.java @@ -130,4 +130,12 @@ public class CommonSysConfig { private String CtApiKey; private String ctMemberId; private String ctPostUrl; + + /** + * 美团接口请求参数 + */ + private String mtNotifyUrl; + private String mtAccessKey; + private String mtSecretKey; + private String mtPostUrl; } diff --git a/service/src/main/java/com/hfkj/dao/BsHltCardRecordMapper.java b/service/src/main/java/com/hfkj/dao/BsHltCardRecordMapper.java new file mode 100644 index 0000000..606e68a --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsHltCardRecordMapper.java @@ -0,0 +1,147 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsHltCardRecord; +import com.hfkj.entity.BsHltCardRecordExample; +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 BsHltCardRecordMapper extends BsHltCardRecordMapperExt { + @SelectProvider(type=BsHltCardRecordSqlProvider.class, method="countByExample") + long countByExample(BsHltCardRecordExample example); + + @DeleteProvider(type=BsHltCardRecordSqlProvider.class, method="deleteByExample") + int deleteByExample(BsHltCardRecordExample example); + + @Delete({ + "delete from bs_hlt_card_record", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_hlt_card_record (order_no, card_no, ", + "user_phone, pay_order_no, ", + "pay_serial_no, pay_price, ", + "pay_status, create_time, ", + "update_time, pay_time, ", + "refund_time, exception_status, ", + "exception_content, ext_1, ", + "ext_2, ext_3)", + "values (#{orderNo,jdbcType=VARCHAR}, #{cardNo,jdbcType=VARCHAR}, ", + "#{userPhone,jdbcType=VARCHAR}, #{payOrderNo,jdbcType=VARCHAR}, ", + "#{paySerialNo,jdbcType=VARCHAR}, #{payPrice,jdbcType=DECIMAL}, ", + "#{payStatus,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP}, ", + "#{refundTime,jdbcType=TIMESTAMP}, #{exceptionStatus,jdbcType=BIT}, ", + "#{exceptionContent,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, ", + "#{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(BsHltCardRecord record); + + @InsertProvider(type=BsHltCardRecordSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsHltCardRecord record); + + @SelectProvider(type=BsHltCardRecordSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="card_no", property="cardNo", jdbcType=JdbcType.VARCHAR), + @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_order_no", property="payOrderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="exception_status", property="exceptionStatus", jdbcType=JdbcType.BIT), + @Result(column="exception_content", property="exceptionContent", 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(BsHltCardRecordExample example); + + @Select({ + "select", + "id, order_no, card_no, user_phone, pay_order_no, pay_serial_no, pay_price, pay_status, ", + "create_time, update_time, pay_time, refund_time, exception_status, exception_content, ", + "ext_1, ext_2, ext_3", + "from bs_hlt_card_record", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="order_no", property="orderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="card_no", property="cardNo", jdbcType=JdbcType.VARCHAR), + @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_order_no", property="payOrderNo", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_serial_no", property="paySerialNo", jdbcType=JdbcType.VARCHAR), + @Result(column="pay_price", property="payPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="pay_status", property="payStatus", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="pay_time", property="payTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="refund_time", property="refundTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="exception_status", property="exceptionStatus", jdbcType=JdbcType.BIT), + @Result(column="exception_content", property="exceptionContent", 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) + }) + BsHltCardRecord selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsHltCardRecordSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsHltCardRecord record, @Param("example") BsHltCardRecordExample example); + + @UpdateProvider(type=BsHltCardRecordSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsHltCardRecord record, @Param("example") BsHltCardRecordExample example); + + @UpdateProvider(type=BsHltCardRecordSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsHltCardRecord record); + + @Update({ + "update bs_hlt_card_record", + "set order_no = #{orderNo,jdbcType=VARCHAR},", + "card_no = #{cardNo,jdbcType=VARCHAR},", + "user_phone = #{userPhone,jdbcType=VARCHAR},", + "pay_order_no = #{payOrderNo,jdbcType=VARCHAR},", + "pay_serial_no = #{paySerialNo,jdbcType=VARCHAR},", + "pay_price = #{payPrice,jdbcType=DECIMAL},", + "pay_status = #{payStatus,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "pay_time = #{payTime,jdbcType=TIMESTAMP},", + "refund_time = #{refundTime,jdbcType=TIMESTAMP},", + "exception_status = #{exceptionStatus,jdbcType=BIT},", + "exception_content = #{exceptionContent,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(BsHltCardRecord record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsHltCardRecordMapperExt.java b/service/src/main/java/com/hfkj/dao/BsHltCardRecordMapperExt.java new file mode 100644 index 0000000..0646446 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsHltCardRecordMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsHltCardRecordMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsHltCardRecordSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsHltCardRecordSqlProvider.java new file mode 100644 index 0000000..3bcae85 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsHltCardRecordSqlProvider.java @@ -0,0 +1,402 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsHltCardRecord; +import com.hfkj.entity.BsHltCardRecordExample.Criteria; +import com.hfkj.entity.BsHltCardRecordExample.Criterion; +import com.hfkj.entity.BsHltCardRecordExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsHltCardRecordSqlProvider { + + public String countByExample(BsHltCardRecordExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_hlt_card_record"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsHltCardRecordExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_hlt_card_record"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsHltCardRecord record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_hlt_card_record"); + + if (record.getOrderNo() != null) { + sql.VALUES("order_no", "#{orderNo,jdbcType=VARCHAR}"); + } + + if (record.getCardNo() != null) { + sql.VALUES("card_no", "#{cardNo,jdbcType=VARCHAR}"); + } + + if (record.getUserPhone() != null) { + sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); + } + + if (record.getPayOrderNo() != null) { + sql.VALUES("pay_order_no", "#{payOrderNo,jdbcType=VARCHAR}"); + } + + if (record.getPaySerialNo() != null) { + sql.VALUES("pay_serial_no", "#{paySerialNo,jdbcType=VARCHAR}"); + } + + if (record.getPayPrice() != null) { + sql.VALUES("pay_price", "#{payPrice,jdbcType=DECIMAL}"); + } + + if (record.getPayStatus() != null) { + sql.VALUES("pay_status", "#{payStatus,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.getPayTime() != null) { + sql.VALUES("pay_time", "#{payTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRefundTime() != null) { + sql.VALUES("refund_time", "#{refundTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExceptionStatus() != null) { + sql.VALUES("exception_status", "#{exceptionStatus,jdbcType=BIT}"); + } + + if (record.getExceptionContent() != null) { + sql.VALUES("exception_content", "#{exceptionContent,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(BsHltCardRecordExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("order_no"); + sql.SELECT("card_no"); + sql.SELECT("user_phone"); + sql.SELECT("pay_order_no"); + sql.SELECT("pay_serial_no"); + sql.SELECT("pay_price"); + sql.SELECT("pay_status"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("pay_time"); + sql.SELECT("refund_time"); + sql.SELECT("exception_status"); + sql.SELECT("exception_content"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_hlt_card_record"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsHltCardRecord record = (BsHltCardRecord) parameter.get("record"); + BsHltCardRecordExample example = (BsHltCardRecordExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_hlt_card_record"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getOrderNo() != null) { + sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); + } + + if (record.getCardNo() != null) { + sql.SET("card_no = #{record.cardNo,jdbcType=VARCHAR}"); + } + + if (record.getUserPhone() != null) { + sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); + } + + if (record.getPayOrderNo() != null) { + sql.SET("pay_order_no = #{record.payOrderNo,jdbcType=VARCHAR}"); + } + + if (record.getPaySerialNo() != null) { + sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}"); + } + + if (record.getPayPrice() != null) { + sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}"); + } + + if (record.getPayStatus() != null) { + sql.SET("pay_status = #{record.payStatus,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.getPayTime() != null) { + sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRefundTime() != null) { + sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExceptionStatus() != null) { + sql.SET("exception_status = #{record.exceptionStatus,jdbcType=BIT}"); + } + + if (record.getExceptionContent() != null) { + sql.SET("exception_content = #{record.exceptionContent,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("bs_hlt_card_record"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("order_no = #{record.orderNo,jdbcType=VARCHAR}"); + sql.SET("card_no = #{record.cardNo,jdbcType=VARCHAR}"); + sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); + sql.SET("pay_order_no = #{record.payOrderNo,jdbcType=VARCHAR}"); + sql.SET("pay_serial_no = #{record.paySerialNo,jdbcType=VARCHAR}"); + sql.SET("pay_price = #{record.payPrice,jdbcType=DECIMAL}"); + sql.SET("pay_status = #{record.payStatus,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("pay_time = #{record.payTime,jdbcType=TIMESTAMP}"); + sql.SET("refund_time = #{record.refundTime,jdbcType=TIMESTAMP}"); + sql.SET("exception_status = #{record.exceptionStatus,jdbcType=BIT}"); + sql.SET("exception_content = #{record.exceptionContent,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}"); + + BsHltCardRecordExample example = (BsHltCardRecordExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsHltCardRecord record) { + SQL sql = new SQL(); + sql.UPDATE("bs_hlt_card_record"); + + if (record.getOrderNo() != null) { + sql.SET("order_no = #{orderNo,jdbcType=VARCHAR}"); + } + + if (record.getCardNo() != null) { + sql.SET("card_no = #{cardNo,jdbcType=VARCHAR}"); + } + + if (record.getUserPhone() != null) { + sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); + } + + if (record.getPayOrderNo() != null) { + sql.SET("pay_order_no = #{payOrderNo,jdbcType=VARCHAR}"); + } + + if (record.getPaySerialNo() != null) { + sql.SET("pay_serial_no = #{paySerialNo,jdbcType=VARCHAR}"); + } + + if (record.getPayPrice() != null) { + sql.SET("pay_price = #{payPrice,jdbcType=DECIMAL}"); + } + + if (record.getPayStatus() != null) { + sql.SET("pay_status = #{payStatus,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.getPayTime() != null) { + sql.SET("pay_time = #{payTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRefundTime() != null) { + sql.SET("refund_time = #{refundTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExceptionStatus() != null) { + sql.SET("exception_status = #{exceptionStatus,jdbcType=BIT}"); + } + + if (record.getExceptionContent() != null) { + sql.SET("exception_content = #{exceptionContent,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, BsHltCardRecordExample 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/dao/BsOrderCouponMapper.java b/service/src/main/java/com/hfkj/dao/BsOrderCouponMapper.java index 545e191..1371fab 100644 --- a/service/src/main/java/com/hfkj/dao/BsOrderCouponMapper.java +++ b/service/src/main/java/com/hfkj/dao/BsOrderCouponMapper.java @@ -131,10 +131,17 @@ public interface BsOrderCouponMapper extends BsOrderCouponMapperExt { @Select({ "select", +<<<<<<< HEAD "id, order_no, child_order_no, mer_id, platform_code, user_id, user_phone, goods_id, ", "goods_name, goods_type_id, goods_type_name, goods_brand_id, goods_brand_name, ", "goods_specs_id, goods_specs_name, goods_spesc_original_price, goods_spesc_sale_price, ", "goods_vpd_id, goods_vpd_key, goods_vpd_source, goods_count, total_price, total_deduction_price, ", +======= + "id, order_no, child_order_no, mer_id, user_id, user_phone, goods_id, goods_name, ", + "goods_type_id, goods_type_name, goods_brand_id, goods_brand_name, goods_specs_id, ", + "goods_specs_name, goods_spesc_original_price, goods_spesc_sale_price, goods_vpd_id, ", + "goods_vpd_key, goods_vpd_source, goods_count, total_price, total_deduction_price, ", +>>>>>>> 829e638cdd103b441766e88156903755733dca7a "coupon_discount_price, integral_discount_price, pay_real_price, pay_channel, ", "pay_serial_no, pay_type, `status`, create_time, pay_time, cancel_time, refund_time, ", "finish_time, update_time, ext_1, ext_2, ext_3", diff --git a/service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java b/service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java index f7b5c3e..f62a811 100644 --- a/service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java +++ b/service/src/main/java/com/hfkj/dao/BsOrderCouponMapperExt.java @@ -20,7 +20,8 @@ public interface BsOrderCouponMapperExt { " b.goods_vpd_key goodsKey," + " b.goods_name goodsName," + " b.goods_specs_name goodsSpecsName, " + - " b.goods_spesc_original_price goodsPrice," + + " b.goods_spesc_original_price goodsOriginalPrice," + + " b.goods_spesc_sale_price goodsSalePrice," + " b.goods_count goodsCount," + " b.total_price totalPrice," + " b.total_deduction_price totalDeductionPrice," + @@ -56,7 +57,8 @@ public interface BsOrderCouponMapperExt { " = #{param.createTimeS} ]]>" + " " + " GROUP BY a.id" + - " ORDER BY b.create_time desc,b.order_no" + + " ORDER BY b.create_time desc,b.child_order_no" + "") List getOrderList(@Param("param") Map param); + } diff --git a/service/src/main/java/com/hfkj/entity/BsHltCardRecord.java b/service/src/main/java/com/hfkj/entity/BsHltCardRecord.java new file mode 100644 index 0000000..9a8d3c2 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsHltCardRecord.java @@ -0,0 +1,313 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * bs_hlt_card_record + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsHltCardRecord implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 订单号 + */ + private String orderNo; + + /** + * 卡号 + */ + private String cardNo; + + /** + * 用户电话 + */ + private String userPhone; + + /** + * 支付订单号 + */ + private String payOrderNo; + + /** + * 渠道支付订单号 + */ + private String paySerialNo; + + /** + * 支付金额 + */ + private BigDecimal payPrice; + + /** + * 支付状态 1:待支付 2:已支付 3:已退款 + */ + private Integer payStatus; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + /** + * 支付时间 + */ + private Date payTime; + + /** + * 退款时间 + */ + private Date refundTime; + + /** + * 是否异常0:否 1:是 + */ + private Boolean exceptionStatus; + + /** + * 异常内容 + */ + private String exceptionContent; + + private String ext1; + + private String ext2; + + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo; + } + + public String getCardNo() { + return cardNo; + } + + public void setCardNo(String cardNo) { + this.cardNo = cardNo; + } + + public String getUserPhone() { + return userPhone; + } + + public void setUserPhone(String userPhone) { + this.userPhone = userPhone; + } + + public String getPayOrderNo() { + return payOrderNo; + } + + public void setPayOrderNo(String payOrderNo) { + this.payOrderNo = payOrderNo; + } + + public String getPaySerialNo() { + return paySerialNo; + } + + public void setPaySerialNo(String paySerialNo) { + this.paySerialNo = paySerialNo; + } + + public BigDecimal getPayPrice() { + return payPrice; + } + + public void setPayPrice(BigDecimal payPrice) { + this.payPrice = payPrice; + } + + public Integer getPayStatus() { + return payStatus; + } + + public void setPayStatus(Integer payStatus) { + this.payStatus = payStatus; + } + + 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 getPayTime() { + return payTime; + } + + public void setPayTime(Date payTime) { + this.payTime = payTime; + } + + public Date getRefundTime() { + return refundTime; + } + + public void setRefundTime(Date refundTime) { + this.refundTime = refundTime; + } + + public Boolean getExceptionStatus() { + return exceptionStatus; + } + + public void setExceptionStatus(Boolean exceptionStatus) { + this.exceptionStatus = exceptionStatus; + } + + public String getExceptionContent() { + return exceptionContent; + } + + public void setExceptionContent(String exceptionContent) { + this.exceptionContent = exceptionContent; + } + + 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; + } + BsHltCardRecord other = (BsHltCardRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getOrderNo() == null ? other.getOrderNo() == null : this.getOrderNo().equals(other.getOrderNo())) + && (this.getCardNo() == null ? other.getCardNo() == null : this.getCardNo().equals(other.getCardNo())) + && (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) + && (this.getPayOrderNo() == null ? other.getPayOrderNo() == null : this.getPayOrderNo().equals(other.getPayOrderNo())) + && (this.getPaySerialNo() == null ? other.getPaySerialNo() == null : this.getPaySerialNo().equals(other.getPaySerialNo())) + && (this.getPayPrice() == null ? other.getPayPrice() == null : this.getPayPrice().equals(other.getPayPrice())) + && (this.getPayStatus() == null ? other.getPayStatus() == null : this.getPayStatus().equals(other.getPayStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getPayTime() == null ? other.getPayTime() == null : this.getPayTime().equals(other.getPayTime())) + && (this.getRefundTime() == null ? other.getRefundTime() == null : this.getRefundTime().equals(other.getRefundTime())) + && (this.getExceptionStatus() == null ? other.getExceptionStatus() == null : this.getExceptionStatus().equals(other.getExceptionStatus())) + && (this.getExceptionContent() == null ? other.getExceptionContent() == null : this.getExceptionContent().equals(other.getExceptionContent())) + && (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 + ((getOrderNo() == null) ? 0 : getOrderNo().hashCode()); + result = prime * result + ((getCardNo() == null) ? 0 : getCardNo().hashCode()); + result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); + result = prime * result + ((getPayOrderNo() == null) ? 0 : getPayOrderNo().hashCode()); + result = prime * result + ((getPaySerialNo() == null) ? 0 : getPaySerialNo().hashCode()); + result = prime * result + ((getPayPrice() == null) ? 0 : getPayPrice().hashCode()); + result = prime * result + ((getPayStatus() == null) ? 0 : getPayStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getPayTime() == null) ? 0 : getPayTime().hashCode()); + result = prime * result + ((getRefundTime() == null) ? 0 : getRefundTime().hashCode()); + result = prime * result + ((getExceptionStatus() == null) ? 0 : getExceptionStatus().hashCode()); + result = prime * result + ((getExceptionContent() == null) ? 0 : getExceptionContent().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(", orderNo=").append(orderNo); + sb.append(", cardNo=").append(cardNo); + sb.append(", userPhone=").append(userPhone); + sb.append(", payOrderNo=").append(payOrderNo); + sb.append(", paySerialNo=").append(paySerialNo); + sb.append(", payPrice=").append(payPrice); + sb.append(", payStatus=").append(payStatus); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", payTime=").append(payTime); + sb.append(", refundTime=").append(refundTime); + sb.append(", exceptionStatus=").append(exceptionStatus); + sb.append(", exceptionContent=").append(exceptionContent); + 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/BsHltCardRecordExample.java b/service/src/main/java/com/hfkj/entity/BsHltCardRecordExample.java new file mode 100644 index 0000000..7352432 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsHltCardRecordExample.java @@ -0,0 +1,1334 @@ +package com.hfkj.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsHltCardRecordExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsHltCardRecordExample() { + 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 andOrderNoIsNull() { + addCriterion("order_no is null"); + return (Criteria) this; + } + + public Criteria andOrderNoIsNotNull() { + addCriterion("order_no is not null"); + return (Criteria) this; + } + + public Criteria andOrderNoEqualTo(String value) { + addCriterion("order_no =", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotEqualTo(String value) { + addCriterion("order_no <>", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoGreaterThan(String value) { + addCriterion("order_no >", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoGreaterThanOrEqualTo(String value) { + addCriterion("order_no >=", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLessThan(String value) { + addCriterion("order_no <", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLessThanOrEqualTo(String value) { + addCriterion("order_no <=", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoLike(String value) { + addCriterion("order_no like", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotLike(String value) { + addCriterion("order_no not like", value, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoIn(List values) { + addCriterion("order_no in", values, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotIn(List values) { + addCriterion("order_no not in", values, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoBetween(String value1, String value2) { + addCriterion("order_no between", value1, value2, "orderNo"); + return (Criteria) this; + } + + public Criteria andOrderNoNotBetween(String value1, String value2) { + addCriterion("order_no not between", value1, value2, "orderNo"); + return (Criteria) this; + } + + public Criteria andCardNoIsNull() { + addCriterion("card_no is null"); + return (Criteria) this; + } + + public Criteria andCardNoIsNotNull() { + addCriterion("card_no is not null"); + return (Criteria) this; + } + + public Criteria andCardNoEqualTo(String value) { + addCriterion("card_no =", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotEqualTo(String value) { + addCriterion("card_no <>", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoGreaterThan(String value) { + addCriterion("card_no >", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoGreaterThanOrEqualTo(String value) { + addCriterion("card_no >=", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoLessThan(String value) { + addCriterion("card_no <", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoLessThanOrEqualTo(String value) { + addCriterion("card_no <=", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoLike(String value) { + addCriterion("card_no like", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotLike(String value) { + addCriterion("card_no not like", value, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoIn(List values) { + addCriterion("card_no in", values, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotIn(List values) { + addCriterion("card_no not in", values, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoBetween(String value1, String value2) { + addCriterion("card_no between", value1, value2, "cardNo"); + return (Criteria) this; + } + + public Criteria andCardNoNotBetween(String value1, String value2) { + addCriterion("card_no not between", value1, value2, "cardNo"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNull() { + addCriterion("user_phone is null"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNotNull() { + addCriterion("user_phone is not null"); + return (Criteria) this; + } + + public Criteria andUserPhoneEqualTo(String value) { + addCriterion("user_phone =", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotEqualTo(String value) { + addCriterion("user_phone <>", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThan(String value) { + addCriterion("user_phone >", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThanOrEqualTo(String value) { + addCriterion("user_phone >=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThan(String value) { + addCriterion("user_phone <", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThanOrEqualTo(String value) { + addCriterion("user_phone <=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLike(String value) { + addCriterion("user_phone like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotLike(String value) { + addCriterion("user_phone not like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneIn(List values) { + addCriterion("user_phone in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotIn(List values) { + addCriterion("user_phone not in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneBetween(String value1, String value2) { + addCriterion("user_phone between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotBetween(String value1, String value2) { + addCriterion("user_phone not between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria andPayOrderNoIsNull() { + addCriterion("pay_order_no is null"); + return (Criteria) this; + } + + public Criteria andPayOrderNoIsNotNull() { + addCriterion("pay_order_no is not null"); + return (Criteria) this; + } + + public Criteria andPayOrderNoEqualTo(String value) { + addCriterion("pay_order_no =", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoNotEqualTo(String value) { + addCriterion("pay_order_no <>", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoGreaterThan(String value) { + addCriterion("pay_order_no >", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoGreaterThanOrEqualTo(String value) { + addCriterion("pay_order_no >=", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoLessThan(String value) { + addCriterion("pay_order_no <", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoLessThanOrEqualTo(String value) { + addCriterion("pay_order_no <=", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoLike(String value) { + addCriterion("pay_order_no like", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoNotLike(String value) { + addCriterion("pay_order_no not like", value, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoIn(List values) { + addCriterion("pay_order_no in", values, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoNotIn(List values) { + addCriterion("pay_order_no not in", values, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoBetween(String value1, String value2) { + addCriterion("pay_order_no between", value1, value2, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPayOrderNoNotBetween(String value1, String value2) { + addCriterion("pay_order_no not between", value1, value2, "payOrderNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoIsNull() { + addCriterion("pay_serial_no is null"); + return (Criteria) this; + } + + public Criteria andPaySerialNoIsNotNull() { + addCriterion("pay_serial_no is not null"); + return (Criteria) this; + } + + public Criteria andPaySerialNoEqualTo(String value) { + addCriterion("pay_serial_no =", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoNotEqualTo(String value) { + addCriterion("pay_serial_no <>", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoGreaterThan(String value) { + addCriterion("pay_serial_no >", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoGreaterThanOrEqualTo(String value) { + addCriterion("pay_serial_no >=", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoLessThan(String value) { + addCriterion("pay_serial_no <", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoLessThanOrEqualTo(String value) { + addCriterion("pay_serial_no <=", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoLike(String value) { + addCriterion("pay_serial_no like", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoNotLike(String value) { + addCriterion("pay_serial_no not like", value, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoIn(List values) { + addCriterion("pay_serial_no in", values, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoNotIn(List values) { + addCriterion("pay_serial_no not in", values, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoBetween(String value1, String value2) { + addCriterion("pay_serial_no between", value1, value2, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPaySerialNoNotBetween(String value1, String value2) { + addCriterion("pay_serial_no not between", value1, value2, "paySerialNo"); + return (Criteria) this; + } + + public Criteria andPayPriceIsNull() { + addCriterion("pay_price is null"); + return (Criteria) this; + } + + public Criteria andPayPriceIsNotNull() { + addCriterion("pay_price is not null"); + return (Criteria) this; + } + + public Criteria andPayPriceEqualTo(BigDecimal value) { + addCriterion("pay_price =", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotEqualTo(BigDecimal value) { + addCriterion("pay_price <>", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceGreaterThan(BigDecimal value) { + addCriterion("pay_price >", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("pay_price >=", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceLessThan(BigDecimal value) { + addCriterion("pay_price <", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("pay_price <=", value, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceIn(List values) { + addCriterion("pay_price in", values, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotIn(List values) { + addCriterion("pay_price not in", values, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("pay_price between", value1, value2, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("pay_price not between", value1, value2, "payPrice"); + return (Criteria) this; + } + + public Criteria andPayStatusIsNull() { + addCriterion("pay_status is null"); + return (Criteria) this; + } + + public Criteria andPayStatusIsNotNull() { + addCriterion("pay_status is not null"); + return (Criteria) this; + } + + public Criteria andPayStatusEqualTo(Integer value) { + addCriterion("pay_status =", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusNotEqualTo(Integer value) { + addCriterion("pay_status <>", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusGreaterThan(Integer value) { + addCriterion("pay_status >", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("pay_status >=", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusLessThan(Integer value) { + addCriterion("pay_status <", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusLessThanOrEqualTo(Integer value) { + addCriterion("pay_status <=", value, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusIn(List values) { + addCriterion("pay_status in", values, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusNotIn(List values) { + addCriterion("pay_status not in", values, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusBetween(Integer value1, Integer value2) { + addCriterion("pay_status between", value1, value2, "payStatus"); + return (Criteria) this; + } + + public Criteria andPayStatusNotBetween(Integer value1, Integer value2) { + addCriterion("pay_status not between", value1, value2, "payStatus"); + 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 andPayTimeIsNull() { + addCriterion("pay_time is null"); + return (Criteria) this; + } + + public Criteria andPayTimeIsNotNull() { + addCriterion("pay_time is not null"); + return (Criteria) this; + } + + public Criteria andPayTimeEqualTo(Date value) { + addCriterion("pay_time =", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeNotEqualTo(Date value) { + addCriterion("pay_time <>", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeGreaterThan(Date value) { + addCriterion("pay_time >", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeGreaterThanOrEqualTo(Date value) { + addCriterion("pay_time >=", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeLessThan(Date value) { + addCriterion("pay_time <", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeLessThanOrEqualTo(Date value) { + addCriterion("pay_time <=", value, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeIn(List values) { + addCriterion("pay_time in", values, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeNotIn(List values) { + addCriterion("pay_time not in", values, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeBetween(Date value1, Date value2) { + addCriterion("pay_time between", value1, value2, "payTime"); + return (Criteria) this; + } + + public Criteria andPayTimeNotBetween(Date value1, Date value2) { + addCriterion("pay_time not between", value1, value2, "payTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeIsNull() { + addCriterion("refund_time is null"); + return (Criteria) this; + } + + public Criteria andRefundTimeIsNotNull() { + addCriterion("refund_time is not null"); + return (Criteria) this; + } + + public Criteria andRefundTimeEqualTo(Date value) { + addCriterion("refund_time =", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeNotEqualTo(Date value) { + addCriterion("refund_time <>", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeGreaterThan(Date value) { + addCriterion("refund_time >", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeGreaterThanOrEqualTo(Date value) { + addCriterion("refund_time >=", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeLessThan(Date value) { + addCriterion("refund_time <", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeLessThanOrEqualTo(Date value) { + addCriterion("refund_time <=", value, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeIn(List values) { + addCriterion("refund_time in", values, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeNotIn(List values) { + addCriterion("refund_time not in", values, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeBetween(Date value1, Date value2) { + addCriterion("refund_time between", value1, value2, "refundTime"); + return (Criteria) this; + } + + public Criteria andRefundTimeNotBetween(Date value1, Date value2) { + addCriterion("refund_time not between", value1, value2, "refundTime"); + return (Criteria) this; + } + + public Criteria andExceptionStatusIsNull() { + addCriterion("exception_status is null"); + return (Criteria) this; + } + + public Criteria andExceptionStatusIsNotNull() { + addCriterion("exception_status is not null"); + return (Criteria) this; + } + + public Criteria andExceptionStatusEqualTo(Boolean value) { + addCriterion("exception_status =", value, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusNotEqualTo(Boolean value) { + addCriterion("exception_status <>", value, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusGreaterThan(Boolean value) { + addCriterion("exception_status >", value, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusGreaterThanOrEqualTo(Boolean value) { + addCriterion("exception_status >=", value, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusLessThan(Boolean value) { + addCriterion("exception_status <", value, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusLessThanOrEqualTo(Boolean value) { + addCriterion("exception_status <=", value, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusIn(List values) { + addCriterion("exception_status in", values, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusNotIn(List values) { + addCriterion("exception_status not in", values, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusBetween(Boolean value1, Boolean value2) { + addCriterion("exception_status between", value1, value2, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionStatusNotBetween(Boolean value1, Boolean value2) { + addCriterion("exception_status not between", value1, value2, "exceptionStatus"); + return (Criteria) this; + } + + public Criteria andExceptionContentIsNull() { + addCriterion("exception_content is null"); + return (Criteria) this; + } + + public Criteria andExceptionContentIsNotNull() { + addCriterion("exception_content is not null"); + return (Criteria) this; + } + + public Criteria andExceptionContentEqualTo(String value) { + addCriterion("exception_content =", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentNotEqualTo(String value) { + addCriterion("exception_content <>", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentGreaterThan(String value) { + addCriterion("exception_content >", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentGreaterThanOrEqualTo(String value) { + addCriterion("exception_content >=", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentLessThan(String value) { + addCriterion("exception_content <", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentLessThanOrEqualTo(String value) { + addCriterion("exception_content <=", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentLike(String value) { + addCriterion("exception_content like", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentNotLike(String value) { + addCriterion("exception_content not like", value, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentIn(List values) { + addCriterion("exception_content in", values, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentNotIn(List values) { + addCriterion("exception_content not in", values, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentBetween(String value1, String value2) { + addCriterion("exception_content between", value1, value2, "exceptionContent"); + return (Criteria) this; + } + + public Criteria andExceptionContentNotBetween(String value1, String value2) { + addCriterion("exception_content not between", value1, value2, "exceptionContent"); + 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/entity/BsOrderGoods.java b/service/src/main/java/com/hfkj/entity/BsOrderGoods.java index 3034473..8e99555 100644 --- a/service/src/main/java/com/hfkj/entity/BsOrderGoods.java +++ b/service/src/main/java/com/hfkj/entity/BsOrderGoods.java @@ -170,7 +170,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/meituan/MeiTuanService.java b/service/src/main/java/com/hfkj/meituan/MeiTuanService.java new file mode 100644 index 0000000..243750b --- /dev/null +++ b/service/src/main/java/com/hfkj/meituan/MeiTuanService.java @@ -0,0 +1,74 @@ +package com.hfkj.meituan; + +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.HttpsUtils; +import com.hfkj.config.CommonSysConst; + +import com.meituan.sqt.utils.EncryptUtil; +import com.meituan.sqt.utils.JsonUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; + +/** + * @ClassName MeiTuanService + * @Author Sum1Dream + * @Description 美团接口 + * @Date 2024/8/26 下午4:52 + **/ +public class MeiTuanService { + + + private static Logger log = LoggerFactory.getLogger(MeiTuanService.class); + + + /** + * @MethodName loginFree + * @Description: H5免登接口 + * @param map + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/8/27 上午11:16 + */ + public static JSONObject loginFree(Map map) throws Exception { + + JSONObject object = request("" , map); + + if (object.getBoolean("success") && object.getInteger("code") == 10000) { + return object; + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "查询失败!"); + } + + } + + /** + * 请求 + * @param postUrl 接口请求地址 + * @param param 参数 + * @return + * @throws Exception + */ + public static JSONObject request(String postUrl, Map param) throws Exception { + + + + log.info("============ 千猪请求-START ============="); + param.put("accessKey", CommonSysConst.getSysConfig().getMtAccessKey()); + param.put("content", EncryptUtil.aesEncrypt(JsonUtil.object2Json(param), CommonSysConst.getSysConfig().getMtSecretKey())); + + log.info("请求接口:" + postUrl); + log.info("请求参数:" + JSONObject.toJSONString(param)); + + JSONObject response = HttpsUtils.doPost(CommonSysConst.getSysConfig().getMtPostUrl() + postUrl, JSONObject.toJSONString(param)); + + log.info("响应参数:" + response.toJSONString()); + log.info("============ 千猪请求-END =============="); + return response; + + } +} diff --git a/service/src/main/java/com/hfkj/model/order/OrderCouponModel.java b/service/src/main/java/com/hfkj/model/order/OrderCouponModel.java index 7c34453..bf7ab54 100644 --- a/service/src/main/java/com/hfkj/model/order/OrderCouponModel.java +++ b/service/src/main/java/com/hfkj/model/order/OrderCouponModel.java @@ -41,8 +41,12 @@ public class OrderCouponModel { public String goodsSpecsName; @ColumnWidth(20) - @ExcelProperty("商品价格") - public String goodsPrice; + @ExcelProperty("商品原价(单价)") + public String goodsOriginalPrice; + + @ColumnWidth(20) + @ExcelProperty("商品销售价(单价)") + public String goodsSalePrice; @ColumnWidth(20) @ExcelProperty("购买数量") 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/service/card/BsUserCardService.java b/service/src/main/java/com/hfkj/service/card/BsUserCardService.java index 5bb7ee5..ace72b8 100644 --- a/service/src/main/java/com/hfkj/service/card/BsUserCardService.java +++ b/service/src/main/java/com/hfkj/service/card/BsUserCardService.java @@ -27,6 +27,7 @@ public interface BsUserCardService { * @return */ BsUserCard getCard(String cardNo); + BsUserCard getCard(Long userId); /** * @MethodName insertUserCardBatch diff --git a/service/src/main/java/com/hfkj/service/card/impl/BsUserCardServiceImpl.java b/service/src/main/java/com/hfkj/service/card/impl/BsUserCardServiceImpl.java index 91b1e4d..53426ff 100644 --- a/service/src/main/java/com/hfkj/service/card/impl/BsUserCardServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/card/impl/BsUserCardServiceImpl.java @@ -55,6 +55,17 @@ public class BsUserCardServiceImpl implements BsUserCardService { return null; } + @Override + public BsUserCard getCard(Long userId) { + BsUserCardExample example = new BsUserCardExample(); + example.createCriteria().andUserIdEqualTo(userId).andStatusNotEqualTo(UserCardStatusEnum.status0.getCode()); + List list = userCardMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + @Override public void insertUserCardBatch(List data) { userCardMapper.insertUserCardList(data); 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..62ece48 100644 --- a/service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java +++ b/service/src/main/java/com/hfkj/service/goods/BsOrderGoodsService.java @@ -58,11 +58,21 @@ 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: * @param orderChildNo - * @return: com.hfkj.entity.BsOrderGoods + * @return: com.hfkj.entity.BsOrderGoods * @Author: Sum1Dream * @Date: 2024/7/31 上午10:37 */ @@ -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/hlt/BsHltCardRecordService.java b/service/src/main/java/com/hfkj/service/hlt/BsHltCardRecordService.java new file mode 100644 index 0000000..707a616 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/hlt/BsHltCardRecordService.java @@ -0,0 +1,59 @@ +package com.hfkj.service.hlt; + +import com.hfkj.dao.BsHltCardRecordMapper; +import com.hfkj.entity.BsHltCardRecord; +import com.hfkj.entity.BsHltCardRecordExample; +import com.hfkj.sysenum.hlt.HltCardRecordPayStatusEnum; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * @className: BsHltCardRecordService + * @author: HuRui + * @date: 2024/8/21 + **/ +@Component +public class BsHltCardRecordService { + @Resource + private BsHltCardRecordMapper hltCardRecordMapper; + + /** + * 创建 + * @param record + */ + public void create(BsHltCardRecord record) { + record.setCreateTime(new Date()); + record.setUpdateTime(new Date()); + hltCardRecordMapper.insert(record); + } + + /** + * 修改 + * @param record + */ + public void update(BsHltCardRecord record) { + record.setUpdateTime(new Date()); + hltCardRecordMapper.updateByPrimaryKey(record); + } + + /** + * 获取最新支付单号 + * @param orderNo 订单号 + * @return + */ + public BsHltCardRecord getNewPayOrderNo(String orderNo) { + BsHltCardRecordExample example = new BsHltCardRecordExample(); + example.createCriteria() + .andOrderNoEqualTo(orderNo) + .andPayStatusEqualTo(HltCardRecordPayStatusEnum.status2.getCode()); + List list = hltCardRecordMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + +} diff --git a/service/src/main/java/com/hfkj/service/hlt/HltCardRefundService.java b/service/src/main/java/com/hfkj/service/hlt/HltCardRefundService.java new file mode 100644 index 0000000..39e8d80 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/hlt/HltCardRefundService.java @@ -0,0 +1,152 @@ +package com.hfkj.service.hlt; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.exception.BaseException; +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.RandomUtils; +import com.hfkj.entity.BsHltCardRecord; +import com.hfkj.entity.BsMerPayConfig; +import com.hfkj.entity.BsOrderRefund; +import com.hfkj.mer.BsMerPayConfigService; +import com.hfkj.model.order.OrderChildModel; +import com.hfkj.model.order.OrderModel; +import com.hfkj.service.order.BsOrderRefundService; +import com.hfkj.service.order.BsOrderService; +import com.hfkj.sysenum.hlt.HltCardRecordPayStatusEnum; +import com.hfkj.sysenum.mer.PayPlatformEnum; +import com.hfkj.sysenum.order.OrderChildStatusEnum; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.Date; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** + * @className: HltCardRefundService + * @author: HuRui + * @date: 2024/8/21 + **/ +@Component +public class HltCardRefundService { + @Resource + private BsHltCardRecordService hltCardRecordService; + @Resource + private BsOrderRefundService orderRefundService; + @Resource + private BsMerPayConfigService merPayConfigService; + @Resource + private BsOrderService orderService; + /** + * 退款 + * @param orderRefund + * @return + */ + public boolean refund(BsOrderRefund orderRefund) { + // 查询系统订单号 + BsHltCardRecord oldCardRecord = hltCardRecordService.getNewPayOrderNo(orderRefund.getOrderNo()); + if (oldCardRecord == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到最新的支付订单"); + } + try { + // 订单退款 + JSONObject refundObj = HuiLianTongUnionCardService.refund(orderRefund.getRefundOrderNo(), oldCardRecord.getPayOrderNo()); + if (!refundObj.getString("respCode").equals("0000")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refundObj.getString("respMessage")); + } + JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(refundObj.getString("data")); + if (consumptionResult.getBoolean("success") != true) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "交易失败!"+consumptionResult.getString("message")); + } + oldCardRecord.setRefundTime(new Date()); + oldCardRecord.setPayStatus(HltCardRecordPayStatusEnum.status3.getCode()); + hltCardRecordService.update(oldCardRecord); + + orderRefund.setRefundSerialNo(consumptionResult.getString("orderId")); + orderRefundService.editData(orderRefund); + + // 重新支付金额 + BigDecimal newPayPrice = oldCardRecord.getPayPrice().subtract(orderRefund.getRefundPrice()); + if (newPayPrice.compareTo(new BigDecimal("0")) > 0) { + BsHltCardRecord newRecord = new BsHltCardRecord(); + try { + newRecord.setOrderNo(orderRefund.getOrderNo()); + newRecord.setCardNo(oldCardRecord.getCardNo()); + newRecord.setUserPhone(oldCardRecord.getUserPhone()); + newRecord.setPayOrderNo(DateUtil.date2String(new Date(), "yyMMddHHmmss") + RandomUtils.number(6, false)); + newRecord.setPayPrice(newPayPrice); + newRecord.setPayStatus(HltCardRecordPayStatusEnum.status1.getCode()); + newRecord.setExceptionStatus(false); + hltCardRecordService.create(newRecord); + + // 查询订单 + OrderModel order = orderService.getDetail(orderRefund.getOrderNo()); + // 查询平台 + BsMerPayConfig merPay = merPayConfigService.getMerPay(order.getOrderChildList().get(0).getMerId(), PayPlatformEnum.type2); + if (merPay == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户未配置支付"); + } + // 重新扣款 + String goodsDesc = ""; + String tranDesc = ""; + String businessType = "HiSen_phg_goods"; + + List childModelList = order.getOrderChildList().stream() + .filter(o -> o.getStatus().equals(OrderChildStatusEnum.status2.getCode()) + || o.getStatus().equals(OrderChildStatusEnum.status3.getCode())) + .collect(Collectors.toList()); + for (OrderChildModel orderChild :childModelList) { + if (StringUtils.isBlank(tranDesc)) { + tranDesc = tranDesc + orderChild.getProductName(); + } else { + tranDesc = tranDesc +","+ orderChild.getProductName(); + } + } + // 描述超过30字符,截取加省略号 + if (tranDesc.length()>30) { + tranDesc = tranDesc.substring(1,30) + "..."; + } + JSONObject consumption = HuiLianTongUnionCardService.consumption(newRecord.getPayOrderNo(), newRecord.getCardNo(), newRecord.getPayPrice(), businessType, merPay.getHltInstCode(), goodsDesc, tranDesc); + if (!consumption.getString("respCode").equals("0000")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumption.getString("respMessage")); + } + // 响应参数 + JSONObject payConsumptionResult = HuiLianTongUnionCardService.resolveResponse(consumption.getString("data")); + if (payConsumptionResult.getBoolean("success") != true) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, payConsumptionResult.getString("message")); + } + newRecord.setPaySerialNo(consumptionResult.getString("orderId")); + newRecord.setPayTime(new Date()); + newRecord.setPayStatus(HltCardRecordPayStatusEnum.status2.getCode()); + hltCardRecordService.update(newRecord); + + } catch (BaseException e) { + newRecord.setExceptionStatus(true); + newRecord.setExceptionContent(e.getErrorMsg()); + hltCardRecordService.update(newRecord); + } catch (Exception e) { + newRecord.setExceptionStatus(true); + newRecord.setExceptionContent("未知错误"); + hltCardRecordService.update(newRecord); + } + } + + } catch (BaseException e) { + oldCardRecord.setExceptionStatus(true); + oldCardRecord.setExceptionContent(e.getErrorMsg()); + hltCardRecordService.update(oldCardRecord); + } catch (Exception e) { + oldCardRecord.setExceptionStatus(true); + oldCardRecord.setExceptionContent("未知错误"); + hltCardRecordService.update(oldCardRecord); + } + return !oldCardRecord.getExceptionStatus(); + } +} diff --git a/service/src/main/java/com/hfkj/service/hlt/HuiLianTongUnionCardService.java b/service/src/main/java/com/hfkj/service/hlt/HuiLianTongUnionCardService.java index 812b031..256b522 100644 --- a/service/src/main/java/com/hfkj/service/hlt/HuiLianTongUnionCardService.java +++ b/service/src/main/java/com/hfkj/service/hlt/HuiLianTongUnionCardService.java @@ -98,6 +98,29 @@ public class HuiLianTongUnionCardService { } + /** + * @MethodName queryTransJournal + * @Description: 查询交易记录 + * @param cardNo + * @param tranType + * @return: com.alibaba.fastjson.JSONObject + * @Author: Sum1Dream + * @Date: 2024/8/27 上午9:40 + */ + public static JSONObject queryTransJournal(String cardNo , String tranType) throws Exception { + try { + Map dataMap = new HashMap<>(); + dataMap.put("tranType", tranType); + dataMap.put("cardNo", cardNo); + dataMap.put("page", 1); + dataMap.put("pageSize", 10000); + return request("coresystem/queryTransJournal", dataMap); + } catch (Exception e) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQUEST_TIMED_OUT, ""); + } + } + + /** * 充值 * @param orderNo 订单号 @@ -229,15 +252,11 @@ public class HuiLianTongUnionCardService { public static JSONObject resolveResponse(String param) { String data = param.replace("\\n", ""); String decodeData = DesUtil.decode(HLT_CARD_SIGN_CODE, data, Charset.forName("UTF-8")); - - log.info("============请求任务Start============="); - log.info("解析响应的参数-请求参数: " + data); + log.info("响应data参数: " + data); JSONObject returnObject = JSONObject.parseObject(decodeData); - log.info("解析响应的参数-响应参数: " + returnObject.toJSONString()); - log.info("============请求任务End=============="); - + log.info("解析响应参数: " + returnObject.toJSONString()); return returnObject; } diff --git a/service/src/main/java/com/hfkj/service/order/BsOrderService.java b/service/src/main/java/com/hfkj/service/order/BsOrderService.java index d0717a4..21a790a 100644 --- a/service/src/main/java/com/hfkj/service/order/BsOrderService.java +++ b/service/src/main/java/com/hfkj/service/order/BsOrderService.java @@ -51,6 +51,9 @@ public interface BsOrderService { */ OrderModel cancel(String orderNo, boolean system); + + void deleteOrder(BsOrder order); + /** * 子订单完成 * @param childOrderNo 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 90e3703..a2102e2 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderCreateService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderCreateService.java @@ -133,6 +133,7 @@ public class OrderCreateService { orderCoupon.setGoodsSpecsId(goodsSpecs.getId()); orderCoupon.setGoodsSpecsName(goodsSpecs.getName()); orderCoupon.setGoodsSpescOriginalPrice(goodsSpecs.getOriginalPrice()); + orderCoupon.setGoodsSpescSalePrice(goodsSpecs.getSalePrice()); orderCoupon.setGoodsVpdId(goodsVpd.getId()); orderCoupon.setGoodsVpdKey(goodsVpd.getKey()); orderCoupon.setGoodsVpdSource(goodsVpd.getSource()); @@ -239,7 +240,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()); 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 0260149..3d6431b 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderPaySuccessService.java @@ -124,6 +124,7 @@ public class OrderPaySuccessService { for (Object data : dataArray) { JSONObject dataObject = (JSONObject) data; couponNo.setExpireTime(dataObject.getDate("validEndDate")); + couponNo.setDeliverTime(new Date()); couponNo.setGoodsVpdSourceCouNo(dataObject.getString("couNo")); couponNo.setStatus(OrderCouponNoStatusEnum.status2.getCode()); orderCouponNoService.editData(couponNo); @@ -140,6 +141,7 @@ public class OrderPaySuccessService { JSONArray codeList = response.getJSONArray("codeList"); for (Object data : codeList) { couponNo.setExpireTime(DateUtil.format(couponDetail.getString("expiredDate"), "yyyy-MM-dd")); + couponNo.setDeliverTime(new Date()); couponNo.setGoodsVpdSourceCouNo(ChongQingCNPCCouponService.decryptCouponCode(String.valueOf(data))); couponNo.setStatus(OrderCouponNoStatusEnum.status2.getCode()); orderCouponNoService.editData(couponNo); @@ -157,8 +159,9 @@ public class OrderPaySuccessService { String data = PetroConfig.decrypt(jsonObject.getString("jsonResult")); JSONObject object = JSONObject.parseObject(data); couponNo.setExpireTime(vpd.getSalesEndTime()); + couponNo.setDeliverTime(new Date()); couponNo.setGoodsVpdSourceCouNo(object.getString("voucher")); - couponNo.setStatus(OrderCouponNoStatusEnum.status2.getCode()); + couponNo.setStatus(OrderCouponNoStatusEnum.status2.getCode()); orderCouponService.editData(orderCoupon); } else if (vpd.getSource() == GoodsVpdSourceEnum.type10.getCode()) { @@ -169,6 +172,7 @@ public class OrderPaySuccessService { } JSONObject object = jsonObject.getJSONObject("data"); couponNo.setExpireTime(vpd.getSalesEndTime()); + couponNo.setDeliverTime(new Date()); couponNo.setGoodsVpdSourceCouNo(object.getString("couponCode")); couponNo.setStatus(OrderCouponNoStatusEnum.status2.getCode()); orderCouponNoService.editData(couponNo); @@ -224,14 +228,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) { diff --git a/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java b/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java index cb69e69..0e53f11 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java @@ -7,15 +7,23 @@ import com.hfkj.common.exception.SysCode; import com.hfkj.config.CommonSysConst; import com.hfkj.entity.BsOrderChild; import com.hfkj.entity.BsOrderCinema; +import com.hfkj.entity.BsOrderCoupon; +import com.hfkj.entity.BsOrderGoods; import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderModel; import com.hfkj.qianzhu.channel.CinemaService; +import com.hfkj.service.coupon.BsOrderCouponService; import com.hfkj.service.goods.BsOrderCinemaService; +import com.hfkj.service.goods.impl.BsOrderGoodsServiceImpl; import com.hfkj.sysenum.order.OrderChildProductTypeEnum; +import com.hfkj.sysenum.order.OrderChildStatusEnum; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.Resource; +import java.util.Date; import java.util.HashMap; +import java.util.List; import java.util.Map; @@ -30,6 +38,10 @@ public class OrderRefundSuccessService { @Resource private BsOrderCinemaService bsOrderCinemaService; + @Autowired + private BsOrderGoodsServiceImpl bsOrderGoodsService; + @Resource + private BsOrderCouponService orderCouponService; /** * 订单业务处理 @@ -39,9 +51,11 @@ public class OrderRefundSuccessService { public void orderRefundHandle(OrderChildModel orderChild) { try { if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type1.getCode())) { - // todo 实物产品退款业务 + // 实物产品退款业务 + goods(orderChild); } else if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type2.getCode())) { - // todo 虚拟产品退款业务 + // 虚拟产品退款业务 + orderCoupon(orderChild); } else if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type3.getCode())) { // 电影票退款业务 cinema(orderChild); @@ -52,6 +66,42 @@ public class OrderRefundSuccessService { } } + public void goods(BsOrderChild childOrder) { + // 查询实物订单 + BsOrderGoods orderGoods = bsOrderGoodsService.findGoodsOrderByChild(childOrder.getOrderNo()); + + try { + + if (orderGoods != null) { + Map map = new HashMap<>(); + map.put("orderNo", childOrder.getOrderNo()); + CinemaService.refundMovieOrder(map); + orderGoods.setStatus(OrderChildStatusEnum.status4.getCode()); + orderGoods.setLogisticsStatusDesc(null); + orderGoods.setLogisticsNo(null); + orderGoods.setLogisticsStatus(null); + orderGoods.setExceptionStatus(false); + bsOrderGoodsService.update(orderGoods); + } + } catch (Exception e) { + orderGoods.setExceptionStatus(true); + orderGoods.setExceptionMsg(e.getMessage()); + bsOrderGoodsService.update(orderGoods); + } + } + + + public void orderCoupon(BsOrderChild childOrder) { + // 查询虚拟订单 + BsOrderCoupon orderCoupon = orderCouponService.getDetailByChildOrderNo(childOrder.getChildOrderNo()); + if (orderCoupon != null) { + orderCoupon.setRefundTime(new Date()); + orderCoupon.setStatus(OrderChildStatusEnum.status4.getCode()); + orderCouponService.editData(orderCoupon); + } + } + + public void cinema(BsOrderChild childOrder) { // 查询电影票订单 BsOrderCinema orderCinema = bsOrderCinemaService.findGoodsOrder(childOrder.getOrderNo()); @@ -64,11 +114,11 @@ public class OrderRefundSuccessService { CinemaService.refundMovieOrder(map); orderCinema.setStatus(-5); orderCinema.setExceptionStatus(false); + bsOrderCinemaService.update(orderCinema); } } catch (Exception e) { orderCinema.setExceptionStatus(true); orderCinema.setExceptionMsg(e.getMessage()); - } finally { bsOrderCinemaService.update(orderCinema); } diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderAfterSalesApplyServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderAfterSalesApplyServiceImpl.java index 579556f..b230965 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderAfterSalesApplyServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderAfterSalesApplyServiceImpl.java @@ -286,10 +286,22 @@ public class BsOrderAfterSalesApplyServiceImpl implements BsOrderAfterSalesApply criteria.andUserPhoneLike("%"+MapUtils.getString(param, "userPhone")+"%"); } + if (StringUtils.isNotBlank(MapUtils.getString(param, "orderNo"))) { + criteria.andOrderNoLike("%"+MapUtils.getString(param, "orderNo")+"%"); + } + if (StringUtils.isNotBlank(MapUtils.getString(param, "childOrderNo"))) { criteria.andChildOrderNoLike("%"+MapUtils.getString(param, "childOrderNo")+"%"); } + if (MapUtils.getInteger(param, "productType") != null) { + criteria.andProductTypeEqualTo(MapUtils.getInteger(param, "productType")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "productName"))) { + criteria.andProductNameLike("%"+MapUtils.getString(param, "productName")+"%"); + } + if (StringUtils.isNotBlank(MapUtils.getString(param, "applyNo"))) { criteria.andApplyNoLike("%"+MapUtils.getString(param, "applyNo")+"%"); } 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/service/order/impl/BsOrderRefundServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java index 8b1a796..ed828bd 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java @@ -15,6 +15,7 @@ import com.hfkj.entity.BsOrderRefundExample; import com.hfkj.mer.BsMerPayConfigService; import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderModel; +import com.hfkj.service.hlt.HltCardRefundService; import com.hfkj.service.hlt.HuiLianTongUnionCardService; import com.hfkj.service.order.BsOrderChildService; import com.hfkj.service.order.BsOrderRefundService; @@ -56,10 +57,10 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { @Resource private UserIntegralService userIntegralService; @Resource - private BsMerPayConfigService merPayConfigService; - @Resource private TradeService huiftTradeService; @Resource + private HltCardRefundService hltCardRefundService; + @Resource private OrderRefundSuccessService orderRefundSuccessService; @Override public void editData(BsOrderRefund data) { @@ -100,19 +101,10 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { orderRefund.setRefundPayChannelOrderNo(refundObj.getString("refundOrderNo")); return true; - } /*else if (OrderPayChannelEnum.type4.getCode() == orderRefund.getRefundPayChannel()) { + } else if (OrderPayChannelEnum.type4.getCode() == orderRefund.getRefundPayChannel()) { // 商户退款 - JSONObject refundObj = HuiLianTongUnionCardService.refund(orderRefund.getRefundOrderNo(), orderRefund.getOrderNo()); - if (!refundObj.getString("respCode").equals("0000")) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refundObj.getString("respMessage")); - } - JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(refundObj.getString("data")); - if (!(consumptionResult.getBoolean("success") || Objects.equals(consumptionResult.getString("message"), "原交易已撤销,不可再次操作"))) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!"+consumptionResult.getString("message")); - } - orderRefund.setRefundSerialNo(consumptionResult.getString("orderId")); - return true; - }*/ else { + return hltCardRefundService.refund(orderRefund); + } else { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!该支付方式暂不支持退款"); } } catch (BaseException e) { @@ -236,9 +228,7 @@ public class BsOrderRefundServiceImpl implements BsOrderRefundService { orderChild.setStatus(orderChild.getSurplusRefundCount()==0?OrderChildStatusEnum.status4.getCode():orderChild.getStatus()); // 退款业务处理 - if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type3.getCode())) { - orderRefundSuccessService.orderRefundHandle(orderChild); - } + orderRefundSuccessService.orderRefundHandle(orderChild); orderChildService.editData(orderChild); } diff --git a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java index 7f3e170..3e76adf 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java @@ -231,7 +231,7 @@ public class BsOrderServiceImpl implements BsOrderService { childOrder.setSurplusRefundCount(childOrder.getProductCount()); // 计算 子订单 在交易订单金额中的占比 - BigDecimal ratio = childOrder.getProductTotalPrice().divide(order.getTotalPrice(), 2, BigDecimal.ROUND_DOWN); + BigDecimal ratio = childOrder.getProductTotalPrice().divide(order.getTotalPrice(), 4, BigDecimal.ROUND_DOWN); // 优惠券优惠 if (order.getDeduction().getCouponDiscountActualPrice().compareTo(BigDecimal.ZERO) > 0) { @@ -263,10 +263,10 @@ public class BsOrderServiceImpl implements BsOrderService { // 积分差值 Long integralDiscountDifference = order.getDeduction().getIntegralDiscountPrice() - totalIntegralDiscountPrice; - if (integralDiscountDifference > 0) { + if (integralDiscountDifference > 0L) { // 大于0 childOrder.setIntegralDiscountPrice(childOrder.getIntegralDiscountPrice() + integralDiscountDifference); - } else if (integralDiscountDifference < 0) { + } else if (integralDiscountDifference < 0L) { // 小于0 childOrder.setIntegralDiscountPrice(childOrder.getIntegralDiscountPrice() - integralDiscountDifference); } @@ -274,7 +274,6 @@ public class BsOrderServiceImpl implements BsOrderService { // 商品订单总优惠 childOrder.setTotalDeductionPrice(childOrder.getCouponDiscountPrice().add(new BigDecimal(childOrder.getIntegralDiscountPrice()).divide(new BigDecimal("100")))); - // 可退款金额 产品总价 - 优惠总价 childOrder.setSurplusRefundPrice(childOrder.getProductTotalPrice().subtract(childOrder.getTotalDeductionPrice())); // 可退款积分 积分优惠 @@ -454,6 +453,11 @@ public class BsOrderServiceImpl implements BsOrderService { return order; } + @Override + public void deleteOrder(BsOrder order) { + orderMapper.updateByPrimaryKey(order); + } + @Override public void childOrderComplete(String childOrderNo) { BsOrderChild orderChild = orderChildService.getDetail(childOrderNo); @@ -597,6 +601,7 @@ public class BsOrderServiceImpl implements BsOrderService { if (MapUtils.getLong(param, "cancelTimeE") != null) { criteria.andCancelTimeLessThanOrEqualTo(new Date(MapUtils.getLong(param, "cancelTimeE"))); } + criteria.andOrderStatusNotEqualTo(0); example.setOrderByClause("create_time desc"); return orderMapper.selectByExample(example); diff --git a/service/src/main/java/com/hfkj/service/order/impl/OrderPayServiceImpl.java b/service/src/main/java/com/hfkj/service/order/impl/OrderPayServiceImpl.java index 973282e..023b8ff 100644 --- a/service/src/main/java/com/hfkj/service/order/impl/OrderPayServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/impl/OrderPayServiceImpl.java @@ -4,13 +4,16 @@ 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.entity.BsHltCardRecord; import com.hfkj.entity.BsUserCard; import com.hfkj.model.order.OrderChildModel; import com.hfkj.model.order.OrderModel; +import com.hfkj.service.hlt.BsHltCardRecordService; import com.hfkj.service.hlt.HuiLianTongUnionCardService; import com.hfkj.service.order.BsOrderService; import com.hfkj.service.order.OrderPayService; import com.hfkj.service.order.OrderPaySuccessService; +import com.hfkj.sysenum.hlt.HltCardRecordPayStatusEnum; import com.hfkj.sysenum.order.OrderPayChannelEnum; import com.hfkj.sysenum.order.OrderPayTypeEnum; import org.apache.commons.lang3.StringUtils; @@ -28,7 +31,8 @@ import java.util.Date; public class OrderPayServiceImpl implements OrderPayService { @Resource private BsOrderService orderService; - + @Resource + private BsHltCardRecordService hltCardRecordService; @Override public OrderModel hltCardPay(String instCode,OrderModel order, BsUserCard userCard) throws Exception { String goodsDesc = ""; @@ -68,6 +72,18 @@ public class OrderPayServiceImpl implements OrderPayService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, consumptionResult.getString("message")); } + BsHltCardRecord cardRecord = new BsHltCardRecord(); + cardRecord.setOrderNo(order.getOrderNo()); + cardRecord.setCardNo(userCard.getCardNo()); + cardRecord.setUserPhone(order.getUserPhone()); + cardRecord.setPayOrderNo(order.getOrderNo()); + cardRecord.setPaySerialNo(consumptionResult.getString("orderId")); + cardRecord.setPayPrice(order.getPayRealPrice()); + cardRecord.setPayStatus(HltCardRecordPayStatusEnum.status2.getCode()); + cardRecord.setPayTime(new Date()); + cardRecord.setExceptionStatus(false); + hltCardRecordService.create(cardRecord); + order.setPayChannel(OrderPayChannelEnum.type4.getCode()); order.setPayType(OrderPayTypeEnum.type4.getCode()); order.setPaySerialNo(consumptionResult.getString("orderId")); 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..7779f9b --- /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/hlt/HltCardRecordPayStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/hlt/HltCardRecordPayStatusEnum.java new file mode 100644 index 0000000..42dcd61 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/hlt/HltCardRecordPayStatusEnum.java @@ -0,0 +1,38 @@ +package com.hfkj.sysenum.hlt; + +import lombok.Getter; + +/** + * + * @author hurui + */ +@Getter +public enum HltCardRecordPayStatusEnum { + + /** + * 待支付 + */ + status1(1, "待支付"), + + /** + * 已支付 + */ + status2(2, "已支付"), + + /** + * 已退款 + */ + status3(3, "已退款"), + ; + + private int code; + + private String name; + + + HltCardRecordPayStatusEnum(int code, String name) { + this.code = code; + this.name = name; + } + +} 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..5ad6da8 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 @@ -10,6 +12,10 @@ import lombok.Getter; **/ @Getter public enum OrderStatusEnum { + /** + * 删除 + */ + status0(0, "删除"), /** * 待支付 */ @@ -45,4 +51,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 68885ed..db598c6 100644 --- a/service/src/main/resources/dev/commonConfig.properties +++ b/service/src/main/resources/dev/commonConfig.properties @@ -1,4 +1,4 @@ -fileUrl=/Users/chenyao/Desktop/img +fileUrl=/home/project/phg/filesystem domainName=https://phgcs.dctpay.com wechatMpAppid=wxa075e8509802f826 @@ -70,3 +70,9 @@ ctNotifyUrl = 1 ctApiKey=3fd74e7c16b04681a0f481c5bc0a96d3 ctMemberId=1622808562621276161 ctPostUrl=http://113.250.49.100:8088/recharge/ + + +mtNotifyUrl = https://phg.dctpay.com/order/cinemaNotify/notify +mtAccessKey=DVNKSHSDHHJ6-TK +mtSecretKey=lj2YDjGnqroY1OuR5zriWg== +mtPostUrl=https://waimai-openapi.apigw.test.meituan.com/api/sqt/open/login/h5/loginFree/redirection?test_open_swimlane=test-open diff --git a/user/src/main/java/com/user/controller/UserCardController.java b/user/src/main/java/com/user/controller/UserCardController.java index bcd45a6..6af4e2b 100644 --- a/user/src/main/java/com/user/controller/UserCardController.java +++ b/user/src/main/java/com/user/controller/UserCardController.java @@ -1,11 +1,14 @@ package com.user.controller; +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.security.SessionObject; import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.PageUtil; import com.hfkj.common.utils.RedisUtil; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.entity.BsUserCard; @@ -24,6 +27,8 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; +import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; /** @@ -186,5 +191,72 @@ public class UserCardController { } } + @RequestMapping(value = "/getHuiLianTongCardConsume", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询汇联通工会卡消费记录") + public ResponseData getHuiLianTongCardConsume(@RequestParam(name = "cardNo", required = true) String cardNo) { + try { + + // 用户 + UserSessionObject userSessionObject = userCenter.getSessionModel(UserSessionObject.class); + + BsUserCard userCard = userCardService.getCard(userSessionObject.getUser().getId()); + + if (userCard != null) { + JSONObject consumptionRecord = HuiLianTongUnionCardService.queryConsumptionRecordByBusiness("HiSen_phg_goods", cardNo, 1661498490000L, 1882423290000L, 1, 10000); + if (StringUtils.isBlank(consumptionRecord.getString("data"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, ""); + } + + JSONArray array = HuiLianTongUnionCardService.resolveResponse(consumptionRecord.getString("data")).getJSONArray( + "records"); + + return ResponseMsgUtil.success(array); + } + + return ResponseMsgUtil.success(null); + + + } catch (Exception e) { + log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value = "/queryTransJournal", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询汇联通工会卡消费记录") + public ResponseData queryTransJournal(@RequestParam(name = "tranType", required = true) String tranType, + @RequestParam(name = "cardNo", required = true) String cardNo, + @RequestParam(value = "pageNum" , required = true) Integer pageNum, + @RequestParam(value = "pageSize" , required = true) Integer pageSize) { + try { + + + JSONObject consumptionRecord = HuiLianTongUnionCardService.queryTransJournal(cardNo , tranType); + if (StringUtils.isBlank(consumptionRecord.getString("data"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, ""); + } + + JSONArray array = HuiLianTongUnionCardService.resolveResponse(consumptionRecord.getString("data")).getJSONArray( + "journals"); + + List list = new ArrayList<>(); + + for (Object object : array) { + JSONObject journal = (JSONObject) object; + journal.put("tranAmount", journal.getBigDecimal("tranAmount").divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP)); + list.add(journal); + } + + return ResponseMsgUtil.success(PageUtil.initPageInfoObj(pageNum, list.size(), pageSize, new PageInfo<>(list))); + + } catch (Exception e) { + log.error("HighUserCardController --> getHuiLianTongCardConsume() error!", e); + return ResponseMsgUtil.exception(e); + } + } + }