Browse Source

Merge remote-tracking branch 'origin/v1.0' into v1.0

v1.0
Yen 2 years ago
parent
commit
8eab918659
  1. 16
      src/main/java/com/qs/serve/modules/bms/controller/BmsChannelController.java
  2. 7
      src/main/java/com/qs/serve/modules/bms/controller/BmsChannelPointController.java
  3. 3
      src/main/java/com/qs/serve/modules/bms/entity/BmsChannel.java
  4. 3
      src/main/java/com/qs/serve/modules/bms/entity/BmsChannelPoint.java
  5. 12
      src/main/java/com/qs/serve/modules/third/entity/ProcessCreateCostApplyBo.java
  6. 139
      src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java

16
src/main/java/com/qs/serve/modules/bms/controller/BmsChannelController.java

@ -7,10 +7,7 @@ import com.qs.serve.common.model.dto.PageVo;
import com.qs.serve.common.model.dto.R; import com.qs.serve.common.model.dto.R;
import com.qs.serve.common.model.enums.BizType; import com.qs.serve.common.model.enums.BizType;
import com.qs.serve.common.model.enums.SystemModule; import com.qs.serve.common.model.enums.SystemModule;
import com.qs.serve.common.util.CollectionUtil; import com.qs.serve.common.util.*;
import com.qs.serve.common.util.CopierUtil;
import com.qs.serve.common.util.PageUtil;
import com.qs.serve.common.util.StringUtils;
import com.qs.serve.modules.bms.common.MasterUserType; import com.qs.serve.modules.bms.common.MasterUserType;
import com.qs.serve.modules.bms.controller.my.BmsChannelMyController; import com.qs.serve.modules.bms.controller.my.BmsChannelMyController;
import com.qs.serve.modules.bms.entity.*; import com.qs.serve.modules.bms.entity.*;
@ -77,9 +74,20 @@ public class BmsChannelController {
channelWrapper.le(BmsChannel::getCreateTime, param.getSelectEndTime()); channelWrapper.le(BmsChannel::getCreateTime, param.getSelectEndTime());
channelWrapper.isNotNull(BmsChannel::getCreateBy); channelWrapper.isNotNull(BmsChannel::getCreateBy);
} }
if(param.getExportNum()==null || param.getExportNum()==0){
Assert.throwEx("请输入导出条数");
}
if(CollectionUtil.isNotEmpty(param.getSelectIds())){ if(CollectionUtil.isNotEmpty(param.getSelectIds())){
channelWrapper.in(BmsChannel::getId, param.getSelectIds()); channelWrapper.in(BmsChannel::getId, param.getSelectIds());
} }
if(param.getExportNum()==null || param.getExportNum()==0){
Assert.throwEx("请输入导出条数");
}else{
channelWrapper.last(" limit "+param.getExportNum());
}
List<BmsChannel> list = bmsChannelService.list(channelWrapper); List<BmsChannel> list = bmsChannelService.list(channelWrapper);
List<Long> channelIds = list.stream().map(a->a.getId()).collect(Collectors.toList()); List<Long> channelIds = list.stream().map(a->a.getId()).collect(Collectors.toList());

7
src/main/java/com/qs/serve/modules/bms/controller/BmsChannelPointController.java

@ -87,6 +87,13 @@ public class BmsChannelPointController {
if(CollectionUtil.isNotEmpty(param.getSelectIds())){ if(CollectionUtil.isNotEmpty(param.getSelectIds())){
lqw.in(BmsChannelPoint::getId, param.getSelectIds()); lqw.in(BmsChannelPoint::getId, param.getSelectIds());
} }
if(param.getExportNum()==null || param.getExportNum()==0){
Assert.throwEx("请输入导出条数");
}else{
channelWrapper.last(" limit "+param.getExportNum());
}
List<BmsChannelPoint> list = bmsChannelPointService.list(lqw); List<BmsChannelPoint> list = bmsChannelPointService.list(lqw);
List<String> bizRegionIds = new ArrayList<>(); List<String> bizRegionIds = new ArrayList<>();
bizRegionIds.addAll(list.stream().filter(a->a.getBizRegionId()!=null).map(a->a.getBizRegionId()).collect(Collectors.toList())); bizRegionIds.addAll(list.stream().filter(a->a.getBizRegionId()!=null).map(a->a.getBizRegionId()).collect(Collectors.toList()));

3
src/main/java/com/qs/serve/modules/bms/entity/BmsChannel.java

@ -125,5 +125,8 @@ public class BmsChannel implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private String seachSupplierName; private String seachSupplierName;
@TableField(exist = false)
private Integer exportNum;
} }

3
src/main/java/com/qs/serve/modules/bms/entity/BmsChannelPoint.java

@ -217,5 +217,8 @@ public class BmsChannelPoint implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private List<String> supplierNames; private List<String> supplierNames;
@TableField(exist = false)
private Integer exportNum;
} }

12
src/main/java/com/qs/serve/modules/third/entity/ProcessCreateCostApplyBo.java

@ -1,9 +1,12 @@
package com.qs.serve.modules.third.entity; package com.qs.serve.modules.third.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List; import java.util.List;
/** /**
@ -54,4 +57,13 @@ public class ProcessCreateCostApplyBo {
@NotNull(message = "存货编码 不能为空") @NotNull(message = "存货编码 不能为空")
private List<ProcessGoodsItem> goodsList; private List<ProcessGoodsItem> goodsList;
@NotNull(message = "开始时间 不能为空")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private LocalDate startDate;
@NotNull(message = "结束时间 不能为空")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private LocalDate endDate;
} }

139
src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java

@ -587,6 +587,8 @@ public class PortalOfCostApplication {
final BigDecimal OneHundred = new BigDecimal("100"); final BigDecimal OneHundred = new BigDecimal("100");
LocalDateTime nowTime = LocalDateTime.now(); LocalDateTime nowTime = LocalDateTime.now();
LocalDate nowDate = LocalDate.now(); LocalDate nowDate = LocalDate.now();
LocalDate startDate = createBo.getStartDate();
LocalDate endDate = createBo.getEndDate();
String erpCode = createBo.getErpCode(); String erpCode = createBo.getErpCode();
Long supplierId = Long.parseLong(supplier.getId()); Long supplierId = Long.parseLong(supplier.getId());
BigDecimal totalAmount = createBo.getTotalAmount(); BigDecimal totalAmount = createBo.getTotalAmount();
@ -628,10 +630,10 @@ public class PortalOfCostApplication {
activity.setSupplierId(supplierId); activity.setSupplierId(supplierId);
activity.setSupplierName(supplier.getName()); activity.setSupplierName(supplier.getName());
activity.setSupplierCode(supplier.getCode()); activity.setSupplierCode(supplier.getCode());
activity.setActStartDate(nowDate); activity.setActStartDate(startDate);
activity.setActEndDate(nowDate); activity.setActEndDate(endDate);
activity.setPreStartDate(nowDate); activity.setPreStartDate(startDate);
activity.setPreEndDate(nowDate); activity.setPreEndDate(endDate);
activity.setPreCheckDate(nowDate); activity.setPreCheckDate(nowDate);
activity.setTotalAmount(totalAmount); activity.setTotalAmount(totalAmount);
activity.setUsedAmount(totalAmount); activity.setUsedAmount(totalAmount);
@ -696,10 +698,10 @@ public class PortalOfCostApplication {
centerGoods.setSubjectCode(subject.getSubjectCode()); centerGoods.setSubjectCode(subject.getSubjectCode());
centerGoods.setSubjectName(subject.getSubjectName()); centerGoods.setSubjectName(subject.getSubjectName());
//设置活动时间 //设置活动时间
centerGoods.setActEndDate(nowDate); centerGoods.setActEndDate(endDate);
centerGoods.setActStartDate(nowDate); centerGoods.setActStartDate(startDate);
centerGoods.setPreEndDate(nowDate); centerGoods.setPreEndDate(endDate);
centerGoods.setPreStartDate(nowDate); centerGoods.setPreStartDate(startDate);
centerGoods.setPreCheckDate(nowDate); centerGoods.setPreCheckDate(nowDate);
//设置目标 //设置目标
centerGoods.setTargetId(activityGoods.getTargetId()); centerGoods.setTargetId(activityGoods.getTargetId());
@ -784,7 +786,8 @@ public class PortalOfCostApplication {
//保存核销申请 //保存核销申请
VtbVerification verification = new VtbVerification(); VtbVerification verification = new VtbVerification();
verification.setVerificationCode("MHX"+ CodeGenUtil.generate(CodeGenUtil.SourceKey.Verification)); // verification.setVerificationCode("MHX"+ CodeGenUtil.generate(CodeGenUtil.SourceKey.Verification));
verification.setVerificationCode(costCode);
verification.setVerificationMainCode(verification.getVerificationCode()); verification.setVerificationMainCode(verification.getVerificationCode());
verification.setCostApplyId(costApply.getId()); verification.setCostApplyId(costApply.getId());
verification.setFinishedTime(nowTime); verification.setFinishedTime(nowTime);
@ -821,64 +824,72 @@ public class PortalOfCostApplication {
verificationSubjectService.save(verificationSubject); verificationSubjectService.save(verificationSubject);
//保存支付信息 //保存支付信息
String json = ThirtyVerificationUtil.buildJson(supplier, subject, totalAmount, activityTitle, verification); if(costCode.indexOf("DHX")==0) {
String COST_TO_PAY_API = projectApisProperties.getCostToPay(); //发货单的
log.info("COST_TO_PAY_API 支付单信息:{} 数据:{}",verification.getVerificationCode(),json); String json = ThirtyVerificationUtil.buildJson(supplier, subject, totalAmount, activityTitle, verification);
String rs = HttpUtil.doPost(COST_TO_PAY_API,json,null); String COST_TO_PAY_API = projectApisProperties.getCostToPay();
if(rs==null||!rs.contains("200")){ log.info("COST_TO_PAY_API 支付单信息:{} 数据:{}", verification.getVerificationCode(), json);
log.error("COST_TO_PAY_API \n 请求参数:{},\n 支付单信息:{},\n 结果:{}",json,verification.getVerificationCode(),rs); String rs = HttpUtil.doPost(COST_TO_PAY_API, json, null);
//核销调度接口事务补偿 if (rs == null || !rs.contains("200")) {
costApplyService.removeById(costApply.getId()); log.error("COST_TO_PAY_API \n 请求参数:{},\n 支付单信息:{},\n 结果:{}", json, verification.getVerificationCode(), rs);
activityService.removeById(activity.getId()); //核销调度接口事务补偿
activitySubjectService.removeById(activitySubject.getId()); costApplyService.removeById(costApply.getId());
activityCenterService.removeById(activityCenter.getId()); activityService.removeById(activity.getId());
List<Long> goodIds = activityGoodsList.stream().map(TbsActivityGoods::getId).collect(Collectors.toList()); activitySubjectService.removeById(activitySubject.getId());
if(goodIds.size()>0){ activityCenterService.removeById(activityCenter.getId());
activityGoodsService.removeBatchByIds(goodIds); List<Long> goodIds = activityGoodsList.stream().map(TbsActivityGoods::getId).collect(Collectors.toList());
} if (goodIds.size() > 0) {
List<Long> good2Ids = activityCenterGoodsList.stream().map(TbsActivityCenterGoods::getId).collect(Collectors.toList()); activityGoodsService.removeBatchByIds(goodIds);
if(good2Ids.size()>0){ }
activityCenterGoodsService.removeBatchByIds(good2Ids); List<Long> good2Ids = activityCenterGoodsList.stream().map(TbsActivityCenterGoods::getId).collect(Collectors.toList());
} if (good2Ids.size() > 0) {
List<Long> logIds = budgetLogList.stream().map(TbsBudgetLog::getId).collect(Collectors.toList()); activityCenterGoodsService.removeBatchByIds(good2Ids);
if(logIds.size()>0){ }
budgetLogService.removeBatchByIds(logIds); List<Long> logIds = budgetLogList.stream().map(TbsBudgetLog::getId).collect(Collectors.toList());
if (logIds.size() > 0) {
budgetLogService.removeBatchByIds(logIds);
}
verificationService.removeById(verification.getId());
verificationSubjectService.removeById(verificationSubject.getId());
Assert.throwEx("连接支付接口异常");
} }
verificationService.removeById(verification.getId()); log.info("COST_TO_PAY_API 支付单信息:{},结果:{}", verification.getVerificationCode(), rs);
verificationSubjectService.removeById(verificationSubject.getId());
Assert.throwEx("连接支付接口异常");
} }
log.info("COST_TO_PAY_API 支付单信息:{},结果:{}",verification.getVerificationCode(),rs);
//保存支付 //保存支付
// PayPayment payPayment = new PayPayment(); if(costCode.indexOf("SHX")==0) {
// payPayment.setPayType(PaymentType.PAYMENT); //发票的要直接支付
// payPayment.setPayCode("PM"+ StringUtils.genShortId()); PayPayment payPayment = new PayPayment();
// payPayment.setSupplierId(supplierId); payPayment.setPayType(PaymentType.PAYMENT);
// payPayment.setSupplierCode(supplier.getCode()); payPayment.setPayCode("PM" + StringUtils.genShortId());
// payPayment.setSupplierName(supplier.getName()); payPayment.setSupplierId(supplierId);
// payPayment.setPayAmount(totalAmount); payPayment.setSupplierCode(supplier.getCode());
// payPayment.setUserId(user.getId()); payPayment.setSupplierName(supplier.getName());
// payPayment.setUserCode(user.getCode()); payPayment.setPayAmount(totalAmount);
// payPayment.setUserName(user.getName()); payPayment.setUserId(user.getId());
// payPayment.setPayTime(nowTime); payPayment.setUserCode(user.getCode());
// payPayment.setErpCode(erpCode); payPayment.setUserName(user.getName());
// payPayment.setBillNumber(billNumber); payPayment.setPayTime(nowTime);
// paymentService.save(payPayment); payPayment.setErpCode(erpCode);
// payPayment.setBillNumber(billNumber);
// PayPaymentItem paymentItem = new PayPaymentItem(); paymentService.save(payPayment);
// paymentItem.setPaymentId(payPayment.getId());
// paymentItem.setPayType(PaymentType.PAYMENT); PayPaymentItem paymentItem = new PayPaymentItem();
// paymentItem.setSupplierId(supplierId); paymentItem.setPaymentId(payPayment.getId());
// paymentItem.setItemPayAmount(totalAmount); paymentItem.setPayType(PaymentType.PAYMENT);
// paymentItem.setVerificationId(verification.getId()); paymentItem.setSupplierId(supplierId);
// paymentItem.setVerificationSubjectId(verificationSubject.getId()); paymentItem.setItemPayAmount(totalAmount);
// paymentItem.setCostApplyId(costApply.getId()); paymentItem.setVerificationId(verification.getId());
// paymentItem.setActivityId(activity.getId()); paymentItem.setVerificationCode(verification.getVerificationCode());
// paymentItem.setActivityCode(activity.getActivityCode()); paymentItem.setVerificationMainCode(verification.getVerificationCode());
// paymentItem.setSubjectId(subject.getId()); paymentItem.setVerificationSubjectId(verificationSubject.getId());
// paymentItem.setSubjectCode(subject.getSubjectCode()); paymentItem.setCostApplyId(costApply.getId());
// paymentItem.setSubjectName(subject.getSubjectName()); paymentItem.setActivityId(activity.getId());
// paymentItemService.save(paymentItem); paymentItem.setActivityCode(activity.getActivityCode());
paymentItem.setSubjectId(subject.getId());
paymentItem.setSubjectCode(subject.getSubjectCode());
paymentItem.setSubjectName(subject.getSubjectName());
paymentItemService.save(paymentItem);
}
} }

Loading…
Cancel
Save