查询显示科目单价;
This commit is contained in:
+73
-5
@@ -4,8 +4,11 @@ import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.basic.domain.contractManage.entity.ContractManage;
|
||||
import com.mhd.basic.domain.contractManage.repository.mapper.ContractManageMapper;
|
||||
import com.mhd.basic.domain.contractManage.repository.po.ContractManagePO;
|
||||
import com.mhd.basic.domain.contractManage.repository.todo.ContractManageDO;
|
||||
import com.mhd.basic.domain.contractManage.service.ContractManageDomainService;
|
||||
@@ -17,11 +20,9 @@ import com.mhd.basic.domain.contractManageDetail.service.ContractManageDetailDom
|
||||
import com.mhd.basic.domain.expenseAccount.repository.po.ExpenseAccountPO;
|
||||
import com.mhd.basic.domain.expenseAccount.service.ExpenseAccountDomainService;
|
||||
import com.mhd.basic.interfaces.dto.contractManage.ContractManageDTO;
|
||||
import com.mhd.basic.interfaces.dto.contractManage.SubjectAndPriceDTO;
|
||||
import com.mhd.basic.interfaces.dto.contractManageDetail.ContractManageDetailDTO;
|
||||
import com.mhd.common.core.domain.po.BillingRulesPO;
|
||||
import com.mhd.common.core.domain.po.DocumentTypePO;
|
||||
import com.mhd.common.core.domain.po.SettlementCustomersPO;
|
||||
import com.mhd.common.core.domain.po.SysDictDataVo;
|
||||
import com.mhd.common.core.domain.po.*;
|
||||
import com.mhd.common.core.enums.DictCode;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
|
||||
@@ -42,6 +43,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -63,8 +65,10 @@ public class ContractManageApplicationService {
|
||||
private ExpenseAccountDomainService expenseAccountDomainService;
|
||||
@Autowired
|
||||
private ContractManageDetailDomainService contractManageDetailDomainService;
|
||||
@Autowired
|
||||
@Resource
|
||||
private ContractManageDetailMapper contractManageDetailMapper;
|
||||
@Resource
|
||||
private ContractManageMapper contractManageMapper;
|
||||
@Autowired
|
||||
private BmsServiceFeign bmsServiceFeign;
|
||||
|
||||
@@ -125,6 +129,70 @@ public class ContractManageApplicationService {
|
||||
return contractManageDomainService.queryList(contractManageDO);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getSubjectAndPrice(SubjectAndPriceDTO contractManageDTO) {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
Long settlementCustomersId = contractManageDTO.getSettlementCustomersId();
|
||||
Long organizationId = contractManageDTO.getOrganizationId();
|
||||
String sunjectCode = contractManageDTO.getSubjectCode();
|
||||
Long topOrganizationId = contractManageDTO.getTopOrganizationId();
|
||||
List<ContractManage> UserContractManages = contractManageMapper.selectList(new LambdaQueryWrapper<ContractManage>()
|
||||
.eq(ContractManage::getSettlementCustomersId, settlementCustomersId)
|
||||
.eq(ContractManage::getDelFlag, 1)
|
||||
.eq(ContractManage::getOrganizationId, organizationId)
|
||||
.eq(ContractManage::getTopOrganizationId, topOrganizationId)
|
||||
.eq(ContractManage::getCommonContractFlag, 2));
|
||||
if (UserContractManages != null && UserContractManages.size() > 0) {
|
||||
}else{
|
||||
List<ContractManage> commonContractManages = contractManageMapper.selectList(new LambdaQueryWrapper<ContractManage>()
|
||||
.eq(ContractManage::getDelFlag, 1)
|
||||
.eq(ContractManage::getOrganizationId, organizationId)
|
||||
.eq(ContractManage::getTopOrganizationId, topOrganizationId)
|
||||
.eq(ContractManage::getCommonContractFlag, 1));
|
||||
if (commonContractManages != null && commonContractManages.size() > 0) {
|
||||
ContractManage contractManage = commonContractManages.get(0);
|
||||
Long contractManageId = contractManage.getContractManageId();
|
||||
List<ContractManageDetail> contractManageDetails = contractManageDetailMapper.selectList(new LambdaQueryWrapper<ContractManageDetail>()
|
||||
.eq(ContractManageDetail::getContractManageId, contractManageId)
|
||||
.eq(ContractManageDetail::getDelFlag, 1));
|
||||
if (contractManageDetails != null && contractManageDetails.size() > 0) {
|
||||
for (ContractManageDetail contractManageDetail : contractManageDetails) {
|
||||
String code = contractManageDetail.getFirstSubjectCode();
|
||||
if (sunjectCode.equals(code)) {
|
||||
Long accountingStrategyId = contractManageDetail.getAccountingStrategyId();
|
||||
BillingRulesPO billingRule = contractManageDetailMapper.getBillingRules(accountingStrategyId);
|
||||
if (billingRule != null) {
|
||||
Long billingRulesId = billingRule.getBillingRulesId();
|
||||
List<BillingParamsPO> billingParams = contractManageDetailMapper.getBillingParams(billingRulesId);
|
||||
if (billingParams != null && billingParams.size() > 0) {
|
||||
BillingParamsPO billingParam = billingParams.get(0);
|
||||
String billingParamsJson = billingParam.getBillingParamsJson();
|
||||
String preSetRules = billingParam.getPreSetRules();
|
||||
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");
|
||||
if (fieldsName != null && ("装卸费单价".equals(fieldsName) ||
|
||||
"纸箱贴标单价".equals(fieldsName)||"木箱贴标单价".equals(fieldsName)
|
||||
|| "进出仓操作费单价".equals(fieldsName))) {
|
||||
Map<String, Object> subjectAndPrice = billingParamsList.get(0);
|
||||
String sort = (String) stringObjectMap.get("sort");
|
||||
String price = (String) stringObjectMap1.get("fields" + sort);
|
||||
subjectAndPrice.put("name", fieldsName);
|
||||
subjectAndPrice.put("price", price);
|
||||
result.add(subjectAndPrice);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增合同管理
|
||||
|
||||
+7
-1
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.basic.domain.contractManageDetail.entity.ContractManageDetail;
|
||||
import com.mhd.basic.domain.contractManageDetail.repository.po.ContractManageDetailPO;
|
||||
import com.mhd.basic.domain.contractManageDetail.repository.todo.ContractManageDetailDO;
|
||||
import com.mhd.common.core.domain.po.BillingParamsPO;
|
||||
import com.mhd.common.core.domain.po.BillingRulesPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 合同管理详情Mapper接口
|
||||
@@ -20,4 +22,8 @@ public interface ContractManageDetailMapper extends BaseMapper<ContractManageDet
|
||||
public List<ContractManageDetailPO> queryList(@Param("contractManageDetailDO") ContractManageDetailDO contractManageDetailDO);
|
||||
|
||||
List<ContractManageDetailPO> getListByContractManageId(@Param("contractManageId") Long contractManageId);
|
||||
}
|
||||
|
||||
BillingRulesPO getBillingRules(@Param("id") Long id);
|
||||
|
||||
List<BillingParamsPO> getBillingParams(@Param("id") Long id);
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.mhd.basic.interfaces.dto.contractManage;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SubjectAndPriceDTO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("结算主体")
|
||||
@Excel(name = "结算主体")
|
||||
private Long settlementCustomersId;
|
||||
|
||||
@ApiModelProperty("价格")
|
||||
@Excel(name = "价格")
|
||||
private String subjectCode;
|
||||
}
|
||||
+13
-1
@@ -3,6 +3,7 @@ package com.mhd.basic.interfaces.facade.contractManage;
|
||||
import java.util.List;
|
||||
|
||||
import com.mhd.basic.interfaces.assember.contractManage.ContractManageAssembler;
|
||||
import com.mhd.basic.interfaces.dto.contractManage.SubjectAndPriceDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -46,6 +47,17 @@ public class ContractManageApi extends BaseController{
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取科目和单价
|
||||
*/
|
||||
@ApiOperation("获取科目和单价")
|
||||
@GetMapping("/getSubjectAndPrice")
|
||||
public AjaxResult getSubjectAndPrice(SubjectAndPriceDTO subjectAndPriceDTO)
|
||||
{
|
||||
//转换实体
|
||||
return AjaxResult.success(contractManageApplicationService.getSubjectAndPrice(subjectAndPriceDTO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存合同管理
|
||||
*/
|
||||
@@ -146,4 +158,4 @@ public class ContractManageApi extends BaseController{
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+9
-1
@@ -76,4 +76,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
WHERE
|
||||
contract_manage_id = #{contractManageId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
<select id="getBillingRules" resultType="com.mhd.common.core.domain.po.BillingRulesPO" parameterType="java.lang.Long">
|
||||
select * from "NGWL_TEST_BMS".billing_rules where billing_rules_id = #{id} and del_flag = 1
|
||||
</select>
|
||||
|
||||
<select id="getBillingParams" resultType="com.mhd.common.core.domain.po.BillingParamsPO" parameterType="java.lang.Long">
|
||||
select * from "NGWL_TEST_BMS".billing_params where billing_rules_id = #{id} and del_flag = 1
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user