Merge branch 'dev-cq' into dev-cq-rudy20240806

This commit is contained in:
sxu 2024-08-06 17:06:46 +08:00
commit 9fbf60d747
5 changed files with 29 additions and 26 deletions

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.material.mapper; package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
import com.bonus.sgzb.material.domain.AgreementInfo; import com.bonus.sgzb.material.domain.AgreementInfo;
import com.bonus.sgzb.material.domain.CalMonthlyBean; import com.bonus.sgzb.material.domain.CalMonthlyBean;
import com.bonus.sgzb.material.domain.ProjectMonthCosts; import com.bonus.sgzb.material.domain.ProjectMonthCosts;
@ -35,7 +36,7 @@ public interface CalMonthlyMapper {
int updateProMonCosts(ProjectMonthCosts pmcId); int updateProMonCosts(ProjectMonthCosts pmcId);
List<ProjectMonthCosts> getMonthCosts(AgreementInfo agreementInfo); List<SltAgreementInfo> getMonthCosts(AgreementInfo agreementInfo);
List<ProjectMonthDetail> getMonthDetails(ProjectMonthCosts monthCost); List<SltAgreementInfo> getMonthDetails(SltAgreementInfo monthCost);
} }

View File

@ -15,7 +15,7 @@ public class Inform {
private final int CAL_DAY = 6; private final int CAL_DAY = 6;
@Scheduled(cron = "0 */1 * * * ? ") // 间隔5分钟执行 // @Scheduled(cron = "0 */1 * * * ? ") // 间隔5分钟执行
// @Scheduled(cron = "0 0 1 22 * ? ") // 每个月22日凌晨1点执行 // @Scheduled(cron = "0 0 1 22 * ? ") // 每个月22日凌晨1点执行
@Async @Async
public void taskCycle() { public void taskCycle() {

View File

@ -5,6 +5,7 @@ import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
import com.bonus.sgzb.base.api.domain.SltInfoVo; import com.bonus.sgzb.base.api.domain.SltInfoVo;
import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.material.domain.AgreementInfo; import com.bonus.sgzb.material.domain.AgreementInfo;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@ -39,7 +40,7 @@ public interface SltAgreementInfoService {
int updateTrimDay(List<SltAgreementInfo> sltAgreementInfo); int updateTrimDay(List<SltAgreementInfo> sltAgreementInfo);
List<SltAgreementInfo> getSltInfoMonth(List<AgreementInfo> list); List getSltInfoMonth(List<AgreementInfo> list);
int updateOutSourceCosts(SltAgreementInfo sltAgreementInfo); int updateOutSourceCosts(SltAgreementInfo sltAgreementInfo);
} }

View File

@ -20,6 +20,7 @@ import com.bonus.sgzb.material.mapper.SltAgreementInfoMapper;
import com.bonus.sgzb.material.service.SltAgreementInfoService; import com.bonus.sgzb.material.service.SltAgreementInfoService;
import com.bonus.sgzb.material.vo.GlobalContants; import com.bonus.sgzb.material.vo.GlobalContants;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -406,7 +407,6 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
@Override @Override
public List getSltInfoMonth(List<AgreementInfo> list) { public List getSltInfoMonth(List<AgreementInfo> list) {
List<SltAgreementInfo> leaseListMonth = new ArrayList<>(); List<SltAgreementInfo> leaseListMonth = new ArrayList<>();
List<ProjectMonthCosts> monthCostsList = new ArrayList<>();
Integer num = 0; Integer num = 0;
//租赁费用列表 //租赁费用列表
for (AgreementInfo agreementInfo : list) { for (AgreementInfo agreementInfo : list) {
@ -414,21 +414,21 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService {
if (agreementInfo.getStartTime() == null || DateTimeHelper.getNowMonth().equals(DateTimeHelper.getNowMonth(DateTimeHelper.parse(agreementInfo.getEndTime(), "yyyy-MM")))) { if (agreementInfo.getStartTime() == null || DateTimeHelper.getNowMonth().equals(DateTimeHelper.getNowMonth(DateTimeHelper.parse(agreementInfo.getEndTime(), "yyyy-MM")))) {
List<SltAgreementInfo> listMonth = getLeaseListMonth(agreementInfo, num); List<SltAgreementInfo> listMonth = getLeaseListMonth(agreementInfo, num);
leaseListMonth.addAll(listMonth); leaseListMonth.addAll(listMonth);
return leaseListMonth;
} else { } else {
// 查定时任务记录的数据 // 查定时任务记录的数据
List<ProjectMonthCosts> listMonth = getLeaseJobListMonth(agreementInfo); List<SltAgreementInfo> listMonth = getLeaseJobListMonth(agreementInfo);
monthCostsList.addAll(listMonth); leaseListMonth.addAll(listMonth);
return monthCostsList;
} }
} }
return new ArrayList<>(); return leaseListMonth;
} }
private List<ProjectMonthCosts> getLeaseJobListMonth(AgreementInfo agreementInfo) { private List<SltAgreementInfo> getLeaseJobListMonth(AgreementInfo agreementInfo) {
List<ProjectMonthCosts> monthCosts = calMonthlyMapper.getMonthCosts(agreementInfo); List<SltAgreementInfo> monthCosts = calMonthlyMapper.getMonthCosts(agreementInfo);
for (ProjectMonthCosts monthCost : monthCosts) { int num = 0;
List<ProjectMonthDetail> monthDetails = calMonthlyMapper.getMonthDetails(monthCost); for (SltAgreementInfo monthCost : monthCosts) {
monthCost.setCodeNum(num++);
List<SltAgreementInfo> monthDetails = calMonthlyMapper.getMonthDetails(monthCost);
monthCost.setNode(monthDetails); monthCost.setNode(monthDetails);
} }
return monthCosts; return monthCosts;

View File

@ -25,7 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select id,month from calc_project_month select id,month from calc_project_month
where month = #{month} where month = #{month}
</select> </select>
<select id="getMonthCosts" resultType="com.bonus.sgzb.material.domain.ProjectMonthCosts">
<select id="getMonthCosts" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
SELECT SELECT
pmc.id as id, pmc.id as id,
bui.unit_name AS unitName, bui.unit_name AS unitName,
@ -35,14 +36,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pmc.costs as costs pmc.costs as costs
FROM FROM
project_month_costs pmc project_month_costs pmc
LEFT JOIN slt_project_month spm ON pmc.slt_month_id = spm.id LEFT JOIN slt_project_month spm ON pmc.slt_month_id = spm.id
LEFT JOIN bm_agreement_info bai ON pmc.agreement_id = bai.agreement_id LEFT JOIN bm_agreement_info bai ON pmc.agreement_id = bai.agreement_id
LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_id LEFT JOIN bm_project_lot bp ON bp.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
WHERE WHERE
spm.month = DATE_FORMAT(#{endTime}, '%Y-%m') spm.month = DATE_FORMAT(#{endTime}, '%Y-%m')
</select> </select>
<select id="getMonthDetails" resultType="com.bonus.sgzb.material.domain.ProjectMonthDetail"> <select id="getMonthDetails" resultType="com.bonus.sgzb.base.api.domain.SltAgreementInfo">
SELECT SELECT
mt1.type_name AS typeName, mt1.type_name AS typeName,
mt.type_name AS modelName, mt.type_name AS modelName,
@ -60,12 +61,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pmd.month_temporarily_costs as realCosts pmd.month_temporarily_costs as realCosts
FROM FROM
project_month_detail pmd project_month_detail pmd
LEFT JOIN project_month_costs pmc ON pmd.pro_month_cost_id = pmc.id LEFT JOIN project_month_costs pmc ON pmd.pro_month_cost_id = pmc.id
LEFT JOIN bm_unit_info bui ON bui.unit_id = pmc.unit_id LEFT JOIN bm_unit_info bui ON bui.unit_id = pmc.unit_id
LEFT JOIN bm_project_lot bp ON bp.lot_id = pmc.project_id LEFT JOIN bm_project_lot bp ON bp.lot_id = pmc.project_id
LEFT JOIN ma_type mt ON pmd.type_id = mt.type_id LEFT JOIN ma_type mt ON pmd.type_id = mt.type_id
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
LEFT JOIN ma_machine mm ON mm.ma_id = pmd.ma_id LEFT JOIN ma_machine mm ON mm.ma_id = pmd.ma_id
WHERE WHERE
pmc.id = #{id} pmc.id = #{id}
</select> </select>