计费单据查询单价;
This commit is contained in:
+58
@@ -337,6 +337,64 @@ public class ContractManageApplicationService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<SubjectAndPriceReturn> getPrice(String documentTypeCode, String settlementCustomersCode,Long organizationId,Long topOrganizationId) {
|
||||||
|
List<SubjectAndPriceReturn> result = new ArrayList<>();
|
||||||
|
ContractManagePO contractManagePO = getInfoByCustomerAndOrganizationId(settlementCustomersCode, 1, topOrganizationId, organizationId);
|
||||||
|
if (contractManagePO != null) {
|
||||||
|
List<ContractManageDetailPO> contractManageDetailPOList = contractManagePO.getContractManageDetailPOList();
|
||||||
|
if (contractManageDetailPOList != null && contractManageDetailPOList.size() > 0) {
|
||||||
|
List<ContractManageDetailPO> contractManageDetailPOs = contractManageDetailPOList.stream()
|
||||||
|
.filter(item -> item.getDocumentType().equals(documentTypeCode))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (contractManageDetailPOs != null && contractManageDetailPOs.size() > 0) {
|
||||||
|
for (ContractManageDetailPO contractManageDetailPO : contractManageDetailPOs) {
|
||||||
|
Long accountingStrategyId = contractManageDetailPO.getAccountingStrategyId();
|
||||||
|
List<BillingParamsPO> billingParams = contractManageDetailMapper.getBillingParams(accountingStrategyId);
|
||||||
|
if (billingParams != null && billingParams.size() > 0) {
|
||||||
|
//if (billingParams != null && billingParams.size() > 0) {
|
||||||
|
BillingParamsPO billingParam = billingParams.get(0);
|
||||||
|
String billingParamsJson = billingParam.getBillingParamsJson();
|
||||||
|
String preSetRules = billingParam.getPreSetRules();
|
||||||
|
Long billingParamsId = billingParam.getBillingParamsId();
|
||||||
|
List<Map<String, Object>> preSetRulesList = JSON.parseObject(preSetRules, new TypeReference<List<Map<String, Object>>>() {});
|
||||||
|
List<Map<String, Object>> billingParamsList = JSON.parseObject(billingParamsJson, new TypeReference<List<Map<String, Object>>>() {});
|
||||||
|
Map<String, Object> stringObjectMap1 = preSetRulesList.get(0);
|
||||||
|
for (Map<String, Object> stringObjectMap : billingParamsList) {
|
||||||
|
String fieldsName = (String) stringObjectMap.get("fieldsName");
|
||||||
|
String isShow = (String) stringObjectMap.get("isShow");
|
||||||
|
String isFee = (String) stringObjectMap.get("isFee");
|
||||||
|
String isPush = (String) stringObjectMap.get("isPush");
|
||||||
|
if ("1".equals(isFee)) {
|
||||||
|
Integer sort = (Integer) stringObjectMap.get("sort");
|
||||||
|
String chargingId = (String) stringObjectMap.get("chargingId");
|
||||||
|
String fields = (String) stringObjectMap.get("fields");
|
||||||
|
String price = (String) stringObjectMap1.get("fields" + sort);
|
||||||
|
SubjectAndPriceReturn subjectAndPriceReturn = new SubjectAndPriceReturn();
|
||||||
|
subjectAndPriceReturn.setName(fieldsName);
|
||||||
|
subjectAndPriceReturn.setPrice(new BigDecimal(price));
|
||||||
|
subjectAndPriceReturn.setChargingId(chargingId);
|
||||||
|
subjectAndPriceReturn.setFields(fields);
|
||||||
|
subjectAndPriceReturn.setBillingRulesId(accountingStrategyId);
|
||||||
|
subjectAndPriceReturn.setIsShow(isShow);
|
||||||
|
subjectAndPriceReturn.setIsFee(isFee);
|
||||||
|
subjectAndPriceReturn.setIsPush(isPush);
|
||||||
|
subjectAndPriceReturn.setRulesId(billingParamsId);
|
||||||
|
result.add(subjectAndPriceReturn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//}
|
||||||
|
} else {
|
||||||
|
throw new ServiceException("计费参数不存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw new ServiceException("合同信息不存在");
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public List<SubjectAndPriceReturn> getSubject(SubjectAndPriceDTO contractManageDTO) {
|
public List<SubjectAndPriceReturn> getSubject(SubjectAndPriceDTO contractManageDTO) {
|
||||||
List<SubjectAndPriceReturn> result = new ArrayList<>();
|
List<SubjectAndPriceReturn> result = new ArrayList<>();
|
||||||
Long settlementCustomersId = contractManageDTO.getSettlementCustomersId();
|
Long settlementCustomersId = contractManageDTO.getSettlementCustomersId();
|
||||||
|
|||||||
+13
@@ -70,6 +70,19 @@ public class ContractManageApi extends BaseController{
|
|||||||
return AjaxResult.success(contractManageApplicationService.getSubject(subjectAndPriceDTO));
|
return AjaxResult.success(contractManageApplicationService.getSubject(subjectAndPriceDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取单价
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取单价")
|
||||||
|
@GetMapping(value = "/getPrice")
|
||||||
|
public AjaxResult getPrice(@RequestParam("documentTypeCode") String documentTypeCode,
|
||||||
|
@RequestParam("settlementCustomersCode") String settlementCustomersCode,
|
||||||
|
@RequestParam("organizationId") Long organizationId,
|
||||||
|
@RequestParam("topOrganizationId") Long topOrganizationId)
|
||||||
|
{
|
||||||
|
return AjaxResult.success(contractManageApplicationService.getPrice(documentTypeCode,settlementCustomersCode,organizationId,topOrganizationId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取科目和单价
|
* 获取科目和单价
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user