diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java index 79d8157..e5d81c4 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java @@ -41,6 +41,19 @@ public class SltAgreementInfoController extends BaseController { @Resource private SltAgreementInfoService sltAgreementInfoService; + @ApiOperation(value = "工程下拉选") + @GetMapping("getProjectListByUnitIds") + public AjaxResult getProjectListByUnitIds(AgreementInfo agreementInfo) { + return sltAgreementInfoService.getProjectListByUnitIds(agreementInfo); + } + + @ApiOperation(value = "单位下拉选") + @GetMapping("getUnitListByProjetctIds") + public AjaxResult getUnitListByProjetctIds(AgreementInfo agreementInfo) { + return sltAgreementInfoService.getUnitListByProjetctIds(agreementInfo); + } + + /** * 根据条件获取协议结算列表 */ diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/AgreementInfo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/AgreementInfo.java index 86154f4..6fd3b92 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/AgreementInfo.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/AgreementInfo.java @@ -154,4 +154,6 @@ public class AgreementInfo extends BaseEntity { @ApiModelProperty(value = "导出选中列表") private List dataCondition; + @ApiModelProperty(value = "往来单位ids") + private int[] unitIds; } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java index db74bd3..a20bef9 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/SltAgreementInfoMapper.java @@ -79,4 +79,8 @@ public interface SltAgreementInfoMapper { List getAddLoseList(AgreementInfo bean); List checkEndTime(SltAgreementApply apply); + + List getProjectListByUnitIds(@Param("unitIds") int[] unitIds); + + List getUnitListByProjetctIds(Long projectId); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SltAgreementInfoService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SltAgreementInfoService.java index 95c5750..7bdde82 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SltAgreementInfoService.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/SltAgreementInfoService.java @@ -43,4 +43,8 @@ public interface SltAgreementInfoService { List getSltInfoMonth(List list); int updateOutSourceCosts(SltAgreementInfo sltAgreementInfo); + + AjaxResult getProjectListByUnitIds(AgreementInfo bean); + + AjaxResult getUnitListByProjetctIds(AgreementInfo bean); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java index 1323c34..32748cc 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java @@ -16,6 +16,7 @@ import com.bonus.sgzb.material.mapper.CalMonthlyMapper; import com.bonus.sgzb.material.mapper.SltAgreementInfoMapper; import com.bonus.sgzb.material.service.SltAgreementInfoService; import com.bonus.sgzb.material.vo.GlobalContants; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -628,4 +629,42 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { } return codeNum; } + + /** + * 工程类型下拉 + * @param agreementInfo + * @return + */ + @Override + public AjaxResult getProjectListByUnitIds(AgreementInfo agreementInfo) { + List list = new ArrayList<>(); + try { + if(agreementInfo.getUnitIds()!=null){ + list = sltAgreementInfoMapper.getProjectListByUnitIds(agreementInfo.getUnitIds()); + } + + } catch (Exception e) { + return AjaxResult.error(e+"工程下拉查询失败"); + } + return AjaxResult.success(list); + } + + /** + * 单位类型下拉 + * @param agreementInfo + * @return + */ + @Override + public AjaxResult getUnitListByProjetctIds(AgreementInfo agreementInfo) { + List list = new ArrayList<>(); + try { + if(agreementInfo.getProjectId()!=null){ + list = sltAgreementInfoMapper.getUnitListByProjetctIds(agreementInfo.getProjectId()); + } + + } catch (Exception e) { + return AjaxResult.error(e+"单位下拉查询失败"); + } + return AjaxResult.success(list); + } } diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml index 3479f11..d3d5da2 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/SltAgreementInfoMapper.xml @@ -133,8 +133,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id left join slt_agreement_relation sar on bai.agreement_id = sar.agreement_id where bai.status = '1' - - and bui.unit_id = #{unitId} + + and bui.unit_id in + + #{unitId} + and bp.lot_id = #{projectId} @@ -618,4 +621,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join ma_type mt1 on mt.parent_id = mt1.type_id where sai.agreement_id = #{agreementId} and sai.lease_type = 0 + + + + \ No newline at end of file