袁野 3 months ago
parent 73d66e8324
commit e11082cea9
  1. BIN
      bweb/lib/open-platform-sdk-1.0.21.jar
  2. 20
      bweb/pom.xml
  3. 4
      bweb/src/main/java/com/bweb/controller/FileUploadController.java
  4. 137
      bweb/src/main/java/com/bweb/controller/TestController.java
  5. 80
      cweb/src/main/java/com/cweb/controller/qianZhu/CinemaController.java
  6. 33
      order/src/main/java/com/order/controller/OrderController.java
  7. 30
      order/src/main/java/com/order/controller/business/BsOrderGoodsController.java
  8. 22
      order/src/main/resources/dev/logback.xml
  9. 22
      order/src/main/resources/prod/logback.xml
  10. BIN
      service/lib/open-platform-sdk-1.0.21.jar
  11. 24
      service/pom.xml
  12. 23
      service/src/main/java/com/hfkj/common/utils/RandomStringGeneratorUtil.java
  13. 8
      service/src/main/java/com/hfkj/config/CommonSysConfig.java
  14. 74
      service/src/main/java/com/hfkj/meituan/MeiTuanService.java
  15. 1
      service/src/main/java/com/hfkj/service/card/BsUserCardService.java
  16. 11
      service/src/main/java/com/hfkj/service/card/impl/BsUserCardServiceImpl.java
  17. 23
      service/src/main/java/com/hfkj/service/hlt/HuiLianTongUnionCardService.java
  18. 3
      service/src/main/java/com/hfkj/service/order/BsOrderService.java
  19. 37
      service/src/main/java/com/hfkj/service/order/OrderRefundSuccessService.java
  20. 2
      service/src/main/java/com/hfkj/service/order/impl/BsOrderRefundServiceImpl.java
  21. 6
      service/src/main/java/com/hfkj/service/order/impl/BsOrderServiceImpl.java
  22. 4
      service/src/main/java/com/hfkj/sysenum/order/OrderStatusEnum.java
  23. 6
      service/src/main/resources/dev/commonConfig.properties
  24. 72
      user/src/main/java/com/user/controller/UserCardController.java

@ -18,6 +18,19 @@
<artifactId>service</artifactId>
<version>PACKT-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.11</version>
</dependency>
<dependency>
<groupId>meituan.skd</groupId>
<artifactId>meituan-open-sdk</artifactId>
<scope>system</scope>
<version>1.0.21</version>
<systemPath>${basedir}/lib/open-platform-sdk-1.0.21.jar</systemPath>
</dependency>
</dependencies>
<build>
@ -26,6 +39,13 @@
<directory>src/main/resources/${env}</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>${basedir}/lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>

@ -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(),

@ -1,18 +1,19 @@
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.DateUtil;
import com.hfkj.common.utils.OrderUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
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;
@ -29,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;
@ -54,6 +56,9 @@ public class TestController {
@Resource
private BsOrderGoodsService bsOrderGoodsService;
@Resource
private GoodsUserAddressService addressService;
@RequestMapping(value="/canteenConsume",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "食堂消费")
@ -168,5 +173,131 @@ public class TestController {
}
}
@RequestMapping(value="/getLogisticsMsg",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询物流")
public ResponseData getLogisticsMsg(@RequestParam(value = "id" , required = false) Long id) {
try {
Map<String, Object> 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<JSONObject> 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<String , Object> map = new HashMap<>();
Map<String , Object> 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);
}
}
}

@ -17,6 +17,7 @@ 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;
@ -48,6 +49,9 @@ public class CinemaController {
@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
) {
@ -76,6 +80,9 @@ public class CinemaController {
for (Object o : array) {
JSONObject item = (JSONObject) o;
if (item.getString("grade") == null) {
item.put("grade" , "0");
}
list.add(item);
}
@ -90,6 +97,19 @@ public class CinemaController {
}
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(
@ -98,6 +118,66 @@ public class CinemaController {
// 放开下面的注释,使用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) {

@ -31,10 +31,7 @@ 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;
/**
@ -236,5 +233,33 @@ public class OrderController {
}
}
@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);
}
}
}

@ -3,7 +3,6 @@ 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;
@ -17,7 +16,6 @@ import com.hfkj.config.CommonSysConst;
import com.hfkj.entity.*;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.model.UserSessionObject;
import com.hfkj.model.order.orderExport.OrderGoodsExportModel;
import com.hfkj.service.file.FileRecordsService;
import com.hfkj.service.goods.BsOrderGoodsService;
@ -44,8 +42,6 @@ import java.util.*;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@Controller
@RequestMapping(value="/orderGoods")
@ -408,4 +404,30 @@ public class BsOrderGoodsController {
}
}
@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<String , Object> 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);
}
}
}

@ -246,4 +246,26 @@
</logger>
<!-- 话费接口 -->
<!--美团接口 -->
<appender name="MeiTuanLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/MeiTuanLog.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/MeiTuanLog/MeiTuanLog.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<logger name="com.hfkj.meituan.MeiTuanService" level="INFO">
<appender-ref ref="MeiTuanLog" />
</logger>
<!-- 美团接口 -->
</configuration>

@ -245,4 +245,26 @@
</logger>
<!-- 话费接口 -->
<!--美团接口 -->
<appender name="MeiTuanLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>log/MeiTuanLog.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log/MeiTuanLog/MeiTuanLog.log.%d.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 64 MB -->
<maxFileSize>64 MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>
%d %p (%file:%line\)- %m%n
</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
</appender>
<logger name="com.hfkj.meituan.MeiTuanService" level="INFO">
<appender-ref ref="MeiTuanLog" />
</logger>
<!-- 美团接口 -->
</configuration>

@ -20,6 +20,7 @@
<joda-time-version>2.9.9</joda-time-version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -248,6 +249,20 @@
<artifactId>ocr_api20210707</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.11</version>
</dependency>
<dependency>
<groupId>meituan.skd</groupId>
<artifactId>meituan-open-sdk</artifactId>
<scope>system</scope>
<version>1.0.21</version>
<systemPath>${basedir}/lib/open-platform-sdk-1.0.21.jar</systemPath>
</dependency>
</dependencies>
<build>
<resources>
@ -255,6 +270,15 @@
<directory>src/main/resources/${env}</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>${basedir}/lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</resources>
</build>
</project>

@ -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();
}
}

@ -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;
}

@ -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<String , Object> 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<String,Object> 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;
}
}

@ -27,6 +27,7 @@ public interface BsUserCardService {
* @return
*/
BsUserCard getCard(String cardNo);
BsUserCard getCard(Long userId);
/**
* @MethodName insertUserCardBatch

@ -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<BsUserCard> list = userCardMapper.selectByExample(example);
if (!list.isEmpty()) {
return list.get(0);
}
return null;
}
@Override
public void insertUserCardBatch(List<BsUserCard> data) {
userCardMapper.insertUserCardList(data);

@ -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<String,Object> 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 订单号

@ -51,6 +51,9 @@ public interface BsOrderService {
*/
OrderModel cancel(String orderNo, boolean system);
void deleteOrder(BsOrder order);
/**
* 子订单完成
* @param childOrderNo

@ -7,15 +7,20 @@ 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.BsOrderGoods;
import com.hfkj.model.order.OrderChildModel;
import com.hfkj.model.order.OrderModel;
import com.hfkj.qianzhu.channel.CinemaService;
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.HashMap;
import java.util.List;
import java.util.Map;
@ -30,6 +35,8 @@ public class OrderRefundSuccessService {
@Resource
private BsOrderCinemaService bsOrderCinemaService;
@Autowired
private BsOrderGoodsServiceImpl bsOrderGoodsService;
/**
* 订单业务处理
@ -39,7 +46,8 @@ 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 虚拟产品退款业务
} else if (orderChild.getProductType().equals(OrderChildProductTypeEnum.type3.getCode())) {
@ -52,6 +60,31 @@ public class OrderRefundSuccessService {
}
}
public void goods(BsOrderChild childOrder) {
// 查询实物订单
BsOrderGoods orderGoods = bsOrderGoodsService.findGoodsOrderByChild(childOrder.getOrderNo());
try {
if (orderGoods != null) {
Map<String , Object> 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);
}
} catch (Exception e) {
orderGoods.setExceptionStatus(true);
orderGoods.setExceptionMsg(e.getMessage());
} finally {
bsOrderGoodsService.update(orderGoods);
}
}
public void cinema(BsOrderChild childOrder) {
// 查询电影票订单
BsOrderCinema orderCinema = bsOrderCinemaService.findGoodsOrder(childOrder.getOrderNo());
@ -64,11 +97,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);
}

@ -228,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);
}
orderChildService.editData(orderChild);
}

@ -453,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);
@ -596,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);

@ -12,6 +12,10 @@ import java.util.Objects;
**/
@Getter
public enum OrderStatusEnum {
/**
* 删除
*/
status0(0, "删除"),
/**
* 待支付
*/

@ -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

@ -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<JSONObject> 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);
}
}
}

Loading…
Cancel
Save