修改汇联通distributorId 原参数aNId4A3X修改为orjuOND7

cpupon-dev
袁野 1 month ago
parent a178adec42
commit 08b78b5f27
  1. 2
      bweb/src/main/java/com/bweb/config/AuthConfig.java
  2. 2
      bweb/src/main/java/com/bweb/controller/file/FileController.java
  3. 130
      bweb/src/main/java/com/bweb/controller/goods/GoodPresentController.java
  4. 1
      cweb/src/main/java/com/cweb/controller/discount/DiscountController.java
  5. 34
      cweb/src/main/java/com/cweb/controller/goods/GoodsController.java
  6. 1
      service/src/main/java/com/hfkj/dao/GoodsSpecsMapperExt.java
  7. 5
      service/src/main/java/com/hfkj/jd/Impl/JdServiceImpl.java
  8. 5
      service/src/main/java/com/hfkj/model/discount/CouponDiscountUserRelModel.java
  9. 55
      service/src/main/java/com/hfkj/service/goods/GoodPresentService.java
  10. 62
      service/src/main/java/com/hfkj/service/goods/impl/GoodPresentServiceImpl.java
  11. 2
      service/src/main/java/com/hfkj/service/order/impl/BsOrderAfterSalesApplyServiceImpl.java

@ -1,4 +1,4 @@
package com.cweb.config;
package com.bweb.config;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;

@ -46,7 +46,7 @@ public class FileController {
@RequestMapping(value="/getFileRecordsList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询列表")
public ResponseData getFileRecordsList( HttpServletRequest request) {
public ResponseData getFileRecordsList(HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);

@ -0,0 +1,130 @@
package com.bweb.controller.goods;
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.CouponDiscountPackage;
import com.hfkj.entity.GoodPresent;
import com.hfkj.entity.GoodsMsg;
import com.hfkj.entity.GoodsType;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.service.discount.CouponDiscountPackageService;
import com.hfkj.service.goods.GoodPresentService;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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;
@Controller
@RequestMapping(value="/goodPresent")
@Api(value="商品赠送")
public class GoodPresentController {
private static final Logger log = LoggerFactory.getLogger(GoodPresentController.class);
@Resource
private GoodPresentService goodPresentService;
@Resource
private CouponDiscountPackageService discountPackageService;
@Resource
private UserCenter userCenter;
@RequestMapping(value="/createGoodPresent",method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "创建商品赠送")
public ResponseData createGoodPresent(@RequestBody GoodPresent body, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject();
if (!userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
if (body == null
|| body.getKey() == null
|| body.getType() == null
|| body.getSpecsId() == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
CouponDiscountPackage discountPackage = discountPackageService.findDiscountPackageByKey(body.getKey());
if (discountPackage == null) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券包不存在");
}
body.setCreateTime(new Date());
body.setUpdateTime(new Date());
body.setStatus(1);
body.setName(discountPackage.getTitle());
goodPresentService.create(body);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/getListBrand",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询列表")
public ResponseData getListBrand(@RequestParam(value = "specsId" , required = false) Long specsId) {
try {
Map<String , Object> map = new HashMap<>();
map.put("specsId", specsId);
return ResponseMsgUtil.success(goodPresentService.getList(map));
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/delete",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "删除")
public ResponseData delete(@RequestParam(value = "id" , required = false) Long id, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject();
if (!userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, "");
}
goodPresentService.delete(id , false);
return ResponseMsgUtil.success("删除成功");
} catch (Exception e) {
log.error("error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -106,6 +106,7 @@ public class DiscountController {
rel.setUserId(userSession.getUser().getId());
rel.setDiscountName(jsonObject.getString("discountName"));
rel.setDiscountType(jsonObject.getInteger("discountType"));
rel.setDiscountNo(jsonObject.getString("discountNo"));
rel.setDiscountCondition(jsonObject.getBigDecimal("discountCondition"));
if (jsonObject.getInteger("discountType") == 3) {
rel.setDiscountPercentage(jsonObject.getBigDecimal("discountPrice"));

@ -10,16 +10,14 @@ import com.hfkj.common.security.SessionObject;
import com.hfkj.common.security.UserCenter;
import com.hfkj.common.utils.PageUtil;
import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.entity.GoodsMsg;
import com.hfkj.entity.GoodsSpecs;
import com.hfkj.entity.GoodsType;
import com.hfkj.entity.GoodsVpd;
import com.hfkj.entity.*;
import com.hfkj.jd.JdService;
import com.hfkj.model.ResponseData;
import com.hfkj.model.SecUserSessionObject;
import com.hfkj.model.goods.GoodsModel;
import com.hfkj.model.goods.GoodsModelSpecs;
import com.hfkj.model.goods.GoodsTypeModel;
import com.hfkj.service.discount.CouponDiscountService;
import com.hfkj.service.goods.*;
import com.hfkj.sysenum.SecUserObjectTypeEnum;
import io.swagger.annotations.Api;
@ -61,6 +59,8 @@ public class GoodsController {
@Resource
private JdService jdService;
@Resource
private CouponDiscountService couponDiscountService;
@RequestMapping(value="/getListGoodsType",method = RequestMethod.GET)
@ -114,6 +114,7 @@ public class GoodsController {
@RequestParam(value = "goodsTypeParent", required = false) Long goodsTypeParent,
@RequestParam(value = "goodsType", required = false) Long goodsType,
@RequestParam(value = "showType", required = false) Integer showType,
@RequestParam(value = "discountId", required = false) Integer discountId,
@RequestParam(value = "goodsBrand", required = false) Long goodsBrand,
@RequestParam(value = "price", required = false) Integer price,
@RequestParam(value = "saleNum", required = false) Integer saleNum,
@ -142,6 +143,14 @@ public class GoodsController {
List<GoodsModel> goodsModels = new ArrayList<>();
// 查询优惠券可以用规格
Map<String, Object> mapSpecs = new HashMap<>();
mapSpecs.put("discountId", discountId);
// 查询规格可用优惠券
List<CouponDiscountGoodsRel> couponDiscountGoodsRel = couponDiscountService.getListGoodsRel(mapSpecs);
for (GoodsMsg goodsMsg : list) {
GoodsModel goodsModel = new GoodsModel();
@ -152,12 +161,29 @@ public class GoodsController {
BigDecimal minPrice = goodsSpecs.get(0).getSalePrice();
BigDecimal minOriginalPrice = goodsSpecs.get(0).getOriginalPrice();
for (GoodsSpecs specs : goodsSpecs) {
if (specs.getSalePrice().compareTo(minPrice) < 0) {
minPrice = specs.getSalePrice();
minOriginalPrice = specs.getOriginalPrice();
}
if (discountId != null) {
CouponDiscountGoodsRel discountGoodsRel = couponDiscountGoodsRel.stream().filter(s -> s.getSpecsId().equals(specs.getId())).findFirst().orElse(null);
if (discountGoodsRel == null) {
specs.setExt1("0");
}
}
}
// todo 删除没有绑定优惠券的
goodsSpecs = goodsSpecs.stream().filter(s-> !s.getExt1().equals("0")).collect(Collectors.toList());
if (goodsSpecs.isEmpty()) {
continue;
}
BeanUtils.copyProperties(goodsMsg, goodsModel);
goodsModel.setOriginalPrice(minOriginalPrice);
goodsModel.setPrice(minPrice);

@ -17,6 +17,7 @@ public interface GoodsSpecsMapperExt {
@Select("<script>" +
" SELECT" +
" id as id ," +
" goods_id as goodsId ," +
" sale_price as salePrice," +
" original_price as originalPrice" +

@ -87,10 +87,13 @@ public class JdServiceImpl implements JdService {
public String getToken() throws Exception {
Object token = redisUtil.get("jd_access_token");
for (int i = 0; i < 10; i++) {
}
if (token == null) {
// 请求回调 会在回调存入参数
JdPostService.getAccessToken();
// getToken();
getToken();
}
return token.toString();
}

@ -11,4 +11,9 @@ public class CouponDiscountUserRelModel extends CouponDiscountUserRel {
*/
private Integer source;
/**
* 优惠券编号
*/
private String discountNo;
}

@ -1,4 +1,59 @@
package com.hfkj.service.goods;
import com.hfkj.entity.GoodPresent;
import java.util.List;
import java.util.Map;
public interface GoodPresentService {
/**
* @Author Sum1Dream
* @Name create
* @Description // 创建
* @Date 15:12 2024/4/19
* @Param GoodsBrand
* @return void
*/
void create(GoodPresent goodPresent);
/**
* @MethodName update
* @Description: 更新
* @param goodPresent
* @Author: Sum1Dream
* @Date: 2024/12/18 下午3:39
*/
void update(GoodPresent goodPresent);
/**
* @MethodName findById
* @Description:
* @param id
* @return: com.hfkj.entity.GoodPresent
* @Author: Sum1Dream
* @Date: 2024/12/18 下午3:38
*/
GoodPresent findById(Long id);
/**
* @MethodName getList
* @Description: 查询列表
* @param map
* @return: java.util.List<com.hfkj.entity.GoodPresent>
* @Author: Sum1Dream
* @Date: 2024/12/18 下午3:39
*/
List<GoodPresent> getList(Map<String , Object> map);
/**
* @MethodName delete
* @Description: 删除
* @param id
* @param fullDelete
* @Author: Sum1Dream
* @Date: 2024/12/18 下午3:42
*/
void delete(Long id , Boolean fullDelete);
}

@ -0,0 +1,62 @@
package com.hfkj.service.goods.impl;
import com.hfkj.dao.GoodPresentMapper;
import com.hfkj.entity.GoodPresent;
import com.hfkj.entity.GoodPresentExample;
import com.hfkj.entity.GoodsBrand;
import com.hfkj.service.goods.GoodPresentService;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service("goodPresentService")
public class GoodPresentServiceImpl implements GoodPresentService {
@Resource
private GoodPresentMapper goodPresentMapper;
@Override
public void create(GoodPresent goodPresent) {
goodPresentMapper.insert(goodPresent);
}
@Override
public void update(GoodPresent goodPresent) {
goodPresentMapper.updateByPrimaryKey(goodPresent);
}
@Override
public GoodPresent findById(Long id) {
return goodPresentMapper.selectByPrimaryKey(id);
}
@Override
public List<GoodPresent> getList(Map<String, Object> map) {
GoodPresentExample example = new GoodPresentExample();
GoodPresentExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "specsId") != null) {
criteria.andSpecsIdEqualTo(MapUtils.getLong(map, "specsId"));
}
return goodPresentMapper.selectByExample(example);
}
@Override
public void delete(Long id, Boolean fullDelete) {
if (fullDelete) {
goodPresentMapper.deleteByPrimaryKey(id);
} else {
GoodPresent goodPresent = findById(id);
goodPresent.setStatus(0);
goodPresent.setUpdateTime(new Date());
update(goodPresent);
}
}
}

@ -326,7 +326,6 @@ public class BsOrderAfterSalesApplyServiceImpl implements BsOrderAfterSalesApply
if (response.getOpenRpcResult().getSuccess()) {
apply.setStatus(OrderAfterSalesApplyStatusEnum.type4.getCode());
editData(apply);
// 操作记录
BsOrderAfterSalesOpRecord opRecord = new BsOrderAfterSalesOpRecord();
opRecord.setApplyNo(apply.getApplyNo());
@ -340,7 +339,6 @@ public class BsOrderAfterSalesApplyServiceImpl implements BsOrderAfterSalesApply
apply.setAuditMsg(response.getOpenRpcResult().getResultMessage());
editData(apply);
}
}
@Override

Loading…
Cancel
Save