|
|
@@ -911,4 +911,87 @@ public class ContractInfoService {
|
|
|
public List<ContractInfo> getByContractNameList(List<String> contractNameList,String userId) {
|
|
|
return mapper.getByContractNameList(contractNameList,userId);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 项目登记时,查询所有合同
|
|
|
+ * @param page
|
|
|
+ * @param info
|
|
|
+ * @param wrapper
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public IPage<ContractInfo> projectRegContractList(Page<ContractInfo> page, ContractInfo info, QueryWrapper<ContractInfo> wrapper) {
|
|
|
+ //1、合同编号
|
|
|
+ if (StringUtils.isNotBlank(info.getContractNo())) {
|
|
|
+ wrapper.like("a.contract_no", info.getContractNo());
|
|
|
+ }
|
|
|
+ //案卷号
|
|
|
+ if (StringUtils.isNotBlank(info.getFiledNo())) {
|
|
|
+ wrapper.like("h.filed_no", info.getFiledNo());
|
|
|
+ }
|
|
|
+ //2、合同名称
|
|
|
+ if (StringUtils.isNotBlank(info.getContractName())) {
|
|
|
+ wrapper.like("a.contract_name", info.getContractName());
|
|
|
+ }
|
|
|
+ //3、合同金额(区间)
|
|
|
+ String[] contractAmounts = info.getContractAmounts();
|
|
|
+ if (contractAmounts != null) {
|
|
|
+ if (StringUtils.isNotBlank(contractAmounts[0])) {
|
|
|
+ wrapper.ge("a.contract_amount",contractAmounts[0]);
|
|
|
+ }
|
|
|
+ if (contractAmounts.length>1 && StringUtils.isNotBlank(contractAmounts[1])) {
|
|
|
+ wrapper.le("a.contract_amount", contractAmounts[1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //4、签约时间(区间)
|
|
|
+ String[] contractDates = info.getContractDates();
|
|
|
+ if (contractDates != null) {
|
|
|
+
|
|
|
+ wrapper.between("a.signing_date", contractDates[0], contractDates[1]);
|
|
|
+ }
|
|
|
+ //5、创建人
|
|
|
+ if (StringUtils.isNotBlank(info.getCreateById())) {
|
|
|
+ wrapper.like("c.`id`", info.getCreateById()).or().like("c.name", info.getCreateById());
|
|
|
+ }
|
|
|
+ //6、所属部门
|
|
|
+ if (StringUtils.isNotBlank(info.getDepartment())) {
|
|
|
+ //先根据id查出是否是父节点,是父节点则查出所有的子节点信息
|
|
|
+ List<String> childIds = mapper.findChildIds(info.getDepartment());
|
|
|
+ if ( null != childIds & childIds.size()>0){
|
|
|
+ childIds.add(info.getDepartment());
|
|
|
+ wrapper.in("a.department",childIds);
|
|
|
+ }else {
|
|
|
+ wrapper.eq("a.department", info.getDepartment());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //7、状态
|
|
|
+ //判断 状态是否包含 逗号
|
|
|
+ if(StringUtils.isNotBlank(info.getStatus())){
|
|
|
+ if (info.getStatus().contains(",")) {
|
|
|
+ List<String> statusList = Lists.newLinkedList();
|
|
|
+ statusList = Arrays.asList(info.getStatus().split(","));
|
|
|
+ wrapper.in("a.status", statusList);
|
|
|
+ }else{
|
|
|
+ wrapper.like("a.status", info.getStatus());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //8、归档状态
|
|
|
+ if (StringUtils.isNotBlank(info.getFiledType())) {
|
|
|
+ wrapper.like("a.filed_type", info.getFiledType());
|
|
|
+ }
|
|
|
+ //纸质归档
|
|
|
+ if (StringUtils.isNotBlank(info.getFiledPaperType())) {
|
|
|
+ wrapper.like("a.filed_paper_type", info.getFiledPaperType());
|
|
|
+ }
|
|
|
+ //委托方名称
|
|
|
+ if (StringUtils.isNotBlank(info.getClientContactsName())) {
|
|
|
+ wrapper.like("cw_wcb.name", info.getClientContactsName());
|
|
|
+ }
|
|
|
+ wrapper.eq("a.del_flag","0");
|
|
|
+
|
|
|
+ StringBuilder officeIds = new StringBuilder();
|
|
|
+
|
|
|
+ IPage<ContractInfo> pageList = mapper.projectRegContractList(page, officeIds.toString(), wrapper);
|
|
|
+
|
|
|
+ return pageList;
|
|
|
+ }
|
|
|
}
|