## 添加、修改、删除提货卡不需要处理签呈;
This commit is contained in:
parent
1ad3981186
commit
31c53881ec
|
@ -238,11 +238,11 @@ 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())
|
// if (null == param.getSignType() || CollectionUtil.isEmpty(param.getUserIdList())
|
||||||
|| CollectionUtil.isEmpty(param.getDetailList())) {
|
// || CollectionUtil.isEmpty(param.getDetailList())) {
|
||||||
// 缺少参数
|
// // 缺少参数
|
||||||
return AjaxResult.error("缺少参数");
|
// return AjaxResult.error("缺少参数");
|
||||||
}
|
// }
|
||||||
|
|
||||||
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())
|
||||||
|
@ -279,15 +279,12 @@ public class AcPickController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 删除充值提货卡
|
* 删除充值提货卡
|
||||||
* @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 (null == anpParam.getSignType() || CollectionUtil.isEmpty(anpParam.getUserIdList())
|
if (CollectionUtil.isEmpty(anpParam.getDetailList())) {
|
||||||
|| CollectionUtil.isEmpty(anpParam.getDetailList())) {
|
|
||||||
// 缺少参数
|
// 缺少参数
|
||||||
return AjaxResult.error("缺少参数");
|
return AjaxResult.error("缺少参数");
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,6 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提货基础表 服务类
|
* 提货基础表 服务类
|
||||||
*
|
|
||||||
* @author hzs
|
|
||||||
* @since 2023-04-21
|
|
||||||
*/
|
*/
|
||||||
public interface IAcPickService extends IService<AcPick> {
|
public interface IAcPickService extends IService<AcPick> {
|
||||||
|
|
||||||
|
@ -75,13 +72,11 @@ public interface IAcPickService extends IService<AcPick> {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @description: 更新提货单
|
* @description: 更新提货单
|
||||||
* @param: null null
|
|
||||||
**/
|
**/
|
||||||
boolean updatePickUse(List<AcPickExt> acPickExtList, Integer signSource, List<AcPickMemberLog> acPickMemberLogList);
|
boolean updatePickUse(List<AcPickExt> acPickExtList, Integer signSource, List<AcPickMemberLog> acPickMemberLogList);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @description: 更新提货单
|
* @description: 更新提货单
|
||||||
* @param: null null
|
|
||||||
**/
|
**/
|
||||||
boolean updatePickUse(List<AcPickExt> acPickExtList, List<AcPickMemberLog> acPickMemberLogList);
|
boolean updatePickUse(List<AcPickExt> acPickExtList, List<AcPickMemberLog> acPickMemberLogList);
|
||||||
|
|
||||||
|
@ -114,8 +109,6 @@ public interface IAcPickService extends IService<AcPick> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 删除充值提货卡发起签呈
|
* @description: 删除充值提货卡发起签呈
|
||||||
* @param: [anpParam]
|
|
||||||
* @return: boolean
|
|
||||||
**/
|
**/
|
||||||
boolean delPick(AcPickSaveParam anpParam);
|
boolean delPick(AcPickSaveParam anpParam);
|
||||||
|
|
||||||
|
@ -129,10 +122,7 @@ public interface IAcPickService extends IService<AcPick> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 审核删除充值提货卡
|
* @description: 审核删除充值提货卡
|
||||||
* @param: [resultDTO]
|
|
||||||
* @return: java.lang.String
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
String delpickApprovalAgree(ApprovalBusinessResultDTO resultDTO);
|
String delpickApprovalAgree(ApprovalBusinessResultDTO resultDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -16,12 +16,10 @@ 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.SystemFieldConstants;
|
import com.hzs.common.core.constant.SystemFieldConstants;
|
||||||
import com.hzs.common.core.constant.msg.ActivityMsgConstants;
|
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.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.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.AcApprovalLog;
|
||||||
|
@ -38,9 +36,7 @@ import com.hzs.member.base.IMemberServiceApi;
|
||||||
import com.hzs.sale.postage.IPostageServiceApi;
|
import com.hzs.sale.postage.IPostageServiceApi;
|
||||||
import com.hzs.sale.postage.dto.PostageProductDTO;
|
import com.hzs.sale.postage.dto.PostageProductDTO;
|
||||||
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.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;
|
||||||
|
@ -56,9 +52,6 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提货基础表 服务实现类
|
* 提货基础表 服务实现类
|
||||||
*
|
|
||||||
* @author hzs
|
|
||||||
* @since 2023-04-21
|
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
@ -79,8 +72,6 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBdProductService iBdProductService;
|
private IBdProductService iBdProductService;
|
||||||
|
|
||||||
@DubboReference
|
|
||||||
IApprovalServiceApi iApprovalServiceApi;
|
|
||||||
@DubboReference
|
@DubboReference
|
||||||
IMemberServiceApi iMemberServiceApi;
|
IMemberServiceApi iMemberServiceApi;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
|
@ -193,24 +184,81 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
// 操作日志列表
|
// 操作日志列表
|
||||||
List<BusinessLogDTO> logDTOList = new ArrayList<>();
|
List<BusinessLogDTO> logDTOList = new ArrayList<>();
|
||||||
|
|
||||||
// 批量保存日志
|
// // 批量保存日志
|
||||||
List<AcApprovalLog> approvalLogList = 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);
|
||||||
|
|
||||||
|
// 新増提货列表
|
||||||
|
List<AcPick> createList = new ArrayList<>();
|
||||||
|
// 修改提货列表
|
||||||
|
List<AcPick> updateList = new ArrayList<>();
|
||||||
|
|
||||||
for (AcPickSaveDetailParam detailParam : param.getDetailList()) {
|
for (AcPickSaveDetailParam detailParam : param.getDetailList()) {
|
||||||
// 活动审批日志
|
// // 活动审批日志
|
||||||
AcApprovalLog acApprovalLog = new AcApprovalLog();
|
// AcApprovalLog acApprovalLog = new AcApprovalLog();
|
||||||
acApprovalLog.setApprovalType(EApprovalBusiness.PICK_ADD.getValue());
|
// acApprovalLog.setApprovalType(EApprovalBusiness.PICK_ADD.getValue());
|
||||||
acApprovalLog.setBusinessCode(businessCode);
|
// acApprovalLog.setBusinessCode(businessCode);
|
||||||
acApprovalLog.setPkCreator(userId);
|
// acApprovalLog.setPkCreator(userId);
|
||||||
acApprovalLog.setPkCountry(pkCountry);
|
// acApprovalLog.setPkCountry(pkCountry);
|
||||||
acApprovalLog.setAfterData(JSONUtil.toJsonStr(detailParam));
|
// acApprovalLog.setAfterData(JSONUtil.toJsonStr(detailParam));
|
||||||
if (null != detailParam.getPkId()) {
|
// if (null != detailParam.getPkId()) {
|
||||||
acApprovalLog.setPkBusiness(detailParam.getPkId());
|
// acApprovalLog.setPkBusiness(detailParam.getPkId());
|
||||||
|
// }
|
||||||
|
// approvalLogList.add(acApprovalLog);
|
||||||
|
|
||||||
|
// 会员信息
|
||||||
|
CuMember cuMember = iMemberServiceApi.queryMember(detailParam.getMemberCode()).getData();
|
||||||
|
// 提货ID
|
||||||
|
Long pickId = null;
|
||||||
|
// 提货类型
|
||||||
|
Integer pickType = null != detailParam.getPickType() ? detailParam.getPickType() : EPickType.PICK_PRODUCT.getValue();
|
||||||
|
|
||||||
|
if (null == detailParam.getPkId()) {
|
||||||
|
LambdaQueryWrapper<AcPick> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(AcPick::getPickType, pickType);
|
||||||
|
queryWrapper.eq(AcPick::getPkBaseConfig, 0);
|
||||||
|
queryWrapper.eq(AcPick::getPkDataId, detailParam.getPkProduct());
|
||||||
|
queryWrapper.eq(AcPick::getSpecsNameId, detailParam.getSpecsNameId());
|
||||||
|
queryWrapper.eq(AcPick::getPkMember, cuMember.getPkId());
|
||||||
|
AcPick acPick = this.getOne(queryWrapper);
|
||||||
|
if (null != acPick) {
|
||||||
|
pickId = acPick.getPkId();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pickId = detailParam.getPkId();
|
||||||
}
|
}
|
||||||
approvalLogList.add(acApprovalLog);
|
|
||||||
|
AcPick acPick = new AcPick();
|
||||||
|
if (null == pickId) {
|
||||||
|
// 新增提货数据
|
||||||
|
acPick.setPkMember(cuMember.getPkId());
|
||||||
|
acPick.setPickType(pickType);
|
||||||
|
acPick.setPkDataId(detailParam.getPkProduct().longValue());
|
||||||
|
acPick.setSpecsName(detailParam.getSpecsName());
|
||||||
|
acPick.setSpecsNameId(detailParam.getSpecsNameId());
|
||||||
|
acPick.setUsableQuantity(detailParam.getQuantity());
|
||||||
|
acPick.setBaseQuantity(detailParam.getBaseQuantity());
|
||||||
|
acPick.setReceiveTime(detailParam.getReceiveTime());
|
||||||
|
acPick.setIsFreeMail(detailParam.getIsFreeMail());
|
||||||
|
acPick.setPkPostage(detailParam.getPkPostage());
|
||||||
|
acPick.setPkCreator(userId);
|
||||||
|
acPick.setPkCountry(pkCountry);
|
||||||
|
createList.add(acPick);
|
||||||
|
} else {
|
||||||
|
// 修改提货数据
|
||||||
|
acPick.setPkId(pickId);
|
||||||
|
acPick.setUsableQuantity(detailParam.getQuantity());
|
||||||
|
acPick.setBaseQuantity(detailParam.getBaseQuantity());
|
||||||
|
acPick.setReceiveTime(detailParam.getReceiveTime());
|
||||||
|
acPick.setIsFreeMail(detailParam.getIsFreeMail());
|
||||||
|
acPick.setPkPostage(detailParam.getPkPostage());
|
||||||
|
acPick.setPkModified(userId);
|
||||||
|
acPick.setModifiedTime(new Date());
|
||||||
|
updateList.add(acPick);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 产品信息
|
// 产品信息
|
||||||
BdProduct bdProduct = productMap.get(detailParam.getPkProduct());
|
BdProduct bdProduct = productMap.get(detailParam.getPkProduct());
|
||||||
|
@ -228,9 +276,6 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
} else {
|
} else {
|
||||||
content.append(",不包邮;");
|
content.append(",不包邮;");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 会员信息
|
|
||||||
CuMember cuMember = iMemberServiceApi.queryMember(detailParam.getMemberCode()).getData();
|
|
||||||
// 封装业务操作日志
|
// 封装业务操作日志
|
||||||
logDTOList.add(BusinessLogDTO.builder()
|
logDTOList.add(BusinessLogDTO.builder()
|
||||||
.businessType(EApprovalBusiness.PICK_ADD.getValue())
|
.businessType(EApprovalBusiness.PICK_ADD.getValue())
|
||||||
|
@ -243,32 +288,68 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iAcApprovalLogService.saveBatch(approvalLogList)) {
|
// 提货操作日志
|
||||||
// 保存审批日志成功,提交签呈
|
List<AcPickLog> logList = new ArrayList<>();
|
||||||
|
|
||||||
// 提交签呈处理
|
// 插入提货数据
|
||||||
R<String> resultR = iApprovalServiceApi.submitOrder(
|
if (CollectionUtil.isNotEmpty(createList)) {
|
||||||
ApprovalSubmitDTO.builder()
|
for (AcPick acPick : createList) {
|
||||||
.eApprovalBusiness(EApprovalBusiness.PICK_ADD)
|
this.baseMapper.insert(acPick);
|
||||||
.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;
|
AcPickLog acPickLog = new AcPickLog();
|
||||||
|
acPickLog.setPkPick(acPick.getPkId());
|
||||||
|
acPickLog.setQuantity(acPick.getUsableQuantity());
|
||||||
|
acPickLog.setPkUser(userId);
|
||||||
|
acPickLog.setPkCountry(pkCountry);
|
||||||
|
logList.add(acPickLog);
|
||||||
}
|
}
|
||||||
throw new BaseException(TransactionUtils.getContent(CommonMsgConstants.OPERATION_FAILED) + ": " + resultR.getMsg());
|
|
||||||
}
|
}
|
||||||
return TransactionUtils.getContent(CommonMsgConstants.OPERATION_FAILED);
|
// 更新提货数据
|
||||||
|
if (CollectionUtil.isNotEmpty(updateList)) {
|
||||||
|
for (AcPick acPick : updateList) {
|
||||||
|
this.baseMapper.updatePickByPkId(acPick);
|
||||||
|
|
||||||
|
AcPickLog acPickLog = new AcPickLog();
|
||||||
|
acPickLog.setPkPick(acPick.getPkId());
|
||||||
|
acPickLog.setQuantity(acPick.getUsableQuantity());
|
||||||
|
acPickLog.setPkUser(userId);
|
||||||
|
acPickLog.setPkCountry(pkCountry);
|
||||||
|
logList.add(acPickLog);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 插入提货操作日志
|
||||||
|
iAcPickLogService.insertBatch(logList);
|
||||||
|
|
||||||
|
// 推送业务操作日志
|
||||||
|
rabbitTemplate.convertAndSend(RabbitMqConstants.BUSINESS_LOG_EXCHANGE, RabbitMqConstants.BUSINESS_LOG_KEY, logDTOList);
|
||||||
|
return null;
|
||||||
|
|
||||||
|
// 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
|
@Override
|
||||||
|
@ -283,28 +364,61 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
// 操作日志列表
|
// 操作日志列表
|
||||||
List<BusinessLogDTO> logDTOList = new ArrayList<>();
|
List<BusinessLogDTO> logDTOList = new ArrayList<>();
|
||||||
|
|
||||||
// 批量保存日志
|
// 删除提货列表
|
||||||
List<AcApprovalLog> approvalLogList = new ArrayList<>();
|
List<AcPick> updateList = new ArrayList<>();
|
||||||
|
|
||||||
|
// // 批量保存日志
|
||||||
|
// List<AcApprovalLog> approvalLogList = new ArrayList<>();
|
||||||
|
|
||||||
for (AcPickSaveDetailParam detailParam : param.getDetailList()) {
|
for (AcPickSaveDetailParam detailParam : param.getDetailList()) {
|
||||||
// 活动审批日志
|
// // 活动审批日志
|
||||||
AcApprovalLog acApprovalLog = new AcApprovalLog();
|
// AcApprovalLog acApprovalLog = new AcApprovalLog();
|
||||||
acApprovalLog.setApprovalType(EApprovalBusiness.PICK_ADD_DEL.getValue());
|
// acApprovalLog.setApprovalType(EApprovalBusiness.PICK_ADD_DEL.getValue());
|
||||||
acApprovalLog.setBusinessCode(businessCode);
|
// acApprovalLog.setBusinessCode(businessCode);
|
||||||
acApprovalLog.setPkCreator(userId);
|
// acApprovalLog.setPkCreator(userId);
|
||||||
acApprovalLog.setPkCountry(pkCountry);
|
// acApprovalLog.setPkCountry(pkCountry);
|
||||||
acApprovalLog.setAfterData(JSONUtil.toJsonStr(detailParam));
|
// acApprovalLog.setAfterData(JSONUtil.toJsonStr(detailParam));
|
||||||
if (null != detailParam.getPkId()) {
|
// if (null != detailParam.getPkId()) {
|
||||||
acApprovalLog.setPkBusiness(detailParam.getPkId());
|
// acApprovalLog.setPkBusiness(detailParam.getPkId());
|
||||||
|
// }
|
||||||
|
// approvalLogList.add(acApprovalLog);
|
||||||
|
|
||||||
|
// 被操作会员
|
||||||
|
CuMember cuMember = iMemberServiceApi.queryMember(detailParam.getMemberCode()).getData();
|
||||||
|
// 提货ID
|
||||||
|
Long pickId = null;
|
||||||
|
if (null == detailParam.getPkId()) {
|
||||||
|
LambdaQueryWrapper<AcPick> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(AcPick::getPickType, EPickType.PICK_PRODUCT.getValue());
|
||||||
|
queryWrapper.eq(AcPick::getPkBaseConfig, 0);
|
||||||
|
queryWrapper.eq(AcPick::getPkDataId, detailParam.getPkProduct());
|
||||||
|
queryWrapper.eq(AcPick::getPkMember, cuMember.getPkId());
|
||||||
|
AcPick acPick = this.getOne(queryWrapper);
|
||||||
|
if (null != acPick) {
|
||||||
|
pickId = acPick.getPkId();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
pickId = detailParam.getPkId();
|
||||||
|
}
|
||||||
|
|
||||||
|
AcPick acPick = new AcPick();
|
||||||
|
if (null != pickId) {
|
||||||
|
// 删除提货数据
|
||||||
|
acPick.setPkId(pickId);
|
||||||
|
acPick.setPkModified(userId);
|
||||||
|
acPick.setModifiedTime(new Date());
|
||||||
|
updateList.add(acPick);
|
||||||
|
} else {
|
||||||
|
log.error("提货充值同意处理失败: 更新数据失败");
|
||||||
|
throw new ServiceException(TransactionUtils.getContent(DocumentMsgConstants.DOCUMENT_ORDER_ERROR));
|
||||||
}
|
}
|
||||||
approvalLogList.add(acApprovalLog);
|
|
||||||
|
|
||||||
// 操作日志内容
|
// 操作日志内容
|
||||||
StringBuilder content = new StringBuilder("删除会员编号 ").append(detailParam.getMemberCode()).append(" 的 ");
|
StringBuilder content = new StringBuilder("删除会员编号 ").append(detailParam.getMemberCode()).append(" 的 ");
|
||||||
|
|
||||||
// 查询提货数量
|
// 查询提货数量
|
||||||
AcPick acPick = this.getById(detailParam.getPkId());
|
AcPick delAcPick = this.getById(detailParam.getPkId());
|
||||||
EPickType ePickType = EPickType.getEnumByValue(acPick.getPickType());
|
EPickType ePickType = EPickType.getEnumByValue(delAcPick.getPickType());
|
||||||
switch (ePickType) {
|
switch (ePickType) {
|
||||||
case PICK_PRODUCT:
|
case PICK_PRODUCT:
|
||||||
case PRIZE:
|
case PRIZE:
|
||||||
|
@ -314,7 +428,7 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
// 提货产品、抽奖、创客沙棘提货、复购提货、代金券
|
// 提货产品、抽奖、创客沙棘提货、复购提货、代金券
|
||||||
if (null != detailParam.getPkProduct()) {
|
if (null != detailParam.getPkProduct()) {
|
||||||
BdProduct product = iBdProductService.getProduct(detailParam.getPkProduct());
|
BdProduct product = iBdProductService.getProduct(detailParam.getPkProduct());
|
||||||
content.append(ePickType.getLabel()).append(",").append(product.getProductName()).append("(").append(acPick.getSpecsName()).append(");");
|
content.append(ePickType.getLabel()).append(",").append(product.getProductName()).append("(").append(delAcPick.getSpecsName()).append(");");
|
||||||
} else {
|
} else {
|
||||||
content.append(ePickType.getLabel()).append(",").append(";");
|
content.append(ePickType.getLabel()).append(",").append(";");
|
||||||
}
|
}
|
||||||
|
@ -326,7 +440,7 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
case LOTTERY_DRAW:
|
case LOTTERY_DRAW:
|
||||||
// 消费赠送、直推赠送、抽奖(超级工作室赠送、节日赠送 -- 这俩未对接)
|
// 消费赠送、直推赠送、抽奖(超级工作室赠送、节日赠送 -- 这俩未对接)
|
||||||
content.append(ePickType.getLabel());
|
content.append(ePickType.getLabel());
|
||||||
List<AcGiftConfigExt> acGiftConfigList = iAcGiftConfigService.queryListByRuleIdList(acPick.getPkDataId(), acPick.getPkCountry());
|
List<AcGiftConfigExt> acGiftConfigList = iAcGiftConfigService.queryListByRuleIdList(delAcPick.getPkDataId(), delAcPick.getPkCountry());
|
||||||
if (CollectionUtil.isNotEmpty(acGiftConfigList)) {
|
if (CollectionUtil.isNotEmpty(acGiftConfigList)) {
|
||||||
content.append(",");
|
content.append(",");
|
||||||
for (AcGiftConfigExt acGiftConfigExt : acGiftConfigList) {
|
for (AcGiftConfigExt acGiftConfigExt : acGiftConfigList) {
|
||||||
|
@ -337,9 +451,6 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
// 被操作会员
|
|
||||||
CuMember cuMember = iMemberServiceApi.queryMember(detailParam.getMemberCode()).getData();
|
|
||||||
// 封装业务操作日志
|
// 封装业务操作日志
|
||||||
logDTOList.add(BusinessLogDTO.builder()
|
logDTOList.add(BusinessLogDTO.builder()
|
||||||
.businessType(EApprovalBusiness.PICK_ADD_DEL.getValue())
|
.businessType(EApprovalBusiness.PICK_ADD_DEL.getValue())
|
||||||
|
@ -352,30 +463,40 @@ public class AcPickServiceImpl extends ServiceImpl<AcPickMapper, AcPick> impleme
|
||||||
.build());
|
.build());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iAcApprovalLogService.saveBatch(approvalLogList)) {
|
// 更新提货数据
|
||||||
// 保存审批日志成功,提交签呈
|
if (CollectionUtil.isNotEmpty(updateList)) {
|
||||||
// 提交签呈处理
|
for (AcPick acPick : updateList) {
|
||||||
R<String> resultR = iApprovalServiceApi.submitOrder(
|
this.baseMapper.removePickByPkId(acPick);
|
||||||
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());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 推送业务操作日志
|
||||||
|
rabbitTemplate.convertAndSend(RabbitMqConstants.BUSINESS_LOG_EXCHANGE, RabbitMqConstants.BUSINESS_LOG_KEY, logDTOList);
|
||||||
|
|
||||||
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue