forked from angelo/java-retail-app
Compare commits
No commits in common. "ccbf6d1b3787b8a45a74fd32e227c3ba7dec0735" and "8d941689d57313c30ae2198a66500addb32286f3" have entirely different histories.
ccbf6d1b37
...
8d941689d5
|
|
@ -1,7 +1,6 @@
|
||||||
package com.hzs.member.base.vo;
|
package com.hzs.member.base.vo;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.hzs.common.core.annotation.BigDecimalFormat;
|
|
||||||
import com.hzs.common.core.annotation.Excel;
|
import com.hzs.common.core.annotation.Excel;
|
||||||
import com.hzs.common.core.annotation.Transaction;
|
import com.hzs.common.core.annotation.Transaction;
|
||||||
import com.hzs.common.core.constant.EnumsPrefixConstants;
|
import com.hzs.common.core.constant.EnumsPrefixConstants;
|
||||||
|
|
@ -91,15 +90,13 @@ public class RetailMemberVO implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 消费金额 注册金额
|
* 消费金额 注册金额
|
||||||
*/
|
*/
|
||||||
@Excel(name = "注册金额", scale = 2)
|
@Excel(name = "注册金额")
|
||||||
@BigDecimalFormat()
|
|
||||||
private BigDecimal consumeMoney;
|
private BigDecimal consumeMoney;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 消费业绩 注册业绩
|
* 消费业绩 注册业绩
|
||||||
*/
|
*/
|
||||||
@Excel(name = "注册业绩", scale = 2)
|
@Excel(name = "注册业绩($)")
|
||||||
@BigDecimalFormat()
|
|
||||||
private BigDecimal consumeAchieve;
|
private BigDecimal consumeAchieve;
|
||||||
/**
|
/**
|
||||||
* 隶属体系
|
* 隶属体系
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,9 @@ import com.hzs.activity.consume.service.IAcMemberConsumeRuleService;
|
||||||
import com.hzs.activity.draw.param.PurchasedTimesParam;
|
import com.hzs.activity.draw.param.PurchasedTimesParam;
|
||||||
import com.hzs.activity.draw.service.IAcDrawGiftRuleConfigService;
|
import com.hzs.activity.draw.service.IAcDrawGiftRuleConfigService;
|
||||||
import com.hzs.activity.draw.service.IAcDrawRewardNumService;
|
import com.hzs.activity.draw.service.IAcDrawRewardNumService;
|
||||||
|
|
||||||
|
import com.hzs.activity.pick.param.AcPickSaveDetailParam;
|
||||||
|
import com.hzs.activity.pick.service.IAcPickService;
|
||||||
import com.hzs.activity.pick.service.IAcRetailPickProductConfigService;
|
import com.hzs.activity.pick.service.IAcRetailPickProductConfigService;
|
||||||
import com.hzs.activity.recommend.param.AcRecommendParam;
|
import com.hzs.activity.recommend.param.AcRecommendParam;
|
||||||
import com.hzs.activity.recommend.service.IAcRepurCouponsRuleConfigService;
|
import com.hzs.activity.recommend.service.IAcRepurCouponsRuleConfigService;
|
||||||
|
|
@ -18,10 +21,14 @@ import com.hzs.common.core.enums.*;
|
||||||
import com.hzs.common.core.exception.base.BaseException;
|
import com.hzs.common.core.exception.base.BaseException;
|
||||||
import com.hzs.common.core.utils.StringUtils;
|
import com.hzs.common.core.utils.StringUtils;
|
||||||
import com.hzs.common.domain.activity.base.AcApprovalLog;
|
import com.hzs.common.domain.activity.base.AcApprovalLog;
|
||||||
|
import com.hzs.member.base.IMemberServiceApi;
|
||||||
|
import com.hzs.sale.product.IProductServiceApi;
|
||||||
import com.hzs.system.sys.dto.ApprovalBusinessResultDTO;
|
import com.hzs.system.sys.dto.ApprovalBusinessResultDTO;
|
||||||
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -39,6 +46,8 @@ public class ActivityApprovalProvider implements IActivityApprovalServiceApi {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAcDrawGiftRuleConfigService drawGiftConfigService;
|
private IAcDrawGiftRuleConfigService drawGiftConfigService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private IAcPickService iAcPickService;
|
||||||
|
@Autowired
|
||||||
private IAcApprovalLogService iAcApprovalLogService;
|
private IAcApprovalLogService iAcApprovalLogService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAcRepurCouponsRuleConfigService acRepurCouponsRuleConfigService;
|
private IAcRepurCouponsRuleConfigService acRepurCouponsRuleConfigService;
|
||||||
|
|
@ -47,6 +56,12 @@ public class ActivityApprovalProvider implements IActivityApprovalServiceApi {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAcRetailPickProductConfigService iAcRetailPickProductConfigService;
|
private IAcRetailPickProductConfigService iAcRetailPickProductConfigService;
|
||||||
|
|
||||||
|
@DubboReference
|
||||||
|
IMemberServiceApi iMemberServiceApi;
|
||||||
|
@DubboReference
|
||||||
|
IProductServiceApi iProductServiceApi;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R<Boolean> approvalCallback(ApprovalBusinessResultDTO approvalBusinessResultDTO) {
|
public R<Boolean> approvalCallback(ApprovalBusinessResultDTO approvalBusinessResultDTO) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -55,6 +70,14 @@ public class ActivityApprovalProvider implements IActivityApprovalServiceApi {
|
||||||
if (EApproveStatus.FINISH.getValue() == approvalBusinessResultDTO.getEApproveStatus().getValue()) {
|
if (EApproveStatus.FINISH.getValue() == approvalBusinessResultDTO.getEApproveStatus().getValue()) {
|
||||||
// 通过处理
|
// 通过处理
|
||||||
switch (approvalBusinessResultDTO.getEApprovalBusiness()) {
|
switch (approvalBusinessResultDTO.getEApprovalBusiness()) {
|
||||||
|
case PICK_ADD:
|
||||||
|
// 提货充值
|
||||||
|
str = iAcPickService.pickApprovalAgree(approvalBusinessResultDTO);
|
||||||
|
break;
|
||||||
|
case PICK_ADD_DEL:
|
||||||
|
// 提货充值删除
|
||||||
|
str = iAcPickService.delpickApprovalAgree(approvalBusinessResultDTO);
|
||||||
|
break;
|
||||||
// 直推赠送
|
// 直推赠送
|
||||||
case DIRECT_PUSH_GIFT:
|
case DIRECT_PUSH_GIFT:
|
||||||
str = acRepurCouponsRuleConfigService.approvalAgree(approvalBusinessResultDTO);
|
str = acRepurCouponsRuleConfigService.approvalAgree(approvalBusinessResultDTO);
|
||||||
|
|
@ -105,6 +128,10 @@ public class ActivityApprovalProvider implements IActivityApprovalServiceApi {
|
||||||
} else {
|
} else {
|
||||||
// 驳回处理
|
// 驳回处理
|
||||||
switch (approvalBusinessResultDTO.getEApprovalBusiness()) {
|
switch (approvalBusinessResultDTO.getEApprovalBusiness()) {
|
||||||
|
case PICK_ADD:
|
||||||
|
// 提货充值
|
||||||
|
str = iAcPickService.pickApprovalReject(approvalBusinessResultDTO);
|
||||||
|
break;
|
||||||
// 直推赠送
|
// 直推赠送
|
||||||
case DIRECT_PUSH_GIFT:
|
case DIRECT_PUSH_GIFT:
|
||||||
str = acRepurCouponsRuleConfigService.approvalReject(approvalBusinessResultDTO);
|
str = acRepurCouponsRuleConfigService.approvalReject(approvalBusinessResultDTO);
|
||||||
|
|
@ -136,6 +163,19 @@ public class ActivityApprovalProvider implements IActivityApprovalServiceApi {
|
||||||
try {
|
try {
|
||||||
List<AcApprovalLog> acApprovalLogList = iAcApprovalLogService.queryApprovalLogList(eApprovalBusiness, businessCode, pkCountry);
|
List<AcApprovalLog> acApprovalLogList = iAcApprovalLogService.queryApprovalLogList(eApprovalBusiness, businessCode, pkCountry);
|
||||||
switch (eApprovalBusiness) {
|
switch (eApprovalBusiness) {
|
||||||
|
case PICK_ADD:
|
||||||
|
case PICK_ADD_DEL:
|
||||||
|
// 提货充值
|
||||||
|
List<AcPickSaveDetailParam> list = new ArrayList<>();
|
||||||
|
for (AcApprovalLog approvalLog : acApprovalLogList) {
|
||||||
|
AcPickSaveDetailParam afterData = JSONUtil.toBean(approvalLog.getAfterData(), AcPickSaveDetailParam.class);
|
||||||
|
afterData.setMemberName(iMemberServiceApi.getMember(afterData.getMemberCode()).getData().getMemberName());
|
||||||
|
if (afterData.getPkProduct() != null) {
|
||||||
|
afterData.setProductName(iProductServiceApi.getProduct(afterData.getPkProduct()).getData().getProductName() + "(" + afterData.getSpecsName() + ")");
|
||||||
|
}
|
||||||
|
list.add(afterData);
|
||||||
|
}
|
||||||
|
return R.ok(list);
|
||||||
case DIRECT_PUSH_GIFT:
|
case DIRECT_PUSH_GIFT:
|
||||||
case LOTTERY_DRAW:
|
case LOTTERY_DRAW:
|
||||||
// 抽奖
|
// 抽奖
|
||||||
|
|
@ -169,9 +209,11 @@ public class ActivityApprovalProvider implements IActivityApprovalServiceApi {
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private AcRecommendParam getRecommendApprovalData(AcApprovalLog acApprovalLog) {
|
private AcRecommendParam getRecommendApprovalData(AcApprovalLog acApprovalLog) {
|
||||||
String data = acApprovalLog.getAfterData();
|
String data = acApprovalLog.getAfterData();
|
||||||
return JSONUtil.toBean(data, AcRecommendParam.class);
|
return JSONUtil.toBean(data, AcRecommendParam.class);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private PurchasedTimesParam getRecommendApprovalDataInfo(AcApprovalLog acApprovalLog) {
|
private PurchasedTimesParam getRecommendApprovalDataInfo(AcApprovalLog acApprovalLog) {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import com.hzs.activity.pick.vo.AcPickQueryDetailVO;
|
||||||
import com.hzs.activity.pick.vo.AcPickQueryVO;
|
import com.hzs.activity.pick.vo.AcPickQueryVO;
|
||||||
import com.hzs.activity.wares.service.IAcGiftConfigService;
|
import com.hzs.activity.wares.service.IAcGiftConfigService;
|
||||||
import com.hzs.common.core.annotation.Log;
|
import com.hzs.common.core.annotation.Log;
|
||||||
|
import com.hzs.common.core.constant.msg.CommonMsgConstants;
|
||||||
import com.hzs.common.core.constant.msg.MemberMsgConstants;
|
import com.hzs.common.core.constant.msg.MemberMsgConstants;
|
||||||
import com.hzs.common.core.constant.msg.ProductMsgConstants;
|
import com.hzs.common.core.constant.msg.ProductMsgConstants;
|
||||||
import com.hzs.common.core.enums.*;
|
import com.hzs.common.core.enums.*;
|
||||||
|
|
@ -92,8 +93,7 @@ public class AcPickController extends BaseController {
|
||||||
|
|
||||||
acPickQueryVO.setPickTypeVal(EPickType.getEnumByValue(acPickQueryVO.getPickType()).getLabel());
|
acPickQueryVO.setPickTypeVal(EPickType.getEnumByValue(acPickQueryVO.getPickType()).getLabel());
|
||||||
|
|
||||||
if (EPickType.PICK_PRODUCT.getValue() == acPickExt.getPickType()
|
if (EPickType.PICK_PRODUCT.getValue() == acPickExt.getPickType()) {
|
||||||
|| EPickType.COMPANY_PRODUCT.getValue() == acPickExt.getPickType()) {
|
|
||||||
// 提货产品
|
// 提货产品
|
||||||
acPickQueryVO.setDetailList(Collections.singletonList(AcPickQueryDetailVO.builder()
|
acPickQueryVO.setDetailList(Collections.singletonList(AcPickQueryDetailVO.builder()
|
||||||
.productName(acPickExt.getProductName())
|
.productName(acPickExt.getProductName())
|
||||||
|
|
@ -155,8 +155,7 @@ public class AcPickController extends BaseController {
|
||||||
|
|
||||||
acPickQueryVO.setPickTypeVal(EPickType.getEnumByValue(acPickQueryVO.getPickType()).getLabel());
|
acPickQueryVO.setPickTypeVal(EPickType.getEnumByValue(acPickQueryVO.getPickType()).getLabel());
|
||||||
|
|
||||||
if (EPickType.PICK_PRODUCT.getValue() == acPickExt.getPickType()
|
if (EPickType.PICK_PRODUCT.getValue() == acPickExt.getPickType()) {
|
||||||
|| EPickType.COMPANY_PRODUCT.getValue() == acPickExt.getPickType()) {
|
|
||||||
// 产品处理
|
// 产品处理
|
||||||
acPickQueryVO.setDetailList(Collections.singletonList(AcPickQueryDetailVO.builder()
|
acPickQueryVO.setDetailList(Collections.singletonList(AcPickQueryDetailVO.builder()
|
||||||
.productName(acPickExt.getProductName())
|
.productName(acPickExt.getProductName())
|
||||||
|
|
@ -200,8 +199,7 @@ public class AcPickController extends BaseController {
|
||||||
AcPickExt acPickExt = iAcPickService.queryDetail(pkId, pkCountry);
|
AcPickExt acPickExt = iAcPickService.queryDetail(pkId, pkCountry);
|
||||||
if (null != acPickExt) {
|
if (null != acPickExt) {
|
||||||
acPickQueryVO = BeanUtil.copyProperties(acPickExt, AcPickQueryVO.class);
|
acPickQueryVO = BeanUtil.copyProperties(acPickExt, AcPickQueryVO.class);
|
||||||
if (EPickType.PICK_PRODUCT.getValue() == acPickExt.getPickType()
|
if (EPickType.PICK_PRODUCT.getValue() == acPickExt.getPickType()) {
|
||||||
|| EPickType.COMPANY_PRODUCT.getValue() == acPickExt.getPickType()) {
|
|
||||||
// 产品处理
|
// 产品处理
|
||||||
acPickQueryVO.setDetailList(Collections.singletonList(AcPickQueryDetailVO.builder()
|
acPickQueryVO.setDetailList(Collections.singletonList(AcPickQueryDetailVO.builder()
|
||||||
.pkProduct(acPickExt.getPkDataId().intValue())
|
.pkProduct(acPickExt.getPkDataId().intValue())
|
||||||
|
|
@ -235,17 +233,23 @@ public class AcPickController extends BaseController {
|
||||||
@Log(module = EOperationModule.RECHARGE_PICK, business = EOperationBusiness.RECHARGE_PICK, method = EOperationMethod.SUBMIT)
|
@Log(module = EOperationModule.RECHARGE_PICK, business = EOperationBusiness.RECHARGE_PICK, method = EOperationMethod.SUBMIT)
|
||||||
@PostMapping("/submit")
|
@PostMapping("/submit")
|
||||||
public AjaxResult submit(@RequestBody AcPickSaveParam param) {
|
public AjaxResult submit(@RequestBody AcPickSaveParam param) {
|
||||||
|
if (null == param.getSignType() || CollectionUtil.isEmpty(param.getUserIdList())
|
||||||
|
|| CollectionUtil.isEmpty(param.getDetailList())) {
|
||||||
|
// 缺少参数
|
||||||
|
return AjaxResult.error(TransactionUtils.getContent(CommonMsgConstants.MISSING_PARAM));
|
||||||
|
}
|
||||||
|
|
||||||
for (AcPickSaveDetailParam detailParam : param.getDetailList()) {
|
for (AcPickSaveDetailParam detailParam : param.getDetailList()) {
|
||||||
if (StringUtils.isAnyEmpty(detailParam.getMemberCode(), detailParam.getSpecsName(), detailParam.getSpecsNameId())
|
if (StringUtils.isAnyEmpty(detailParam.getMemberCode(), detailParam.getSpecsName(), detailParam.getSpecsNameId())
|
||||||
|| null == detailParam.getPkProduct() || null == detailParam.getBaseQuantity() || null == detailParam.getQuantity()
|
|| null == detailParam.getPkProduct() || null == detailParam.getBaseQuantity() || null == detailParam.getQuantity()
|
||||||
|| null == detailParam.getIsFreeMail()) {
|
|| null == detailParam.getIsFreeMail()) {
|
||||||
// 缺少参数
|
// 缺少参数
|
||||||
return AjaxResult.error("缺少参数");
|
return AjaxResult.error(TransactionUtils.getContent(CommonMsgConstants.MISSING_PARAM));
|
||||||
}
|
}
|
||||||
if (EYesNo.NO.getIntValue() == detailParam.getIsFreeMail() && null == detailParam.getPkPostage()) {
|
if (EYesNo.NO.getIntValue() == detailParam.getIsFreeMail() && null == detailParam.getPkPostage()) {
|
||||||
// 不包邮,则必须传入邮费模板
|
// 不包邮,则必须传入邮费模板
|
||||||
// 缺少参数
|
// 缺少参数
|
||||||
return AjaxResult.error("缺少参数");
|
return AjaxResult.error(TransactionUtils.getContent(CommonMsgConstants.MISSING_PARAM));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 手动添加提货数据比较少,此处查人和产品先单次查,如果同时操作人过多可以改成批量,或者不进行校验
|
// 手动添加提货数据比较少,此处查人和产品先单次查,如果同时操作人过多可以改成批量,或者不进行校验
|
||||||
|
|
@ -270,14 +274,19 @@ public class AcPickController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除充值提货卡
|
* @description: 删除充值提货卡
|
||||||
|
* @author: zhang jing
|
||||||
|
* @date: 2023/10/17 17:35
|
||||||
|
* @param: [anpParam]
|
||||||
|
* @return: com.hzs.common.core.web.domain.AjaxResult
|
||||||
**/
|
**/
|
||||||
@Log(module = EOperationModule.RECHARGE_PICK, business = EOperationBusiness.RECHARGE_PICK, method = EOperationMethod.DELETE)
|
@Log(module = EOperationModule.RECHARGE_PICK, business = EOperationBusiness.RECHARGE_PICK, method = EOperationMethod.DELETE)
|
||||||
@PostMapping("/del-pick")
|
@PostMapping("/del-pick")
|
||||||
public AjaxResult delPick(@RequestBody AcPickSaveParam anpParam) {
|
public AjaxResult delPick(@RequestBody AcPickSaveParam anpParam) {
|
||||||
if (CollectionUtil.isEmpty(anpParam.getDetailList())) {
|
if (null == anpParam.getSignType() || CollectionUtil.isEmpty(anpParam.getUserIdList())
|
||||||
|
|| CollectionUtil.isEmpty(anpParam.getDetailList())) {
|
||||||
// 缺少参数
|
// 缺少参数
|
||||||
return AjaxResult.error("缺少参数");
|
return AjaxResult.error(TransactionUtils.getContent(CommonMsgConstants.MISSING_PARAM));
|
||||||
}
|
}
|
||||||
// 设置参数
|
// 设置参数
|
||||||
LoginUser loginUser = userTokenService.getLoginUser();
|
LoginUser loginUser = userTokenService.getLoginUser();
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,11 @@ import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提货明细保存入参
|
* @Description: 提货明细保存入参
|
||||||
|
* @Author: jiang chao
|
||||||
|
* @Time: 2023/5/10 19:06
|
||||||
|
* @Classname: AcPickSaveDetailParam
|
||||||
|
* @PackageName: com.hzs.activity.pick.param
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class AcPickSaveDetailParam implements Serializable {
|
public class AcPickSaveDetailParam implements Serializable {
|
||||||
|
|
@ -72,9 +76,4 @@ public class AcPickSaveDetailParam implements Serializable {
|
||||||
*/
|
*/
|
||||||
private String productName;
|
private String productName;
|
||||||
|
|
||||||
/**
|
|
||||||
* 提货类型
|
|
||||||
*/
|
|
||||||
private Integer pickType;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,11 @@ import lombok.EqualsAndHashCode;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提货保存入参
|
* @Description: 提货保存入参
|
||||||
|
* @Author: jiang chao
|
||||||
|
* @Time: 2023/4/22 11:26
|
||||||
|
* @Classname: AcPickSaveParam
|
||||||
|
* @PackageName: com.hzs.activity.pick.param
|
||||||
*/
|
*/
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import com.hzs.activity.pick.param.AcPickSaveParam;
|
||||||
import com.hzs.activity.pick.vo.ApiPickListVO;
|
import com.hzs.activity.pick.vo.ApiPickListVO;
|
||||||
import com.hzs.common.domain.activity.pick.AcPick;
|
import com.hzs.common.domain.activity.pick.AcPick;
|
||||||
import com.hzs.common.domain.activity.pick.ext.AcPickExt;
|
import com.hzs.common.domain.activity.pick.ext.AcPickExt;
|
||||||
|
import com.hzs.system.sys.dto.ApprovalBusinessResultDTO;
|
||||||
import com.hzs.system.sys.dto.LoginUser;
|
import com.hzs.system.sys.dto.LoginUser;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
@ -37,6 +38,7 @@ public interface IAcPickService extends IService<AcPick> {
|
||||||
Integer usableQuantity, String pickCover, Date receiveTime, Integer pkPostage,
|
Integer usableQuantity, String pickCover, Date receiveTime, Integer pkPostage,
|
||||||
Long pkCreator, Integer pkCountry, Long pkBaseId);
|
Long pkCreator, Integer pkCountry, Long pkBaseId);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据会员和活动类型回退使用数量
|
* 根据会员和活动类型回退使用数量
|
||||||
*
|
*
|
||||||
|
|
@ -79,10 +81,31 @@ public interface IAcPickService extends IService<AcPick> {
|
||||||
String pickSubmit(AcPickSaveParam param, LoginUser loginUser);
|
String pickSubmit(AcPickSaveParam param, LoginUser loginUser);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除充值提货卡
|
* 删除充值提货卡发起签呈
|
||||||
**/
|
**/
|
||||||
boolean delPick(AcPickSaveParam anpParam);
|
boolean delPick(AcPickSaveParam anpParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提货变动审批通过
|
||||||
|
*
|
||||||
|
* @param resultDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String pickApprovalAgree(ApprovalBusinessResultDTO resultDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核删除充值提货卡
|
||||||
|
**/
|
||||||
|
String delpickApprovalAgree(ApprovalBusinessResultDTO resultDTO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提货变动审批驳回
|
||||||
|
*
|
||||||
|
* @param resultDTO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String pickApprovalReject(ApprovalBusinessResultDTO resultDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员提货列表
|
* 会员提货列表
|
||||||
*
|
*
|
||||||
|
|
@ -112,6 +135,7 @@ public interface IAcPickService extends IService<AcPick> {
|
||||||
*/
|
*/
|
||||||
int batchSaveOrUpdatePick(List<AcPick> pickList);
|
int batchSaveOrUpdatePick(List<AcPick> pickList);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID更新会员提货数据
|
* 根据ID更新会员提货数据
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
package com.hzs.activity.pick.service.impl;
|
package com.hzs.activity.pick.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.hzs.activity.base.service.IAcApprovalLogService;
|
||||||
import com.hzs.activity.pick.mapper.AcPickMapper;
|
import com.hzs.activity.pick.mapper.AcPickMapper;
|
||||||
import com.hzs.activity.pick.param.AcPickQueryParam;
|
import com.hzs.activity.pick.param.AcPickQueryParam;
|
||||||
import com.hzs.activity.pick.param.AcPickSaveDetailParam;
|
import com.hzs.activity.pick.param.AcPickSaveDetailParam;
|
||||||
|
|
@ -11,11 +13,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.hzs.activity.pick.vo.ApiPickListVO;
|
import com.hzs.activity.pick.vo.ApiPickListVO;
|
||||||
import com.hzs.activity.wares.service.IAcGiftConfigService;
|
import com.hzs.activity.wares.service.IAcGiftConfigService;
|
||||||
import com.hzs.common.core.constant.RabbitMqConstants;
|
import com.hzs.common.core.constant.RabbitMqConstants;
|
||||||
|
import com.hzs.common.core.constant.msg.ActivityMsgConstants;
|
||||||
|
import com.hzs.common.core.constant.msg.CommonMsgConstants;
|
||||||
import com.hzs.common.core.constant.msg.DocumentMsgConstants;
|
import com.hzs.common.core.constant.msg.DocumentMsgConstants;
|
||||||
|
import com.hzs.common.core.domain.R;
|
||||||
import com.hzs.common.core.enums.*;
|
import com.hzs.common.core.enums.*;
|
||||||
import com.hzs.common.core.exception.ServiceException;
|
import com.hzs.common.core.exception.base.BaseException;
|
||||||
import com.hzs.common.core.utils.CommonUtil;
|
import com.hzs.common.core.utils.CommonUtil;
|
||||||
import com.hzs.common.core.utils.DateUtils;
|
import com.hzs.common.core.utils.DateUtils;
|
||||||
|
import com.hzs.common.domain.activity.base.AcApprovalLog;
|
||||||
import com.hzs.common.domain.activity.base.AcPickUpConfig;
|
import com.hzs.common.domain.activity.base.AcPickUpConfig;
|
||||||
import com.hzs.common.domain.activity.base.ext.AcGiftConfigExt;
|
import com.hzs.common.domain.activity.base.ext.AcGiftConfigExt;
|
||||||
import com.hzs.common.domain.activity.pick.AcPick;
|
import com.hzs.common.domain.activity.pick.AcPick;
|
||||||
|
|
@ -28,6 +34,9 @@ import com.hzs.member.base.IMemberServiceApi;
|
||||||
import com.hzs.sale.postage.dto.PostageProductDTO;
|
import com.hzs.sale.postage.dto.PostageProductDTO;
|
||||||
import com.hzs.sale.postage.service.IPostageBusinessService;
|
import com.hzs.sale.postage.service.IPostageBusinessService;
|
||||||
import com.hzs.sale.product.service.IBdProductService;
|
import com.hzs.sale.product.service.IBdProductService;
|
||||||
|
import com.hzs.system.sys.IApprovalServiceApi;
|
||||||
|
import com.hzs.system.sys.dto.ApprovalBusinessResultDTO;
|
||||||
|
import com.hzs.system.sys.dto.ApprovalSubmitDTO;
|
||||||
import com.hzs.system.sys.dto.BusinessLogDTO;
|
import com.hzs.system.sys.dto.BusinessLogDTO;
|
||||||
import com.hzs.system.sys.dto.LoginUser;
|
import com.hzs.system.sys.dto.LoginUser;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -48,6 +57,8 @@ import java.util.stream.Collectors;
|
||||||
@Service
|
@Service
|
||||||
public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> implements IAcPickService {
|
public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> implements IAcPickService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IAcApprovalLogService iAcApprovalLogService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IAcPickLogService iAcPickLogService;
|
private IAcPickLogService iAcPickLogService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -61,6 +72,8 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
@Autowired
|
@Autowired
|
||||||
private IPostageBusinessService iPostageBusinessService;
|
private IPostageBusinessService iPostageBusinessService;
|
||||||
|
|
||||||
|
@DubboReference
|
||||||
|
IApprovalServiceApi iApprovalServiceApi;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
IMemberServiceApi iMemberServiceApi;
|
IMemberServiceApi iMemberServiceApi;
|
||||||
|
|
||||||
|
|
@ -128,25 +141,222 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
// 操作日志列表
|
// 操作日志列表
|
||||||
List<BusinessLogDTO> logDTOList = new ArrayList<>();
|
List<BusinessLogDTO> logDTOList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 批量保存日志
|
||||||
|
List<AcApprovalLog> approvalLogList = new ArrayList<>();
|
||||||
|
|
||||||
// 产品数据map
|
// 产品数据map
|
||||||
Map<Integer, BdProduct> productMap = iBdProductService.queryProductMap(param.getDetailList().stream().map(AcPickSaveDetailParam::getPkProduct).collect(Collectors.toList()), pkCountry);
|
Map<Integer, BdProduct> productMap = iBdProductService.queryProductMap(param.getDetailList().stream().map(AcPickSaveDetailParam::getPkProduct).collect(Collectors.toList()), pkCountry);
|
||||||
|
|
||||||
|
for (AcPickSaveDetailParam detailParam : param.getDetailList()) {
|
||||||
|
// 活动审批日志
|
||||||
|
AcApprovalLog acApprovalLog = new AcApprovalLog();
|
||||||
|
acApprovalLog.setApprovalType(EApprovalBusiness.PICK_ADD.getValue());
|
||||||
|
acApprovalLog.setBusinessCode(businessCode);
|
||||||
|
acApprovalLog.setPkCreator(userId);
|
||||||
|
acApprovalLog.setPkCountry(pkCountry);
|
||||||
|
acApprovalLog.setAfterData(JSONUtil.toJsonStr(detailParam));
|
||||||
|
if (null != detailParam.getPkId()) {
|
||||||
|
acApprovalLog.setPkBusiness(detailParam.getPkId());
|
||||||
|
}
|
||||||
|
approvalLogList.add(acApprovalLog);
|
||||||
|
|
||||||
|
// 产品信息
|
||||||
|
BdProduct bdProduct = productMap.get(detailParam.getPkProduct());
|
||||||
|
// 操作日志内容
|
||||||
|
StringBuilder content = new StringBuilder();
|
||||||
|
content.append("会员编号 ").append(detailParam.getMemberCode());
|
||||||
|
content.append(" 充值提货卡 ").append(bdProduct.getProductName()).append("(").append(detailParam.getSpecsName()).append(")");
|
||||||
|
content.append(",提货基数 ").append(detailParam.getBaseQuantity());
|
||||||
|
content.append(",充值数量 ").append(detailParam.getQuantity());
|
||||||
|
if (null != detailParam.getReceiveTime()) {
|
||||||
|
content.append(",截止日期 ").append(DateUtils.parseDateToFormat(DateUtils.YYYY_MM_DD_HH_MM_SS, detailParam.getReceiveTime()));
|
||||||
|
}
|
||||||
|
if (EYesNo.YES.getIntValue() == detailParam.getIsFreeMail()) {
|
||||||
|
content.append(",包邮;");
|
||||||
|
} else {
|
||||||
|
content.append(",不包邮;");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 会员信息
|
||||||
|
CuMember cuMember = iMemberServiceApi.queryMember(detailParam.getMemberCode()).getData();
|
||||||
|
// 封装业务操作日志
|
||||||
|
logDTOList.add(BusinessLogDTO.builder()
|
||||||
|
.businessType(EApprovalBusiness.PICK_ADD.getValue())
|
||||||
|
.businessCode(businessCode)
|
||||||
|
.content(content.toString())
|
||||||
|
.pkMember(cuMember.getPkId())
|
||||||
|
.pkCreator(userId)
|
||||||
|
.pkCountry(pkCountry)
|
||||||
|
.freeSignFlag(false)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iAcApprovalLogService.saveBatch(approvalLogList)) {
|
||||||
|
// 保存审批日志成功,提交签呈
|
||||||
|
|
||||||
|
// 提交签呈处理
|
||||||
|
R<String> resultR = iApprovalServiceApi.submitOrder(
|
||||||
|
ApprovalSubmitDTO.builder()
|
||||||
|
.eApprovalBusiness(EApprovalBusiness.PICK_ADD)
|
||||||
|
.businessCode(businessCode)
|
||||||
|
.signType(ESignType.getEnumByValue(param.getSignType()))
|
||||||
|
.userIdList(param.getUserIdList())
|
||||||
|
.sendIdList(param.getSendIdList())
|
||||||
|
.remark(param.getRemark())
|
||||||
|
.fileList(param.getFileList())
|
||||||
|
.build(),
|
||||||
|
loginUser,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
if (resultR.isSuccess()) {
|
||||||
|
// 推送业务操作日志
|
||||||
|
rabbitTemplate.convertAndSend(RabbitMqConstants.BUSINESS_LOG_EXCHANGE, RabbitMqConstants.BUSINESS_LOG_KEY, logDTOList);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
throw new BaseException(TransactionUtils.getContent(CommonMsgConstants.OPERATION_FAILED) + ": " + resultR.getMsg());
|
||||||
|
}
|
||||||
|
return TransactionUtils.getContent(CommonMsgConstants.OPERATION_FAILED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean delPick(AcPickSaveParam param) {
|
||||||
|
// 会员ID
|
||||||
|
Long userId = param.getLoginUser().getUserId();
|
||||||
|
// 所属国家
|
||||||
|
Integer pkCountry = param.getLoginUser().getDataCountry();
|
||||||
|
// 业务编号
|
||||||
|
String businessCode = CommonUtil.createSerialNumber(EOrderPrefix.ACTIVITY_CODE);
|
||||||
|
|
||||||
|
// 操作日志列表
|
||||||
|
List<BusinessLogDTO> logDTOList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 批量保存日志
|
||||||
|
List<AcApprovalLog> approvalLogList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (AcPickSaveDetailParam detailParam : param.getDetailList()) {
|
||||||
|
// 活动审批日志
|
||||||
|
AcApprovalLog acApprovalLog = new AcApprovalLog();
|
||||||
|
acApprovalLog.setApprovalType(EApprovalBusiness.PICK_ADD_DEL.getValue());
|
||||||
|
acApprovalLog.setBusinessCode(businessCode);
|
||||||
|
acApprovalLog.setPkCreator(userId);
|
||||||
|
acApprovalLog.setPkCountry(pkCountry);
|
||||||
|
acApprovalLog.setAfterData(JSONUtil.toJsonStr(detailParam));
|
||||||
|
if (null != detailParam.getPkId()) {
|
||||||
|
acApprovalLog.setPkBusiness(detailParam.getPkId());
|
||||||
|
}
|
||||||
|
approvalLogList.add(acApprovalLog);
|
||||||
|
|
||||||
|
// 操作日志内容
|
||||||
|
StringBuilder content = new StringBuilder("删除会员编号 ").append(detailParam.getMemberCode()).append(" 的 ");
|
||||||
|
|
||||||
|
// 查询提货数量
|
||||||
|
AcPick acPick = this.getById(detailParam.getPkId());
|
||||||
|
EPickType ePickType = EPickType.getEnumByValue(acPick.getPickType());
|
||||||
|
switch (ePickType) {
|
||||||
|
case PICK_PRODUCT:
|
||||||
|
case PRIZE:
|
||||||
|
// 提货产品、抽奖
|
||||||
|
if (null != detailParam.getPkProduct()) {
|
||||||
|
BdProduct product = iBdProductService.getProduct(detailParam.getPkProduct());
|
||||||
|
content.append(ePickType.getLabel()).append(",").append(product.getProductName()).append("(").append(acPick.getSpecsName()).append(");");
|
||||||
|
} else {
|
||||||
|
content.append(ePickType.getLabel()).append(",").append(";");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case CONSUMPTION_GIFT:
|
||||||
|
case DIRECT_PUSH_GIFT:
|
||||||
|
case LOTTERY_DRAW:
|
||||||
|
// 消费赠送、直推赠送、抽奖
|
||||||
|
content.append(ePickType.getLabel());
|
||||||
|
List<AcGiftConfigExt> acGiftConfigList = iAcGiftConfigService.queryListByRuleIdList(acPick.getPkDataId(), acPick.getPkCountry());
|
||||||
|
if (CollectionUtil.isNotEmpty(acGiftConfigList)) {
|
||||||
|
content.append(",");
|
||||||
|
for (AcGiftConfigExt acGiftConfigExt : acGiftConfigList) {
|
||||||
|
content.append(acGiftConfigExt.getProductName()).append("(").append(acGiftConfigExt.getSpecsName()).append(") ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
content.append(";");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
|
||||||
|
// 被操作会员
|
||||||
|
CuMember cuMember = iMemberServiceApi.queryMember(detailParam.getMemberCode()).getData();
|
||||||
|
// 封装业务操作日志
|
||||||
|
logDTOList.add(BusinessLogDTO.builder()
|
||||||
|
.businessType(EApprovalBusiness.PICK_ADD_DEL.getValue())
|
||||||
|
.businessCode(businessCode)
|
||||||
|
.content(content.toString())
|
||||||
|
.pkMember(cuMember.getPkId())
|
||||||
|
.pkCreator(userId)
|
||||||
|
.pkCountry(pkCountry)
|
||||||
|
.freeSignFlag(false)
|
||||||
|
.build());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iAcApprovalLogService.saveBatch(approvalLogList)) {
|
||||||
|
// 保存审批日志成功,提交签呈
|
||||||
|
// 提交签呈处理
|
||||||
|
R<String> resultR = iApprovalServiceApi.submitOrder(
|
||||||
|
ApprovalSubmitDTO.builder()
|
||||||
|
.eApprovalBusiness(EApprovalBusiness.PICK_ADD_DEL)
|
||||||
|
.businessCode(businessCode)
|
||||||
|
.signType(ESignType.getEnumByValue(param.getSignType()))
|
||||||
|
.userIdList(param.getUserIdList())
|
||||||
|
.sendIdList(param.getSendIdList())
|
||||||
|
.remark(param.getRemark())
|
||||||
|
.fileList(param.getFileList())
|
||||||
|
.build(),
|
||||||
|
param.getLoginUser(),
|
||||||
|
null
|
||||||
|
);
|
||||||
|
if (resultR.isSuccess()) {
|
||||||
|
// 推送业务操作日志
|
||||||
|
rabbitTemplate.convertAndSend(RabbitMqConstants.BUSINESS_LOG_EXCHANGE, RabbitMqConstants.BUSINESS_LOG_KEY, logDTOList);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
throw new BaseException(TransactionUtils.getContent(CommonMsgConstants.OPERATION_FAILED) + ": " + resultR.getMsg());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
@Override
|
||||||
|
public String pickApprovalAgree(ApprovalBusinessResultDTO resultDTO) {
|
||||||
|
// 用户ID
|
||||||
|
Long userId = resultDTO.getLoginUser().getUserId();
|
||||||
|
// 所属国家
|
||||||
|
Integer pkCountry = resultDTO.getLoginUser().getDataCountry();
|
||||||
|
|
||||||
|
List<AcApprovalLog> approvalLogList = iAcApprovalLogService.queryApprovalLogList(resultDTO.getEApprovalBusiness(), resultDTO.getBusinessCode(), pkCountry);
|
||||||
|
// 一批审批可能有多个
|
||||||
|
AcApprovalLog approvalLog = approvalLogList.get(0);
|
||||||
|
if (null == approvalLog) {
|
||||||
|
log.error("提货充值同意处理失败: 签呈不存在!");
|
||||||
|
return TransactionUtils.getContent(ActivityMsgConstants.PICK_NOT_EXIST);
|
||||||
|
}
|
||||||
|
if (EAgentApprovalStatus.UNAPPROVED.getValue() != approvalLog.getApprovalStatus()) {
|
||||||
|
log.error("提货充值同意处理失败: 签呈已处理");
|
||||||
|
return TransactionUtils.getContent(ActivityMsgConstants.PICK_PROCESSED);
|
||||||
|
}
|
||||||
|
|
||||||
// 新増提货列表
|
// 新増提货列表
|
||||||
List<AcPick> createList = new ArrayList<>();
|
List<AcPick> createList = new ArrayList<>();
|
||||||
// 修改提货列表
|
// 修改提货列表
|
||||||
List<AcPick> updateList = new ArrayList<>();
|
List<AcPick> updateList = new ArrayList<>();
|
||||||
|
|
||||||
for (AcPickSaveDetailParam detailParam : param.getDetailList()) {
|
for (AcApprovalLog acApprovalLog : approvalLogList) {
|
||||||
// 会员信息
|
// 存在业务ID,则为修改
|
||||||
CuMember cuMember = iMemberServiceApi.queryMember(detailParam.getMemberCode()).getData();
|
AcPickSaveDetailParam detailParam = JSONUtil.toBean(acApprovalLog.getAfterData(), AcPickSaveDetailParam.class);
|
||||||
|
// 当前会员
|
||||||
|
CuMember cuMember = iMemberServiceApi.getMember(detailParam.getMemberCode()).getData();
|
||||||
// 提货ID
|
// 提货ID
|
||||||
Long pickId = null;
|
Long pickId = null;
|
||||||
// 提货类型
|
|
||||||
Integer pickType = null != detailParam.getPickType() ? detailParam.getPickType() : EPickType.COMPANY_PRODUCT.getValue();
|
|
||||||
|
|
||||||
if (null == detailParam.getPkId()) {
|
if (null == detailParam.getPkId()) {
|
||||||
LambdaQueryWrapper<AcPick> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AcPick> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(AcPick::getPickType, pickType);
|
queryWrapper.eq(AcPick::getPickType, EPickType.PICK_PRODUCT.getValue());
|
||||||
queryWrapper.eq(AcPick::getPkBaseConfig, 0);
|
queryWrapper.eq(AcPick::getPkBaseConfig, 0);
|
||||||
queryWrapper.eq(AcPick::getPkDataId, detailParam.getPkProduct());
|
queryWrapper.eq(AcPick::getPkDataId, detailParam.getPkProduct());
|
||||||
queryWrapper.eq(AcPick::getSpecsNameId, detailParam.getSpecsNameId());
|
queryWrapper.eq(AcPick::getSpecsNameId, detailParam.getSpecsNameId());
|
||||||
|
|
@ -163,7 +373,7 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
if (null == pickId) {
|
if (null == pickId) {
|
||||||
// 新增提货数据
|
// 新增提货数据
|
||||||
acPick.setPkMember(cuMember.getPkId());
|
acPick.setPkMember(cuMember.getPkId());
|
||||||
acPick.setPickType(pickType);
|
acPick.setPickType(EPickType.PICK_PRODUCT.getValue());
|
||||||
acPick.setPkDataId(detailParam.getPkProduct().longValue());
|
acPick.setPkDataId(detailParam.getPkProduct().longValue());
|
||||||
acPick.setSpecsName(detailParam.getSpecsName());
|
acPick.setSpecsName(detailParam.getSpecsName());
|
||||||
acPick.setSpecsNameId(detailParam.getSpecsNameId());
|
acPick.setSpecsNameId(detailParam.getSpecsNameId());
|
||||||
|
|
@ -187,35 +397,10 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
acPick.setModifiedTime(new Date());
|
acPick.setModifiedTime(new Date());
|
||||||
updateList.add(acPick);
|
updateList.add(acPick);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iAcApprovalLogService.updateApprovalLog(resultDTO.getEApprovalBusiness(), resultDTO.getBusinessCode(), pkCountry, userId, EApproveRechargeStatus.AGREE, resultDTO.getApproveRemark())) {
|
||||||
// 产品信息
|
// 更新修改记录
|
||||||
BdProduct bdProduct = productMap.get(detailParam.getPkProduct());
|
|
||||||
// 操作日志内容
|
|
||||||
StringBuilder content = new StringBuilder();
|
|
||||||
content.append("会员编号 ").append(detailParam.getMemberCode());
|
|
||||||
content.append(" 充值提货卡 ").append(bdProduct.getProductName()).append("(").append(detailParam.getSpecsName()).append(")");
|
|
||||||
content.append(",提货基数 ").append(detailParam.getBaseQuantity());
|
|
||||||
content.append(",充值数量 ").append(detailParam.getQuantity());
|
|
||||||
if (null != detailParam.getReceiveTime()) {
|
|
||||||
content.append(",截止日期 ").append(DateUtils.parseDateToFormat(DateUtils.YYYY_MM_DD_HH_MM_SS, detailParam.getReceiveTime()));
|
|
||||||
}
|
|
||||||
if (EYesNo.YES.getIntValue() == detailParam.getIsFreeMail()) {
|
|
||||||
content.append(",包邮;");
|
|
||||||
} else {
|
|
||||||
content.append(",不包邮;");
|
|
||||||
}
|
|
||||||
// 封装业务操作日志
|
|
||||||
logDTOList.add(BusinessLogDTO.builder()
|
|
||||||
.businessType(EApprovalBusiness.PICK_ADD.getValue())
|
|
||||||
.businessCode(businessCode)
|
|
||||||
.content(content.toString())
|
|
||||||
.pkMember(cuMember.getPkId())
|
|
||||||
.pkCreator(userId)
|
|
||||||
.pkCountry(pkCountry)
|
|
||||||
.freeSignFlag(false)
|
|
||||||
.build());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提货操作日志
|
// 提货操作日志
|
||||||
List<AcPickLog> logList = new ArrayList<>();
|
List<AcPickLog> logList = new ArrayList<>();
|
||||||
|
|
@ -249,34 +434,45 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
// 插入提货操作日志
|
// 插入提货操作日志
|
||||||
iAcPickLogService.insertBatch(logList);
|
iAcPickLogService.insertBatch(logList);
|
||||||
|
|
||||||
// 推送业务操作日志
|
|
||||||
rabbitTemplate.convertAndSend(RabbitMqConstants.BUSINESS_LOG_EXCHANGE, RabbitMqConstants.BUSINESS_LOG_KEY, logDTOList);
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
log.error("提货充值同意处理失败: 更新数据失败");
|
||||||
|
return TransactionUtils.getContent(DocumentMsgConstants.DOCUMENT_ORDER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@Override
|
@Override
|
||||||
public boolean delPick(AcPickSaveParam param) {
|
public String delpickApprovalAgree(ApprovalBusinessResultDTO resultDTO) {
|
||||||
// 会员ID
|
// 用户ID
|
||||||
Long userId = param.getLoginUser().getUserId();
|
Long userId = resultDTO.getLoginUser().getUserId();
|
||||||
// 所属国家
|
// 所属国家
|
||||||
Integer pkCountry = param.getLoginUser().getDataCountry();
|
Integer pkCountry = resultDTO.getLoginUser().getDataCountry();
|
||||||
// 业务编号
|
|
||||||
String businessCode = CommonUtil.createSerialNumber(EOrderPrefix.ACTIVITY_CODE);
|
|
||||||
|
|
||||||
// 操作日志列表
|
List<AcApprovalLog> approvalLogList = iAcApprovalLogService.queryApprovalLogList(resultDTO.getEApprovalBusiness(), resultDTO.getBusinessCode(), pkCountry);
|
||||||
List<BusinessLogDTO> logDTOList = new ArrayList<>();
|
// 一批审批可能有多个
|
||||||
|
AcApprovalLog approvalLog = approvalLogList.get(0);
|
||||||
|
if (null == approvalLog) {
|
||||||
|
log.error("提货充值同意处理失败: 签呈不存在!");
|
||||||
|
return TransactionUtils.getContent(ActivityMsgConstants.PICK_NOT_EXIST);
|
||||||
|
}
|
||||||
|
if (EAgentApprovalStatus.UNAPPROVED.getValue() != approvalLog.getApprovalStatus()) {
|
||||||
|
log.error("提货充值同意处理失败: 签呈已处理");
|
||||||
|
return TransactionUtils.getContent(ActivityMsgConstants.PICK_PROCESSED);
|
||||||
|
}
|
||||||
|
|
||||||
// 删除提货列表
|
// 删除提货列表
|
||||||
List<AcPick> updateList = new ArrayList<>();
|
List<AcPick> updateList = new ArrayList<>();
|
||||||
|
|
||||||
for (AcPickSaveDetailParam detailParam : param.getDetailList()) {
|
for (AcApprovalLog acApprovalLog : approvalLogList) {
|
||||||
// 被操作会员
|
// 存在业务ID,则为修改
|
||||||
CuMember cuMember = iMemberServiceApi.queryMember(detailParam.getMemberCode()).getData();
|
AcPickSaveDetailParam detailParam = JSONUtil.toBean(acApprovalLog.getAfterData(), AcPickSaveDetailParam.class);
|
||||||
|
// 当前会员
|
||||||
|
CuMember cuMember = iMemberServiceApi.getMember(detailParam.getMemberCode()).getData();
|
||||||
// 提货ID
|
// 提货ID
|
||||||
Long pickId = null;
|
Long pickId = null;
|
||||||
if (null == detailParam.getPkId()) {
|
if (null == detailParam.getPkId()) {
|
||||||
LambdaQueryWrapper<AcPick> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AcPick> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(AcPick::getPickType, EPickType.COMPANY_PRODUCT.getValue());
|
queryWrapper.eq(AcPick::getPickType, EPickType.PICK_PRODUCT.getValue());
|
||||||
queryWrapper.eq(AcPick::getPkBaseConfig, 0);
|
queryWrapper.eq(AcPick::getPkBaseConfig, 0);
|
||||||
queryWrapper.eq(AcPick::getPkDataId, detailParam.getPkProduct());
|
queryWrapper.eq(AcPick::getPkDataId, detailParam.getPkProduct());
|
||||||
queryWrapper.eq(AcPick::getPkMember, cuMember.getPkId());
|
queryWrapper.eq(AcPick::getPkMember, cuMember.getPkId());
|
||||||
|
|
@ -297,54 +493,12 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
updateList.add(acPick);
|
updateList.add(acPick);
|
||||||
} else {
|
} else {
|
||||||
log.error("提货充值同意处理失败: 更新数据失败");
|
log.error("提货充值同意处理失败: 更新数据失败");
|
||||||
throw new ServiceException(TransactionUtils.getContent(DocumentMsgConstants.DOCUMENT_ORDER_ERROR));
|
return TransactionUtils.getContent(DocumentMsgConstants.DOCUMENT_ORDER_ERROR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 操作日志内容
|
if (iAcApprovalLogService.updateApprovalLog(resultDTO.getEApprovalBusiness(), resultDTO.getBusinessCode(), pkCountry, userId, EApproveRechargeStatus.AGREE, resultDTO.getApproveRemark())) {
|
||||||
StringBuilder content = new StringBuilder("删除会员编号 ").append(detailParam.getMemberCode()).append(" 的 ");
|
// 更新修改记录
|
||||||
|
|
||||||
// 查询提货数量
|
|
||||||
AcPick delAcPick = this.getById(detailParam.getPkId());
|
|
||||||
EPickType ePickType = EPickType.getEnumByValue(delAcPick.getPickType());
|
|
||||||
switch (ePickType) {
|
|
||||||
case PICK_PRODUCT:
|
|
||||||
case PRIZE:
|
|
||||||
case COMPANY_PRODUCT:
|
|
||||||
// 提货产品、抽奖、分公司产品
|
|
||||||
if (null != detailParam.getPkProduct()) {
|
|
||||||
BdProduct product = iBdProductService.getProduct(detailParam.getPkProduct());
|
|
||||||
content.append(ePickType.getLabel()).append(",").append(product.getProductName()).append("(").append(acPick.getSpecsName()).append(");");
|
|
||||||
} else {
|
|
||||||
content.append(ePickType.getLabel()).append(",").append(";");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case CONSUMPTION_GIFT:
|
|
||||||
case DIRECT_PUSH_GIFT:
|
|
||||||
case LOTTERY_DRAW:
|
|
||||||
// 消费赠送、直推赠送、抽奖
|
|
||||||
content.append(ePickType.getLabel());
|
|
||||||
List<AcGiftConfigExt> acGiftConfigList = iAcGiftConfigService.queryListByRuleIdList(acPick.getPkDataId(), acPick.getPkCountry());
|
|
||||||
if (CollectionUtil.isNotEmpty(acGiftConfigList)) {
|
|
||||||
content.append(",");
|
|
||||||
for (AcGiftConfigExt acGiftConfigExt : acGiftConfigList) {
|
|
||||||
content.append(acGiftConfigExt.getProductName()).append("(").append(acGiftConfigExt.getSpecsName()).append(") ");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
content.append(";");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
// 封装业务操作日志
|
|
||||||
logDTOList.add(BusinessLogDTO.builder()
|
|
||||||
.businessType(EApprovalBusiness.PICK_ADD_DEL.getValue())
|
|
||||||
.businessCode(businessCode)
|
|
||||||
.content(content.toString())
|
|
||||||
.pkMember(cuMember.getPkId())
|
|
||||||
.pkCreator(userId)
|
|
||||||
.pkCountry(pkCountry)
|
|
||||||
.freeSignFlag(false)
|
|
||||||
.build());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新提货数据
|
// 更新提货数据
|
||||||
if (CollectionUtil.isNotEmpty(updateList)) {
|
if (CollectionUtil.isNotEmpty(updateList)) {
|
||||||
|
|
@ -353,9 +507,36 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 推送业务操作日志
|
return null;
|
||||||
rabbitTemplate.convertAndSend(RabbitMqConstants.BUSINESS_LOG_EXCHANGE, RabbitMqConstants.BUSINESS_LOG_KEY, logDTOList);
|
}
|
||||||
return true;
|
log.error("提货充值同意处理失败: 更新数据失败");
|
||||||
|
return TransactionUtils.getContent(DocumentMsgConstants.DOCUMENT_ORDER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String pickApprovalReject(ApprovalBusinessResultDTO resultDTO) {
|
||||||
|
// 用户ID
|
||||||
|
Long userId = resultDTO.getLoginUser().getUserId();
|
||||||
|
// 所属国家
|
||||||
|
Integer pkCountry = resultDTO.getLoginUser().getDataCountry();
|
||||||
|
|
||||||
|
List<AcApprovalLog> approvalLogList = iAcApprovalLogService.queryApprovalLogList(resultDTO.getEApprovalBusiness(), resultDTO.getBusinessCode(), pkCountry);
|
||||||
|
// 一批审批可能有多个
|
||||||
|
AcApprovalLog approvalLog = approvalLogList.get(0);
|
||||||
|
if (null == approvalLog) {
|
||||||
|
log.error("提货充值驳回处理失败: 签呈不存在!");
|
||||||
|
return TransactionUtils.getContent(ActivityMsgConstants.PICK_NOT_EXIST);
|
||||||
|
}
|
||||||
|
if (EAgentApprovalStatus.UNAPPROVED.getValue() != approvalLog.getApprovalStatus()) {
|
||||||
|
log.error("提货充值驳回处理失败: 签呈已处理");
|
||||||
|
return TransactionUtils.getContent(ActivityMsgConstants.PICK_PROCESSED);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iAcApprovalLogService.updateApprovalLog(resultDTO.getEApprovalBusiness(), resultDTO.getBusinessCode(), pkCountry, userId, EApproveRechargeStatus.REJECT, resultDTO.getApproveRemark())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
log.error("提货充值驳回处理失败: 更新数据失败");
|
||||||
|
return TransactionUtils.getContent(DocumentMsgConstants.DOCUMENT_ORDER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -412,6 +593,7 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
return iPostageBusinessService.queryPostage(acPick.getPkPostage(), productList, recProvince, recCity);
|
return iPostageBusinessService.queryPostage(acPick.getPkPostage(), productList, recProvince, recCity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -633,6 +633,7 @@ public class ApiRetailOrderController {
|
||||||
.channel(shoppingCartRedis.getSource())
|
.channel(shoppingCartRedis.getSource())
|
||||||
.waresCode(shoppingCartRedis.getWaresCode())
|
.waresCode(shoppingCartRedis.getWaresCode())
|
||||||
.quantity(shoppingCartRedis.getNumber())
|
.quantity(shoppingCartRedis.getNumber())
|
||||||
|
.pkMakerSpace(shoppingCartRedis.getPkMakerSpace())
|
||||||
.build();
|
.build();
|
||||||
List<WaresItemsParam> waresItemsParamList = new ArrayList<>(shoppingCartRedis.getProductGroup().size());
|
List<WaresItemsParam> waresItemsParamList = new ArrayList<>(shoppingCartRedis.getProductGroup().size());
|
||||||
for (ProductGroup productGroup : shoppingCartRedis.getProductGroup()) {
|
for (ProductGroup productGroup : shoppingCartRedis.getProductGroup()) {
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ public class RetailOrderServiceImpl implements IRetailOrderService {
|
||||||
|
|
||||||
if (boxWaresList.contains(waresDetailExt.getWaresCode())) {
|
if (boxWaresList.contains(waresDetailExt.getWaresCode())) {
|
||||||
// 商品是盒数商品,需要累计数量
|
// 商品是盒数商品,需要累计数量
|
||||||
boxNum += waresDetailExt.getBoxNum() * orderItems.getWaresQuantity();
|
boxNum += orderItems.getWaresQuantity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -601,6 +601,7 @@ public abstract class ParentOrderController extends BaseController {
|
||||||
.channel(shoppingCartRedis.getSource())
|
.channel(shoppingCartRedis.getSource())
|
||||||
.waresCode(shoppingCartRedis.getWaresCode())
|
.waresCode(shoppingCartRedis.getWaresCode())
|
||||||
.quantity(shoppingCartRedis.getNumber())
|
.quantity(shoppingCartRedis.getNumber())
|
||||||
|
.pkMakerSpace(shoppingCartRedis.getPkMakerSpace())
|
||||||
.build();
|
.build();
|
||||||
List<WaresItemsParam> waresItemsParamList = new ArrayList<>(shoppingCartRedis.getProductGroup().size());
|
List<WaresItemsParam> waresItemsParamList = new ArrayList<>(shoppingCartRedis.getProductGroup().size());
|
||||||
for (ProductGroup productGroup : shoppingCartRedis.getProductGroup()) {
|
for (ProductGroup productGroup : shoppingCartRedis.getProductGroup()) {
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,9 @@ public class OrderItemsParam implements Serializable {
|
||||||
private Integer quantity;
|
private Integer quantity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品盒数
|
* 创客空间id
|
||||||
*/
|
*/
|
||||||
private Integer boxNum;
|
private Long pkMakerSpace;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品明细
|
* 商品明细
|
||||||
|
|
|
||||||
|
|
@ -2157,13 +2157,11 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
|
||||||
|
|
||||||
// 当前产品盒数
|
// 当前产品盒数
|
||||||
int boxNum = 0;
|
int boxNum = 0;
|
||||||
// 处理商品盒数
|
|
||||||
this.handleWaresBoxNum(specialArea, orderItemsParams);
|
|
||||||
// 判断订单明细中指定产品数量,校验等级
|
// 判断订单明细中指定产品数量,校验等级
|
||||||
for (OrderItemsParam orderItemsParam : orderItemsParams) {
|
for (OrderItemsParam orderItemsParam : orderItemsParams) {
|
||||||
if (boxWaresList.contains(orderItemsParam.getWaresCode())) {
|
if (boxWaresList.contains(orderItemsParam.getWaresCode())) {
|
||||||
// 存在指定商品,需要累计盒数
|
// 存在指定商品,需要累计盒数
|
||||||
boxNum += orderItemsParam.getBoxNum() * orderItemsParam.getQuantity();
|
boxNum += orderItemsParam.getQuantity();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2299,29 +2297,4 @@ public class SaOrderServiceImpl extends ServiceImpl<SaOrderMapper, SaOrder> impl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理商品盒数
|
|
||||||
*
|
|
||||||
* @param orderItemsParams
|
|
||||||
*/
|
|
||||||
private void handleWaresBoxNum(Integer specialArea, List<OrderItemsParam> orderItemsParams) {
|
|
||||||
if (CollectionUtil.isNotEmpty(orderItemsParams)) {
|
|
||||||
List<String> waresCodeList = orderItemsParams.stream().map(OrderItemsParam::getWaresCode).collect(Collectors.toList());
|
|
||||||
List<BdWares> waresList = iBdWaresService.list(Wrappers.<BdWares>lambdaQuery()
|
|
||||||
.eq(BdWares::getSpecialArea, specialArea)
|
|
||||||
.in(BdWares::getWaresCode, waresCodeList)
|
|
||||||
);
|
|
||||||
if (CollectionUtil.isNotEmpty(waresList)) {
|
|
||||||
for (OrderItemsParam orderItemsParam : orderItemsParams) {
|
|
||||||
for (BdWares bdWares : waresList) {
|
|
||||||
if (orderItemsParam.getWaresCode().equals(bdWares.getWaresCode())) {
|
|
||||||
orderItemsParam.setBoxNum(bdWares.getBoxNum());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@ public class ApiShoppingCartController extends BaseController {
|
||||||
String jsonString = innerShopMap.get(innerKey.toString());
|
String jsonString = innerShopMap.get(innerKey.toString());
|
||||||
ShoppingCartRedis shoppingCartRedis = JSONUtil.toBean(jsonString, ShoppingCartRedis.class);
|
ShoppingCartRedis shoppingCartRedis = JSONUtil.toBean(jsonString, ShoppingCartRedis.class);
|
||||||
shoppingCartRedis.setNumber(shoppingCartRedis.getNumber() + scr.getNumber());
|
shoppingCartRedis.setNumber(shoppingCartRedis.getNumber() + scr.getNumber());
|
||||||
|
shoppingCartRedis.setPkMakerSpace(scr.getPkMakerSpace());
|
||||||
|
|
||||||
innerShopMap.put(innerKey.toString(), JSONUtil.toJsonStr(shoppingCartRedis));
|
innerShopMap.put(innerKey.toString(), JSONUtil.toJsonStr(shoppingCartRedis));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,11 @@ public class ShoppingCartRedis implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Integer number;
|
private Integer number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创客空间id
|
||||||
|
*/
|
||||||
|
private Long pkMakerSpace;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产品 sku 组合
|
* 产品 sku 组合
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ import com.hzs.sale.wares.param.WaresDetailParams;
|
||||||
import com.hzs.sale.wares.param.*;
|
import com.hzs.sale.wares.param.*;
|
||||||
import com.hzs.sale.wares.service.*;
|
import com.hzs.sale.wares.service.*;
|
||||||
import com.hzs.sale.wares.vo.*;
|
import com.hzs.sale.wares.vo.*;
|
||||||
|
import com.hzs.system.base.ICurrencyServiceApi;
|
||||||
|
import com.hzs.system.base.dto.CurrencyDTO;
|
||||||
import com.hzs.system.config.IRangeServiceApi;
|
import com.hzs.system.config.IRangeServiceApi;
|
||||||
import com.hzs.system.sys.dto.LoginUser;
|
import com.hzs.system.sys.dto.LoginUser;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -55,6 +57,8 @@ import java.util.stream.Collectors;
|
||||||
@RequestMapping("/manage/wares")
|
@RequestMapping("/manage/wares")
|
||||||
public class BdWaresController extends BaseController {
|
public class BdWaresController extends BaseController {
|
||||||
|
|
||||||
|
@DubboReference
|
||||||
|
ICurrencyServiceApi iCurrencyServiceApi;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
IRangeServiceApi iRangeServiceApi;
|
IRangeServiceApi iRangeServiceApi;
|
||||||
|
|
||||||
|
|
@ -112,6 +116,8 @@ public class BdWaresController extends BaseController {
|
||||||
startPage();
|
startPage();
|
||||||
List<WaresVo> resultList = iBdWaresService.selectByWaresInfo(waresParams);
|
List<WaresVo> resultList = iBdWaresService.selectByWaresInfo(waresParams);
|
||||||
if (CollectionUtil.isNotEmpty(resultList)) {
|
if (CollectionUtil.isNotEmpty(resultList)) {
|
||||||
|
R<CurrencyDTO> currencyDto = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry());
|
||||||
|
|
||||||
resultList.parallelStream().forEach(waresVo -> {
|
resultList.parallelStream().forEach(waresVo -> {
|
||||||
WaresAuthorityVo waresAuthorityVo = iBdWaresService.getWaresAuthorityFirst(waresVo.getPkWares());
|
WaresAuthorityVo waresAuthorityVo = iBdWaresService.getWaresAuthorityFirst(waresVo.getPkWares());
|
||||||
if (waresAuthorityVo != null) {
|
if (waresAuthorityVo != null) {
|
||||||
|
|
@ -125,6 +131,10 @@ public class BdWaresController extends BaseController {
|
||||||
if (waresVo.getIsMakerGift() != null) {
|
if (waresVo.getIsMakerGift() != null) {
|
||||||
waresVo.setIsMakerGiftVal(EWaresType.getEnumByValue(waresVo.getIsMakerGift()).getLabel());
|
waresVo.setIsMakerGiftVal(EWaresType.getEnumByValue(waresVo.getIsMakerGift()).getLabel());
|
||||||
}
|
}
|
||||||
|
if (null != waresVo.getMakerIncome()) {
|
||||||
|
// 处理发起人收益
|
||||||
|
waresVo.setMakerIncome(waresVo.getMakerIncome().multiply(currencyDto.getData().getInExchangeRate()));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return getDataTable(resultList);
|
return getDataTable(resultList);
|
||||||
|
|
@ -141,6 +151,7 @@ public class BdWaresController extends BaseController {
|
||||||
|
|
||||||
List<WaresVo> resultList = iBdWaresService.selectByWaresInfo(waresParams);
|
List<WaresVo> resultList = iBdWaresService.selectByWaresInfo(waresParams);
|
||||||
if (CollectionUtil.isNotEmpty(resultList)) {
|
if (CollectionUtil.isNotEmpty(resultList)) {
|
||||||
|
R<CurrencyDTO> currencyDto = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry());
|
||||||
// 获取需要翻译的枚举翻译
|
// 获取需要翻译的枚举翻译
|
||||||
Map<String, String> transactionMap = iTransactionCommonService.exportEnumTransaction(ESpecialArea.values(), EYesNo.values(), ESupplyWay.values(), EPresaleStatus.values());
|
Map<String, String> transactionMap = iTransactionCommonService.exportEnumTransaction(ESpecialArea.values(), EYesNo.values(), ESupplyWay.values(), EPresaleStatus.values());
|
||||||
|
|
||||||
|
|
@ -177,6 +188,10 @@ public class BdWaresController extends BaseController {
|
||||||
waresVo.setIsMakerGiftVal(EWaresType.getEnumByValue(waresVo.getIsMakerGift()).getLabel());
|
waresVo.setIsMakerGiftVal(EWaresType.getEnumByValue(waresVo.getIsMakerGift()).getLabel());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (null != waresVo.getMakerIncome()) {
|
||||||
|
// 处理发起人收益
|
||||||
|
waresVo.setMakerIncome(waresVo.getMakerIncome().multiply(currencyDto.getData().getInExchangeRate()));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
ExcelUtil<WaresVo> util = new ExcelUtil<>(WaresVo.class);
|
ExcelUtil<WaresVo> util = new ExcelUtil<>(WaresVo.class);
|
||||||
|
|
@ -305,6 +320,7 @@ public class BdWaresController extends BaseController {
|
||||||
if (!isPutOn) {
|
if (!isPutOn) {
|
||||||
return AjaxResult.error("产品规格至少有一个上架");
|
return AjaxResult.error("产品规格至少有一个上架");
|
||||||
}
|
}
|
||||||
|
// wares.setSort(0);
|
||||||
iBdWaresService.saveWares(wares, userTokenService.getLoginUser());
|
iBdWaresService.saveWares(wares, userTokenService.getLoginUser());
|
||||||
return AjaxResult.success(wares.getWaresCode());
|
return AjaxResult.success(wares.getWaresCode());
|
||||||
}
|
}
|
||||||
|
|
@ -434,6 +450,8 @@ public class BdWaresController extends BaseController {
|
||||||
return AjaxResult.error("规格图片必传");
|
return AjaxResult.error("规格图片必传");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// waresParams.setSort(0);
|
||||||
iBdWaresService.updateWares(waresParams, userTokenService.getLoginUser());
|
iBdWaresService.updateWares(waresParams, userTokenService.getLoginUser());
|
||||||
return AjaxResult.success(waresParams.getWaresCode());
|
return AjaxResult.success(waresParams.getWaresCode());
|
||||||
}
|
}
|
||||||
|
|
@ -517,7 +535,10 @@ public class BdWaresController extends BaseController {
|
||||||
waresParams.setSortStatus(wares.getSortStatus());
|
waresParams.setSortStatus(wares.getSortStatus());
|
||||||
waresParams.setSystemType(waresExtend.getSystemType());
|
waresParams.setSystemType(waresExtend.getSystemType());
|
||||||
waresParams.setAreaIncome(wares.getAreaIncome());
|
waresParams.setAreaIncome(wares.getAreaIncome());
|
||||||
waresParams.setBoxNum(wares.getBoxNum());
|
if (waresExtend.getMakerIncome() != null) {
|
||||||
|
R<CurrencyDTO> currencyDto = iCurrencyServiceApi.getCurrency(SecurityUtils.getPkCountry());
|
||||||
|
waresParams.setMakerIncome(waresExtend.getMakerIncome().multiply(currencyDto.getData().getInExchangeRate()));
|
||||||
|
}
|
||||||
|
|
||||||
BdAreaClassify parentAreaClassify = areaClassifyService.getAreaClassify(wares.getPkAreaClassify());
|
BdAreaClassify parentAreaClassify = areaClassifyService.getAreaClassify(wares.getPkAreaClassify());
|
||||||
if (parentAreaClassify != null) {
|
if (parentAreaClassify != null) {
|
||||||
|
|
|
||||||
|
|
@ -394,6 +394,11 @@ public class WaresParams implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Integer sortStatus;
|
private Integer sortStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起人收益(目前复购使用)
|
||||||
|
*/
|
||||||
|
private BigDecimal makerIncome;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统类型(2=新零售,3=美业)
|
* 系统类型(2=新零售,3=美业)
|
||||||
*/
|
*/
|
||||||
|
|
@ -409,9 +414,4 @@ public class WaresParams implements Serializable {
|
||||||
*/
|
*/
|
||||||
private BigDecimal areaIncome;
|
private BigDecimal areaIncome;
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品上传盒数
|
|
||||||
*/
|
|
||||||
private Integer boxNum;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ public class BdWaresDetailServiceImpl extends ServiceImpl<BdWaresDetailMapper, B
|
||||||
.waresCode(orderItemsParam.getWaresCode())
|
.waresCode(orderItemsParam.getWaresCode())
|
||||||
.pkWaresSpecsSku(waresItemsParam.getPkWaresSpecsSku())
|
.pkWaresSpecsSku(waresItemsParam.getPkWaresSpecsSku())
|
||||||
.waresQuantity(orderItemsParam.getQuantity())
|
.waresQuantity(orderItemsParam.getQuantity())
|
||||||
|
.pkMakerSpace(orderItemsParam.getPkMakerSpace())
|
||||||
.price(BigDecimal.ZERO)
|
.price(BigDecimal.ZERO)
|
||||||
.achieve(BigDecimal.ZERO)
|
.achieve(BigDecimal.ZERO)
|
||||||
.build();
|
.build();
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,9 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
||||||
// 设置 wares 对象的值
|
// 设置 wares 对象的值
|
||||||
BdWares wares = BeanUtil.copyProperties(waresParams, BdWares.class);
|
BdWares wares = BeanUtil.copyProperties(waresParams, BdWares.class);
|
||||||
wares.setPkId(waresParams.getWaresId());
|
wares.setPkId(waresParams.getWaresId());
|
||||||
|
R<Integer> transaction = transactionServiceApi.createTransaction(user.getDataCountry(), ETransactionKey.SPEC, waresParams.getWaresName(), EYesNo.NO, EYesNo.NO);
|
||||||
wares.setWaresCode(waresParams.getWaresCode());
|
wares.setWaresCode(waresParams.getWaresCode());
|
||||||
|
wares.setPkTransaction(transaction.getData());
|
||||||
wares.setPkCreator(user.getUserId());
|
wares.setPkCreator(user.getUserId());
|
||||||
wares.setPkCountry(user.getDataCountry());
|
wares.setPkCountry(user.getDataCountry());
|
||||||
wares.setSystemType(user.getSystemType());
|
wares.setSystemType(user.getSystemType());
|
||||||
|
|
@ -125,6 +127,14 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
||||||
this.save(wares);
|
this.save(wares);
|
||||||
// 商品拓展表
|
// 商品拓展表
|
||||||
BdWaresExtend waresExtend = BeanUtil.copyProperties(waresParams, BdWaresExtend.class);
|
BdWaresExtend waresExtend = BeanUtil.copyProperties(waresParams, BdWaresExtend.class);
|
||||||
|
// 存入要转化美金
|
||||||
|
if (!waresParams.getSpecialArea().equals(ESpecialArea.REPURCHASE_AREA.getValue())) {
|
||||||
|
waresParams.setMakerIncome(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
if (null != waresParams.getMakerIncome()) {
|
||||||
|
R<CurrencyDTO> currencyDto = currencyServiceApi.getCurrency(user.getDataCountry());
|
||||||
|
waresExtend.setMakerIncome(waresParams.getMakerIncome().divide(currencyDto.getData().getInExchangeRate(), 6, BigDecimal.ROUND_HALF_UP));
|
||||||
|
}
|
||||||
// 处理系统类型
|
// 处理系统类型
|
||||||
waresExtend.setSystemType(user.getSystemType());
|
waresExtend.setSystemType(user.getSystemType());
|
||||||
waresExtend.setPkWares(wares.getPkId());
|
waresExtend.setPkWares(wares.getPkId());
|
||||||
|
|
@ -529,6 +539,8 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
||||||
public void updateWares(WaresParams waresParams, LoginUser user) {
|
public void updateWares(WaresParams waresParams, LoginUser user) {
|
||||||
BdWares wares = BeanUtil.copyProperties(waresParams, BdWares.class);
|
BdWares wares = BeanUtil.copyProperties(waresParams, BdWares.class);
|
||||||
wares.setPkId(waresParams.getWaresId());
|
wares.setPkId(waresParams.getWaresId());
|
||||||
|
R<Integer> transaction = transactionServiceApi.createTransaction(user.getDataCountry(), ETransactionKey.SPEC, waresParams.getWaresName(), EYesNo.NO, EYesNo.NO);
|
||||||
|
wares.setPkTransaction(transaction.getData());
|
||||||
if (waresParams.getIsPutOn().equals(EYesNo.YES.getIntValue())) {
|
if (waresParams.getIsPutOn().equals(EYesNo.YES.getIntValue())) {
|
||||||
wares.setListingTime(DateUtils.currentDateTime());
|
wares.setListingTime(DateUtils.currentDateTime());
|
||||||
}
|
}
|
||||||
|
|
@ -542,6 +554,14 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
||||||
|
|
||||||
// 商品拓展表
|
// 商品拓展表
|
||||||
BdWaresExtend waresExtend = BeanUtil.copyProperties(waresParams, BdWaresExtend.class);
|
BdWaresExtend waresExtend = BeanUtil.copyProperties(waresParams, BdWaresExtend.class);
|
||||||
|
// 存入要转化美金
|
||||||
|
if (!waresParams.getSpecialArea().equals(ESpecialArea.REPURCHASE_AREA.getValue())) {
|
||||||
|
waresParams.setMakerIncome(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
if (null != waresParams.getMakerIncome()) {
|
||||||
|
R<CurrencyDTO> currencyDto = currencyServiceApi.getCurrency(user.getDataCountry());
|
||||||
|
waresExtend.setMakerIncome(waresParams.getMakerIncome().divide(currencyDto.getData().getInExchangeRate(), 6, BigDecimal.ROUND_HALF_UP));
|
||||||
|
}
|
||||||
// 处理系统类型
|
// 处理系统类型
|
||||||
waresExtend.setSystemType(user.getSystemType());
|
waresExtend.setSystemType(user.getSystemType());
|
||||||
waresExtend.setPkWares(wares.getPkId());
|
waresExtend.setPkWares(wares.getPkId());
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,13 @@ import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description:
|
||||||
|
* @Author: yuhui
|
||||||
|
* @Time: 2022/11/9 11:02
|
||||||
|
* @Classname: WaresVo
|
||||||
|
* @PackageName: com.hzs.sale.wares.vo
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class WaresVo {
|
public class WaresVo {
|
||||||
|
|
||||||
|
|
@ -49,15 +56,23 @@ public class WaresVo {
|
||||||
* 商品价格
|
* 商品价格
|
||||||
*/
|
*/
|
||||||
@Excel(name = "商品价格")
|
@Excel(name = "商品价格")
|
||||||
@BigDecimalFormat("#0.00")
|
@BigDecimalFormat("#0.0000")
|
||||||
private BigDecimal waresPrice;
|
private BigDecimal waresPrice;
|
||||||
/**
|
/**
|
||||||
* 商品业绩
|
* 商品业绩
|
||||||
*/
|
*/
|
||||||
@Excel(name = "商品业绩")
|
@Excel(name = "商品业绩")
|
||||||
@BigDecimalFormat("#0.00")
|
@BigDecimalFormat("#0.0000")
|
||||||
private BigDecimal waresAchieve;
|
private BigDecimal waresAchieve;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发起人收益(目前复购使用)
|
||||||
|
*/
|
||||||
|
@Excel(name = "发起人收益(¥)", scale = 2)
|
||||||
|
@BigDecimalFormat
|
||||||
|
private BigDecimal makerIncome;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付比例名称
|
* 支付比例名称
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
cm.member_code,
|
cm.member_code,
|
||||||
cm.member_name,
|
cm.member_name,
|
||||||
case
|
case
|
||||||
when ap.pick_type in (0, 20) then
|
when ap.pick_type = 0 then
|
||||||
(select bp.product_name
|
(select bp.product_name
|
||||||
from bd_product bp
|
from bd_product bp
|
||||||
where bp.pk_id = PK_DATA_ID)
|
where bp.pk_id = PK_DATA_ID)
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@
|
||||||
<result column="IS_MAKER_GIFT" property="isMakerGift"/>
|
<result column="IS_MAKER_GIFT" property="isMakerGift"/>
|
||||||
<result column="EDIT_FLAG" property="editFlag"/>
|
<result column="EDIT_FLAG" property="editFlag"/>
|
||||||
<result column="WARES_CODE" property="waresCode"/>
|
<result column="WARES_CODE" property="waresCode"/>
|
||||||
|
<result column="MAKER_INCOME" property="makerIncome"/>
|
||||||
<result column="ITEM_PK_STOREHOUSE" property="pkStorehouse"/>
|
<result column="ITEM_PK_STOREHOUSE" property="pkStorehouse"/>
|
||||||
</collection>
|
</collection>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
@ -124,6 +125,7 @@
|
||||||
<result column="CREATOR_CODE" property="creatorCode"/>
|
<result column="CREATOR_CODE" property="creatorCode"/>
|
||||||
<result column="PK_SETTLE_COUNTRY" property="pkSettleCountry"/>
|
<result column="PK_SETTLE_COUNTRY" property="pkSettleCountry"/>
|
||||||
<result column="PK_CENTER_CODE" property="pkCenterCode"/>
|
<result column="PK_CENTER_CODE" property="pkCenterCode"/>
|
||||||
|
<result column="PK_STORE_LEVEL" property="pkStoreLevel"/>
|
||||||
<result column="IN_EXCHANGE_RATE" property="inExchangeRate"/>
|
<result column="IN_EXCHANGE_RATE" property="inExchangeRate"/>
|
||||||
<result column="PK_CORP" property="pkCorp"/>
|
<result column="PK_CORP" property="pkCorp"/>
|
||||||
<collection property="orderWaresExtList" ofType="com.hzs.common.domain.sale.ext.SaOrderWaresExt">
|
<collection property="orderWaresExtList" ofType="com.hzs.common.domain.sale.ext.SaOrderWaresExt">
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,6 @@
|
||||||
<result column="PRE_SALE_STATUS" property="preSaleStatus"/>
|
<result column="PRE_SALE_STATUS" property="preSaleStatus"/>
|
||||||
<result column="PK_PRODUCT_BAS" property="pkProductBas"/>
|
<result column="PK_PRODUCT_BAS" property="pkProductBas"/>
|
||||||
<result column="PK_UNIT" property="pkUnit"/>
|
<result column="PK_UNIT" property="pkUnit"/>
|
||||||
<result column="BOX_NUM" property="boxNum"/>
|
|
||||||
<collection property="waresSpecsList" ofType="com.hzs.common.domain.sale.ext.WaresSpecsExt">
|
<collection property="waresSpecsList" ofType="com.hzs.common.domain.sale.ext.WaresSpecsExt">
|
||||||
<result column="PK_SPECS_TYPE" property="pkSpecsType"/>
|
<result column="PK_SPECS_TYPE" property="pkSpecsType"/>
|
||||||
<result column="PK_SPECS" property="pkSpecs"/>
|
<result column="PK_SPECS" property="pkSpecs"/>
|
||||||
|
|
@ -51,7 +50,7 @@
|
||||||
be.pk_special_currency,bw.wares_code, bw.wares_name,
|
be.pk_special_currency,bw.wares_code, bw.wares_name,
|
||||||
bd.is_gift is_gift,
|
bd.is_gift is_gift,
|
||||||
bd.pk_product,bs.price,bs.achieve,bp.pk_supplier,bp.shipping_channel,bp.product_code,
|
bd.pk_product,bs.price,bs.achieve,bp.pk_supplier,bp.shipping_channel,bp.product_code,
|
||||||
bs.ass_achieve,b.specs_name,b.specs_name_id, bw.box_num
|
bs.ass_achieve,b.specs_name,b.specs_name_id
|
||||||
from bd_wares bw
|
from bd_wares bw
|
||||||
inner join bd_wares_extend be
|
inner join bd_wares_extend be
|
||||||
on bw.pk_id = be.pk_wares
|
on bw.pk_id = be.pk_wares
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@
|
||||||
<result column="PK_SPECIAL_CURRENCY" property="pkSpecialCurrency"/>
|
<result column="PK_SPECIAL_CURRENCY" property="pkSpecialCurrency"/>
|
||||||
<result column="SYSTEM_TYPE" property="systemType"/>
|
<result column="SYSTEM_TYPE" property="systemType"/>
|
||||||
<result column="AREA_INCOME" property="areaIncome"/>
|
<result column="AREA_INCOME" property="areaIncome"/>
|
||||||
<result column="BOX_NUM" property="boxNum"/>
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="resultMap" type="com.hzs.sale.wares.vo.WaresVo">
|
<resultMap id="resultMap" type="com.hzs.sale.wares.vo.WaresVo">
|
||||||
|
|
@ -82,6 +81,7 @@
|
||||||
<result column="SORT_STATUS" property="sortStatus"/>
|
<result column="SORT_STATUS" property="sortStatus"/>
|
||||||
<result column="IS_MAKER_GIFT" property="isMakerGift"/>
|
<result column="IS_MAKER_GIFT" property="isMakerGift"/>
|
||||||
<result column="TEMP_NAME" property="tempName"/>
|
<result column="TEMP_NAME" property="tempName"/>
|
||||||
|
<result column="MAKER_INCOME" property="makerIncome"/>
|
||||||
<result column="SYSTEM_TYPE" property="systemType"/>
|
<result column="SYSTEM_TYPE" property="systemType"/>
|
||||||
<result column="WARES_STATUS" property="waresStatus"/>
|
<result column="WARES_STATUS" property="waresStatus"/>
|
||||||
<result column="WARES_APPROVER" property="waresApprover"/>
|
<result column="WARES_APPROVER" property="waresApprover"/>
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ import java.lang.annotation.Target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BigDecimal自定义序列化处理
|
* BigDecimal自定义序列化处理
|
||||||
|
*
|
||||||
|
* @author
|
||||||
*/
|
*/
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
package com.hzs.common.core.constant.msg;
|
package com.hzs.common.core.constant.msg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公用类提示
|
* @Description: 公用类提示
|
||||||
|
* @Author: jiang chao
|
||||||
|
* @Time: 2023/4/11 11:31
|
||||||
|
* @Classname: CommonMsgConstants
|
||||||
|
* @PackageName: com.hzs.common.core.constant.msg
|
||||||
*/
|
*/
|
||||||
public class CommonMsgConstants {
|
public class CommonMsgConstants {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,9 +138,4 @@ public class BdWaresDetailExt extends BdWaresDetail {
|
||||||
*/
|
*/
|
||||||
private Integer pkUnit;
|
private Integer pkUnit;
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品上传盒数
|
|
||||||
*/
|
|
||||||
private Integer boxNum;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -222,10 +222,4 @@ public class BdWares extends BaseEntity {
|
||||||
@TableField("AREA_INCOME")
|
@TableField("AREA_INCOME")
|
||||||
private BigDecimal areaIncome;
|
private BigDecimal areaIncome;
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品上传盒数
|
|
||||||
*/
|
|
||||||
@TableField("BOX_NUM")
|
|
||||||
private Integer boxNum;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue