Browse Source

Merge remote-tracking branch 'origin/master'

zhanglei
ligaode 6 months ago
parent
commit
2411afa1f1
  1. 5
      anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basemanufacturer/BaseManufacturerFeign.java
  2. 5
      anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basemanufacturer/BaseManufacturerFeignFallback.java
  3. 7
      anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basemanufacturer/BaseManufacturerRest.java
  4. 6
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/BusDeliveredApplyFeign.java
  5. 5
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/BusDeliveredApplyFeignFallback.java
  6. 11
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusOrderAndVehInfo.java
  7. 9
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusSalesOrderVehicleFeign.java
  8. 5
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusSalesOrderVehicleFeignFallback.java
  9. 2
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyMapper.java
  10. 9
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyMapper.xml
  11. 7
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyRest.java
  12. 4
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java
  13. 2
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesordervehicle/BusSalesOrderVehicleMapper.java
  14. 14
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesordervehicle/BusSalesOrderVehicleMapper.xml
  15. 5
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesordervehicle/BusSalesOrderVehicleRest.java
  16. 15
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesordervehicle/BusSalesOrderVehicleService.java
  17. 14
      anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeign.java
  18. 15
      anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeignFallBack.java
  19. 3
      anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/GeneralVoucher.java
  20. 274
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/FinKingDeeFeignRest.java
  21. 6
      anrui-scm/anrui-scm-biz/pom.xml
  22. 2
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/AnruiScmApplication.java
  23. 481
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyService.java
  24. 160
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatewithapply/ScmSpecialRebateWithApplyService.java
  25. 340
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatecheckapply/ScmVehrebateCheckapplyService.java
  26. 115
      anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatewithapply/ScmVehRebateWithApplyService.java
  27. 28
      anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatecheck/specialrebatecheckAdd.vue
  28. 26
      anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatecheck/specialrebatecheckInfo.vue
  29. 26
      anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliheduiFlow/zhuanxiangfanliheduiDaiBanInfo.vue
  30. 26
      anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliheduiFlow/zhuanxiangfanliheduiEdit.vue
  31. 26
      anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliheduiFlow/zhuanxiangfanliheduiYiBanInfo.vue
  32. 20
      yxt-as-ui/src/api/operation/claimbilling.js
  33. 9
      yxt-as-ui/src/router/index.js
  34. 396
      yxt-as-ui/src/views/operation/claimbilling/claimbillingAdd.vue
  35. 103
      yxt-as-ui/src/views/operation/claimbilling/claimbillingInfo.vue
  36. 8
      yxt-as-ui/src/views/operation/workslrsettlement/workslrsettlementAdd.vue
  37. 8
      yxt-as-ui/src/views/operation/workslrsettlement/workslrsettlementInfo.vue
  38. 7
      yxt-as-ui/src/views/workFlow/fanjiesuanFlow/workslrsettlementDaiBan.vue
  39. 7
      yxt-as-ui/src/views/workFlow/fanjiesuanFlow/workslrsettlementEdit.vue
  40. 7
      yxt-as-ui/src/views/workFlow/fanjiesuanFlow/workslrsettlementYiBan.vue
  41. 99
      yxt-as-ui/src/views/workFlow/suopeikaipiaoFlow/claimbillingDaiBan.vue
  42. 397
      yxt-as-ui/src/views/workFlow/suopeikaipiaoFlow/claimbillingEdit.vue
  43. 99
      yxt-as-ui/src/views/workFlow/suopeikaipiaoFlow/claimbillingYiBan.vue
  44. 3
      yxt-as/src/main/java/com/yxt/anrui/as/api/asbillsettelapply/AsBillSettelApplyDetailsVo.java
  45. 1
      yxt-as/src/main/java/com/yxt/anrui/as/api/asbusclaimbill/AsBusclaimBill.java
  46. 9
      yxt-as/src/main/java/com/yxt/anrui/as/biz/asbillsettelapply/AsBillSettelApplyService.java

5
anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basemanufacturer/BaseManufacturerFeign.java

@ -250,4 +250,9 @@ public interface BaseManufacturerFeign {
@GetMapping("/fetchByCode")
@ResponseBody
ResultBean<BaseManufacturerDetailsVo> fetchByCode(@RequestParam("supplierCode") String supplierCode);
@ApiOperation("根据sid查询供应商信息")
@GetMapping("/fetchBySid")
@ResponseBody
ResultBean<BaseManufacturer> fetchBySid(@RequestParam("sid") String sid);
}

5
anrui-base/anrui-base-api/src/main/java/com/yxt/anrui/base/api/basemanufacturer/BaseManufacturerFeignFallback.java

@ -160,4 +160,9 @@ public class BaseManufacturerFeignFallback implements BaseManufacturerFeign {
public ResultBean<BaseManufacturerDetailsVo> fetchByCode(String supplierCode) {
return null;
}
@Override
public ResultBean<BaseManufacturer> fetchBySid(String sid) {
return null;
}
}

7
anrui-base/anrui-base-biz/src/main/java/com/yxt/anrui/base/biz/basemanufacturer/BaseManufacturerRest.java

@ -252,4 +252,11 @@ public class BaseManufacturerRest implements BaseManufacturerFeign {
public ResultBean<BaseManufacturerDetailsVo> fetchByCode(String supplierCode) {
return baseManufacturerService.fetchByCode(supplierCode);
}
@Override
public ResultBean<BaseManufacturer> fetchBySid(String sid) {
ResultBean rb = ResultBean.fireFail();
BaseManufacturer baseManufacturer = baseManufacturerService.fetchBySid(sid);
return rb.success().setData(baseManufacturer);
}
}

6
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/BusDeliveredApplyFeign.java

@ -26,7 +26,6 @@
package com.yxt.anrui.buscenter.api.busdeliveredapply;
import com.yxt.anrui.buscenter.api.busdelivered.AppDeliveredDetailsVo;
import com.yxt.anrui.buscenter.api.bussalesorder.flowable.BusSalesOrderDelegateQuery;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
@ -35,7 +34,6 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.Valid;
import java.util.List;
@ -247,4 +245,8 @@ public interface BusDeliveredApplyFeign {
@ApiOperation("根据车辆sid和已办结流程状态查询是否为欠款出库")
@GetMapping("/selByVinSidAndYBJ/{vinSid}")
ResultBean<Integer> selByVinSidAndYBJ(@RequestParam("vinSid") String vinSid);
@ApiOperation("根据销售订单车辆sid查询客户sid")
@PostMapping("/selCustomerByBusVinSid")
ResultBean<String> selCustomerByBusVinSid(@RequestParam("busVinSid") String busVinSid);
}

5
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/busdeliveredapply/BusDeliveredApplyFeignFallback.java

@ -201,6 +201,11 @@ public class BusDeliveredApplyFeignFallback implements BusDeliveredApplyFeign {
return null;
}
@Override
public ResultBean<String> selCustomerByBusVinSid(String busVinSid) {
return null;
}
@Override
public ResultBean complete(BusDeliveredApplyCompleteDto query) {
return null;

11
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusOrderAndVehInfo.java

@ -0,0 +1,11 @@
package com.yxt.anrui.buscenter.api.bussalesordervehicle;
import lombok.Data;
@Data
public class BusOrderAndVehInfo {
private String busVinSid; //销售订单车辆sid
private String orderSid; //销售订单sid
private String deptSid;//销售部门sid
}

9
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusSalesOrderVehicleFeign.java

@ -33,7 +33,6 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.Max;
import java.util.List;
/**
@ -152,7 +151,7 @@ public interface BusSalesOrderVehicleFeign {
@ApiOperation("根据销售订单sid和贷款人sid和贷款合同sid查车辆信息")
@PostMapping("/selectListByOrderSidAndDkrSidAndLoanContractSid")
@ResponseBody
ResultBean<List<BusSalesOrderVehicle>> selectListByOrderSidAndDkrSidAndLoanContractSid(@RequestParam("saleOrderSid") String saleOrderSid, @RequestParam("borrowerSid") String borrowerSid,@RequestParam("loanContractSid") String loanContractSid);
ResultBean<List<BusSalesOrderVehicle>> selectListByOrderSidAndDkrSidAndLoanContractSid(@RequestParam("saleOrderSid") String saleOrderSid, @RequestParam("borrowerSid") String borrowerSid, @RequestParam("loanContractSid") String loanContractSid);
@ApiOperation("根据销售订单sid和消贷合同sid查车辆信息")
@ -180,7 +179,7 @@ public interface BusSalesOrderVehicleFeign {
@ApiOperation("根据订单sid车架号查询")
@GetMapping("/selByOrderSidAndVinNo")
ResultBean<BusSalesOrderVehicle> selByOrderSidAndVinNo(@RequestParam("salesOrderSid")String salesOrderSid, @RequestParam("vinNo")String vinNo);
ResultBean<BusSalesOrderVehicle> selByOrderSidAndVinNo(@RequestParam("salesOrderSid") String salesOrderSid, @RequestParam("vinNo") String vinNo);
@ApiOperation("批量保存")
@PostMapping("/saveList")
@ -189,4 +188,8 @@ public interface BusSalesOrderVehicleFeign {
@ApiOperation("批量修改")
@PostMapping("/updateVehiclesList")
ResultBean updateVehiclesList(@RequestBody List<BusSalesOrderVehicle> updateVehicles);
@ApiOperation("根据车架号后八位关联查询车辆及订单信息")
@PostMapping("/selVehOrderInfoByVinNo")
ResultBean<BusOrderAndVehInfo> selVehOrderInfoByVinNo(@RequestParam("vinNo") String vinNo);
}

5
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesordervehicle/BusSalesOrderVehicleFeignFallback.java

@ -188,4 +188,9 @@ public class BusSalesOrderVehicleFeignFallback implements BusSalesOrderVehicleFe
return null;
}
@Override
public ResultBean<BusOrderAndVehInfo> selVehOrderInfoByVinNo(String vinNo) {
return null;
}
}

2
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyMapper.java

@ -124,4 +124,6 @@ public interface BusDeliveredApplyMapper extends BaseMapper<BusDeliveredApply> {
int selectCountByVinSid(@Param("vinSid") String vinSid,@Param("contractNo") String contractNo);
int selByVinSidAndYBJ(String vinSid);
String selCustomerByBusVinSid(@Param("busVinSid") String busVinSid);
}

9
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyMapper.xml

@ -209,4 +209,13 @@
WHERE bdad.`vinSid` = #{vinSid}
AND bda.`nodeState` = '已办结'
</select>
<select id="selCustomerByBusVinSid" resultType="java.lang.String">
SELECT a.customerSid
FROM bus_delivered_apply_details as d
LEFT JOIN bus_delivered_apply as a ON d.applySid = a.sid
WHERE d.busVinSid = #{busVinSid}
AND a.nodeState = '已办结'
ORDER BY a.createTime DESC
LIMIT 1
</select>
</mapper>

7
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyRest.java

@ -272,6 +272,13 @@ public class BusDeliveredApplyRest implements BusDeliveredApplyFeign {
return busDeliveredApplyService.selByVinSidAndYBJ(vinSid);
}
@Override
public ResultBean<String> selCustomerByBusVinSid(String busVinSid) {
ResultBean rb = ResultBean.fireFail();
String customerSid = busDeliveredApplyService.selCustomerByBusVinSid(busVinSid);
return rb.success().setData(customerSid);
}
@Override
public ResultBean complete(BusDeliveredApplyCompleteDto query) {
BusinessVariables bv = new BusinessVariables();

4
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java

@ -4928,4 +4928,8 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
int i = baseMapper.selByVinSidAndYBJ(vinSid);
return rb.success().setData(i);
}
public String selCustomerByBusVinSid(String busVinSid) {
return baseMapper.selCustomerByBusVinSid(busVinSid);
}
}

2
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesordervehicle/BusSalesOrderVehicleMapper.java

@ -190,4 +190,6 @@ public interface BusSalesOrderVehicleMapper extends BaseMapper<BusSalesOrderVehi
int saveList(@Param("list") List<BusSalesOrderVehicle> list);
void updateVehiclesList(@Param("list") List<BusSalesOrderVehicle> list);
BusOrderAndVehInfo selVehOrderInfoByVinNo(@Param("vinNo") String vinNo);
}

14
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesordervehicle/BusSalesOrderVehicleMapper.xml

@ -420,4 +420,18 @@
where bv.`salesOrderSid` = #{salesOrderSid} and
bv.linkNo LIKE CONCAT( '%', #{vinNo}, '%' )
</select>
<select id="selVehOrderInfoByVinNo"
resultType="com.yxt.anrui.buscenter.api.bussalesordervehicle.BusOrderAndVehInfo">
SELECT
bv.sid busVinSid,
o.sid orderSid,
o.orgSid deptSid
FROM
bus_sales_order_vehicle bv
LEFT JOIN bus_sales_order as o ON bv.salesOrderSid = o.sid
WHERE
bv.linkNo LIKE CONCAT('%',#{vinNo}, '%' ) AND o.nodeState = '已办结'
ORDER BY o.createTime DESC
LIMIT 1
</select>
</mapper>

5
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesordervehicle/BusSalesOrderVehicleRest.java

@ -221,4 +221,9 @@ public class BusSalesOrderVehicleRest implements BusSalesOrderVehicleFeign {
busSalesOrderVehicleService.updateVehiclesList(updateVehicles);
return rb.success();
}
@Override
public ResultBean<BusOrderAndVehInfo> selVehOrderInfoByVinNo(String vinNo) {
return busSalesOrderVehicleService.selVehOrderInfoByVinNo(vinNo);
}
}

15
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesordervehicle/BusSalesOrderVehicleService.java

@ -29,26 +29,19 @@ import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.anrui.base.api.basepurchasesystem.BasePurchSystemVo;
import com.yxt.anrui.base.api.basetrailer.BaseTrailerDetailsVo;
import com.yxt.anrui.base.api.basetrailer.BaseTrailerFeign;
import com.yxt.anrui.base.api.basetrailer.TrailerVo;
import com.yxt.anrui.base.api.basetrailer.TraliveredVo;
import com.yxt.anrui.base.api.basevehicle.BaseVehicle;
import com.yxt.anrui.base.api.basevehicle.BaseVehicleFeign;
import com.yxt.anrui.base.api.basevehicle.BaseVehicleQKKPVo;
import com.yxt.anrui.base.api.basevehicleappendix.BaseVehicleAppendixFeign;
import com.yxt.anrui.base.api.basevehiclecertificate.BaseVehicleCertificateFeign;
import com.yxt.anrui.base.api.basevehiclecertificate.BaseVehicleCertificateVo;
import com.yxt.anrui.base.api.basevehiclestate.BaseVehicleState;
import com.yxt.anrui.base.api.basevehiclestate.BaseVehicleStateFeign;
import com.yxt.anrui.base.api.basevehicletempstate.BaseVehicleTempstate;
import com.yxt.anrui.base.api.basevehicletempstate.BaseVehicleTempstateFeign;
import com.yxt.anrui.base.api.commoncontract.ContractPageVo;
import com.yxt.anrui.base.common.enums.VehicleStateTempOrLast;
import com.yxt.anrui.buscenter.api.busarrearscarryvehicleapply.AdCarListVo;
import com.yxt.anrui.buscenter.api.busarrearscarryvehicleapply.BusArrearsCarryVehicleApply;
import com.yxt.anrui.buscenter.api.busarrearscarryvehicleapply.GCarListVo;
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrder;
import com.yxt.anrui.buscenter.api.bussalesorder.app.model.AppNowCarListVo;
import com.yxt.anrui.buscenter.api.bussalesorder.app.vin.VinListsVo;
import com.yxt.anrui.buscenter.api.bussalesordervehicle.*;
@ -71,7 +64,6 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* Project: anrui-buscenter(业务管理) <br/>
@ -682,4 +674,11 @@ public class BusSalesOrderVehicleService extends MybatisBaseService<BusSalesOrde
public void updateVehiclesList(List<BusSalesOrderVehicle> updateVehicles) {
baseMapper.updateVehiclesList(updateVehicles);
}
public ResultBean<BusOrderAndVehInfo> selVehOrderInfoByVinNo(String vinNo) {
ResultBean rb = ResultBean.fireFail();
BusOrderAndVehInfo busOrderAndVehInfo = baseMapper.selVehOrderInfoByVinNo(vinNo);
return rb.success().setData(busOrderAndVehInfo);
}
}

14
anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeign.java

@ -77,6 +77,20 @@ public interface FinKingDeeFeign {
@ResponseBody
ResultBean<String> saveRebatePrepareVoucher(@RequestBody @Valid GeneralVoucher voucher);
@ApiOperation("保存单车返利核对凭证")
@PostMapping("/saveRebateReviewVoucher")
@ResponseBody
ResultBean<String> saveRebateReviewVoucher(@RequestBody @Valid GeneralVoucher voucher);
@ApiOperation("保存专项返利预提凭证")
@PostMapping("/saveRebateSpecialVoucher")
@ResponseBody
ResultBean<String> saveRebateSpecialVoucher(@RequestBody @Valid GeneralVoucher voucher);
@ApiOperation("保存专项返利核对凭证")
@PostMapping("/saveRebateSpecialReviewVoucher")
@ResponseBody
ResultBean<String> saveRebateSpecialReviewVoucher(@RequestBody @Valid GeneralVoucher voucher);
//---------------------- 返利凭证 ---------------------------------
@ApiOperation("保存凭证的接口")

15
anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/FinKingDeeFeignFallBack.java

@ -53,6 +53,21 @@ implements FinKingDeeFeign{
return null;
}
@Override
public ResultBean<String> saveRebateReviewVoucher(@Valid GeneralVoucher voucher) {
return null;
}
@Override
public ResultBean<String> saveRebateSpecialVoucher(@Valid GeneralVoucher voucher) {
return null;
}
@Override
public ResultBean<String> saveRebateSpecialReviewVoucher(@Valid GeneralVoucher voucher) {
return null;
}
@Override
public ResultBean<String> saveVoucher(Voucher voucher) {
return null;

3
anrui-fin/anrui-fin-api/src/main/java/com/yxt/anrui/fin/api/kingdee/voucher/GeneralVoucher.java

@ -21,12 +21,15 @@ public class GeneralVoucher {
@ApiModelProperty("分公司编码")
@NotBlank(message = "分公司编码不能为空")
public String useOrgCode;
@ApiModelProperty("业务日期")
public String bussDate;
@ApiModelProperty("凭证明细")
public List<GeneralVoucher.GeneralVoucherDetail> voucherDetails;
@Data
public static class GeneralVoucherDetail {
public String timeFlag; //应用于资金占用费计提凭证摘要标识 0代表上月 1代表本月
public String type;
@ApiModelProperty("场景编码")
public String sceneCode;
@ApiModelProperty("资方简称")

274
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/kingdee/FinKingDeeFeignRest.java

@ -239,13 +239,16 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign {
newVoucher.setAccountBook(voucher.getUseOrgCode());
newVoucher.setVoucherNo(voucher.getUseOrgCode());
}
if (StringUtils.isNotBlank(voucher.getBussDate())) {
newVoucher.setBussDate(voucher.getBussDate());
}
List<GeneralVoucher.GeneralVoucherDetail> voucherDetails = voucher.getVoucherDetails();
if (!voucherDetails.isEmpty()) {
for (GeneralVoucher.GeneralVoucherDetail voucherDetail : voucherDetails) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto(); //借方
Voucher.VoucherResultDetailDto dto2 = new Voucher.VoucherResultDetailDto(); //贷方
dto1.setSummary(voucherDetail.getTimeFlag() + "单车返利预提预留费用");
dto2.setSummary(voucherDetail.getTimeFlag() + "单车返利预提预留费用");
dto1.setSummary(voucherDetail.getTimeFlag() + "单车返利预提预留费用");
dto2.setSummary(voucherDetail.getTimeFlag() + "单车返利预提预留费用");
if (voucherDetail.getSceneCode().equals("上年")) {
dto1.setSubjectNo("1161.02.15");
} else if (voucherDetail.getSceneCode().equals("本年")) {
@ -266,6 +269,273 @@ public class FinKingDeeFeignRest implements FinKingDeeFeign {
return voucherService.saveVoucher(newVoucher);
}
@Override
public ResultBean<String> saveRebateReviewVoucher(@Valid GeneralVoucher voucher) {
ResultBean rb = ResultBean.fireFail();
Voucher newVoucher = new Voucher();
List<Voucher.VoucherResultDetailDto> resultDetails = new ArrayList<>();
if (StringUtils.isNotBlank(voucher.getUseOrgCode())) {
newVoucher.setAccountBook(voucher.getUseOrgCode());
newVoucher.setVoucherNo(voucher.getUseOrgCode());
}
if (StringUtils.isNotBlank(voucher.getBussDate())) {
newVoucher.setBussDate(voucher.getBussDate());
}
List<GeneralVoucher.GeneralVoucherDetail> voucherDetails = voucher.getVoucherDetails();
if (!voucherDetails.isEmpty()) {
for (GeneralVoucher.GeneralVoucherDetail voucherDetail : voucherDetails) {
if (voucherDetail.getRemarks().equals("金融贴息")) {
if (voucherDetail.getSceneCode().equals("1161.01.16")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "金融贴息上传");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setManufacturer(voucherDetail.getManufacturer());
dto1.setDebit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
if (voucherDetail.getSceneCode().equals("1161.02.19") || voucherDetail.getSceneCode().equals("1161.01.19")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "金融贴息上传");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setManufacturer(voucherDetail.getManufacturer());
dto1.setDimensionCustom(voucherDetail.getCustomerCode());
dto1.setMaterial(voucherDetail.getMaterial());
dto1.setCredit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
}
if (voucherDetail.getRemarks().equals("返利上传")) {
if (voucherDetail.getSceneCode().equals("1161.01.16")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "单车返利上传");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setManufacturer(voucherDetail.getManufacturer());
dto1.setDebit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
if (voucherDetail.getSceneCode().equals("1161.02.15") ||
voucherDetail.getSceneCode().equals("1161.01.15") ||
voucherDetail.getSceneCode().equals("1161.04.00")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "单车返利上传");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setManufacturer(voucherDetail.getManufacturer());
dto1.setCredit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
}
if (voucherDetail.getRemarks().equals("预留费用调整")) {
if (voucherDetail.getSceneCode().equals("1161.02.15") || voucherDetail.getSceneCode().equals("1161.01.15")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "返利上传预留费用调整");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setManufacturer(voucherDetail.getManufacturer());
dto1.setDebit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
if (voucherDetail.getSceneCode().equals("2181.07.00")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "返利上传预留费用调整");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionCustom(voucherDetail.getCustomerCode());
dto1.setCredit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
}
}
newVoucher.setResultDetails(resultDetails);
}
log.info("FinKingDeeFeignRest-saveVoucher:{}", JSONObject.toJSONString(newVoucher));
return voucherService.saveVoucher(newVoucher);
}
@Override
public ResultBean<String> saveRebateSpecialVoucher(@Valid GeneralVoucher voucher) {
ResultBean rb = ResultBean.fireFail();
Voucher newVoucher = new Voucher();
List<Voucher.VoucherResultDetailDto> resultDetails = new ArrayList<>();
if (StringUtils.isNotBlank(voucher.getUseOrgCode())) {
newVoucher.setAccountBook(voucher.getUseOrgCode());
newVoucher.setVoucherNo(voucher.getUseOrgCode());
}
if (StringUtils.isNotBlank(voucher.getBussDate())) {
newVoucher.setBussDate(voucher.getBussDate());
}
List<GeneralVoucher.GeneralVoucherDetail> voucherDetails = voucher.getVoucherDetails();
if (!voucherDetails.isEmpty()) {
for (GeneralVoucher.GeneralVoucherDetail voucherDetail : voucherDetails) {
if (voucherDetail.getSceneCode().equals("1161.02.15") || voucherDetail.getSceneCode().equals("1161.01.15")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利预提");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setManufacturer(voucherDetail.getManufacturer());
dto1.setDebit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
if (voucherDetail.getSceneCode().equals("6401.13")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利预提");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setDebit("-" + voucherDetail.getAmount().toString());
resultDetails.add(dto1);
}
if (voucherDetail.getSceneCode().equals("2181.07.00")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利预提");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionCustom(voucherDetail.getCustomerCode());
dto1.setCredit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
}
newVoucher.setResultDetails(resultDetails);
}
log.info("FinKingDeeFeignRest-saveVoucher:{}", JSONObject.toJSONString(newVoucher));
return voucherService.saveVoucher(newVoucher);
}
@Override
public ResultBean<String> saveRebateSpecialReviewVoucher(@Valid GeneralVoucher voucher) {
ResultBean rb = ResultBean.fireFail();
Voucher newVoucher = new Voucher();
List<Voucher.VoucherResultDetailDto> resultDetails = new ArrayList<>();
if (StringUtils.isNotBlank(voucher.getUseOrgCode())) {
newVoucher.setAccountBook(voucher.getUseOrgCode());
newVoucher.setVoucherNo(voucher.getUseOrgCode());
}
if (StringUtils.isNotBlank(voucher.getBussDate())) {
newVoucher.setBussDate(voucher.getBussDate());
}
List<GeneralVoucher.GeneralVoucherDetail> voucherDetails = voucher.getVoucherDetails();
if (!voucherDetails.isEmpty()) {
for (GeneralVoucher.GeneralVoucherDetail voucherDetail : voucherDetails) {
if (!voucherDetail.getType().equals("行销活动")) {
if (voucherDetail.getRemarks().equals("返利上传")) {
if (voucherDetail.getSceneCode().equals("1161.01.16")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利上传");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setManufacturer(voucherDetail.getManufacturer());
dto1.setDebit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
if (voucherDetail.getSceneCode().equals("1161.02.15") ||
voucherDetail.getSceneCode().equals("1161.01.15") ||
voucherDetail.getSceneCode().equals("1161.04.00")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利上传");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setManufacturer(voucherDetail.getManufacturer());
dto1.setCredit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
}
if (voucherDetail.getRemarks().equals("返利调整")) {
if (voucherDetail.getSceneCode().equals("1161.02.15") || voucherDetail.getSceneCode().equals("1161.01.15")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利调整");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setManufacturer(voucherDetail.getManufacturer());
dto1.setDebit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
if (voucherDetail.getSceneCode().equals("6401.13")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利调整");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setDebit("-" + String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
if (voucherDetail.getSceneCode().equals("2181.07.00")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利调整");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionCustom(voucherDetail.getCustomerCode());
dto1.setCredit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
}
} else {
if (voucherDetail.getRemarks().equals("返利上传")) {
if (voucherDetail.getSceneCode().equals("1161.01.16")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "行销返利上传");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setManufacturer(voucherDetail.getManufacturer());
dto1.setDebit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
if (voucherDetail.getSceneCode().equals("2181.07.00")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "行销返利上传");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionCustom(voucherDetail.getCustomerCode());
dto1.setCredit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
if (voucherDetail.getSceneCode().equals("1161.03.00") ||
voucherDetail.getSceneCode().equals("1161.04.00")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "行销返利上传");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setManufacturer(voucherDetail.getManufacturer());
dto1.setCredit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
if (voucherDetail.getSceneCode().equals("6401.14")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "行销返利上传");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setCredit("-"+String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
}
if (voucherDetail.getRemarks().equals("返利调整")) {
if (voucherDetail.getSceneCode().equals("1161.03.00")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利调整");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setManufacturer(voucherDetail.getManufacturer());
dto1.setDebit(String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
if (voucherDetail.getSceneCode().equals("6401.14")) {
Voucher.VoucherResultDetailDto dto1 = new Voucher.VoucherResultDetailDto();
dto1.setSummary(voucherDetail.getTimeFlag() + "专项返利调整");
dto1.setSubjectNo(voucherDetail.getSceneCode());
dto1.setDimensionDept(voucherDetail.getDeptCode());
dto1.setDebit("-" + String.valueOf(voucherDetail.getAmount()));
resultDetails.add(dto1);
}
}
}
}
newVoucher.setResultDetails(resultDetails);
}
log.info("FinKingDeeFeignRest-saveVoucher:{}", JSONObject.toJSONString(newVoucher));
return voucherService.saveVoucher(newVoucher);
}
@Override
public ResultBean<String> saveVoucher(Voucher voucher) {
log.info("FinKingDeeFeignRest-saveVoucher:{}", JSONObject.toJSONString(voucher));

6
anrui-scm/anrui-scm-biz/pom.xml

@ -83,7 +83,11 @@
<artifactId>message-center-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<artifactId>anrui-crm-api</artifactId>
<groupId>com.yxt.anrui</groupId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>

2
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/AnruiScmApplication.java

@ -50,7 +50,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
})
@EnableFeignClients(basePackages = {"com.yxt.anrui.buscenter",
"com.yxt.anrui.portal","com.yxt.anrui.flowable","com.yxt.anrui.base"
,"com.yxt.anrui.fin","com.yxt.messagecenter"})
,"com.yxt.anrui.fin","com.yxt.messagecenter", "com.yxt.anrui.crm"})
public class AnruiScmApplication {
public static void main(String[] args) {

481
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmspecialrebatecheckapply/ScmSpecialrebateCheckapplyService.java

@ -26,10 +26,15 @@
package com.yxt.anrui.scm.biz.scmspecialrebatecheckapply;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.anrui.base.api.basemanufacturer.BaseManufacturer;
import com.yxt.anrui.base.api.basemanufacturer.BaseManufacturerFeign;
import com.yxt.anrui.base.api.basevehiclebrand.BaseVehicleBrand;
import com.yxt.anrui.base.api.basevehiclebrand.BaseVehicleBrandFeign;
import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign;
import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher;
import com.yxt.anrui.flowable.api.flow.FlowableFeign;
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo;
import com.yxt.anrui.flowable.api.flow2.FlowDelegateQuery;
@ -37,6 +42,8 @@ import com.yxt.anrui.flowable.api.flow2.FlowFeign;
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign;
import com.yxt.anrui.flowable.api.utils.ProcDefEnum;
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign;
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery;
@ -44,41 +51,43 @@ import com.yxt.anrui.portal.api.sysuser.SysUserFeign;
import com.yxt.anrui.portal.api.sysuser.SysUserVo;
import com.yxt.anrui.scm.api.flow.FlowTaskVo;
import com.yxt.anrui.scm.api.scmspecialrebate.ScmSpecialRebate;
import com.yxt.anrui.scm.api.scmspecialrebate.ScmSpecialRebateVo;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.*;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.flow.GetNodeQuery;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.flow.GetNodeVo;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.flow.ScmSpecialRebateCheckApplyDelegateQuery;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.flow.SubmitScmSpecialRebateCheckApplyDto;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapplydetail.ScmSpecialrebateCheckapplydetail;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapplydetail.ScmSpecialrebateCheckapplydetailDetailsVo;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapplydetail.ScmSpecialrebateCheckapplydetailDto;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapplydetail.ScmSpecialrebateCheckapplydetailVo;
import com.yxt.anrui.scm.api.scmvehrebate.ScmVehRebate;
import com.yxt.anrui.scm.api.scmvehrebatecheckapplydetail.ScmVehrebateCheckapplydetailVo;
import com.yxt.anrui.scm.biz.scmspecialrebate.ScmSpecialRebateService;
import com.yxt.anrui.scm.biz.scmspecialrebatecheckapplydetail.ScmSpecialrebateCheckapplydetailService;
import org.apache.commons.lang3.StringUtils;
import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.ScmSpecialrebateCheckapply;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.ScmSpecialrebateCheckapplyQuery;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.ScmSpecialrebateCheckapplyVo;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.ScmSpecialrebateCheckapplyDetailsVo;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.ScmSpecialrebateCheckapplyDto;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class ScmSpecialrebateCheckapplyService extends MybatisBaseService<ScmSpecialrebateCheckapplyMapper, ScmSpecialrebateCheckapply> {
@Autowired
private FinKingDeeFeign finKingDeeFeign;
@Autowired
private BaseVehicleBrandFeign baseVehicleBrandFeign;
@Autowired
private BaseManufacturerFeign baseManufacturerFeign;
@Autowired
private SysOrganizationFeign sysOrganizationFeign;
@Autowired
private ScmSpecialrebateCheckapplydetailService scmSpecialrebateCheckapplydetailService;
@Autowired
@ -380,6 +389,452 @@ public class ScmSpecialrebateCheckapplyService extends MybatisBaseService<ScmSpe
return baseMapper.updateFlowFiled(beanToMap);
}
/**
* 推送单车返利核对凭证
*
* @param sid,tag (0代表核对申请通过推送1代表重推功能)
*/
public void pushSpecialRebateWithVoucher(String sid, String tag) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
int month = calendar.get(Calendar.MONTH);
calendar.set(Calendar.MONTH, month - 1);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
Date endTime = calendar.getTime();//上个月最后一天
String format = sdf.format(endTime);
String summaryTag = "";//摘要前缀
ScmSpecialrebateCheckapply entity = fetchBySid(sid);
if (null != entity) {
if (StringUtils.isNotBlank(entity.getCheckApply())) {
summaryTag = entity.getCheckApply();
}
}
List<ScmSpecialRebate> scmVehRebates = new ArrayList<>();
List<ScmSpecialrebateCheckapplydetailVo> scmVehrebateCheckapplydetailVos = scmSpecialrebateCheckapplydetailService.selByMainSid(sid);
if (!scmVehrebateCheckapplydetailVos.isEmpty()) {
for (ScmSpecialrebateCheckapplydetailVo s : scmVehrebateCheckapplydetailVos) {
ScmSpecialRebate v = scmSpecialRebateService.fetchBySid(s.getSpecialRebateSid());
if (null != v) {
scmVehRebates.add(v);
}
}
}
//按照采购系统分组
if (!scmVehRebates.isEmpty()) {
Map<String, List<ScmSpecialRebate>> map = scmVehRebates.stream().collect(Collectors.groupingBy(ScmSpecialRebate::getPurchaseSystemSid));
String finalSummaryTag = summaryTag;
String[] split = finalSummaryTag.split("年");
String y1 = split[0]; //预提申请标题年份
map.forEach((k, v) -> {
List<ScmSpecialRebate> rebates = v;
GeneralVoucher generalVoucher = new GeneralVoucher();
generalVoucher.setBussDate(format);
List<GeneralVoucher.GeneralVoucherDetail> voucherDetails = new ArrayList<>();
if (!v.isEmpty()) {
for (ScmSpecialRebate rebate : v) {
if (StringUtils.isNotBlank(rebate.getUseOrgSid())) {
String useOrgSid = rebate.getUseOrgSid();
SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(useOrgSid).getData();
if (null != organizationVo) {
generalVoucher.setUseOrgCode(organizationVo.getOrgCode());
}
}
String deptCode = "";//部门编码
String gysCode = "";//厂商编码
SysOrganizationVo data = sysOrganizationFeign.fetchBySid(rebate.getPurchaseSystemSid()).getData();
if (null != data) {
deptCode = data.getOrgCode();
}
if (StringUtils.isNotBlank(rebate.getBrandSid())) {
String brandSid = rebate.getBrandSid();
BaseVehicleBrand baseVehicleBrand = baseVehicleBrandFeign.fetchBySid(brandSid);
if (null != baseVehicleBrand) {
String manufacturerSid = baseVehicleBrand.getManufacturerSid();
if (StringUtils.isNotBlank(manufacturerSid)) {
BaseManufacturer baseManufacturer = baseManufacturerFeign.fetchBySid(manufacturerSid).getData();
if (null != baseManufacturer) {
gysCode = baseManufacturer.getManufacturerCode();
}
}
}
}
if (!rebate.getRebateTypeValue().equals("行销活动")) {
if (rebate.getOnceCheckState().intValue() == 0 || tag.equals("1")) {
//没有进行过核对申请
BigDecimal oneMoney = BigDecimal.ZERO;//一次上传金额
BigDecimal yicifanli = BigDecimal.ZERO;//一次应收返利返利
BigDecimal yicididing = BigDecimal.ZERO;//一次抵顶费用
BigDecimal yizhichufeiyong = BigDecimal.ZERO;//一次支出费用
BigDecimal feiyong = BigDecimal.ZERO;//一次合计费用
if (StringUtils.isNotBlank(rebate.getUploadMoney())) {
oneMoney = new BigDecimal(rebate.getUploadMoney());
if (oneMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setType("非行销");
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setSceneCode("1161.01.16");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(oneMoney);
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
}
if (null != rebate.getOnceItureCost()) {
yizhichufeiyong = rebate.getOnceItureCost();
}
if (null != rebate.getOnceSuppCost()) {
yicididing = rebate.getOnceSuppCost();
}
yicifanli = oneMoney.subtract(yicididing).subtract(yizhichufeiyong);
if (yicifanli.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setType("非行销");
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(yicifanli);
String palceGenDate = rebate.getPalceGenDate();
String[] palceGenDateSplit = palceGenDate.split("-");
String y2 = palceGenDateSplit[0];//所属年份
if (y1.equals(y2)) {
voucherDetail.setSceneCode("1161.01.15");
} else {
voucherDetail.setSceneCode("1161.02.15");
}
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
feiyong = yizhichufeiyong.add(yicididing);
if (feiyong.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setType("非行销");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(feiyong);
voucherDetail.setSceneCode("1161.04.00");
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
}
BigDecimal twoMoney = BigDecimal.ZERO;//二次次上传金额
BigDecimal ercifanli = BigDecimal.ZERO;//二次应收返利返利
BigDecimal ercididing = BigDecimal.ZERO;//二次抵顶费用
BigDecimal erzhichufeiyong = BigDecimal.ZERO;//一次支出费用
BigDecimal erfeiyong = BigDecimal.ZERO;//二次合计费用
if (StringUtils.isNotBlank(rebate.getSecondaryUploadMoney())) {
twoMoney = new BigDecimal(rebate.getSecondaryUploadMoney());
if (twoMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setType("非行销");
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setSceneCode("1161.01.16");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(twoMoney);
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
}
if (null != rebate.getSecondItureCost()) {
erzhichufeiyong = rebate.getSecondItureCost();
}
if (null != rebate.getSecondSuppCost()) {
ercididing = rebate.getSecondSuppCost();
}
ercifanli = twoMoney.subtract(ercididing).subtract(erzhichufeiyong);
if (ercifanli.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setType("非行销");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(ercifanli);
String palceGenDate = rebate.getPalceGenDate();
String[] palceGenDateSplit = palceGenDate.split("-");
String y2 = palceGenDateSplit[0];//所属年份
if (y1.equals(y2)) {
voucherDetail.setSceneCode("1161.01.15");
} else {
voucherDetail.setSceneCode("1161.02.15");
}
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
erfeiyong = erzhichufeiyong.add(ercididing);
if (ercididing.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setType("非行销");
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(erfeiyong);
voucherDetail.setSceneCode("1161.04.00");
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
//确认调整时
if (StringUtils.isNotBlank(rebate.getIsAdjustment())) {
if (rebate.getIsAdjustment().equals("是")) {
BigDecimal adMoney = BigDecimal.ZERO;//返利差额
BigDecimal daizhifuchaMoney = BigDecimal.ZERO;//待支付差额
BigDecimal yingshouMoney = BigDecimal.ZERO;//应收返利
if (StringUtils.isNotBlank(rebate.getAdjustmentMoney())) {
adMoney = new BigDecimal(rebate.getAdjustmentMoney());
}
if (null != rebate.getOnceTreatCost()) {
daizhifuchaMoney = daizhifuchaMoney.add(rebate.getOnceTreatCost());
}
if (null != rebate.getSecondTreatCost()) {
daizhifuchaMoney = daizhifuchaMoney.add(rebate.getSecondTreatCost());
}
if (null != rebate.getExpectTreatCost()) {
daizhifuchaMoney = daizhifuchaMoney.subtract(rebate.getExpectTreatCost());
}
yingshouMoney = adMoney.add(daizhifuchaMoney);
if (yingshouMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail1 = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail1.setType("非行销");
voucherDetail1.setTimeFlag(finalSummaryTag);
voucherDetail1.setDeptCode(deptCode); //部门编码赋值
voucherDetail1.setManufacturer(gysCode);
voucherDetail1.setAmount(yingshouMoney);
String palceGenDate = rebate.getPalceGenDate();
String[] palceGenDateSplit = palceGenDate.split("-");
String y2 = palceGenDateSplit[0];//所属年份
if (y1.equals(y2)) {
voucherDetail1.setSceneCode("1161.01.15");
} else {
voucherDetail1.setSceneCode("1161.02.15");
}
voucherDetail1.setRemarks("返利调整");
voucherDetails.add(voucherDetail1);
}
if (adMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail1 = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail1.setType("非行销");
voucherDetail1.setTimeFlag(finalSummaryTag);
voucherDetail1.setDeptCode(deptCode); //部门编码赋值
voucherDetail1.setAmount(adMoney);
voucherDetail1.setSceneCode("6401.13");
voucherDetail1.setRemarks("返利调整");
voucherDetails.add(voucherDetail1);
}
if (daizhifuchaMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail2 = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail2.setTimeFlag(finalSummaryTag);
voucherDetail2.setType("非行销");
voucherDetail2.setCustomerCode("DZFCJFL"); //客户编码
voucherDetail2.setAmount(daizhifuchaMoney);
voucherDetail2.setSceneCode("2181.07.00");
voucherDetail2.setRemarks("返利调整");
voucherDetails.add(voucherDetail2);
}
}
}
} else {
if (rebate.getOnceCheckState().intValue() == 0 || tag.equals("1")) {
//没有进行过核对申请
BigDecimal oneMoney = BigDecimal.ZERO;//一次上传金额
BigDecimal yicidaizhifu = BigDecimal.ZERO;//一次待支付金额
BigDecimal yicididing = BigDecimal.ZERO;//一次抵顶费用
BigDecimal yizhichufeiyong = BigDecimal.ZERO;//一次支出费用
BigDecimal feiyong = BigDecimal.ZERO;//一次合计费用
if (StringUtils.isNotBlank(rebate.getUploadMoney())) {
oneMoney = new BigDecimal(rebate.getUploadMoney());
}
if (null != rebate.getOnceItureCost()) {
yizhichufeiyong = rebate.getOnceItureCost();
}
if (null != rebate.getOnceSuppCost()) {
yicididing = rebate.getOnceSuppCost();
}
if (null != rebate.getOnceTreatCost()) {
yicidaizhifu = rebate.getOnceTreatCost();
}
feiyong = oneMoney.subtract(yicidaizhifu).subtract(yizhichufeiyong).subtract(yicididing);
if (oneMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setType("行销活动");
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setSceneCode("1161.01.16");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(oneMoney);
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
if (yicidaizhifu.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setType("行销活动");
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setCustomerCode("DZFCJFL");
voucherDetail.setSceneCode("2181.07.00");
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(yicidaizhifu);
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
if (yizhichufeiyong.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setType("行销活动");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(yizhichufeiyong);
voucherDetail.setSceneCode("1161.03.00");
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
if (yicididing.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setType("行销活动");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(yicididing);
voucherDetail.setSceneCode("1161.04.00");
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
if (feiyong.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setType("行销活动");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setAmount(feiyong);
voucherDetail.setSceneCode("6401.14");
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
}
BigDecimal twoMoney = BigDecimal.ZERO;//二次上传金额
BigDecimal ercidaizhifu = BigDecimal.ZERO;//二次待支付金额
BigDecimal ercididing = BigDecimal.ZERO;//二次抵顶费用
BigDecimal erzhichufeiyong = BigDecimal.ZERO;//二次支出费用
BigDecimal erfeiyong = BigDecimal.ZERO;//二次合计费用
if (StringUtils.isNotBlank(rebate.getSecondaryUploadMoney())) {
twoMoney = new BigDecimal(rebate.getSecondaryUploadMoney());
}
if (null != rebate.getSecondItureCost()) {
erzhichufeiyong = rebate.getSecondItureCost();
}
if (null != rebate.getSecondSuppCost()) {
ercididing = rebate.getSecondSuppCost();
}
if (null != rebate.getSecondTreatCost()) {
ercidaizhifu = rebate.getSecondTreatCost();
}
erfeiyong = twoMoney.subtract(ercidaizhifu).subtract(erzhichufeiyong).subtract(ercididing);
if (twoMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setType("行销活动");
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setSceneCode("1161.01.16");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(twoMoney);
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
if (ercidaizhifu.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setType("行销活动");
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setCustomerCode("DZFCJFL");
voucherDetail.setSceneCode("2181.07.00");
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(ercidaizhifu);
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
if (erzhichufeiyong.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setType("行销活动");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(erzhichufeiyong);
voucherDetail.setSceneCode("1161.03.00");
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
if (ercididing.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setType("行销活动");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(ercididing);
voucherDetail.setSceneCode("1161.04.00");
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
if (erfeiyong.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setType("行销活动");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setAmount(erfeiyong);
voucherDetail.setSceneCode("6401.14");
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
//确认调整时
if (StringUtils.isNotBlank(rebate.getIsAdjustment())) {
if (rebate.getIsAdjustment().equals("是")) {
BigDecimal daizhifuchaMoney = BigDecimal.ZERO;//待支付差额
if (null != rebate.getOnceItureCost()) {
daizhifuchaMoney = daizhifuchaMoney.add(rebate.getOnceItureCost());
}
if (null != rebate.getSecondItureCost()) {
daizhifuchaMoney = daizhifuchaMoney.add(rebate.getSecondItureCost());
}
if (null != rebate.getExpectItureCost()) {
daizhifuchaMoney = daizhifuchaMoney.subtract(rebate.getExpectItureCost());
}
if (daizhifuchaMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail1 = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail1.setTimeFlag(finalSummaryTag);
voucherDetail1.setType("行销活动");
voucherDetail1.setDeptCode(deptCode);
voucherDetail1.setManufacturer(gysCode);
voucherDetail1.setAmount(daizhifuchaMoney);
voucherDetail1.setSceneCode("1161.03.00");
voucherDetail1.setRemarks("返利调整");
voucherDetails.add(voucherDetail1);
GeneralVoucher.GeneralVoucherDetail voucherDetail2 = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail2.setTimeFlag(finalSummaryTag);
voucherDetail2.setType("行销活动");
voucherDetail2.setDeptCode(deptCode);
voucherDetail2.setAmount(daizhifuchaMoney);
voucherDetail2.setSceneCode("6401.14");
voucherDetail2.setRemarks("返利调整");
voucherDetails.add(voucherDetail2);
}
}
}
}
}
if (!voucherDetails.isEmpty()) {
generalVoucher.setVoucherDetails(voucherDetails);
finKingDeeFeign.saveRebateSpecialReviewVoucher(generalVoucher);
}
}
});
}
}
public ResultBean complete(BusinessVariables bv) {
ResultBean rb = ResultBean.fireFail();
ScmSpecialrebateCheckapply scmSpecialrebateCheckapply = fetchBySid(bv.getBusinessSid());
@ -401,6 +856,8 @@ public class ScmSpecialrebateCheckapplyService extends MybatisBaseService<ScmSpe
}
scmSpecialRebateService.updateOnceCheckState(scmSpecialrebateCheckapplydetailVo.getSpecialRebateSid(), 1);
}
pushSpecialRebateWithVoucher(bv.getBusinessSid(),"0");
}
return rb.success().setData(resultBean.getData());
} else {

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

@ -29,7 +29,12 @@ import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.api.R;
import com.yxt.anrui.base.api.basemanufacturer.BaseManufacturer;
import com.yxt.anrui.base.api.basemanufacturer.BaseManufacturerFeign;
import com.yxt.anrui.base.api.basevehiclebrand.BaseVehicleBrand;
import com.yxt.anrui.base.api.basevehiclebrand.BaseVehicleBrandFeign;
import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign;
import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher;
import com.yxt.anrui.flowable.api.flow.FlowableFeign;
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo;
import com.yxt.anrui.flowable.api.flow2.FlowDelegateQuery;
@ -37,38 +42,36 @@ import com.yxt.anrui.flowable.api.flow2.FlowFeign;
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign;
import com.yxt.anrui.flowable.api.utils.ProcDefEnum;
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign;
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery;
import com.yxt.anrui.portal.api.sysuser.SysUserFeign;
import com.yxt.anrui.portal.api.sysuser.SysUserVo;
import com.yxt.anrui.scm.api.flow.FlowTaskVo;
import com.yxt.anrui.scm.api.scmspecialrebatecheckapply.ScmSpecialrebateCheckapplyVo;
import com.yxt.anrui.scm.api.scmspecialrebate.ScmSpecialRebate;
import com.yxt.anrui.scm.api.scmspecialrebatewith.ScmSpecialRebateWith;
import com.yxt.anrui.scm.api.scmspecialrebatewith.ScmSpecialRebateWithDetailsVo;
import com.yxt.anrui.scm.api.scmspecialrebatewith.ScmSpecialRebateWithDto;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.*;
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.ScmSpecialRebateWithApplyDelegateQuery;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.flow.SubmitScmSpecialRebateWithApplyDto;
import com.yxt.anrui.scm.api.scmvehrebatewith.ScmVehRebateWithDetailsVo;
import com.yxt.anrui.scm.biz.scmspecialrebate.ScmSpecialRebateService;
import com.yxt.anrui.scm.biz.scmspecialrebatewith.ScmSpecialRebateWithService;
import org.apache.commons.lang3.StringUtils;
import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApply;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApplyQuery;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApplyVo;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApplyDetailsVo;
import com.yxt.anrui.scm.api.scmspecialrebatewithapply.ScmSpecialRebateWithApplyDto;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -88,6 +91,14 @@ import java.util.stream.Collectors;
@Service
public class ScmSpecialRebateWithApplyService extends MybatisBaseService<ScmSpecialRebateWithApplyMapper, ScmSpecialRebateWithApply> {
@Autowired
private FinKingDeeFeign finKingDeeFeign;
@Autowired
private BaseVehicleBrandFeign baseVehicleBrandFeign;
@Autowired
private BaseManufacturerFeign baseManufacturerFeign;
@Autowired
private SysOrganizationFeign sysOrganizationFeign;
@Autowired
private ScmSpecialRebateWithService scmSpecialRebateWithService;
@Autowired
@ -377,6 +388,134 @@ public class ScmSpecialRebateWithApplyService extends MybatisBaseService<ScmSpec
return baseMapper.updateFlowFiled(beanToMap);
}
/**
* 推送专项返利预提凭证
* @param sid
*/
public void pushSpecialRebateWithVoucher(String sid) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance();
int month=calendar.get(Calendar.MONTH);
calendar.set(Calendar.MONTH, month-1);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
Date endTime = calendar.getTime();//上个月最后一天
String format = sdf.format(endTime);
String summaryTag = "";//摘要前缀
ScmSpecialRebateWithApply entity = fetchBySid(sid);
if (null != entity) {
if (StringUtils.isNotBlank(entity.getWithApply())) {
summaryTag = entity.getWithApply();
}
}
List<ScmSpecialRebate> scmVehRebates = new ArrayList<>();
List<String> vehRebateSids = scmSpecialRebateWithService.fetchSpecialReBateSidByMainSid(sid);
if (!vehRebateSids.isEmpty()) {
for (String s : vehRebateSids) {
ScmSpecialRebate v = scmSpecialRebateService.fetchBySid(s);
if (null != v) {
scmVehRebates.add(v);
}
}
}
//按照采购系统分组
if (!scmVehRebates.isEmpty()) {
Map<String, List<ScmSpecialRebate>> map = scmVehRebates.stream().collect(Collectors.groupingBy(ScmSpecialRebate::getPurchaseSystemSid));
String finalSummaryTag = summaryTag;
String[] split = finalSummaryTag.split("年");
String y1 = split[0]; //预提申请标题年份
map.forEach((k, v) -> {
List<ScmSpecialRebate> rebates = v;
GeneralVoucher generalVoucher = new GeneralVoucher();
generalVoucher.setBussDate(format);
List<GeneralVoucher.GeneralVoucherDetail> voucherDetails = new ArrayList<>();
if (!v.isEmpty()) {
for (ScmSpecialRebate rebate : v) {
if (!rebate.getRebateTypeValue().equals("行销活动")) {
if (StringUtils.isNotBlank(rebate.getUseOrgSid())) {
String useOrgSid = rebate.getUseOrgSid();
SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(useOrgSid).getData();
if (null != organizationVo) {
generalVoucher.setUseOrgCode(organizationVo.getOrgCode());
}
}
String deptCode = "";//部门编码
String gysCode = "";//厂商编码
SysOrganizationVo data = sysOrganizationFeign.fetchBySid(rebate.getPurchaseSystemSid()).getData();
if (null != data) {
deptCode = data.getOrgCode();
}
if (StringUtils.isNotBlank(rebate.getBrandSid())) {
String brandSid = rebate.getBrandSid();
BaseVehicleBrand baseVehicleBrand = baseVehicleBrandFeign.fetchBySid(brandSid);
if (null != baseVehicleBrand) {
String manufacturerSid = baseVehicleBrand.getManufacturerSid();
if (StringUtils.isNotBlank(manufacturerSid)) {
BaseManufacturer baseManufacturer = baseManufacturerFeign.fetchBySid(manufacturerSid).getData();
if (null != baseManufacturer) {
gysCode = baseManufacturer.getManufacturerCode();
}
}
}
}
BigDecimal fanliMoney = BigDecimal.ZERO;// 其中返利金额
BigDecimal daizhifuMoney = BigDecimal.ZERO;// 其中待支付金额
BigDecimal yingshouMoney = BigDecimal.ZERO;// 应收返利金额
if (StringUtils.isNotBlank(rebate.getEstimateRebate())) {
fanliMoney = new BigDecimal(rebate.getEstimateRebate());
}
if (null != rebate.getExpectTreatCost()) {
daizhifuMoney = rebate.getExpectTreatCost();
}
yingshouMoney = fanliMoney.add(daizhifuMoney);
if (yingshouMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
String palceGenDate = rebate.getPalceGenDate();
String[] palceGenDateSplit = palceGenDate.split("-");
String y2 = palceGenDateSplit[0];//所属年份
if (y1.equals(y2)) {
voucherDetail.setSceneCode("1161.01.15");
} else {
voucherDetail.setSceneCode("1161.02.15");
}
voucherDetail.setAmount(yingshouMoney);
voucherDetails.add(voucherDetail);
}
if (fanliMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setSceneCode("6401.13");
voucherDetail.setAmount(fanliMoney);
voucherDetails.add(voucherDetail);
}
if (daizhifuMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setSceneCode("2181.07.00");
voucherDetail.setCustomerCode("DZFCJFL");
voucherDetail.setAmount(daizhifuMoney);
voucherDetails.add(voucherDetail);
}
}
}
if (!voucherDetails.isEmpty()) {
generalVoucher.setVoucherDetails(voucherDetails);
finKingDeeFeign.saveRebateSpecialVoucher(generalVoucher);
}
}
});
}
}
public ResultBean complete(BusinessVariables bv) {
ResultBean rb = ResultBean.fireFail();
ScmSpecialRebateWithApply scmSpecialRebateWithApply = fetchBySid(bv.getBusinessSid());
@ -392,6 +531,7 @@ public class ScmSpecialRebateWithApplyService extends MybatisBaseService<ScmSpec
scmSpecialRebateService.updateState(specialRebateSid, 2);
scmSpecialRebateService.updateWithholdingDateBySid(specialRebateSid,scmSpecialRebateWithApply.getWithApply());
}
pushSpecialRebateWithVoucher(bv.getBusinessSid());
}
return rb.success().setData(resultBean.getData());
} else {

340
anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehrebatecheckapply/ScmVehrebateCheckapplyService.java

@ -26,10 +26,18 @@
package com.yxt.anrui.scm.biz.scmvehrebatecheckapply;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.anrui.base.api.basevehicle.BaseVehicle;
import com.yxt.anrui.base.api.basevehicle.BaseVehicleFeign;
import com.yxt.anrui.buscenter.api.busdeliveredapply.BusDeliveredApplyFeign;
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusOrderAndVehInfo;
import com.yxt.anrui.buscenter.api.bussalesordervehicle.BusSalesOrderVehicleFeign;
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTemp;
import com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempFeign;
import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign;
import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher;
import com.yxt.anrui.flowable.api.flow.FlowableFeign;
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo;
import com.yxt.anrui.flowable.api.flow2.FlowDelegateQuery;
@ -37,6 +45,8 @@ import com.yxt.anrui.flowable.api.flow2.FlowFeign;
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign;
import com.yxt.anrui.flowable.api.utils.ProcDefEnum;
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign;
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery;
@ -44,33 +54,27 @@ import com.yxt.anrui.portal.api.sysuser.SysUserFeign;
import com.yxt.anrui.portal.api.sysuser.SysUserVo;
import com.yxt.anrui.scm.api.flow.FlowTaskVo;
import com.yxt.anrui.scm.api.scmvehrebate.ScmVehRebate;
import com.yxt.anrui.scm.api.scmvehrebate.ScmVehRebateVo;
import com.yxt.anrui.scm.api.scmvehrebatecheckapply.*;
import com.yxt.anrui.scm.api.scmvehrebatecheckapply.flow.GetNodeQuery;
import com.yxt.anrui.scm.api.scmvehrebatecheckapply.flow.GetNodeVo;
import com.yxt.anrui.scm.api.scmvehrebatecheckapply.flow.ScmVehRebateCheckApplyDelegateQuery;
import com.yxt.anrui.scm.api.scmvehrebatecheckapply.flow.SubmitScmVehRebateCheckApplyDto;
import com.yxt.anrui.scm.api.scmvehrebatecheckapplydetail.ScmVehrebateCheckapplydetail;
import com.yxt.anrui.scm.api.scmvehrebatecheckapplydetail.ScmVehrebateCheckapplydetailDetailsVo;
import com.yxt.anrui.scm.api.scmvehrebatecheckapplydetail.ScmVehrebateCheckapplydetailDto;
import com.yxt.anrui.scm.api.scmvehrebatecheckapplydetail.ScmVehrebateCheckapplydetailVo;
import com.yxt.anrui.scm.biz.scmvehrebate.ScmVehRebateService;
import com.yxt.anrui.scm.biz.scmvehrebatecheckapplydetail.ScmVehrebateCheckapplydetailService;
import com.yxt.common.core.result.ResultBean;
import org.apache.commons.lang3.StringUtils;
import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapply;
import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapplyQuery;
import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapplyVo;
import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapplyDetailsVo;
import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapplyDto;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -90,6 +94,10 @@ import java.util.stream.Collectors;
@Service
public class ScmVehrebateCheckapplyService extends MybatisBaseService<ScmVehrebateCheckapplyMapper, ScmVehrebateCheckapply> {
@Autowired
private CrmCustomerTempFeign crmCustomerTempFeign;
@Autowired
private BusDeliveredApplyFeign busDeliveredApplyFeign;
@Autowired
ScmVehrebateCheckapplydetailService scmVehrebateCheckapplydetailService;
@Autowired
@ -104,7 +112,14 @@ public class ScmVehrebateCheckapplyService extends MybatisBaseService<ScmVehreba
private SysUserFeign sysUserFeign;
@Autowired
private FlowFeign flowFeign;
@Autowired
private SysOrganizationFeign sysOrganizationFeign;
@Autowired
private BaseVehicleFeign baseVehicleFeign;
@Autowired
private FinKingDeeFeign finKingDeeFeign;
@Autowired
private BusSalesOrderVehicleFeign busSalesOrderVehicleFeign;
public PagerVo<ScmVehrebateCheckapplyVo> listPageVo(PagerQuery<ScmVehrebateCheckapplyQuery> pq) {
ScmVehrebateCheckapplyQuery query = pq.getParams();
QueryWrapper<ScmVehrebateCheckapply> qw = new QueryWrapper<>();
@ -413,6 +428,8 @@ public class ScmVehrebateCheckapplyService extends MybatisBaseService<ScmVehreba
}
scmVehRebateService.updateOnceCheckState(scmVehrebateCheckapplydetailVo.getVehRebateSid(), 1);
}
pushVehRebateWithVoucher(bv.getBusinessSid(),"0"); //推送返利核对凭证
}
return rb.success().setData(resultBean.getData());
} else {
@ -420,6 +437,305 @@ public class ScmVehrebateCheckapplyService extends MybatisBaseService<ScmVehreba
}
}
/**
* 推送单车返利核对凭证
*
* @param sid,tag (0代表核对申请通过推送1代表重推功能)
*/
public void pushVehRebateWithVoucher(String sid, String tag) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = Calendar.getInstance();
int month = calendar.get(Calendar.MONTH);
calendar.set(Calendar.MONTH, month - 1);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
Date endTime = calendar.getTime();//上个月最后一天
String format = sdf.format(endTime);
String summaryTag = "";//摘要前缀
ScmVehrebateCheckapply entity = fetchBySid(sid);
if (null != entity) {
if (StringUtils.isNotBlank(entity.getCheckApply())) {
summaryTag = entity.getCheckApply();
}
}
List<ScmVehRebate> scmVehRebates = new ArrayList<>();
List<ScmVehrebateCheckapplydetailVo> scmVehrebateCheckapplydetailVos = scmVehrebateCheckapplydetailService.selByMainSid(sid);
if (!scmVehrebateCheckapplydetailVos.isEmpty()) {
for (ScmVehrebateCheckapplydetailVo s : scmVehrebateCheckapplydetailVos) {
ScmVehRebate v = scmVehRebateService.fetchBySid(s.getVehRebateSid());
if (null != v) {
scmVehRebates.add(v);
}
}
}
//按照采购系统分组
if (!scmVehRebates.isEmpty()) {
Map<String, List<ScmVehRebate>> map = scmVehRebates.stream().collect(Collectors.groupingBy(ScmVehRebate::getPurchaseSystemSid));
String finalSummaryTag = summaryTag;
String[] split = finalSummaryTag.split("年");
String y1 = split[0]; //预提申请标题年份
map.forEach((k, v) -> {
List<ScmVehRebate> rebates = v;
GeneralVoucher generalVoucher = new GeneralVoucher();
generalVoucher.setBussDate(format);
List<GeneralVoucher.GeneralVoucherDetail> voucherDetails = new ArrayList<>();
if (!v.isEmpty()) {
for (ScmVehRebate rebate : v) {
String deptCode = ""; //采购系统部门编码
String salesDeptCode = ""; //销售部门编码
String customerCode = ""; //出库单客户编码
String vinCode = ""; //物料
String gysCode = ""; //供应商
SysOrganizationVo data = sysOrganizationFeign.fetchBySid(rebate.getPurchaseSystemSid()).getData();
if (null != data) {
deptCode = data.getOrgCode();
}
BaseVehicle vehicle = baseVehicleFeign.fetchBySid(rebate.getVehSid()).getData();
if (null != vehicle) {
if (StringUtils.isNotBlank(vehicle.getManufacturerCode())) {
gysCode = vehicle.getManufacturerCode();
}
vinCode = vehicle.getVinNo().substring(vehicle.getVinNo().length() - 8);
}
BusOrderAndVehInfo vehInfo = busSalesOrderVehicleFeign.selVehOrderInfoByVinNo(vinCode).getData();
if (null != vehInfo) {
String deptSid = vehInfo.getDeptSid();
SysOrganizationVo salesData = sysOrganizationFeign.fetchBySid(deptSid).getData();
if (null != salesData) {
salesDeptCode = salesData.getOrgCode();
}
String busVinSid = vehInfo.getBusVinSid();
String customerSid = busDeliveredApplyFeign.selCustomerByBusVinSid(busVinSid).getData();
if (StringUtils.isNotBlank(customerSid)) {
CrmCustomerTemp customerTemp = crmCustomerTempFeign.fetchEntity(customerSid).getData();
if (null != customerTemp) {
customerCode = customerTemp.getCustomerNo();
}
}
}
if (StringUtils.isNotBlank(rebate.getUseOrgSid())) {
String useOrgSid = rebate.getUseOrgSid();
SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(useOrgSid).getData();
if (null != organizationVo) {
generalVoucher.setUseOrgCode(organizationVo.getOrgCode());
}
}
if (!rebate.getRebateTypeValue().equals("金融贴息")) {
if (rebate.getOnceCheckState().intValue() == 0 || tag.equals("1")) {
//没有进行过核对申请
BigDecimal oneMoney = BigDecimal.ZERO;//一次上传金额
BigDecimal yicifanli = BigDecimal.ZERO;//一次应收返利返利
BigDecimal yicididing = BigDecimal.ZERO;//一次抵顶费用
if (StringUtils.isNotBlank(rebate.getUploadMoney())) {
oneMoney = new BigDecimal(rebate.getUploadMoney());
if (oneMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setSceneCode("1161.01.16");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(oneMoney);
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
}
if (null != rebate.getOnceSuppCost()) {
yicididing = rebate.getOnceSuppCost();
}
yicifanli = oneMoney.subtract(yicididing);
if (yicifanli.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(yicifanli);
String palceGenDate = rebate.getPalceGenDate();
String[] palceGenDateSplit = palceGenDate.split("-");
String y2 = palceGenDateSplit[0];//所属年份
if (y1.equals(y2)) {
voucherDetail.setSceneCode("1161.01.15");
} else {
voucherDetail.setSceneCode("1161.02.15");
}
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
if (yicididing.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(yicididing);
voucherDetail.setSceneCode("1161.04.00");
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
}
BigDecimal twoMoney = BigDecimal.ZERO;//二次次上传金额
BigDecimal ercifanli = BigDecimal.ZERO;//二次应收返利返利
BigDecimal ercididing = BigDecimal.ZERO;//二次抵顶费用
if (StringUtils.isNotBlank(rebate.getSecondaryUploadMoney())) {
twoMoney = new BigDecimal(rebate.getSecondaryUploadMoney());
if (twoMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setSceneCode("1161.01.16");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(twoMoney);
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
}
if (null != rebate.getSecondSuppCost()) {
ercididing = rebate.getSecondSuppCost();
}
ercifanli = twoMoney.subtract(ercididing);
if (ercifanli.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(ercifanli);
String palceGenDate = rebate.getPalceGenDate();
String[] palceGenDateSplit = palceGenDate.split("-");
String y2 = palceGenDateSplit[0];//所属年份
if (y1.equals(y2)) {
voucherDetail.setSceneCode("1161.01.15");
} else {
voucherDetail.setSceneCode("1161.02.15");
}
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
if (ercididing.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(ercididing);
voucherDetail.setSceneCode("1161.04.00");
voucherDetail.setRemarks("返利上传");
voucherDetails.add(voucherDetail);
}
//确认调整时
if (StringUtils.isNotBlank(rebate.getIsAdjustment())) {
if (rebate.getIsAdjustment().equals("是")) {
if (StringUtils.isNotBlank(rebate.getAdjustmentMoney())) {
BigDecimal adMoney = new BigDecimal(rebate.getAdjustmentMoney());
if (adMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail1 = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail1.setTimeFlag(finalSummaryTag);
voucherDetail1.setDeptCode(deptCode); //部门编码赋值
voucherDetail1.setManufacturer(gysCode);
voucherDetail1.setAmount(adMoney);
String palceGenDate = rebate.getPalceGenDate();
String[] palceGenDateSplit = palceGenDate.split("-");
String y2 = palceGenDateSplit[0];//所属年份
if (y1.equals(y2)) {
voucherDetail1.setSceneCode("1161.01.15");
} else {
voucherDetail1.setSceneCode("1161.02.15");
}
voucherDetail1.setRemarks("预留费用调整");
voucherDetails.add(voucherDetail1);
GeneralVoucher.GeneralVoucherDetail voucherDetail2 = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail2.setTimeFlag(finalSummaryTag);
voucherDetail2.setCustomerCode("DZFCJFL"); //客户编码
voucherDetail2.setAmount(adMoney);
voucherDetail2.setSceneCode("1161.04.00");
voucherDetail2.setRemarks("预留费用调整");
voucherDetails.add(voucherDetail2);
}
}
}
}
} else {
if (rebate.getOnceCheckState().intValue() == 0 || tag.equals("1")) {
//没有进行过核对申请
BigDecimal oneMoney = BigDecimal.ZERO;//一次上传金额
if (StringUtils.isNotBlank(rebate.getUploadMoney())) {
oneMoney = new BigDecimal(rebate.getUploadMoney());
if (oneMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setSceneCode("1161.01.16");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(oneMoney);
voucherDetail.setRemarks("金融贴息");
voucherDetails.add(voucherDetail);
GeneralVoucher.GeneralVoucherDetail voucherDetail2 = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail2.setTimeFlag(finalSummaryTag);
voucherDetail2.setDeptCode(salesDeptCode); //部门编码赋值
voucherDetail2.setManufacturer(gysCode);
voucherDetail2.setCustomerCode(customerCode);
voucherDetail2.setMaterial(vinCode);
voucherDetail2.setAmount(oneMoney);
String palceGenDate = rebate.getPalceGenDate();
String[] palceGenDateSplit = palceGenDate.split("-");
String y2 = palceGenDateSplit[0];//所属年份
if (y1.equals(y2)) {
voucherDetail2.setSceneCode("1161.01.19");
} else {
voucherDetail2.setSceneCode("1161.02.19");
}
voucherDetail2.setRemarks("金融贴息");
voucherDetails.add(voucherDetail2);
}
}
}
BigDecimal twoMoney = BigDecimal.ZERO;//二次次上传金额
if (StringUtils.isNotBlank(rebate.getSecondaryUploadMoney())) {
twoMoney = new BigDecimal(rebate.getSecondaryUploadMoney());
if (twoMoney.compareTo(BigDecimal.ZERO) != 0) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail.setTimeFlag(finalSummaryTag);
voucherDetail.setSceneCode("1161.01.16");
voucherDetail.setDeptCode(deptCode); //部门编码赋值
voucherDetail.setManufacturer(gysCode);
voucherDetail.setAmount(twoMoney);
voucherDetail.setRemarks("金融贴息");
voucherDetails.add(voucherDetail);
GeneralVoucher.GeneralVoucherDetail voucherDetail2 = new GeneralVoucher.GeneralVoucherDetail();
voucherDetail2.setTimeFlag(finalSummaryTag);
voucherDetail2.setDeptCode(salesDeptCode); //部门编码赋值
voucherDetail2.setManufacturer(gysCode);
voucherDetail2.setCustomerCode(customerCode);
voucherDetail2.setMaterial(vinCode);
voucherDetail2.setAmount(twoMoney);
String palceGenDate = rebate.getPalceGenDate();
String[] palceGenDateSplit = palceGenDate.split("-");
String y2 = palceGenDateSplit[0];//所属年份
if (y1.equals(y2)) {
voucherDetail2.setSceneCode("1161.01.19");
} else {
voucherDetail2.setSceneCode("1161.02.19");
}
voucherDetail2.setRemarks("金融贴息");
voucherDetails.add(voucherDetail2);
}
}
}
}
if (!voucherDetails.isEmpty()) {
generalVoucher.setVoucherDetails(voucherDetails);
finKingDeeFeign.saveRebateReviewVoucher(generalVoucher);
}
}
});
}
}
public ResultBean revokeProcess(FlowTaskVo query) {
ResultBean rb = ResultBean.fireFail();
if (StringUtils.isBlank(query.getUserSid())) {

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

@ -29,6 +29,10 @@ import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yxt.anrui.base.api.basevehicle.BaseVehicle;
import com.yxt.anrui.base.api.basevehicle.BaseVehicleFeign;
import com.yxt.anrui.fin.api.kingdee.FinKingDeeFeign;
import com.yxt.anrui.fin.api.kingdee.voucher.GeneralVoucher;
import com.yxt.anrui.flowable.api.flow.FlowableFeign;
import com.yxt.anrui.flowable.api.flow.UpdateFlowFieldVo;
import com.yxt.anrui.flowable.api.flow2.FlowDelegateQuery;
@ -36,39 +40,36 @@ import com.yxt.anrui.flowable.api.flow2.FlowFeign;
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign;
import com.yxt.anrui.flowable.api.utils.ProcDefEnum;
import com.yxt.anrui.flowable.sqloperationsymbol.BusinessVariables;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign;
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg;
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign;
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery;
import com.yxt.anrui.portal.api.sysuser.SysUserFeign;
import com.yxt.anrui.portal.api.sysuser.SysUserVo;
import com.yxt.anrui.scm.api.flow.FlowTaskVo;
import com.yxt.anrui.scm.api.scmspecialrebatewith.ScmSpecialRebateWithDto;
import com.yxt.anrui.scm.api.scmvehrebatecheckapply.ScmVehrebateCheckapplyVo;
import com.yxt.anrui.scm.api.scmvehrebatecheckapplydetail.ScmVehrebateCheckapplydetailVo;
import com.yxt.anrui.scm.api.scmvehrebate.ScmVehRebate;
import com.yxt.anrui.scm.api.scmvehrebatewith.ScmVehRebateWith;
import com.yxt.anrui.scm.api.scmvehrebatewith.ScmVehRebateWithDetailsVo;
import com.yxt.anrui.scm.api.scmvehrebatewith.ScmVehRebateWithDto;
import com.yxt.anrui.scm.api.scmvehrebatewithapply.*;
import com.yxt.anrui.scm.api.scmvehrebatewithapply.flow.GetNodeQuery;
import com.yxt.anrui.scm.api.scmvehrebatewithapply.flow.GetNodeVo;
import com.yxt.anrui.scm.api.scmvehrebatewithapply.flow.ScmVehRebateWithApplyDelegateQuery;
import com.yxt.anrui.scm.api.scmvehrebatewithapply.flow.SubmitScmVehRebateWithApplyDto;
import com.yxt.anrui.scm.biz.scmvehrebate.ScmVehRebateService;
import com.yxt.anrui.scm.biz.scmvehrebatewith.ScmVehRebateWithService;
import com.yxt.common.core.result.ResultBean;
import org.apache.commons.lang3.StringUtils;
import com.yxt.common.base.service.MybatisBaseService;
import com.yxt.common.base.utils.PagerUtil;
import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApply;
import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyQuery;
import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyVo;
import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyDetailsVo;
import com.yxt.anrui.scm.api.scmvehrebatewithapply.ScmVehRebateWithApplyDto;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@ -102,7 +103,12 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService<ScmVehRebat
private SysUserFeign sysUserFeign;
@Autowired
private FlowFeign flowFeign;
@Autowired
private FinKingDeeFeign finKingDeeFeign;
@Autowired
private SysOrganizationFeign sysOrganizationFeign;
@Autowired
private BaseVehicleFeign baseVehicleFeign;
private QueryWrapper<ScmVehRebateWithApply> createQueryWrapper(ScmVehRebateWithApplyQuery query) {
// todo: 这里根据具体业务调整查询条件
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
@ -379,7 +385,87 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService<ScmVehRebat
* @param sid
*/
public void pushVehRebateWithVoucher(String sid) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance();
int month=calendar.get(Calendar.MONTH);
calendar.set(Calendar.MONTH, month-1);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
Date endTime = calendar.getTime();//上个月最后一天
String format = sdf.format(endTime);
String summaryTag = "";//摘要前缀
ScmVehRebateWithApply entity = fetchBySid(sid);
if (null != entity) {
if (StringUtils.isNotBlank(entity.getWithApply())) {
summaryTag = entity.getWithApply();
}
}
List<ScmVehRebate> scmVehRebates = new ArrayList<>();
List<String> vehRebateSids = scmVehRebateWithService.fetchVehReBateSidByMainSid(sid);
if (!vehRebateSids.isEmpty()) {
for (String s : vehRebateSids) {
ScmVehRebate v = scmVehRebateService.fetchBySid(s);
if (null != v) {
scmVehRebates.add(v);
}
}
}
//按照采购系统分组
if (!scmVehRebates.isEmpty()) {
Map<String, List<ScmVehRebate>> map = scmVehRebates.stream().collect(Collectors.groupingBy(ScmVehRebate::getPurchaseSystemSid));
String finalSummaryTag = summaryTag;
String[] split = finalSummaryTag.split("年");
String y1 = split[0]; //预提申请标题年份
map.forEach((k, v) -> {
List<ScmVehRebate> rebates = v;
GeneralVoucher generalVoucher = new GeneralVoucher();
generalVoucher.setBussDate(format);
List<GeneralVoucher.GeneralVoucherDetail> voucherDetails = new ArrayList<>();
if (!v.isEmpty()) {
for (ScmVehRebate rebate : v) {
if (!rebate.getRebateTypeValue().equals("金融贴息")) {
GeneralVoucher.GeneralVoucherDetail voucherDetail = new GeneralVoucher.GeneralVoucherDetail();
if (StringUtils.isNotBlank(rebate.getUseOrgSid())) {
String useOrgSid = rebate.getUseOrgSid();
SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(useOrgSid).getData();
if (null != organizationVo) {
generalVoucher.setUseOrgCode(organizationVo.getOrgCode());
}
}
voucherDetail.setTimeFlag(finalSummaryTag);
String palceGenDate = rebate.getPalceGenDate();
String[] palceGenDateSplit = palceGenDate.split("-");
String y2 = palceGenDateSplit[0];//所属年份
if (y1.equals(y2)) {
voucherDetail.setSceneCode("本年");
} else {
voucherDetail.setSceneCode("上年");
}
SysOrganizationVo data = sysOrganizationFeign.fetchBySid(rebate.getPurchaseSystemSid()).getData();
if (null != data) {
voucherDetail.setDeptCode(data.getOrgCode()); //部门编码赋值
}
BaseVehicle vehicle = baseVehicleFeign.fetchBySid(rebate.getVehSid()).getData();
if (null != vehicle) {
if (StringUtils.isNotBlank(vehicle.getManufacturerCode())) {
voucherDetail.setManufacturer(vehicle.getManufacturerCode());
}
}
voucherDetail.setCustomerCode("DZFCJFL");
if (null != rebate.getExpectTreatCost()) {
if (rebate.getExpectTreatCost().compareTo(BigDecimal.ZERO) > 0) {
voucherDetail.setAmount(rebate.getExpectTreatCost());
voucherDetails.add(voucherDetail);
}
}
}
}
if (!voucherDetails.isEmpty()) {
generalVoucher.setVoucherDetails(voucherDetails);
finKingDeeFeign.saveRebatePrepareVoucher(generalVoucher);
}
}
});
}
}
@ -403,6 +489,9 @@ public class ScmVehRebateWithApplyService extends MybatisBaseService<ScmVehRebat
scmVehRebateService.updateState(vehRebateSid, 2);
scmVehRebateService.updateWithholdingDateBySid(vehRebateSid,scmVehRebateWithApply.getWithApply());
}
//推送单车返利预提凭证
pushVehRebateWithVoucher(bv.getBusinessSid());
}
return rb.success().setData(resultBean.getData());
} else {

28
anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatecheck/specialrebatecheckAdd.vue

@ -23,7 +23,7 @@
</el-col>
</el-row>
<div class="title">本月上传返利核对情况(按返利类型统计)</div>
<el-table :key="tableKey" :data="formobj.scmWhenSpecialrebateCheckapplydetailDetails" :index="index" border style="width: 100%">
<el-table :key="tableKey" :data="formobj.scmWhenSpecialrebateCheckapplydetailDetails" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="rebateTypeValue" label="返利类型" align="center" />
<el-table-column prop="num" label="数量" align="center" />
@ -35,7 +35,7 @@
<el-table-column prop="adjustmentMoney" label="返利调整金额" align="center" />
<el-table-column prop="fyAdjustmentMoney" label="其中费用调整金额" align="center" />
<el-table-column label="明细" align="center">
<template slot-scope="scope">
<template>
<el-button type="primary" size="mini" @click="handleLook()">查看</el-button>
</template>
</el-table-column>
@ -389,6 +389,30 @@ export default {
}
})
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property !== 'rebateTypeValue' || column.property !== 'num') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100
} else {
return Math.round((parseFloat(prev)) * 100) / 100
}
}, 0)
sums[index] += ''
}
})
return sums
},
// ===
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')

26
anrui-scm/anrui-scm-ui/src/views/specialrebate/specialrebatecheck/specialrebatecheckInfo.vue

@ -16,7 +16,7 @@
<div class="titwu"><span>{{ formobj.checkApply }}专项返利核对审核申请</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
<div class="title">本月上传返利核对情况(按返利类型统计)</div>
<el-table :key="tableKey" :data="formobj.scmWhenSpecialrebateCheckapplydetailDetails" :index="index" border style="width: 100%">
<el-table :key="tableKey" :data="formobj.scmWhenSpecialrebateCheckapplydetailDetails" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="rebateTypeValue" label="返利类型" align="center" />
<el-table-column prop="num" label="数量" align="center" />
@ -109,6 +109,30 @@ export default {
resetState() {
this.viewState = 1
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property !== 'rebateTypeValue' || column.property !== 'num') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100
} else {
return Math.round((parseFloat(prev)) * 100) / 100
}
}, 0)
sums[index] += ''
}
})
return sums
},
// ===
handleReturn() {
//

26
anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliheduiFlow/zhuanxiangfanliheduiDaiBanInfo.vue

@ -18,7 +18,7 @@
<div class="titwu"><span>{{ formobj.checkApply }}专项返利核对审核申请</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
<div class="title">本月上传返利核对情况(按返利类型统计)</div>
<el-table :key="tableKey" :data="formobj.scmWhenSpecialrebateCheckapplydetailDetails" :index="index" border style="width: 100%">
<el-table :key="tableKey" :data="formobj.scmWhenSpecialrebateCheckapplydetailDetails" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="rebateTypeValue" label="返利类型" align="center" />
<el-table-column prop="num" label="数量" align="center" />
@ -182,6 +182,30 @@ export default {
resetState() {
this.viewState = 1
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property !== 'rebateTypeValue' || column.property !== 'num') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100
} else {
return Math.round((parseFloat(prev)) * 100) / 100
}
}, 0)
sums[index] += ''
}
})
return sums
},
//
openAgree(val) {
this.operation = val

26
anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliheduiFlow/zhuanxiangfanliheduiEdit.vue

@ -22,7 +22,7 @@
</el-col>
</el-row>
<div class="title">本月上传返利核对情况(按返利类型统计)</div>
<el-table :key="tableKey" :data="formobj.scmWhenSpecialrebateCheckapplydetailDetails" :index="index" border style="width: 100%">
<el-table :key="tableKey" :data="formobj.scmWhenSpecialrebateCheckapplydetailDetails" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="rebateTypeValue" label="返利类型" align="center" />
<el-table-column prop="num" label="数量" align="center" />
@ -387,6 +387,30 @@ export default {
return false
}
})
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property !== 'rebateTypeValue' || column.property !== 'num') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100
} else {
return Math.round((parseFloat(prev)) * 100) / 100
}
}, 0)
sums[index] += ''
}
})
return sums
}
}
}

26
anrui-scm/anrui-scm-ui/src/views/workFlow/zhuanxiangfanliheduiFlow/zhuanxiangfanliheduiYiBanInfo.vue

@ -16,7 +16,7 @@
<div class="titwu"><span>{{ formobj.checkApply }}专项返利核对审核申请</span></div>
<el-form ref="form_obj" :model="formobj" :rules="rules" class="formaddcopy02">
<div class="title">本月上传返利核对情况(按返利类型统计)</div>
<el-table :key="tableKey" :data="formobj.scmWhenSpecialrebateCheckapplydetailDetails" :index="index" border style="width: 100%">
<el-table :key="tableKey" :data="formobj.scmWhenSpecialrebateCheckapplydetailDetails" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="rebateTypeValue" label="返利类型" align="center" />
<el-table-column prop="num" label="数量" align="center" />
@ -145,6 +145,30 @@ export default {
resetState() {
this.viewState = 1
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计'
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property !== 'rebateTypeValue' || column.property !== 'num') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100
} else {
return Math.round((parseFloat(prev)) * 100) / 100
}
}, 0)
sums[index] += ''
}
})
return sums
},
/** 确认撤回任务 */
openRevoke() {
this.$confirm('是否确认执行撤回操作', '提示', {

20
yxt-as-ui/src/api/operation/claimbilling.js

@ -52,6 +52,26 @@ export default {
}
})
},
downloadExcelBK: function() {
return request({
url: '/as/v1/AsBusclaimInvoiceBill/downloadExcelBK',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
headers: {
'Content-Type': 'application/json'
}
})
},
downloadExcelKK: function() {
return request({
url: '/as/v1/AsBusclaimInvoiceBill/downloadExcelKK',
method: 'post',
responseType: 'blob', // 表明返回服务器返回的数据类型
headers: {
'Content-Type': 'application/json'
}
})
},
// 提交流程
submit: function(params) {
return request({

9
yxt-as-ui/src/router/index.js

@ -264,6 +264,15 @@ export const constantRoutes = [{
title: '销售单开票申请管理',
noCache: true
}
},
{
path: '/salesSettlement/salesSettlement',
component: () => import('@/views/operation/salesSettlement/salesSettlement.vue'),
name: 'SalesSettlement',
meta: {
title: '销售单结算管理',
noCache: true
}
}
]
},

396
yxt-as-ui/src/views/operation/claimbilling/claimbillingAdd.vue

@ -4,7 +4,9 @@
<div class="tab-header webtop">
<div>{{ viewTitle }}</div>
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="download()">导入</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="exportByKp()">索赔单开票明细导入</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="exportByTZ()">调增当月收入项目导入</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="exportByTJ()">调减当月收入项目导入</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit()">提交</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
@ -26,6 +28,16 @@
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">开票单位</div>
<el-form-item>
<el-select class="addinputInfo" v-model="formobj.purchaseSystemName" placeholder="请选择" @change="changePurchase" filterable clearable>
<el-option v-for="item in purchase_list" :key="item.deptSid" :label="item.purchaseSystemName" :value="item.purchaseSystemName"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="span-sty">开票名称</div>
@ -59,7 +71,7 @@
</el-col>
</el-row>
<div class="title">开票索赔单列表</div>
<el-table :key="tableKey" :data="formobj.detailList" :index="index" border style="width: 100%" :cell-style="cellStyle">
<el-table :key="tableKey" :data="formobj.detailList" :index="index" border style="width: 100%" :cell-style="cellStyle" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="claimBillNo" label="索赔单号" align="center" width="170" />
<el-table-column prop="repairBillNo" label="维修单号" align="center" width="170" />
@ -71,19 +83,53 @@
<el-table-column prop="claimOutAmount" label="外出费" align="center" width="120" />
<el-table-column prop="claimSubsidyAmount" label="厂家补助" align="center" width="120" />
<el-table-column prop="claimRescueAmount" label="施救费" align="center" width="120" />
<el-table-column prop="claimOtherAmount" label="其他费用" align="center" width="120" />
<el-table-column prop="claimOtherAmount" label="其它费用" align="center" width="120" />
<el-table-column prop="totalAmount" label="合计" align="center" width="120" />
<el-table-column label="备注" align="center" min-width="200">
<template slot-scope="scope">
<el-input v-model="scope.row.remarks" clearable placeholder="" />
</template>
</el-table-column>
</el-table>
<el-row>
<el-col :span="12">
<div class="titleOne">调增当月收入项目列表(厂家开票明细中索赔单以外补款项目)</div>
<el-table :key="bkxmKey" :data="formobj.supplementaryItems" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="projectName" label="项目名称" align="center" width="170" />
<el-table-column prop="amount" label="金额" align="center" width="100" />
<el-table-column prop="remarks" label="补款原因" align="center" min-width="130" />
<el-table-column label="附件" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleUpload(scope.row, scope.$index, 'tzdysr')">上传</el-button>
<el-button type="primary" size="mini" style="padding-left: 5px" v-show="scope.row.supplementaryFiles.length > 0" @click="handleLook(scope.row.supplementaryFiles)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="12">
<div class="titleOne">调减当月收入项目列表(厂家开票明细中索赔单以外扣款项目)</div>
<el-table :key="kkxmKey" :data="formobj.deductionItems" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="projectName" label="项目名称" align="center" width="170" />
<el-table-column prop="amount" label="金额" align="center" width="100" />
<el-table-column prop="remarks" label="扣款原因" align="center" min-width="130" />
<el-table-column label="附件" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleUpload(scope.row, scope.$index, 'tjdysr')">上传</el-button>
<el-button type="primary" size="mini" style="padding-left: 5px" v-show="scope.row.deductionFiles.length > 0" @click="handleLook(scope.row.deductionFiles)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</el-form>
</div>
</div>
<el-dialog :visible.sync="dialogVisible" width="70%" :show-close="false">
<!-- 索赔单开票明细导入 -->
<el-dialog :visible.sync="dialogVisibleByKP" width="70%" :show-close="false">
<div>
<el-button style="font-weight: bold" size="small" type="text" @click="downLoad">下载厂家索赔单开票明细模板</el-button>
<el-button style="font-weight: bold" size="small" type="text" @click="downLoadByKP">下载厂家索赔单开票明细模板</el-button>
</div>
<el-card class="box-card">
<div>
@ -114,17 +160,113 @@
</div>
</el-card>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" size="small" @click="handleConfirm">确定</el-button>
<el-button size="small" @click="dialogVisible = false">取消</el-button>
<el-button type="primary" size="small" @click="handleConfirmByKP">确定</el-button>
<el-button size="small" @click="dialogVisibleByKP = false">取消</el-button>
</div>
</el-dialog>
<!-- 调增当月收入项目导入 -->
<el-dialog :visible.sync="dialogVisibleByTZ" width="70%" :show-close="false">
<div>
<el-button style="font-weight: bold" size="small" type="text" @click="downLoadByTZ">下载调增当月收入项目模板</el-button>
</div>
<el-card class="box-card">
<div>
<el-upload
ref="upload"
class="upload-demo"
accept=".xls"
name="file"
:action="updateAction"
:on-success="handleSuccess"
:on-remove="handleRemove"
:file-list="fileList"
:auto-upload="false"
:multiple="false"
:limit="1"
:data="uploadData"
:headers="headers"
>
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传</el-button>
</el-upload>
</div>
<div>
<h3>文件上传结果</h3>
<el-card class="box-card">
<div>{{ uploadResultMesssage }}</div>
</el-card>
</div>
</el-card>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" size="small" @click="handleConfirmByTZ">确定</el-button>
<el-button size="small" @click="dialogVisibleByTZ = false">取消</el-button>
</div>
</el-dialog>
<!-- 调减当月收入项目导入 -->
<el-dialog :visible.sync="dialogVisibleByTJ" width="70%" :show-close="false">
<div>
<el-button style="font-weight: bold" size="small" type="text" @click="downLoadByTJ">下载调减当月收入项目模板</el-button>
</div>
<el-card class="box-card">
<div>
<el-upload
ref="upload"
class="upload-demo"
accept=".xls"
name="file"
:action="updateAction"
:on-success="handleSuccess"
:on-remove="handleRemove"
:file-list="fileList"
:auto-upload="false"
:multiple="false"
:limit="1"
:data="uploadData"
:headers="headers"
>
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传</el-button>
</el-upload>
</div>
<div>
<h3>文件上传结果</h3>
<el-card class="box-card">
<div>{{ uploadResultMesssage }}</div>
</el-card>
</div>
</el-card>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" size="small" @click="handleConfirmByTJ">确定</el-button>
<el-button size="small" @click="dialogVisibleByTJ = false">取消</el-button>
</div>
</el-dialog>
<!-- 附件上传 -->
<el-dialog center :visible.sync="accessoryVisible" :show-close="false">
<el-form class="formadd" :model="accessory">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="24">
<el-form-item>
<uploadImg ref="uploadImg" v-model="accessory.images" :limit="50" bucket="map" :upload-data="{ type: '0001' }"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="handleFileConfirm">确定</el-button>
<el-button size="small" @click="handleColse">取消</el-button>
</span>
</el-dialog>
<!-- 查看 -->
<el-dialog :visible.sync="dialogFileVisible">
<el-image style="width: 150px; height: 150px" v-for="(item, index) in list" :key="index" :src="item" :preview-src-list="list"/>
</el-dialog>
</div>
</template>
<script>
import req from '@/api/operation/claimbilling'
import uploadImg from '@/components/uploadFile/uploadImg'
import { choiceSupplierInfo, getOrgSidByPath } from '@/api/Common/dictcommons'
import { choiceSupplierInfo, fetchDetailsByUseOrgSid, getOrgSidByPath } from '@/api/Common/dictcommons'
export default {
name: 'ClaimBillingAdd',
@ -137,8 +279,19 @@ export default {
viewState: 1,
submitdisabled: false,
tableKey: 1,
bkxmKey: 2,
kkxmKey: 3,
index: 0,
supplier_list: [],
purchase_list: [],
accessoryVisible: false,
accessory: {
index: '',
images: [],
type: ''
},
dialogFileVisible: false,
list: [],
formobj: {
billNo: '',
createByName: '',
@ -147,6 +300,8 @@ export default {
deptSid: '',
createOrgSid: '',
createTime: '',
purchaseSystemName: '',
purchaseSystemSid: '',
detailList: [],
fileList: [],
invoiceKey: '',
@ -162,11 +317,15 @@ export default {
taskDefKey: '',
taskId: '',
useOrgName: '',
useOrgSid: ''
useOrgSid: '',
supplementaryItems: [],
deductionItems: []
},
rules: {},
dialogVisible: false,
updateAction: process.env.VUE_APP_BASE_API + '/as/v1/AsBusclaimInvoiceBill/getExcelInfo',
dialogVisibleByKP: false, //
dialogVisibleByTZ: false, //
dialogVisibleByTJ: false, //
updateAction: '',
fileList: [],
upload_list: [],
uploadResultMesssage: '',
@ -183,7 +342,7 @@ export default {
let kpje = '0'
if (this.formobj.detailList.length > 0) {
this.formobj.detailList.forEach((e) => {
kpje = Math.round((parseFloat(kpje) + parseFloat(e.claimHourAmount) + parseFloat(e.claimGoodsAmount) + parseFloat(e.claimOutAmount) + parseFloat(e.claimSubsidyAmount) + parseFloat(e.claimOtherAmount)) * 100) / 100
kpje = Math.round((parseFloat(kpje) + parseFloat(e.claimHourAmount) + parseFloat(e.claimGoodsAmount) + parseFloat(e.claimOutAmount) + parseFloat(e.claimSubsidyAmount) + parseFloat(e.claimRescueAmount) + parseFloat(e.claimOtherAmount)) * 100) / 100
})
}
return kpje
@ -195,6 +354,11 @@ export default {
if (res.success) {
this.formobj.createOrgSid = res.data
this.formobj.useOrgSid = res.data
fetchDetailsByUseOrgSid(this.formobj.useOrgSid).then((resp) => {
if (resp.success) {
this.purchase_list = resp.data
}
})
}
})
choiceSupplierInfo({ deptSid: window.sessionStorage.getItem('defaultOrgPath').substring(window.sessionStorage.getItem('defaultOrgPath').lastIndexOf('/') + 1) }).then((resp) => {
@ -242,6 +406,14 @@ export default {
}
})
},
changePurchase(value) {
const choose = this.purchase_list.filter((item) => item.purchaseSystemName === value)
if (choose.length > 0 && choose !== null) {
this.formobj.purchaseSystemSid = choose[0].deptSid
} else {
this.formobj.purchaseSystemSid = ''
}
},
supplierChange(value) {
const choose = this.supplier_list.filter((item) => item.sid === value)
if (choose !== null && choose.length > 0) {
@ -254,13 +426,14 @@ export default {
this.formobj.invoiceKey = ''
}
},
download() {
this.dialogVisible = true
exportByKp() {
this.dialogVisibleByKP = true
this.updateAction = process.env.VUE_APP_BASE_API + '/as/v1/AsBusclaimInvoiceBill/getExcelInfo'
this.fileList = []
this.upload_list = []
this.uploadResultMesssage = ''
},
downLoad() {
downLoadByKP() {
const loading = this.$loading({
lock: true,
text: 'Loading',
@ -275,7 +448,71 @@ export default {
const fileName = '厂家索赔单开票明细模板' + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
exportByTZ() {
this.dialogVisibleByTZ = true
this.updateAction = process.env.VUE_APP_BASE_API + '/as/v1/AsBusclaimInvoiceBill/getExcelInfoBK'
this.fileList = []
this.upload_list = []
this.uploadResultMesssage = ''
},
downLoadByTZ() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.downloadExcelBK().then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '调增当月收入项目模板' + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
exportByTJ() {
this.dialogVisibleByTJ = true
this.updateAction = process.env.VUE_APP_BASE_API + '/as/v1/AsBusclaimInvoiceBill/getExcelInfoKK'
this.fileList = []
this.upload_list = []
this.uploadResultMesssage = ''
},
downLoadByTJ() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.downloadExcelKK().then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '调减当月收入项目模板' + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
@ -303,7 +540,7 @@ export default {
_this.uploadResultMesssage = resp.msg
}
},
handleConfirm() {
handleConfirmByKP() {
if (this.upload_list.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请先上传厂家索赔单开票明细' })
return
@ -322,11 +559,52 @@ export default {
claimSubsidyAmount: e.claimSubsidyAmount,
claimRescueAmount: e.claimRescueAmount,
claimOtherAmount: e.claimOtherAmount,
totalAmount: e.totalAmount,
remarks: '',
isUnanimous: e.isUnanimous
})
})
this.dialogVisible = false
this.dialogVisibleByKP = false
}
},
handleConfirmByTZ() {
if (this.upload_list.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请先上传调增当月收入项目' })
return
} else {
this.formobj.supplementaryItems = []
this.upload_list.forEach((e) => {
this.formobj.supplementaryItems.push({
sid: '',
billSid: '',
projectName: e.projectName,
amount: e.amount,
remarks: e.remarks,
type: '1',
supplementaryFiles: []
})
})
this.dialogVisibleByTZ = false
}
},
handleConfirmByTJ() {
if (this.upload_list.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请先上传调减当月收入项目' })
return
} else {
this.formobj.deductionItems = []
this.upload_list.forEach((e) => {
this.formobj.deductionItems.push({
sid: '',
billSid: '',
projectName: e.projectName,
amount: e.amount,
remarks: e.remarks,
type: '2',
deductionFiles: []
})
})
this.dialogVisibleByTJ = false
}
},
cellStyle({ row, column, rowIndex, columnIndex }) {
@ -337,6 +615,50 @@ export default {
return cell
}
},
//
handleUpload(row, index, type) {
this.accessoryVisible = true
this.accessory.index = index
this.accessory.type = type
if (type === 'tzdysr') {
// --
this.accessory.images = row.supplementaryFiles
} else {
// --
this.accessory.images = row.deductionFiles
}
},
//
handleLook(row) {
this.dialogFileVisible = true
const aa = []
if (row.length > 0) {
row.forEach((e) => {
aa.push(e.url)
})
this.list = aa
}
},
// --
handleFileConfirm() {
if (this.accessory.type === 'tzdysr') {
// --
this.formobj.supplementaryItems[this.accessory.index].supplementaryFiles = this.accessory.images
} else {
// --
this.formobj.deductionItems[this.accessory.index].deductionFiles = this.accessory.images
}
this.handleColse()
},
// --
handleColse() {
this.accessoryVisible = false
this.accessory = {
index: '',
images: [],
type: ''
}
},
saveOrUpdate() {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
@ -373,6 +695,30 @@ export default {
}
})
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = ''
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property === 'totalAmount' || column.property === 'amount') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100
} else {
return Math.round((parseFloat(prev)) * 100) / 100
}
}, 0)
sums[index] += ''
}
})
return sums
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
@ -383,6 +729,8 @@ export default {
deptSid: '',
createOrgSid: '',
createTime: '',
purchaseSystemName: '',
purchaseSystemSid: '',
detailList: [],
fileList: [],
invoiceKey: '',
@ -398,9 +746,12 @@ export default {
taskDefKey: '',
taskId: '',
useOrgName: '',
useOrgSid: ''
useOrgSid: '',
supplementaryItems: [],
deductionItems: []
}
this.submitdisabled = false
this.$refs['form_obj'].resetFields()
this.$emit('doback')
}
}
@ -417,4 +768,11 @@ export default {
/deep/ .el-form-item__error {
margin-left: 120px !important;
}
.titleOne {
font-weight: bold;
font-size: 16px;
background-color: #0294d7;
color: #ffffff;
text-align: left;
}
</style>

103
yxt-as-ui/src/views/operation/claimbilling/claimbillingInfo.vue

@ -23,6 +23,12 @@
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">开票单位</div>
<el-form-item><span class="addinputInfo">{{ formobj.purchaseSystemName }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="span-sty">开票名称</div>
@ -50,7 +56,7 @@
</el-col>
</el-row>
<div class="title">开票索赔单列表</div>
<el-table :key="tableKey" :data="formobj.detailList" :index="index" border style="width: 100%" :cell-style="cellStyle">
<el-table :key="tableKey" :data="formobj.detailList" :index="index" border style="width: 100%" :cell-style="cellStyle" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="claimBillNo" label="索赔单号" align="center" width="170" />
<el-table-column prop="repairBillNo" label="维修单号" align="center" width="170" />
@ -62,12 +68,47 @@
<el-table-column prop="claimOutAmount" label="外出费" align="center" width="120" />
<el-table-column prop="claimSubsidyAmount" label="厂家补助" align="center" width="120" />
<el-table-column prop="claimRescueAmount" label="施救费" align="center" width="120" />
<el-table-column prop="claimOtherAmount" label="其他费用" align="center" width="120" />
<el-table-column prop="claimOtherAmount" label="其它费用" align="center" width="120" />
<el-table-column prop="totalAmount" label="合计" align="center" width="120" />
<el-table-column prop="remarks" label="备注" align="center" min-width="200" />
</el-table>
<el-row>
<el-col :span="12">
<div class="titleOne">调增当月收入项目列表(厂家开票明细中索赔单以外补款项目)</div>
<el-table :key="bkxmKey" :data="formobj.supplementaryItems" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="projectName" label="项目名称" align="center" width="170" />
<el-table-column prop="amount" label="金额" align="center" width="100" />
<el-table-column prop="remarks" label="扣款原因" align="center" min-width="130" />
<el-table-column label="附件" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" style="padding-left: 5px" v-show="scope.row.supplementaryFiles.length > 0" @click="handleLook(scope.row.supplementaryFiles)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="12">
<div class="titleOne">调减当月收入项目列表(厂家开票明细中索赔单以外扣款项目)</div>
<el-table :key="kkxmKey" :data="formobj.deductionItems" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="projectName" label="项目名称" align="center" width="170" />
<el-table-column prop="amount" label="金额" align="center" width="100" />
<el-table-column prop="remarks" label="扣款原因" align="center" min-width="130" />
<el-table-column label="附件" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" style="padding-left: 5px" v-show="scope.row.deductionFiles.length > 0" @click="handleLook(scope.row.deductionFiles)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</el-form>
</div>
</div>
<!-- 查看 -->
<el-dialog :visible.sync="dialogFileVisible">
<el-image style="width: 150px; height: 150px" v-for="(item, index) in list" :key="index" :src="item" :preview-src-list="list"/>
</el-dialog>
</div>
</template>
@ -81,7 +122,11 @@ export default {
viewTitle: '',
viewState: 1,
tableKey: 1,
bkxmKey: 2,
kkxmKey: 3,
index: 0,
dialogFileVisible: false,
list: [],
formobj: {
billNo: '',
createByName: '',
@ -90,6 +135,8 @@ export default {
deptSid: '',
createOrgSid: '',
createTime: '',
purchaseSystemName: '',
purchaseSystemSid: '',
detailList: [],
fileList: [],
invoiceKey: '',
@ -105,7 +152,9 @@ export default {
taskDefKey: '',
taskId: '',
useOrgName: '',
useOrgSid: ''
useOrgSid: '',
supplementaryItems: [],
deductionItems: []
},
rules: {}
}
@ -134,6 +183,41 @@ export default {
return cell
}
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = ''
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property === 'totalAmount' || column.property === 'amount') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100
} else {
return Math.round((parseFloat(prev)) * 100) / 100
}
}, 0)
sums[index] += ''
}
})
return sums
},
//
handleLook(row) {
this.dialogFileVisible = true
const aa = []
if (row.length > 0) {
row.forEach((e) => {
aa.push(e.url)
})
this.list = aa
}
},
handleReturn() {
this.formobj = {
billNo: '',
@ -143,6 +227,8 @@ export default {
deptSid: '',
createOrgSid: '',
createTime: '',
purchaseSystemName: '',
purchaseSystemSid: '',
detailList: [],
fileList: [],
invoiceKey: '',
@ -158,7 +244,9 @@ export default {
taskDefKey: '',
taskId: '',
useOrgName: '',
useOrgSid: ''
useOrgSid: '',
supplementaryItems: [],
deductionItems: []
}
this.$emit('doback')
}
@ -173,4 +261,11 @@ export default {
.addinputInfo {
margin-left: 120px !important;
}
.titleOne {
font-weight: bold;
font-size: 16px;
background-color: #0294d7;
color: #ffffff;
text-align: left;
}
</style>

8
yxt-as-ui/src/views/operation/workslrsettlement/workslrsettlementAdd.vue

@ -26,10 +26,14 @@
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-col :span="16">
<div class="span-sty">反结算原因</div>
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.reason" clearable placeholder="" /></el-form-item>
</el-col>
<el-col :span="8">
<div class="span-sty">备注</div>
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.remarks" clearable placeholder="" /></el-form-item>
</el-col>
</el-row>
<div class="title titleOne">
<div>维修单信息</div>
@ -256,6 +260,7 @@ export default {
useOrgSid: '',
useOrgName: '',
reason: '',
remarks: '',
applyDate: '',
sourceSid: '',
amount: '',
@ -423,6 +428,7 @@ export default {
useOrgSid: '',
useOrgName: '',
reason: '',
remarks: '',
applyDate: '',
sourceSid: '',
amount: '',

8
yxt-as-ui/src/views/operation/workslrsettlement/workslrsettlementInfo.vue

@ -24,10 +24,14 @@
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-col :span="16">
<div class="span-sty">反结算原因</div>
<el-form-item><span class="addinputInfo">{{ formobj.reason }}</span></el-form-item>
</el-col>
<el-col :span="8">
<div class="span-sty">备注</div>
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item>
</el-col>
</el-row>
<div class="title">维修单信息</div>
<el-row>
@ -252,6 +256,7 @@ export default {
useOrgSid: '',
useOrgName: '',
reason: '',
remarks: '',
applyDate: '',
sourceSid: '',
amount: '',
@ -337,6 +342,7 @@ export default {
useOrgSid: '',
useOrgName: '',
reason: '',
remarks: '',
applyDate: '',
sourceSid: '',
amount: '',

7
yxt-as-ui/src/views/workFlow/fanjiesuanFlow/workslrsettlementDaiBan.vue

@ -27,10 +27,14 @@
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-col :span="16">
<div class="span-sty">反结算原因</div>
<el-form-item><span class="addinputInfo">{{ formobj.reason }}</span></el-form-item>
</el-col>
<el-col :span="8">
<div class="span-sty">备注</div>
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item>
</el-col>
</el-row>
<div class="title">维修单信息</div>
<el-row>
@ -294,6 +298,7 @@ export default {
useOrgSid: '',
useOrgName: '',
reason: '',
remarks: '',
applyDate: '',
sourceSid: '',
amount: '',

7
yxt-as-ui/src/views/workFlow/fanjiesuanFlow/workslrsettlementEdit.vue

@ -25,10 +25,14 @@
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-col :span="16">
<div class="span-sty">反结算原因</div>
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.reason" clearable placeholder="" /></el-form-item>
</el-col>
<el-col :span="8">
<div class="span-sty">备注</div>
<el-form-item><el-input class="addinputInfo addinputw" v-model="formobj.remarks" clearable placeholder="" /></el-form-item>
</el-col>
</el-row>
<div class="title titleOne">
<div>维修单信息</div>
@ -254,6 +258,7 @@ export default {
useOrgSid: '',
useOrgName: '',
reason: '',
remarks: '',
applyDate: '',
sourceSid: '',
amount: '',

7
yxt-as-ui/src/views/workFlow/fanjiesuanFlow/workslrsettlementYiBan.vue

@ -24,10 +24,14 @@
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-col :span="16">
<div class="span-sty">反结算原因</div>
<el-form-item><span class="addinputInfo">{{ formobj.reason }}</span></el-form-item>
</el-col>
<el-col :span="8">
<div class="span-sty">备注</div>
<el-form-item><span class="addinputInfo">{{ formobj.remarks }}</span></el-form-item>
</el-col>
</el-row>
<div class="title">维修单信息</div>
<el-row>
@ -252,6 +256,7 @@ export default {
useOrgSid: '',
useOrgName: '',
reason: '',
remarks: '',
applyDate: '',
sourceSid: '',
amount: '',

99
yxt-as-ui/src/views/workFlow/suopeikaipiaoFlow/claimbillingDaiBan.vue

@ -26,6 +26,12 @@
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">开票单位</div>
<el-form-item><span class="addinputInfo">{{ formobj.purchaseSystemName }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="span-sty">开票名称</div>
@ -53,10 +59,10 @@
</el-col>
</el-row>
<div class="title">开票索赔单列表</div>
<el-table :key="tableKey" :data="formobj.detailList" :index="index" border style="width: 100%" :cell-style="cellStyle">
<el-table :key="tableKey" :data="formobj.detailList" :index="index" border style="width: 100%" :cell-style="cellStyle" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="claimBillNo" label="索赔单号" align="center" width="170" />
<el-table-column prop="repairBillNo" label="维修号" align="center" width="170" />
<el-table-column prop="repairBillNo" label="维修号" align="center" width="170" />
<el-table-column prop="vehMark" label="车牌号" align="center" width="100" />
<el-table-column prop="vinNo" label="车架号" align="center" width="100" />
<el-table-column prop="claimManufacturer" label="索赔厂家" align="center" width="120" />
@ -65,12 +71,47 @@
<el-table-column prop="claimOutAmount" label="外出费" align="center" width="120" />
<el-table-column prop="claimSubsidyAmount" label="厂家补助" align="center" width="120" />
<el-table-column prop="claimRescueAmount" label="施救费" align="center" width="120" />
<el-table-column prop="claimOtherAmount" label="其他费用" align="center" width="120" />
<el-table-column prop="claimOtherAmount" label="其它费用" align="center" width="120" />
<el-table-column prop="totalAmount" label="合计" align="center" width="120" />
<el-table-column prop="remarks" label="备注" align="center" min-width="200" />
</el-table>
<el-row>
<el-col :span="12">
<div class="titleOne">调增当月收入项目列表(厂家开票明细中索赔单以外补款项目)</div>
<el-table :key="bkxmKey" :data="formobj.supplementaryItems" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="projectName" label="项目名称" align="center" width="170" />
<el-table-column prop="amount" label="金额" align="center" width="100" />
<el-table-column prop="remarks" label="扣款原因" align="center" min-width="130" />
<el-table-column label="附件" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" style="padding-left: 5px" v-show="scope.row.supplementaryFiles.length > 0" @click="handleLook(scope.row.supplementaryFiles)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="12">
<div class="titleOne">调减当月收入项目列表(厂家开票明细中索赔单以外扣款项目)</div>
<el-table :key="kkxmKey" :data="formobj.deductionItems" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="projectName" label="项目名称" align="center" width="170" />
<el-table-column prop="amount" label="金额" align="center" width="100" />
<el-table-column prop="remarks" label="扣款原因" align="center" min-width="130" />
<el-table-column label="附件" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" style="padding-left: 5px" v-show="scope.row.deductionFiles.length > 0" @click="handleLook(scope.row.deductionFiles)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</el-form>
</div>
</div>
<!-- 查看 -->
<el-dialog :visible.sync="dialogFileVisible">
<el-image style="width: 150px; height: 150px" v-for="(item, index) in list" :key="index" :src="item" :preview-src-list="list"/>
</el-dialog>
<!-- 选择待办人 的弹出框-->
<el-dialog title="填写审批意见" :visible.sync="nodeDialogVisible" width="80%">
<el-form class="formadd" >
@ -123,7 +164,11 @@ export default {
viewTitle: '',
viewState: 1,
tableKey: 1,
bkxmKey: 2,
kkxmKey: 3,
index: 0,
dialogFileVisible: false,
list: [],
formobj: {
billNo: '',
createByName: '',
@ -132,6 +177,8 @@ export default {
deptSid: '',
createOrgSid: '',
createTime: '',
purchaseSystemName: '',
purchaseSystemSid: '',
detailList: [],
fileList: [],
invoiceKey: '',
@ -147,7 +194,9 @@ export default {
taskDefKey: '',
taskId: '',
useOrgName: '',
useOrgSid: ''
useOrgSid: '',
supplementaryItems: [],
deductionItems: []
},
rules: {},
options: [],
@ -245,6 +294,41 @@ export default {
return cell
}
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = ''
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property === 'totalAmount' || column.property === 'amount') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100
} else {
return Math.round((parseFloat(prev)) * 100) / 100
}
}, 0)
sums[index] += ''
}
})
return sums
},
//
handleLook(row) {
this.dialogFileVisible = true
const aa = []
if (row.length > 0) {
row.forEach((e) => {
aa.push(e.url)
})
this.list = aa
}
},
//
openCountersign(val) {
this.operation = val
@ -431,4 +515,11 @@ export default {
.rowClass{
border-top: 1px solid #E0E3EB;
}
.titleOne {
font-weight: bold;
font-size: 16px;
background-color: #0294d7;
color: #ffffff;
text-align: left;
}
</style>

397
yxt-as-ui/src/views/workFlow/suopeikaipiaoFlow/claimbillingEdit.vue

@ -4,7 +4,9 @@
<div class="tab-header webtop">
<div>{{ viewTitle }}</div>
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="download()">导入</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="exportByKp()">索赔单开票明细导入</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="exportByTZ()">调增当月收入项目导入</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="exportByTJ()">调减当月收入项目导入</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate()">保存</el-button>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="submit()">提交</el-button>
</div>
@ -25,6 +27,16 @@
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">开票单位</div>
<el-form-item>
<el-select class="addinputInfo" v-model="formobj.purchaseSystemName" placeholder="请选择" @change="changePurchase" filterable clearable>
<el-option v-for="item in purchase_list" :key="item.deptSid" :label="item.purchaseSystemName" :value="item.purchaseSystemName"/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="span-sty">开票名称</div>
@ -58,7 +70,7 @@
</el-col>
</el-row>
<div class="title">开票索赔单列表</div>
<el-table :key="tableKey" :data="formobj.detailList" :index="index" border style="width: 100%" :cell-style="cellStyle">
<el-table :key="tableKey" :data="formobj.detailList" :index="index" border style="width: 100%" :cell-style="cellStyle" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="claimBillNo" label="索赔单号" align="center" width="170" />
<el-table-column prop="repairBillNo" label="维修单号" align="center" width="170" />
@ -70,19 +82,53 @@
<el-table-column prop="claimOutAmount" label="外出费" align="center" width="120" />
<el-table-column prop="claimSubsidyAmount" label="厂家补助" align="center" width="120" />
<el-table-column prop="claimRescueAmount" label="施救费" align="center" width="120" />
<el-table-column prop="claimOtherAmount" label="其他费用" align="center" width="120" />
<el-table-column prop="claimOtherAmount" label="其它费用" align="center" width="120" />
<el-table-column prop="totalAmount" label="合计" align="center" width="120" />
<el-table-column label="备注" align="center" min-width="200">
<template slot-scope="scope">
<el-input v-model="scope.row.remarks" clearable placeholder="" />
</template>
</el-table-column>
</el-table>
<el-row>
<el-col :span="12">
<div class="titleOne">调增当月收入项目列表(厂家开票明细中索赔单以外补款项目)</div>
<el-table :key="bkxmKey" :data="formobj.supplementaryItems" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="projectName" label="项目名称" align="center" width="170" />
<el-table-column prop="amount" label="金额" align="center" width="100" />
<el-table-column prop="remarks" label="补款原因" align="center" min-width="130" />
<el-table-column label="附件" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleUpload(scope.row, scope.$index, 'tzdysr')">上传</el-button>
<el-button type="primary" size="mini" style="padding-left: 5px" v-show="scope.row.supplementaryFiles.length > 0" @click="handleLook(scope.row.supplementaryFiles)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="12">
<div class="titleOne">调减当月收入项目列表(厂家开票明细中索赔单以外扣款项目)</div>
<el-table :key="kkxmKey" :data="formobj.deductionItems" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="projectName" label="项目名称" align="center" width="170" />
<el-table-column prop="amount" label="金额" align="center" width="100" />
<el-table-column prop="remarks" label="扣款原因" align="center" min-width="130" />
<el-table-column label="附件" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="handleUpload(scope.row, scope.$index, 'tjdysr')">上传</el-button>
<el-button type="primary" size="mini" style="padding-left: 5px" v-show="scope.row.deductionFiles.length > 0" @click="handleLook(scope.row.deductionFiles)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</el-form>
</div>
</div>
<el-dialog :visible.sync="dialogVisible" width="70%" :show-close="false">
<!-- 索赔单开票明细导入 -->
<el-dialog :visible.sync="dialogVisibleByKP" width="70%" :show-close="false">
<div>
<el-button style="font-weight: bold" size="small" type="text" @click="downLoad">下载厂家索赔单开票明细模板</el-button>
<el-button style="font-weight: bold" size="small" type="text" @click="downLoadByKP">下载厂家索赔单开票明细模板</el-button>
</div>
<el-card class="box-card">
<div>
@ -113,20 +159,116 @@
</div>
</el-card>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" size="small" @click="handleConfirm">确定</el-button>
<el-button size="small" @click="dialogVisible = false">取消</el-button>
<el-button type="primary" size="small" @click="handleConfirmByKP">确定</el-button>
<el-button size="small" @click="dialogVisibleByKP = false">取消</el-button>
</div>
</el-dialog>
<!-- 调增当月收入项目导入 -->
<el-dialog :visible.sync="dialogVisibleByTZ" width="70%" :show-close="false">
<div>
<el-button style="font-weight: bold" size="small" type="text" @click="downLoadByTZ">下载调增当月收入项目模板</el-button>
</div>
<el-card class="box-card">
<div>
<el-upload
ref="upload"
class="upload-demo"
accept=".xls"
name="file"
:action="updateAction"
:on-success="handleSuccess"
:on-remove="handleRemove"
:file-list="fileList"
:auto-upload="false"
:multiple="false"
:limit="1"
:data="uploadData"
:headers="headers"
>
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传</el-button>
</el-upload>
</div>
<div>
<h3>文件上传结果</h3>
<el-card class="box-card">
<div>{{ uploadResultMesssage }}</div>
</el-card>
</div>
</el-card>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" size="small" @click="handleConfirmByTZ">确定</el-button>
<el-button size="small" @click="dialogVisibleByTZ = false">取消</el-button>
</div>
</el-dialog>
<!-- 调减当月收入项目导入 -->
<el-dialog :visible.sync="dialogVisibleByTJ" width="70%" :show-close="false">
<div>
<el-button style="font-weight: bold" size="small" type="text" @click="downLoadByTJ">下载调减当月收入项目模板</el-button>
</div>
<el-card class="box-card">
<div>
<el-upload
ref="upload"
class="upload-demo"
accept=".xls"
name="file"
:action="updateAction"
:on-success="handleSuccess"
:on-remove="handleRemove"
:file-list="fileList"
:auto-upload="false"
:multiple="false"
:limit="1"
:data="uploadData"
:headers="headers"
>
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">上传</el-button>
</el-upload>
</div>
<div>
<h3>文件上传结果</h3>
<el-card class="box-card">
<div>{{ uploadResultMesssage }}</div>
</el-card>
</div>
</el-card>
<div slot="footer" class="dialog-footer" style="text-align: center">
<el-button type="primary" size="small" @click="handleConfirmByTJ">确定</el-button>
<el-button size="small" @click="dialogVisibleByTJ = false">取消</el-button>
</div>
</el-dialog>
<!-- 附件上传 -->
<el-dialog center :visible.sync="accessoryVisible" :show-close="false">
<el-form class="formadd" :model="accessory">
<el-row style="border-top: 1px solid #E0E3EB">
<el-col :span="24">
<el-form-item>
<uploadImg ref="uploadImg" v-model="accessory.images" :limit="50" bucket="map" :upload-data="{ type: '0001' }"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="handleFileConfirm">确定</el-button>
<el-button size="small" @click="handleColse">取消</el-button>
</span>
</el-dialog>
<!-- 查看 -->
<el-dialog :visible.sync="dialogFileVisible">
<el-image style="width: 150px; height: 150px" v-for="(item, index) in list" :key="index" :src="item" :preview-src-list="list"/>
</el-dialog>
</div>
</template>
<script>
import req from '@/api/operation/claimbilling'
import uploadImg from '@/components/uploadFile/uploadImg'
import { choiceSupplierInfo, getOrgSidByPath } from '@/api/Common/dictcommons'
import { choiceSupplierInfo, fetchDetailsByUseOrgSid } from '@/api/Common/dictcommons'
export default {
name: 'ClaimBillingEdit',
name: 'ClaimbillingEdit',
components: {
uploadImg
},
@ -136,8 +278,19 @@ export default {
viewState: 1,
submitdisabled: false,
tableKey: 1,
bkxmKey: 2,
kkxmKey: 3,
index: 0,
supplier_list: [],
purchase_list: [],
accessoryVisible: false,
accessory: {
index: '',
images: [],
type: ''
},
dialogFileVisible: false,
list: [],
formobj: {
billNo: '',
createByName: '',
@ -146,6 +299,8 @@ export default {
deptSid: '',
createOrgSid: '',
createTime: '',
purchaseSystemName: '',
purchaseSystemSid: '',
detailList: [],
fileList: [],
invoiceKey: '',
@ -161,11 +316,15 @@ export default {
taskDefKey: '',
taskId: '',
useOrgName: '',
useOrgSid: ''
useOrgSid: '',
supplementaryItems: [],
deductionItems: []
},
rules: {},
dialogVisible: false,
updateAction: process.env.VUE_APP_BASE_API + '/as/v1/AsBusclaimInvoiceBill/getExcelInfo',
dialogVisibleByKP: false, //
dialogVisibleByTZ: false, //
dialogVisibleByTJ: false, //
updateAction: '',
fileList: [],
upload_list: [],
uploadResultMesssage: '',
@ -182,7 +341,7 @@ export default {
let kpje = '0'
if (this.formobj.detailList.length > 0) {
this.formobj.detailList.forEach((e) => {
kpje = Math.round((parseFloat(kpje) + parseFloat(e.claimHourAmount) + parseFloat(e.claimGoodsAmount) + parseFloat(e.claimOutAmount) + parseFloat(e.claimSubsidyAmount) + parseFloat(e.claimOtherAmount)) * 100) / 100
kpje = Math.round((parseFloat(kpje) + parseFloat(e.claimHourAmount) + parseFloat(e.claimGoodsAmount) + parseFloat(e.claimOutAmount) + parseFloat(e.claimSubsidyAmount) + parseFloat(e.claimRescueAmount) + parseFloat(e.claimOtherAmount)) * 100) / 100
})
}
return kpje
@ -201,20 +360,25 @@ export default {
params: {
//
code: 2,
data: 500 + 'px'
data: 400 + 'px'
}
}, '*')
},
methods: {
showInfo(sid) {
showInfo(row) {
this.viewTitle = '【编辑】索赔单开票申请'
this.$nextTick(() => {
this.$refs['form_obj'].clearValidate()
})
req.fetchDetailsBySid({ sid: sid }).then((res) => {
req.fetchDetailsBySid({ sid: row.sid }).then((res) => {
if (res.success) {
this.formobj = res.data
this.formobj.instanceId = res.data.procInstId
fetchDetailsByUseOrgSid(this.formobj.useOrgSid).then((resp) => {
if (resp.success) {
this.purchase_list = resp.data
}
})
choiceSupplierInfo({ deptSid: this.formobj.deptSid }).then((resp) => {
if (resp.success) {
this.supplier_list = resp.data
@ -223,6 +387,14 @@ export default {
}
})
},
changePurchase(value) {
const choose = this.purchase_list.filter((item) => item.purchaseSystemName === value)
if (choose.length > 0 && choose !== null) {
this.formobj.purchaseSystemSid = choose[0].deptSid
} else {
this.formobj.purchaseSystemSid = ''
}
},
supplierChange(value) {
const choose = this.supplier_list.filter((item) => item.sid === value)
if (choose !== null && choose.length > 0) {
@ -235,13 +407,14 @@ export default {
this.formobj.invoiceKey = ''
}
},
download() {
this.dialogVisible = true
exportByKp() {
this.dialogVisibleByKP = true
this.updateAction = process.env.VUE_APP_BASE_API + '/as/v1/AsBusclaimInvoiceBill/getExcelInfo'
this.fileList = []
this.upload_list = []
this.uploadResultMesssage = ''
},
downLoad() {
downLoadByKP() {
const loading = this.$loading({
lock: true,
text: 'Loading',
@ -256,7 +429,71 @@ export default {
const fileName = '厂家索赔单开票明细模板' + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'nonde'
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
exportByTZ() {
this.dialogVisibleByTZ = true
this.updateAction = process.env.VUE_APP_BASE_API + '/as/v1/AsBusclaimInvoiceBill/getExcelInfoBK'
this.fileList = []
this.upload_list = []
this.uploadResultMesssage = ''
},
downLoadByTZ() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.downloadExcelBK().then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '调增当月收入项目模板' + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
URL.revokeObjectURL(elink.href)
document.body.removeChild(elink)
}).catch(() => {
loading.close()
})
},
exportByTJ() {
this.dialogVisibleByTJ = true
this.updateAction = process.env.VUE_APP_BASE_API + '/as/v1/AsBusclaimInvoiceBill/getExcelInfoKK'
this.fileList = []
this.upload_list = []
this.uploadResultMesssage = ''
},
downLoadByTJ() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.downloadExcelKK().then((resp) => {
loading.close()
const blob = new Blob([resp], {
type: 'application/vnd.ms-excel'
})
const fileName = '调减当月收入项目模板' + '.xls'
const elink = document.createElement('a')
elink.download = fileName
elink.style.display = 'none'
elink.href = URL.createObjectURL(blob)
document.body.appendChild(elink)
elink.click()
@ -284,7 +521,7 @@ export default {
_this.uploadResultMesssage = resp.msg
}
},
handleConfirm() {
handleConfirmByKP() {
if (this.upload_list.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请先上传厂家索赔单开票明细' })
return
@ -303,11 +540,52 @@ export default {
claimSubsidyAmount: e.claimSubsidyAmount,
claimRescueAmount: e.claimRescueAmount,
claimOtherAmount: e.claimOtherAmount,
totalAmount: e.totalAmount,
remarks: '',
isUnanimous: e.isUnanimous
})
})
this.dialogVisible = false
this.dialogVisibleByKP = false
}
},
handleConfirmByTZ() {
if (this.upload_list.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请先上传调增当月收入项目' })
return
} else {
this.formobj.supplementaryItems = []
this.upload_list.forEach((e) => {
this.formobj.supplementaryItems.push({
sid: '',
billSid: '',
projectName: e.projectName,
amount: e.amount,
remarks: e.remarks,
type: '1',
supplementaryFiles: []
})
})
this.dialogVisibleByTZ = false
}
},
handleConfirmByTJ() {
if (this.upload_list.length === 0) {
this.$message({ showClose: true, type: 'error', message: '请先上传调减当月收入项目' })
return
} else {
this.formobj.deductionItems = []
this.upload_list.forEach((e) => {
this.formobj.deductionItems.push({
sid: '',
billSid: '',
projectName: e.projectName,
amount: e.amount,
remarks: e.remarks,
type: '2',
deductionFiles: []
})
})
this.dialogVisibleByTJ = false
}
},
cellStyle({ row, column, rowIndex, columnIndex }) {
@ -318,6 +596,50 @@ export default {
return cell
}
},
//
handleUpload(row, index, type) {
this.accessoryVisible = true
this.accessory.index = index
this.accessory.type = type
if (type === 'tzdysr') {
// --
this.accessory.images = row.supplementaryFiles
} else {
// --
this.accessory.images = row.deductionFiles
}
},
//
handleLook(row) {
this.dialogFileVisible = true
const aa = []
if (row.length > 0) {
row.forEach((e) => {
aa.push(e.url)
})
this.list = aa
}
},
// --
handleFileConfirm() {
if (this.accessory.type === 'tzdysr') {
// --
this.formobj.supplementaryItems[this.accessory.index].supplementaryFiles = this.accessory.images
} else {
// --
this.formobj.deductionItems[this.accessory.index].deductionFiles = this.accessory.images
}
this.handleColse()
},
// --
handleColse() {
this.accessoryVisible = false
this.accessory = {
index: '',
images: [],
type: ''
}
},
saveOrUpdate() {
this.$refs['form_obj'].validate((valid) => {
if (valid) {
@ -367,6 +689,30 @@ export default {
})
}
})
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = ''
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property === 'totalAmount' || column.property === 'amount') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100
} else {
return Math.round((parseFloat(prev)) * 100) / 100
}
}, 0)
sums[index] += ''
}
})
return sums
}
}
}
@ -382,4 +728,11 @@ export default {
/deep/ .el-form-item__error {
margin-left: 120px !important;
}
.titleOne {
font-weight: bold;
font-size: 16px;
background-color: #0294d7;
color: #ffffff;
text-align: left;
}
</style>

99
yxt-as-ui/src/views/workFlow/suopeikaipiaoFlow/claimbillingYiBan.vue

@ -23,6 +23,12 @@
<el-form-item><span class="addinputInfo">{{ formobj.createTime }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="span-sty">开票单位</div>
<el-form-item><span class="addinputInfo">{{ formobj.purchaseSystemName }}</span></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<div class="span-sty">开票名称</div>
@ -50,10 +56,10 @@
</el-col>
</el-row>
<div class="title">开票索赔单列表</div>
<el-table :key="tableKey" :data="formobj.detailList" :index="index" border style="width: 100%" :cell-style="cellStyle">
<el-table :key="tableKey" :data="formobj.detailList" :index="index" border style="width: 100%" :cell-style="cellStyle" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="claimBillNo" label="索赔单号" align="center" width="170" />
<el-table-column prop="repairBillNo" label="维修号" align="center" width="170" />
<el-table-column prop="repairBillNo" label="维修号" align="center" width="170" />
<el-table-column prop="vehMark" label="车牌号" align="center" width="100" />
<el-table-column prop="vinNo" label="车架号" align="center" width="100" />
<el-table-column prop="claimManufacturer" label="索赔厂家" align="center" width="120" />
@ -62,12 +68,47 @@
<el-table-column prop="claimOutAmount" label="外出费" align="center" width="120" />
<el-table-column prop="claimSubsidyAmount" label="厂家补助" align="center" width="120" />
<el-table-column prop="claimRescueAmount" label="施救费" align="center" width="120" />
<el-table-column prop="claimOtherAmount" label="其他费用" align="center" width="120" />
<el-table-column prop="claimOtherAmount" label="其它费用" align="center" width="120" />
<el-table-column prop="totalAmount" label="合计" align="center" width="120" />
<el-table-column prop="remarks" label="备注" align="center" min-width="200" />
</el-table>
<el-row>
<el-col :span="12">
<div class="titleOne">调增当月收入项目列表(厂家开票明细中索赔单以外补款项目)</div>
<el-table :key="bkxmKey" :data="formobj.supplementaryItems" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="projectName" label="项目名称" align="center" width="170" />
<el-table-column prop="amount" label="金额" align="center" width="100" />
<el-table-column prop="remarks" label="扣款原因" align="center" min-width="130" />
<el-table-column label="附件" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" style="padding-left: 5px" v-show="scope.row.supplementaryFiles.length > 0" @click="handleLook(scope.row.supplementaryFiles)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="12">
<div class="titleOne">调减当月收入项目列表(厂家开票明细中索赔单以外扣款项目)</div>
<el-table :key="kkxmKey" :data="formobj.deductionItems" :index="index" border style="width: 100%" show-summary :summary-method="getSummaries">
<el-table-column fixed width="60" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column prop="projectName" label="项目名称" align="center" width="170" />
<el-table-column prop="amount" label="金额" align="center" width="100" />
<el-table-column prop="remarks" label="扣款原因" align="center" min-width="130" />
<el-table-column label="附件" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" style="padding-left: 5px" v-show="scope.row.deductionFiles.length > 0" @click="handleLook(scope.row.deductionFiles)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</el-form>
</div>
</div>
<!-- 查看 -->
<el-dialog :visible.sync="dialogFileVisible">
<el-image style="width: 150px; height: 150px" v-for="(item, index) in list" :key="index" :src="item" :preview-src-list="list"/>
</el-dialog>
</div>
</template>
@ -81,7 +122,11 @@ export default {
viewTitle: '',
viewState: 1,
tableKey: 1,
bkxmKey: 2,
kkxmKey: 3,
index: 0,
dialogFileVisible: false,
list: [],
formobj: {
billNo: '',
createByName: '',
@ -90,6 +135,8 @@ export default {
deptSid: '',
createOrgSid: '',
createTime: '',
purchaseSystemName: '',
purchaseSystemSid: '',
detailList: [],
fileList: [],
invoiceKey: '',
@ -105,7 +152,9 @@ export default {
taskDefKey: '',
taskId: '',
useOrgName: '',
useOrgSid: ''
useOrgSid: '',
supplementaryItems: [],
deductionItems: []
},
rules: {},
//
@ -169,6 +218,41 @@ export default {
return cell
}
},
//
getSummaries(param) {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = ''
return
}
const values = data.map(item => Number(item[column.property]))
if (column.property === 'totalAmount' || column.property === 'amount') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return Math.round((parseFloat(prev) + parseFloat(curr)) * 100) / 100
} else {
return Math.round((parseFloat(prev)) * 100) / 100
}
}, 0)
sums[index] += ''
}
})
return sums
},
//
handleLook(row) {
this.dialogFileVisible = true
const aa = []
if (row.length > 0) {
row.forEach((e) => {
aa.push(e.url)
})
this.list = aa
}
},
/** 确认撤回任务 */
openRevoke() {
this.$confirm('是否确认执行撤回操作', '提示', {
@ -217,4 +301,11 @@ export default {
.addinputInfo {
margin-left: 120px !important;
}
.titleOne {
font-weight: bold;
font-size: 16px;
background-color: #0294d7;
color: #ffffff;
text-align: left;
}
</style>

3
yxt-as/src/main/java/com/yxt/anrui/as/api/asbillsettelapply/AsBillSettelApplyDetailsVo.java

@ -29,6 +29,7 @@ package com.yxt.anrui.as.api.asbillsettelapply;
import com.yxt.anrui.as.api.utils.FileUrlQuery;
import com.yxt.common.core.vo.Vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
@ -52,6 +53,8 @@ import java.util.List;
public class AsBillSettelApplyDetailsVo implements Vo {
@ApiModelProperty("反结算原因")
private String reason; // 反结算原因
private String settleTime;
private String actualAmount;
/**

1
yxt-as/src/main/java/com/yxt/anrui/as/api/asbusclaimbill/AsBusclaimBill.java

@ -16,6 +16,7 @@ import java.util.Date;
public class AsBusclaimBill extends BaseEntity {
private static final long serialVersionUID = 658254140218350561L;
@ApiModelProperty("索赔单号")
private String billNo;
@ApiModelProperty("上报日期")

9
yxt-as/src/main/java/com/yxt/anrui/as/biz/asbillsettelapply/AsBillSettelApplyService.java

@ -621,10 +621,19 @@ public class AsBillSettelApplyService extends MybatisBaseService<AsBillSettelApp
if (null != invoiceVo) {
if (StringUtils.isNotBlank(invoiceVo.getIsInvoicing())) {
vo.setIsInvoicing(invoiceVo.getIsInvoicing());
if (invoiceVo.getIsInvoicing().equals("1")){
vo.setIsInvoicing2("是");
} else {
vo.setIsInvoicing2("否");
}
} else {
vo.setIsInvoicing("0");
vo.setIsInvoicing2("否");
}
if (StringUtils.isNotBlank(invoiceVo.getTaxRate())) {
vo.setTaxRate(invoiceVo.getTaxRate());
}
}
BigDecimal costAmount = BigDecimal.ZERO;//成本合计
BigDecimal profit = BigDecimal.ZERO;//总利润额

Loading…
Cancel
Save