|
|
@ -5,8 +5,10 @@ import com.qs.serve.common.config.properties.ProjectApisProperties; |
|
|
|
import com.qs.serve.common.model.enums.BudgetLogOptFlag; |
|
|
|
import com.qs.serve.common.model.consts.ResultFlag; |
|
|
|
import com.qs.serve.common.util.*; |
|
|
|
import com.qs.serve.modules.bms.entity.BmsCostCenter; |
|
|
|
import com.qs.serve.modules.bms.entity.BmsSubject; |
|
|
|
import com.qs.serve.modules.bms.entity.BmsSupplier; |
|
|
|
import com.qs.serve.modules.bms.service.BmsCostCenterService; |
|
|
|
import com.qs.serve.modules.bms.service.BmsSubjectService; |
|
|
|
import com.qs.serve.modules.bms.service.BmsSupplierService; |
|
|
|
import com.qs.serve.modules.goods.entity.GoodsCategory; |
|
|
@ -77,6 +79,7 @@ public class PortalOfCostApplication { |
|
|
|
|
|
|
|
private BmsSupplierService supplierService; |
|
|
|
private BmsSubjectService subjectService; |
|
|
|
private BmsCostCenterService costCenterService; |
|
|
|
|
|
|
|
private SysUserService userService; |
|
|
|
|
|
|
@ -538,6 +541,8 @@ public class PortalOfCostApplication { |
|
|
|
if(supplier==null){Assert.throwEx("客户不存在,请重新编辑");} |
|
|
|
BmsSubject subject = subjectService.getByCode(createBo.getSubjectCode()); |
|
|
|
if(subject==null){Assert.throwEx("科目不存在,请重新编辑");} |
|
|
|
BmsCostCenter costCenter = costCenterService.getByCode(createBo.getCenterCode()); |
|
|
|
if(costCenter==null){Assert.throwEx("成本中心不存在,请重新编辑");} |
|
|
|
//发票号
|
|
|
|
String billNumber = createBo.getBillNumber(); |
|
|
|
String disNumber = createBo.getErpCode(); |
|
|
@ -565,7 +570,7 @@ public class PortalOfCostApplication { |
|
|
|
List<GoodsSku> skuList = this.initSkuListOfProcess(invCodeList); |
|
|
|
//常用参数
|
|
|
|
final String GOODS_TYPE = "sku"; |
|
|
|
final String CENTER_TYPE = "customer"; |
|
|
|
final String CENTER_TYPE = "center"; |
|
|
|
final BigDecimal OneHundred = new BigDecimal("100"); |
|
|
|
LocalDateTime nowTime = LocalDateTime.now(); |
|
|
|
LocalDate nowDate = LocalDate.now(); |
|
|
@ -588,6 +593,7 @@ public class PortalOfCostApplication { |
|
|
|
//构建费用申请
|
|
|
|
TbsCostApply costApply = new TbsCostApply(); |
|
|
|
costApply.setCode(costCode); |
|
|
|
costApply.setMatchType(1); |
|
|
|
costApply.setChargeTheme(costTheme); |
|
|
|
costApply.setChargeState(TbsCostApplyState.State_3_finished.getCode()); |
|
|
|
costApply.setSupplierId(supplierId); |
|
|
@ -634,9 +640,9 @@ public class PortalOfCostApplication { |
|
|
|
activityCenter.setCenterAmount(totalAmount); |
|
|
|
activityCenter.setCenterRate(OneHundred); |
|
|
|
activityCenter.setCenterType(CENTER_TYPE); |
|
|
|
activityCenter.setCenterId(supplier.getId()); |
|
|
|
activityCenter.setCenterName(supplier.getName()); |
|
|
|
activityCenter.setCenterCode(supplier.getCode()); |
|
|
|
activityCenter.setCenterId(costCenter.getId()+""); |
|
|
|
activityCenter.setCenterName(costCenter.getName()); |
|
|
|
activityCenter.setCenterCode(costCenter.getCode()); |
|
|
|
activityCenter.setUsedAmount(totalAmount); |
|
|
|
|
|
|
|
//活动-商品
|
|
|
@ -667,9 +673,9 @@ public class PortalOfCostApplication { |
|
|
|
centerGoods.setSupplierName(supplier.getName()); |
|
|
|
//设置成本中心
|
|
|
|
centerGoods.setCenterType(CENTER_TYPE); |
|
|
|
centerGoods.setCenterId(supplier.getId()); |
|
|
|
centerGoods.setCenterCode(supplier.getCode()); |
|
|
|
centerGoods.setCenterName(supplier.getName()); |
|
|
|
centerGoods.setCenterId(costCenter.getId()+""); |
|
|
|
centerGoods.setCenterCode(costCenter.getCode()); |
|
|
|
centerGoods.setCenterName(costCenter.getName()); |
|
|
|
centerGoods.setCenterRate(OneHundred); |
|
|
|
centerGoods.setCenterAmount(totalAmount); |
|
|
|
//设置科目
|
|
|
@ -729,7 +735,7 @@ public class PortalOfCostApplication { |
|
|
|
Arrays.asList(activity), |
|
|
|
Arrays.asList(activitySubject), |
|
|
|
activityCenterGoodsList, |
|
|
|
Arrays.asList(activityCenter),true,false,false); |
|
|
|
Arrays.asList(activityCenter),false,false,false); |
|
|
|
|
|
|
|
//不匹配的商品,保存到无预算表
|
|
|
|
List<TbsBudgetCostItem> unMatchBudgetItem = budgetCostResult.getBudgetUnMatchList(); |
|
|
|