同步代码

This commit is contained in:
sxu 2024-08-23 17:34:52 +08:00
parent fc0e7e66f4
commit b0f06c6e6f
8 changed files with 32 additions and 107 deletions

View File

@ -159,4 +159,7 @@ public class Constants
*/
public static final String privateKey = "MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAqhHyZfSsYourNxaY7Nt+PrgrxkiA50efORdI5U5lsW79MmFnusUA355oaSXcLhu5xxB38SMSyP2KvuKNPuH3owIDAQABAkAfoiLyL+Z4lf4Myxk6xUDgLaWGximj20CUf+5BKKnlrK+Ed8gAkM0HqoTt2UZwA5E2MzS4EI2gjfQhz5X28uqxAiEA3wNFxfrCZlSZHb0gn2zDpWowcSxQAgiCstxGUoOqlW8CIQDDOerGKH5OmCJ4Z21v+F25WaHYPxCFMvwxpcw99EcvDQIgIdhDTIqD2jfYjPTY8Jj3EDGPbH2HHuffvflECt3Ek60CIQCFRlCkHpi7hthhYhovyloRYsM+IS9h/0BzlEAuO0ktMQIgSPT3aFAgJYwKpqRYKlLDVcflZFCKY7u3UP8iWi1Qw0Y=";
public static final String INNER_PROTOCAL = "1"; //内部单位协议
public static final String OUTER_PROTOCAL = "2"; //外部单位协议
}

View File

@ -10,6 +10,7 @@ import com.bonus.sgzb.base.api.domain.*;
import com.bonus.sgzb.base.mapper.MaLabelBindMapper;
import com.bonus.sgzb.base.mapper.MaMachineMapper;
import com.bonus.sgzb.base.vo.MaLabelBindVO;
import com.bonus.sgzb.common.core.constant.Constants;
import com.bonus.sgzb.common.core.utils.StringUtils;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
@ -361,9 +362,9 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
if (StringUtils.isEmpty(protocol)) {
ma.setFinalPrice(ma.getLeasePrice());
} else {
if ("1".equals(protocol)) {
if (Constants.INNER_PROTOCAL.equals(protocol)) {
ma.setFinalPrice(ma.getLeasePrice());
} else if ("2".equals(protocol)) {
} else if (Constants.OUTER_PROTOCAL.equals(protocol)) {
ma.setFinalPrice(ma.getRentPrice());
} else {
ma.setFinalPrice(ma.getLeasePrice());

View File

@ -101,6 +101,7 @@ public class SltAgreementInfoController extends BaseController {
List<SltAgreementInfo> sltInfoMonth = sltAgreementInfoService.getSltInfoMonth(list);
List<List<MonthRepairInfo>> allLists = new ArrayList<>();
for (AgreementInfo agreementInfo : list) {
List<MonthRepairInfo> list1 = new ArrayList<>();
for (SltAgreementInfo sltAgreementInfo : sltInfoMonth) {
// 单个协议导出
if (StringUtils.isNotBlank(agreementInfo.getCodeNum())) {
@ -109,17 +110,20 @@ public class SltAgreementInfoController extends BaseController {
if (s.equals(sltAgreementInfo.getCodeNum().toString())) {
List<SltAgreementInfo> node = sltAgreementInfo.getNode();
List<MonthRepairInfo> leaseInfoList = Convert.toList(MonthRepairInfo.class, node);
allLists.add(leaseInfoList);
list1.addAll(leaseInfoList);
}
}
} else {
if (String.valueOf(agreementInfo.getAgreementId()).equals(sltAgreementInfo.getAgreementId())){
// 多个协议导出
List<SltAgreementInfo> node = sltAgreementInfo.getNode();
List<MonthRepairInfo> leaseInfoList = Convert.toList(MonthRepairInfo.class, node);
allLists.add(leaseInfoList);
list1.addAll(leaseInfoList);
}
}
}
allLists.add(list1);
}
exportMultipleLists(allLists, response);
}
@ -283,7 +287,7 @@ public class SltAgreementInfoController extends BaseController {
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), MonthRepairInfo.class).build();
for (int i = 0; i < lists.size(); i++) {
WriteSheet writeSheet = EasyExcel.writerSheet("Sheet" + (i + 1)).build();
WriteSheet writeSheet = EasyExcel.writerSheet(lists.get(i).get(0).getProjectName()).build();
excelWriter.write(lists.get(i), writeSheet);
}

View File

@ -118,8 +118,6 @@ public interface BackApplyMapper {
* @param bean
* @return
*/
List<TypeTreeNode> getUseTypeTree(BackApplyInfo bean);
List<TypeTreeNode> getUseTypeTreeL4(BackApplyInfo bean);
List<TypeTreeNode> getUseTypeTreeL3(List<Long> list);

View File

@ -369,11 +369,13 @@ public class BackApplyServiceImpl implements BackApplyService {
List<TypeTreeNode> listL3 = new ArrayList<>();
List<TypeTreeNode> listL21 = new ArrayList<>();
try {
//list = backApplyMapper.getUseTypeTree(bean);
// 先查第四层类型
listL4 = backApplyMapper.getUseTypeTreeL4(bean);
List<Long> list4ParentIds = listL4.stream().map(o -> o.getParentId()).collect(Collectors.toList());
// 根据第四层parentId 查第三层类型
listL3 = backApplyMapper.getUseTypeTreeL3(list4ParentIds);
List<Long> list3ParentIds = listL3.stream().map(o -> o.getParentId()).collect(Collectors.toList());
// 根据第三层parentId 查第1.2层类型
listL21 = backApplyMapper.getUseTypeTreeL21(list3ParentIds);
list.addAll(listL4);
list.addAll(listL3);

View File

@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="authPerson != null">#{authPerson},</if>
<if test="phone != null">#{phone},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="protocol != null">#{protocol},</if>
1,
NOW(),
<if test="remark != null">#{remark},</if>
<if test="companyId != null">#{companyId},</if>

View File

@ -610,106 +610,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- LEVEL ASC;-->
<!-- </select>-->
<select id="getUseTypeTree" resultType="com.bonus.sgzb.material.domain.TypeTreeNode">
-- 查询从第四级到第一级的所有类型及相关信息
SELECT
t4.type_id,
t4.type_name,
t4.parent_id,
t4.unit_name,
t4.company_id,
COALESCE(SUM(CASE WHEN sai.agreement_id = #{agreementId} AND sai.status = '0' THEN sai.num ELSE 0 END), 0) AS num,
4 AS LEVEL
FROM
ma_type t4
LEFT JOIN slt_agreement_info sai ON t4.type_id = sai.type_id
WHERE
t4.level = 4
AND EXISTS (
SELECT 1 FROM slt_agreement_info sai2
WHERE sai2.type_id = t4.type_id AND sai2.agreement_id = #{agreementId} AND sai2.status = '0'
)
GROUP BY
t4.type_id
UNION ALL
SELECT
t3.type_id,
t3.type_name,
t3.parent_id,
t3.unit_name,
t3.company_id,
0 AS num,
3 AS LEVEL
FROM
ma_type t3
INNER JOIN (
SELECT DISTINCT t4.parent_id
FROM ma_type t4
WHERE t4.level = 4
) AS parent_t4 ON t3.type_id = parent_t4.parent_id
UNION ALL
SELECT
t2.type_id,
t2.type_name,
t2.parent_id,
t2.unit_name,
t2.company_id,
0 AS num,
2 AS LEVEL
FROM
ma_type t2
INNER JOIN (
SELECT DISTINCT t3.parent_id
FROM ma_type t3
WHERE t3.level = 3
) AS parent_t3 ON t2.type_id = parent_t3.parent_id
UNION ALL
SELECT
t1.type_id,
t1.type_name,
t1.parent_id,
t1.unit_name,
t1.company_id,
0 AS num,
1 AS LEVEL
FROM
ma_type t1
INNER JOIN (
SELECT DISTINCT t2.parent_id
FROM ma_type t2
WHERE t2.level = 2
) AS parent_t2 ON t1.type_id = parent_t2.parent_id
ORDER BY
LEVEL ASC, type_id;
</select>
<select id="getUseTypeTreeL4" resultType="com.bonus.sgzb.material.domain.TypeTreeNode">
SELECT
t4.type_id,
t4.type_name,
t4.parent_id,
t4.unit_name,
t4.company_id,
COALESCE(SUM(CASE WHEN sai.agreement_id = #{agreementId} AND sai.status = '0' THEN sai.num ELSE 0 END), 0) AS num,
4 AS LEVEL
mt.type_id,
mt.type_name,
mt.parent_id,
mt.unit_name as unitNames,
mt.company_id,
SUM( CASE WHEN sai.agreement_id = #{agreementId} AND sai.STATUS = '0' THEN sai.num ELSE 0 END ) AS num,
mt.LEVEL
FROM
ma_type t4
LEFT JOIN slt_agreement_info sai ON t4.type_id = sai.type_id
ma_type mt
LEFT JOIN slt_agreement_info sai ON mt.type_id = sai.type_id
WHERE
t4.level = 4
AND EXISTS (
SELECT 1 FROM slt_agreement_info sai2
WHERE sai2.type_id = t4.type_id AND sai2.agreement_id = #{agreementId} AND sai2.status = '0'
)
EXISTS ( SELECT 1 FROM slt_agreement_info sai2 WHERE sai2.type_id = mt.type_id AND sai2.agreement_id = #{agreementId} AND sai2.STATUS = '0' and sai.lease_type = 0)
GROUP BY
t4.type_id
mt.type_id
</select>
<select id="getUseTypeTreeL3" resultType="com.bonus.sgzb.material.domain.TypeTreeNode">

View File

@ -32,6 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
bui.unit_name AS unitName,
bp.lot_name AS projectName,
spm.month as month,
pmc.agreement_id as agreementId,
pmc.cost_bearing_party as costBearingParty,
pmc.costs as costs
FROM