springboot未授权访问漏洞修改

This commit is contained in:
liang.chao 2024-09-29 15:37:48 +08:00
parent f158d87798
commit 419ec25e37
7 changed files with 75 additions and 1 deletions

View File

@ -1,8 +1,10 @@
package com.bonus.sgzb.material.mapper; package com.bonus.sgzb.material.mapper;
import com.bonus.sgzb.base.domain.BmProjectLot;
import com.bonus.sgzb.material.domain.AgreementInfo; import com.bonus.sgzb.material.domain.AgreementInfo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -83,4 +85,12 @@ public interface AgreementInfoMapper {
int selectByagreementId(Long agreementId); int selectByagreementId(Long agreementId);
List<AgreementInfo> getAllAgreementId(); List<AgreementInfo> getAllAgreementId();
BigDecimal getCostByLotId(BmProjectLot agreementInfo);
List<BmProjectLot> getAllprojectId();
BigDecimal getCostIndicatorsByLotId(BmProjectLot bmProjectLot);
List<AgreementInfo> getprojectIdByLotId(BmProjectLot bmProjectLot);
} }

View File

@ -1,6 +1,7 @@
package com.bonus.sgzb.material.remind.service; package com.bonus.sgzb.material.remind.service;
import com.bonus.sgzb.base.api.domain.SltAgreementInfo; import com.bonus.sgzb.base.api.domain.SltAgreementInfo;
import com.bonus.sgzb.base.domain.BmProjectLot;
import com.bonus.sgzb.common.core.utils.DateTimeHelper; import com.bonus.sgzb.common.core.utils.DateTimeHelper;
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;
@ -50,6 +51,17 @@ public class CalcMonthlyServiceImp implements CalcMonthlyService {
record.setMonth(month); record.setMonth(month);
cleanSameMonthOldRecords(record); cleanSameMonthOldRecords(record);
List<AgreementInfo> list = agreementInfoService.getAllAgreementId(); List<AgreementInfo> list = agreementInfoService.getAllAgreementId();
List<BmProjectLot> projectLots = agreementInfoService.getAllprojectId();
// 如果该工程费用指标已超过则不需要记录月结记录
for (BmProjectLot bmProjectLot : projectLots) {
BigDecimal costIndicatorsByLotId = agreementInfoService.getCostIndicatorsByLotId(bmProjectLot);
BigDecimal costByLotId = agreementInfoService.getCostByLotId(bmProjectLot);
if (costByLotId.compareTo(costIndicatorsByLotId) > 0) {
// 通过lotId找agreementId
List<AgreementInfo> agreementIds = agreementInfoService.getprojectIdByLotId(bmProjectLot);
agreementIds.forEach(t -> list.remove(t));
}
}
list.forEach(t -> { list.forEach(t -> {
t.setStartTime(startTime); t.setStartTime(startTime);
t.setEndTime(endTime); t.setEndTime(endTime);
@ -150,7 +162,7 @@ public class CalcMonthlyServiceImp implements CalcMonthlyService {
ProjectMonthDetail projectMonthDetail = new ProjectMonthDetail(); ProjectMonthDetail projectMonthDetail = new ProjectMonthDetail();
projectMonthDetail.setTypeId(Integer.valueOf(bean.getTypeId())); projectMonthDetail.setTypeId(Integer.valueOf(bean.getTypeId()));
if (bean.getMaId() != null){ if (bean.getMaId() != null) {
projectMonthDetail.setMaId(Integer.valueOf(bean.getMaId())); projectMonthDetail.setMaId(Integer.valueOf(bean.getMaId()));
} }
projectMonthDetail.setUnit(bean.getNuitName()); projectMonthDetail.setUnit(bean.getNuitName());

View File

@ -1,8 +1,10 @@
package com.bonus.sgzb.material.service; package com.bonus.sgzb.material.service;
import com.bonus.sgzb.base.domain.BmProjectLot;
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 java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
@ -66,4 +68,12 @@ public interface AgreementInfoService {
List<AgreementInfo> exportList(AgreementInfo agreementInfo); List<AgreementInfo> exportList(AgreementInfo agreementInfo);
List<AgreementInfo> getAllAgreementId(); List<AgreementInfo> getAllAgreementId();
BigDecimal getCostByLotId(BmProjectLot agreementInfo);
List<BmProjectLot> getAllprojectId();
BigDecimal getCostIndicatorsByLotId(BmProjectLot bmProjectLot);
List<AgreementInfo> getprojectIdByLotId(BmProjectLot bmProjectLot);
} }

View File

@ -1,5 +1,6 @@
package com.bonus.sgzb.material.service.impl; package com.bonus.sgzb.material.service.impl;
import com.bonus.sgzb.base.domain.BmProjectLot;
import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.common.core.utils.DateUtils;
import com.bonus.sgzb.common.core.utils.StringUtils; import com.bonus.sgzb.common.core.utils.StringUtils;
import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.core.web.domain.AjaxResult;
@ -9,6 +10,8 @@ import com.bonus.sgzb.material.service.AgreementInfoService;
import com.bonus.sgzb.material.vo.GlobalContants; import com.bonus.sgzb.material.vo.GlobalContants;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -101,6 +104,26 @@ public class AgreementInfoServiceImpl implements AgreementInfoService {
return agreementInfoMapper.getAllAgreementId(); return agreementInfoMapper.getAllAgreementId();
} }
@Override
public BigDecimal getCostByLotId(BmProjectLot bmProjectLot) {
return agreementInfoMapper.getCostByLotId(bmProjectLot);
}
@Override
public List<BmProjectLot> getAllprojectId() {
return agreementInfoMapper.getAllprojectId();
}
@Override
public BigDecimal getCostIndicatorsByLotId(BmProjectLot bmProjectLot) {
return agreementInfoMapper.getCostIndicatorsByLotId(bmProjectLot);
}
@Override
public List<AgreementInfo> getprojectIdByLotId(BmProjectLot bmProjectLot) {
return agreementInfoMapper.getprojectIdByLotId(bmProjectLot);
}
private String purchaseCodeRule() { private String purchaseCodeRule() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

View File

@ -117,6 +117,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
int i = purchaseMacodeInfoMapper.selectMaCode(purchaseMacodeInfo.getMaCode()); int i = purchaseMacodeInfoMapper.selectMaCode(purchaseMacodeInfo.getMaCode());
if (i > 0) { if (i > 0) {
purchaseMacodeInfo.setStatusFlag(1); purchaseMacodeInfo.setStatusFlag(1);
purchaseMacodeInfo.setMaCode(null);
b = false; b = false;
} else { } else {
purchaseMacodeInfo.setStatusFlag(0); purchaseMacodeInfo.setStatusFlag(0);

View File

@ -172,5 +172,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE WHERE
status = '1' status = '1'
</select> </select>
<select id="getCostByLotId" resultType="java.math.BigDecimal">
select ifnull(sum(costs),0) from project_month_costs where project_id = #{lotId}
</select>
<select id="getAllprojectId" resultType="com.bonus.sgzb.base.domain.BmProjectLot">
SELECT
lot_id as lotId
FROM
bm_project_lot
WHERE
del_flag = '0'
</select>
<select id="getCostIndicatorsByLotId" resultType="java.math.BigDecimal">
SELECT IFNULL(cost_indicators,0) FROM bm_project_lot where lot_id = #{lotId}
</select>
<select id="getprojectIdByLotId" resultType="com.bonus.sgzb.material.domain.AgreementInfo">
select agreement_id from bm_agreement_info where project_id = #{lotId}
</select>
</mapper> </mapper>

View File

@ -532,6 +532,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mt.type_name specificationType, mt.type_name specificationType,
mt1.type_name typeName, mt1.type_name typeName,
pmi.ma_code maCode, pmi.ma_code maCode,
pmi.fix_code fixCode,
mm.assets_code assetsCode mm.assets_code assetsCode
FROM FROM
purchase_check_details pcd purchase_check_details pcd