God 4 months ago
parent
commit
c8e583d944
  1. 2
      anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/PayBaseVehicleQuery.java
  2. 19
      anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleService.java
  3. 2
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewith/ScmSpecialRebateWithDetailsVo.java
  4. 3
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyDetailsVo.java
  5. 66
      anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithPdfVo.java
  6. 4
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewithapply/ScmSpecialRebateWithApplyRest.java
  7. 128
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewithapply/ScmSpecialRebateWithApplyService.java
  8. 65
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyService.java
  9. 6413
      anrui-scm/anrui-scm-biz/src/main/resources/ftl/dcyt.ftl
  10. 2714
      anrui-scm/anrui-scm-biz/src/main/resources/ftl/zxyt.ftl
  11. 63
      工作内容需要的文档/单据模板/专项返利核对模板/dcyt.docx
  12. 50
      工作内容需要的文档/单据模板/专项返利预提模板/zxyt.docx
  13. 63
      工作内容需要的文档/单据模板/单车返利核对模板/dchd.docx
  14. 8355
      工作内容需要的文档/单据模板/单车返利预提模板/dcyt.ftl

2
anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basevehicle/PayBaseVehicleQuery.java

@ -20,6 +20,8 @@ public class PayBaseVehicleQuery implements Query {
private String isSales; private String isSales;
@ApiModelProperty("款项是否已交清,1是0否") @ApiModelProperty("款项是否已交清,1是0否")
private String isSettle; private String isSettle;
@ApiModelProperty(value = "车架号")
private String vinNo;
@ApiModelProperty(value = "品牌") @ApiModelProperty(value = "品牌")
private String brandSid; private String brandSid;
@ApiModelProperty(value = "功能") @ApiModelProperty(value = "功能")

19
anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basevehicle/BaseVehicleService.java

@ -3349,10 +3349,8 @@ public class BaseVehicleService extends MybatisBaseService<BaseVehicleMapper, Ba
private QueryWrapper<BaseVehicle> vehicleRebateWrapper(BaseVehicleRebateQuery params) { private QueryWrapper<BaseVehicle> vehicleRebateWrapper(BaseVehicleRebateQuery params) {
QueryWrapper<BaseVehicle> qw = new QueryWrapper<>(); QueryWrapper<BaseVehicle> qw = new QueryWrapper<>();
if (params != null) { if (params != null) {
if (StringUtils.isNotBlank(params.getUserSid())) { String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(params.getOrgSid()).getData();
String orgSid = sysStaffOrgFeign.getPathSidByUserSid(params.getUserSid()).getData(); qw.eq("bv.useOrgSid", useOrgSid);
qw.eq("bv.useOrgSid", orgSid);
}
//车架号 //车架号
if (StringUtils.isNotBlank(params.getVinNo())) { if (StringUtils.isNotBlank(params.getVinNo())) {
qw.like("bv.vinNo", params.getVinNo()); qw.like("bv.vinNo", params.getVinNo());
@ -3541,14 +3539,17 @@ public class BaseVehicleService extends MybatisBaseService<BaseVehicleMapper, Ba
qw.eq("bv.createOrgSid", query.getOrgSid()); qw.eq("bv.createOrgSid", query.getOrgSid());
if ("1".equals(query.getIsSales())) { if ("1".equals(query.getIsSales())) {
qw.isNotNull("bv.salesDate"); qw.isNotNull("bv.salesDate");
}else if ("0".equals(query.getIsSales())){
qw.isNull("bv.salesDate");
}
if ("1".equals(query.getIsSettle())) { if ("1".equals(query.getIsSettle())) {
qw.eq("vs.finState", 1); qw.eq("vs.finState", 1);
} else if ("0".equals(query.getIsSettle())) { } else if ("0".equals(query.getIsSettle())) {
qw.eq("vs.finState", 0); qw.eq("vs.finState", 0);
} }
} else if ("0".equals(query.getIsSales())) {
qw.isNull("bv.salesDate");
}
if (StringUtils.isNotBlank(query.getVinNo())) {
qw.like("bv.vinNo", query.getVinNo());
}
//品牌 //品牌
if (StringUtils.isNotBlank(query.getBrandSid())) { if (StringUtils.isNotBlank(query.getBrandSid())) {
qw.eq("bvm.carBrand", query.getBrandSid()); qw.eq("bvm.carBrand", query.getBrandSid());
@ -3600,8 +3601,8 @@ public class BaseVehicleService extends MybatisBaseService<BaseVehicleMapper, Ba
qw.eq("bv.isDelete", 0); qw.eq("bv.isDelete", 0);
qw.eq("bv.isProblemVeh", 0); qw.eq("bv.isProblemVeh", 0);
qw.and(wrapper -> wrapper.ne("bv.vehicleState", VehicleState.StockEnum.ING_STOCK.getCode()).or().ne("bv.vehicleState", VehicleState.StockEnum.DR_STOCK.getCode())); qw.and(wrapper -> wrapper.ne("bv.vehicleState", VehicleState.StockEnum.ING_STOCK.getCode()).or().ne("bv.vehicleState", VehicleState.StockEnum.DR_STOCK.getCode()));
qw.groupBy("vs.vinSid"); qw.groupBy("bv.sid");
qw.orderByDesc("vs.createTime"); qw.orderByDesc("bv.createTime");
IPage<PayBaseVehicleVo> pagging = baseMapper.selectPayVehicleList(page, qw); IPage<PayBaseVehicleVo> pagging = baseMapper.selectPayVehicleList(page, qw);
PagerVo<PayBaseVehicleVo> p = PagerUtil.pageToVo(pagging, null); PagerVo<PayBaseVehicleVo> p = PagerUtil.pageToVo(pagging, null);
return p; return p;

2
anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewith/ScmSpecialRebateWithDetailsVo.java

@ -57,7 +57,7 @@ public class ScmSpecialRebateWithDetailsVo implements Vo {
@ApiModelProperty("备注") @ApiModelProperty("备注")
private String remarks; // 备注 private String remarks; // 备注
@ApiModelProperty("预提返利") @ApiModelProperty("预提返利")
private String withRebate; // 预提返利 private BigDecimal withRebate; // 预提返利
@ApiModelProperty("专项返利sid") @ApiModelProperty("专项返利sid")
private List<String> specialRebateSids; // 专项返利sid private List<String> specialRebateSids; // 专项返利sid
@ApiModelProperty("专项返利sid") @ApiModelProperty("专项返利sid")

3
anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithApplyDetailsVo.java

@ -60,6 +60,9 @@ public class ScmSpecialRebateWithApplyDetailsVo implements Vo {
@ApiModelProperty("创建日期") @ApiModelProperty("创建日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date createTime; private Date createTime;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@ApiModelProperty("办结日期")
private Date finishTime;
@ApiModelProperty("申请人sid") @ApiModelProperty("申请人sid")
private String createBySid; // 申请人sid private String createBySid; // 申请人sid
@ApiModelProperty("备注") @ApiModelProperty("备注")

66
anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmspecialrebatewithapply/ScmSpecialRebateWithPdfVo.java

@ -0,0 +1,66 @@
/*********************************************************
*********************************************************
******************** *******************
************* ************
******* _oo0oo_ *******
*** o8888888o ***
* 88" . "88 *
* (| -_- |) *
* 0\ = /0 *
* ___/`---'\___ *
* .' \\| |// '. *
* / \\||| : |||// \ *
* / _||||| -:- |||||- \ *
* | | \\\ - /// | | *
* | \_| ''\---/'' |_/ | *
* \ .-\__ '-' ___/-. / *
* ___'. .' /--.--\ `. .'___ *
* ."" '< `.___\_<|>_/___.' >' "". *
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
* \ \ `_. \_ __\ /__ _/ .-` / / *
* =====`-.____`.___ \_____/___.-`___.-'===== *
* `=---=' *
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
*********************************************************/
package com.yxt.anrui.scm.api.scmspecialrebatewithapply;
import com.yxt.common.core.vo.Vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* Project: anrui-scm(单车返利预提申请) <br/>
* File: ScmVehRebateWithVo.java <br/>
* Class: com.yxt.anrui.scm.api.scmvehrebatewith.ScmVehRebateWithVo <br/>
* Description: 单车返利预提表 视图数据对象. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2022-08-25 09:04:38 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Data
@ApiModel(value = "单车返利预提表 视图数据对象", description = "单车返利预提表 视图数据对象")
public class ScmSpecialRebateWithPdfVo implements Vo {
private Integer id; // sid
@ApiModelProperty("采购系统")
private String cgxt;
@ApiModelProperty("品牌")
private String pp;
@ApiModelProperty("返利类型")
private String fllx;
@ApiModelProperty("预提返利")
private String ytfl;
@ApiModelProperty("其中支出费用")
private String zc;
@ApiModelProperty("其中待支付费用")
private String dzf;
@ApiModelProperty("其中抵顶费用")
private String dd;
}

4
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewithapply/ScmSpecialRebateWithApplyRest.java

@ -102,7 +102,9 @@ public class ScmSpecialRebateWithApplyRest implements ScmSpecialRebateWithApplyF
@Override @Override
public ResultBean<PdfPath> createPdf(String specialWithSid, String userName) { public ResultBean<PdfPath> createPdf(String specialWithSid, String userName) {
return null; ResultBean rb = ResultBean.fireFail();
PdfPath pdf = scmSpecialRebateWithApplyService.createPdf(specialWithSid, userName);
return rb.success().setData(pdf);
} }
@Override @Override

128
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewithapply/ScmSpecialRebateWithApplyService.java

@ -35,6 +35,7 @@ import com.yxt.anrui.base.api.basemanufacturer.BaseManufacturerFeign;
import com.yxt.anrui.base.api.basevehiclebrand.BaseVehicleBrand; import com.yxt.anrui.base.api.basevehiclebrand.BaseVehicleBrand;
import com.yxt.anrui.base.api.basevehiclebrand.BaseVehicleBrandFeign; import com.yxt.anrui.base.api.basevehiclebrand.BaseVehicleBrandFeign;
import com.yxt.anrui.base.common.utils.Rule; import com.yxt.anrui.base.common.utils.Rule;
import com.yxt.anrui.fin.api.finpaymentrecord.FinPaymentrecordSourceLCVo;
import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign; import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign;
import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher; import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher;
import com.yxt.anrui.flowable.api.flow.FlowableFeign; import com.yxt.anrui.flowable.api.flow.FlowableFeign;
@ -44,6 +45,7 @@ import com.yxt.anrui.flowable.api.flow2.FlowFeign;
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign;
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; import com.yxt.anrui.flowable.api.utils.ProcDefEnum;
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables;
import com.yxt.anrui.portal.api.flow.PCHistTaskListAndCommentList;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg;
@ -61,13 +63,23 @@ import com.yxt.anrui.scm.api.scmspecialrebatewithapply.flow.GetNodeQuery;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.flow.GetNodeVo; import com.yxt.anrui.scm.api.scmspecialrebatewithapply.flow.GetNodeVo;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.flow.ScmSpecialRebateWithApplyDelegateQuery; import com.yxt.anrui.scm.api.scmspecialrebatewithapply.flow.ScmSpecialRebateWithApplyDelegateQuery;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.flow.SubmitScmSpecialRebateWithApplyDto; import com.yxt.anrui.scm.api.scmspecialrebatewithapply.flow.SubmitScmSpecialRebateWithApplyDto;
import com.yxt.anrui.scm.api.scmvehrebatewith.ScmVehRebateWithDetailsVo;
import com.yxt.anrui.scm.api.scmvehrebatewith.ScmVehRebateWithPdfVo;
import com.yxt.anrui.scm.api.scmvehrebatewithapply.PdfPath;
import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyDetailsVo;
import com.yxt.anrui.scm.biz.scmspecialrebate.ScmSpecialRebateService; import com.yxt.anrui.scm.biz.scmspecialrebate.ScmSpecialRebateService;
import com.yxt.anrui.scm.biz.scmspecialrebatewith.ScmSpecialRebateWithService; import com.yxt.anrui.scm.biz.scmspecialrebatewith.ScmSpecialRebateWithService;
import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.ConstantUtils;
import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.base.utils.WordUtils;
import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo; import com.yxt.common.core.vo.PagerVo;
import com.yxt.messagecenter.api.message.Message;
import com.yxt.messagecenter.api.message.MessageFeign;
import com.yxt.messagecenter.api.messagelist.MessageList;
import com.yxt.messagecenter.api.messagelist.MessageListFeign;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -77,6 +89,8 @@ import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.util.Comparator.comparing;
/** /**
* Project: anrui-scm(专项返利) <br/> * Project: anrui-scm(专项返利) <br/>
* File: ScmSpecialRebateWithApplyService.java <br/> * File: ScmSpecialRebateWithApplyService.java <br/>
@ -115,6 +129,12 @@ public class ScmSpecialRebateWithApplyService extends MybatisBaseService<ScmSpec
private SysUserFeign sysUserFeign; private SysUserFeign sysUserFeign;
@Autowired @Autowired
private FlowFeign flowFeign; private FlowFeign flowFeign;
@Autowired
private com.yxt.anrui.portal.api.flow.FlowableFeign flowableFeignSp;
@Autowired
private MessageFeign messageFeign;
@Autowired
private MessageListFeign messageListFeign;
private QueryWrapper<ScmSpecialRebateWithApply> createQueryWrapper(ScmSpecialRebateWithApplyQuery query) { private QueryWrapper<ScmSpecialRebateWithApply> createQueryWrapper(ScmSpecialRebateWithApplyQuery query) {
// todo: 这里根据具体业务调整查询条件 // todo: 这里根据具体业务调整查询条件
@ -698,4 +718,112 @@ public class ScmSpecialRebateWithApplyService extends MybatisBaseService<ScmSpec
flowFeign.assignTask(delegateQuery); flowFeign.assignTask(delegateQuery);
return rb.success(); return rb.success();
} }
public PdfPath createPdf(String specialWithSid, String userName) {
PdfPath pdfPath = new PdfPath();
ScmSpecialRebateWithApplyDetailsVo scmSpecialRebateWithApplyDetailsVo = fetchAllDetailsVo(specialWithSid).getData();
//获取专项返利预提
List<ScmSpecialRebateWithDetailsVo> scmSpecialRebateWiths = scmSpecialRebateWithApplyDetailsVo.getScmSpecialRebateWiths();
Map<String, Object> dataMap = new HashMap<String, Object>();
//标题
dataMap.put("title",scmSpecialRebateWithApplyDetailsVo.getWithApply() + "专项返利预提审批");
//分公司
dataMap.put("useOrgName", scmSpecialRebateWithApplyDetailsVo.getCreateOrgName());
//创建部门
dataMap.put("deptName", scmSpecialRebateWithApplyDetailsVo.getDeptName());
//创建人
dataMap.put("createByName", scmSpecialRebateWithApplyDetailsVo.getCreateByName());
//创建日期
dataMap.put("createTime", DateUtil.formatDate(scmSpecialRebateWithApplyDetailsVo.getCreateTime()));
//办结日期
dataMap.put("finishTime", DateUtil.formatDate(scmSpecialRebateWithApplyDetailsVo.getFinishTime()));
//审批编号
dataMap.put("billNo", scmSpecialRebateWithApplyDetailsVo.getBillNo());
List<ScmSpecialRebateWithPdfVo> scmSpecialRebateWithPdfVos = new ArrayList<>();
//循环获取车辆信息
Integer i = 1;
for (ScmSpecialRebateWithDetailsVo scmSpecialRebateWithDetailsVo : scmSpecialRebateWiths) {
ScmSpecialRebateWithPdfVo scmSpecialRebateWithPdfVo = new ScmSpecialRebateWithPdfVo();
scmSpecialRebateWithPdfVo.setId(i);
i = i + 1;
scmSpecialRebateWithPdfVo.setCgxt(scmSpecialRebateWithDetailsVo.getPurchaseSystemName());
scmSpecialRebateWithPdfVo.setPp(scmSpecialRebateWithDetailsVo.getBrandName());
scmSpecialRebateWithPdfVo.setFllx(scmSpecialRebateWithDetailsVo.getRebateTypeValue());
scmSpecialRebateWithPdfVo.setYtfl(scmSpecialRebateWithDetailsVo.getWithRebate().toString());
scmSpecialRebateWithPdfVo.setZc(scmSpecialRebateWithDetailsVo.getExpectItureCost().toString());
scmSpecialRebateWithPdfVo.setDzf(scmSpecialRebateWithDetailsVo.getExpectTreatCost().toString());
scmSpecialRebateWithPdfVo.setDd(scmSpecialRebateWithDetailsVo.getExpectSuppCost().toString());
scmSpecialRebateWithPdfVos.add(scmSpecialRebateWithPdfVo);
}
dataMap.put("wlList", scmSpecialRebateWithPdfVos);
dataMap.put("ytflt", scmSpecialRebateWiths.stream().map(ScmSpecialRebateWithDetailsVo::getWithRebate).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
dataMap.put("zct", scmSpecialRebateWiths.stream().map(ScmSpecialRebateWithDetailsVo::getExpectItureCost).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
dataMap.put("dzft", scmSpecialRebateWiths.stream().map(ScmSpecialRebateWithDetailsVo::getExpectTreatCost).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
dataMap.put("ddt", scmSpecialRebateWiths.stream().map(ScmSpecialRebateWithDetailsVo::getExpectSuppCost).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
dataMap.put("remarks", scmSpecialRebateWithApplyDetailsVo.getRemarks());
//获取审批记录
List<PCHistTaskListAndCommentList> flowRecordVo = flowableFeignSp.flowRecordAndComment(scmSpecialRebateWithApplyDetailsVo.getProcInstId(), "1").getData();
List<FinPaymentrecordSourceLCVo> finPaymentrecordSourceLCVos = new ArrayList<>();
for (PCHistTaskListAndCommentList flowTask : flowRecordVo) {
if (flowTask.getFlowableRecordVo() != null) {
Map<String, Object> flowableRecordVo = flowTask.getFlowableRecordVo();
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo();
List<Map<String, Object>> taskUserInfos = ConstantUtils.getListData(flowableRecordVo, "taskUserInfos");
Map<String, Object> comment = ConstantUtils.getMap(flowableRecordVo, "comment");
String assigneeName = (String) taskUserInfos.get(0).get("assigneeName");
String comment1 = (String) comment.get("comment");
finPaymentrecordSourceLCVo.setName(assigneeName);
finPaymentrecordSourceLCVo.setComment(comment1);
finPaymentrecordSourceLCVo.setSpsj(flowableRecordVo.get("finishTime").toString());
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo);
} else {
Map<String, Object> processCommentVo = flowTask.getProcessCommentVo();
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo();
finPaymentrecordSourceLCVo.setName(processCommentVo.get("title").toString());
finPaymentrecordSourceLCVo.setComment(processCommentVo.get("content").toString());
finPaymentrecordSourceLCVo.setSpsj(processCommentVo.get("time").toString());
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo);
}
}
List<Message> messages = messageFeign.selectByBusinessSid(scmSpecialRebateWithApplyDetailsVo.getSid()).getData();
if (messages.size() > 0) {
for (Message message : messages) {
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo();
String receiverNames = "";
List<MessageList> messageLists = messageListFeign.fetchByMainSid(message.getSid()).getData();
if (messageLists.size() > 0) {
for (MessageList messageList : messageLists) {
receiverNames = receiverNames + messageList.getReceiverName() + ",";
}
}
finPaymentrecordSourceLCVo.setName("系统");
finPaymentrecordSourceLCVo.setComment("抄送 " + receiverNames.substring(0, receiverNames.lastIndexOf(",")));
finPaymentrecordSourceLCVo.setSpsj(DateUtil.format(message.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo);
}
}
finPaymentrecordSourceLCVos.sort(comparing(FinPaymentrecordSourceLCVo::getSpsj));
dataMap.put("lcList", finPaymentrecordSourceLCVos);
//下载人
dataMap.put("downName", userName);
//下载时间
dataMap.put("downTime", DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
//获取模板
//模板路径
String sourcePath = "D:\\anrui\\upload\\template\\";
//生成word文件名
String dateStr = DateUtil.format(new Date(), "yyyyMMdd");
long seconds = System.currentTimeMillis();
String typeName = dateStr + seconds + ".doc";
// 生成文件路径
String targetPath = sourcePath + dateStr;
WordUtils.creatWord(dataMap, "zxyt", sourcePath, targetPath, typeName);
//新生成的word路径
String wordPath = targetPath + "\\" + typeName;
//生成出门证文件名
String pdfName = "专项返利预提_" + dateStr + seconds + ".pdf";
WordUtils.doc2pdf(wordPath, targetPath, pdfName, "");
pdfPath.setPdfPath("/template/" + dateStr + "/" + pdfName);
return pdfPath;
}
} }

65
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyService.java

@ -38,6 +38,7 @@ import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusOrderAndVehInfo;
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign; import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign;
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTemp; import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTemp;
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempFeign; import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempFeign;
import com.yxt.anrui.fin.api.finpaymentrecord.FinPaymentrecordSourceLCVo;
import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign; import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign;
import com.yxt.anrui.fin.api.kingdee.costadjustmentsbill.CostAdjustmentsBill; import com.yxt.anrui.fin.api.kingdee.costadjustmentsbill.CostAdjustmentsBill;
import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher; import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher;
@ -48,6 +49,7 @@ import com.yxt.anrui.flowable.api.flow2.FlowFeign;
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign; import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign;
import com.yxt.anrui.flowable.api.utils.ProcDefEnum; import com.yxt.anrui.flowable.api.utils.ProcDefEnum;
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables; import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables;
import com.yxt.anrui.portal.api.flow.PCHistTaskListAndCommentList;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg;
@ -69,11 +71,16 @@ import com.yxt.anrui.scm.api.scmvehrebatewithapply.flow.SubmitScmVehRebateWithAp
import com.yxt.anrui.scm.biz.scmvehrebate.ScmVehRebateService; import com.yxt.anrui.scm.biz.scmvehrebate.ScmVehRebateService;
import com.yxt.anrui.scm.biz.scmvehrebatewith.ScmVehRebateWithService; import com.yxt.anrui.scm.biz.scmvehrebatewith.ScmVehRebateWithService;
import com.yxt.common.base.service.MybatisBaseService; import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.ConstantUtils;
import com.yxt.common.base.utils.PagerUtil; import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.base.utils.WordUtils; import com.yxt.common.base.utils.WordUtils;
import com.yxt.common.core.query.PagerQuery; import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean; import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo; import com.yxt.common.core.vo.PagerVo;
import com.yxt.messagecenter.api.message.Message;
import com.yxt.messagecenter.api.message.MessageFeign;
import com.yxt.messagecenter.api.messagelist.MessageList;
import com.yxt.messagecenter.api.messagelist.MessageListFeign;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -83,6 +90,8 @@ import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static java.util.Comparator.comparing;
/** /**
* Project: anrui-scm(单车返利预提申请) <br/> * Project: anrui-scm(单车返利预提申请) <br/>
* File: ScmVehRebateWithApplyService.java <br/> * File: ScmVehRebateWithApplyService.java <br/>
@ -106,6 +115,8 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService<ScmVehRebat
@Autowired @Autowired
private SysStaffOrgFeign sysStaffOrgFeign; private SysStaffOrgFeign sysStaffOrgFeign;
@Autowired @Autowired
private com.yxt.anrui.portal.api.flow.FlowableFeign flowableFeignSp;
@Autowired
private FlowableFeign flowableFeign; private FlowableFeign flowableFeign;
@Autowired @Autowired
private FlowTaskFeign flowTaskFeign; private FlowTaskFeign flowTaskFeign;
@ -125,6 +136,10 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService<ScmVehRebat
private BusDeliveredApplyFeign busDeliveredApplyFeign; private BusDeliveredApplyFeign busDeliveredApplyFeign;
@Autowired @Autowired
private CrmCustomerTempFeign crmCustomerTempFeign; private CrmCustomerTempFeign crmCustomerTempFeign;
@Autowired
private MessageFeign messageFeign;
@Autowired
private MessageListFeign messageListFeign;
private QueryWrapper<ScmVehRebateWithApply> createQueryWrapper(ScmVehRebateWithApplyQuery query) { private QueryWrapper<ScmVehRebateWithApply> createQueryWrapper(ScmVehRebateWithApplyQuery query) {
// todo: 这里根据具体业务调整查询条件 // todo: 这里根据具体业务调整查询条件
@ -760,6 +775,8 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService<ScmVehRebat
//获取单车返利预提 //获取单车返利预提
List<ScmVehRebateWithDetailsVo> scmVehRebateWiths = scmVehRebateWithApplyDetailsVo.getScmVehRebateWiths(); List<ScmVehRebateWithDetailsVo> scmVehRebateWiths = scmVehRebateWithApplyDetailsVo.getScmVehRebateWiths();
Map<String, Object> dataMap = new HashMap<String, Object>(); Map<String, Object> dataMap = new HashMap<String, Object>();
//标题
dataMap.put("title",scmVehRebateWithApplyDetailsVo.getWithApply() + "单车返利预提审批");
//分公司 //分公司
dataMap.put("useOrgName", scmVehRebateWithApplyDetailsVo.getCreateOrgName()); dataMap.put("useOrgName", scmVehRebateWithApplyDetailsVo.getCreateOrgName());
//创建部门 //创建部门
@ -767,9 +784,9 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService<ScmVehRebat
//创建人 //创建人
dataMap.put("createByName", scmVehRebateWithApplyDetailsVo.getCreateByName()); dataMap.put("createByName", scmVehRebateWithApplyDetailsVo.getCreateByName());
//创建日期 //创建日期
dataMap.put("scmVehRebateWithApply", scmVehRebateWithApplyDetailsVo.getCreateTime()); dataMap.put("createTime", DateUtil.formatDate(scmVehRebateWithApplyDetailsVo.getCreateTime()));
//办结日期 //办结日期
dataMap.put("finishTime", scmVehRebateWithApplyDetailsVo.getFinishTime()); dataMap.put("finishTime", DateUtil.formatDate(scmVehRebateWithApplyDetailsVo.getFinishTime()));
//审批编号 //审批编号
dataMap.put("billNo", scmVehRebateWithApplyDetailsVo.getBillNo()); dataMap.put("billNo", scmVehRebateWithApplyDetailsVo.getBillNo());
List<ScmVehRebateWithPdfVo> scmVehRebateWithPdfVos = new ArrayList<>(); List<ScmVehRebateWithPdfVo> scmVehRebateWithPdfVos = new ArrayList<>();
@ -786,12 +803,56 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService<ScmVehRebat
scmVehRebateWithPdfVo.setYtfl(scmVehRebateWithDetailsVo.getWithRebate().toString()); scmVehRebateWithPdfVo.setYtfl(scmVehRebateWithDetailsVo.getWithRebate().toString());
scmVehRebateWithPdfVo.setDzf(scmVehRebateWithDetailsVo.getExpectTreatCost().toString()); scmVehRebateWithPdfVo.setDzf(scmVehRebateWithDetailsVo.getExpectTreatCost().toString());
scmVehRebateWithPdfVo.setDd(scmVehRebateWithDetailsVo.getExpectSuppCost().toString()); scmVehRebateWithPdfVo.setDd(scmVehRebateWithDetailsVo.getExpectSuppCost().toString());
scmVehRebateWithPdfVos.add(scmVehRebateWithPdfVo);
} }
dataMap.put("wlList", scmVehRebateWithPdfVos); dataMap.put("wlList", scmVehRebateWithPdfVos);
dataMap.put("ytflt", scmVehRebateWiths.stream().map(ScmVehRebateWithDetailsVo::getWithRebate).reduce(BigDecimal.ZERO, BigDecimal::add).toString()); dataMap.put("ytflt", scmVehRebateWiths.stream().map(ScmVehRebateWithDetailsVo::getWithRebate).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
dataMap.put("dzft", scmVehRebateWiths.stream().map(ScmVehRebateWithDetailsVo::getExpectTreatCost).reduce(BigDecimal.ZERO, BigDecimal::add).toString()); dataMap.put("dzft", scmVehRebateWiths.stream().map(ScmVehRebateWithDetailsVo::getExpectTreatCost).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
dataMap.put("ddt", scmVehRebateWiths.stream().map(ScmVehRebateWithDetailsVo::getExpectSuppCost).reduce(BigDecimal.ZERO, BigDecimal::add).toString()); dataMap.put("ddt", scmVehRebateWiths.stream().map(ScmVehRebateWithDetailsVo::getExpectSuppCost).reduce(BigDecimal.ZERO, BigDecimal::add).toString());
dataMap.put("remarks", scmVehRebateWithApplyDetailsVo.getRemarks()); dataMap.put("remarks", scmVehRebateWithApplyDetailsVo.getRemarks());
//获取审批记录
List<PCHistTaskListAndCommentList> flowRecordVo = flowableFeignSp.flowRecordAndComment(scmVehRebateWithApplyDetailsVo.getProcInstId(), "1").getData();
List<FinPaymentrecordSourceLCVo> finPaymentrecordSourceLCVos = new ArrayList<>();
for (PCHistTaskListAndCommentList flowTask : flowRecordVo) {
if (flowTask.getFlowableRecordVo() != null) {
Map<String, Object> flowableRecordVo = flowTask.getFlowableRecordVo();
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo();
List<Map<String, Object>> taskUserInfos = ConstantUtils.getListData(flowableRecordVo, "taskUserInfos");
Map<String, Object> comment = ConstantUtils.getMap(flowableRecordVo, "comment");
String assigneeName = (String) taskUserInfos.get(0).get("assigneeName");
String comment1 = (String) comment.get("comment");
finPaymentrecordSourceLCVo.setName(assigneeName);
finPaymentrecordSourceLCVo.setComment(comment1);
finPaymentrecordSourceLCVo.setSpsj(flowableRecordVo.get("finishTime").toString());
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo);
} else {
Map<String, Object> processCommentVo = flowTask.getProcessCommentVo();
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo();
finPaymentrecordSourceLCVo.setName(processCommentVo.get("title").toString());
finPaymentrecordSourceLCVo.setComment(processCommentVo.get("content").toString());
finPaymentrecordSourceLCVo.setSpsj(processCommentVo.get("time").toString());
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo);
}
}
List<Message> messages = messageFeign.selectByBusinessSid(scmVehRebateWithApplyDetailsVo.getSid()).getData();
if (messages.size() > 0) {
for (Message message : messages) {
FinPaymentrecordSourceLCVo finPaymentrecordSourceLCVo = new FinPaymentrecordSourceLCVo();
String receiverNames = "";
List<MessageList> messageLists = messageListFeign.fetchByMainSid(message.getSid()).getData();
if (messageLists.size() > 0) {
for (MessageList messageList : messageLists) {
receiverNames = receiverNames + messageList.getReceiverName() + ",";
}
}
finPaymentrecordSourceLCVo.setName("系统");
finPaymentrecordSourceLCVo.setComment("抄送 " + receiverNames.substring(0, receiverNames.lastIndexOf(",")));
finPaymentrecordSourceLCVo.setSpsj(DateUtil.format(message.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
finPaymentrecordSourceLCVos.add(finPaymentrecordSourceLCVo);
}
}
finPaymentrecordSourceLCVos.sort(comparing(FinPaymentrecordSourceLCVo::getSpsj));
dataMap.put("lcList", finPaymentrecordSourceLCVos);
//下载人 //下载人
dataMap.put("downName", userName); dataMap.put("downName", userName);
//下载时间 //下载时间

6413
anrui-scm/anrui-scm-biz/src/main/resources/ftl/dcyt.ftl

File diff suppressed because it is too large

2714
anrui-scm/anrui-scm-biz/src/main/resources/ftl/zxyt.ftl

File diff suppressed because it is too large

63
工作内容需要的文档/单据模板/专项返利核对模板/dcyt.docx

@ -0,0 +1,63 @@
${title!}
分公司:
${useOrgName!}
创建部门:
${deptName!}
创建人:
${createByName!}
创建日期:
${createTime!}
办结日期:
${finishTime!}
审批编号:
${billNo!}
序号
采购系统
品牌
返利类型
台数
预提返利
其中待支付费用
其中抵顶费用
${id!}
${cgxt!}
${pp!}
${fllx!}
${ts!}
${ytfl!}
${dzf!}
${dd!}
合计
${ytflt!}
备注
明细见导表
审批流程
${lc.comment!}
${lc.name!}
${lc.spsj!}
下载人:
${downName!}
下载时间:
${downTime!}

50
工作内容需要的文档/单据模板/专项返利预提模板/zxyt.docx

@ -0,0 +1,50 @@
${title!}
分公司:
${useOrgName!}
创建部门:
${deptName!}
创建人:
${createByName!}
创建日期:
${createTime!}
办结日期:
${finishTime!}
审批编号:
${billNo!}
序号
采购系统
品牌
返利类型
预提返利
其中支出费用
其中待支付费用
其中抵顶费用
${id!}
${cgxt!}
${pp!}
${fllx!}
${ytfl!}
${zc!}
${dzf!}
${dd!}
合计
${ytflt!}
${zct!}
${dzft!}
${ddt!}
备注
明细见导表
审批流程
${lc.comment!}
${lc.name!}
${lc.spsj!}
下载人:
${downName!}
下载时间:
${downTime!}

63
工作内容需要的文档/单据模板/单车返利核对模板/dchd.docx

@ -0,0 +1,63 @@
${title!}
分公司:
${useOrgName!}
创建部门:
${deptName!}
创建人:
${createByName!}
创建日期:
${createTime!}
办结日期:
${finishTime!}
审批编号:
${billNo!}
序号
采购系统
品牌
返利类型
台数
预提返利
其中待支付费用
其中抵顶费用
${id!}
${cgxt!}
${pp!}
${fllx!}
${ts!}
${ytfl!}
${dzf!}
${dd!}
合计
${ytflt!}
备注
明细见导表
审批流程
${lc.comment!}
${lc.name!}
${lc.spsj!}
下载人:
${downName!}
下载时间:
${downTime!}

8355
工作内容需要的文档/单据模板/单车返利预提模板/dcyt.ftl

File diff suppressed because it is too large
Loading…
Cancel
Save