feat: 添加合同全量同步任务和合格供方名录路径生成功能
refactor: 重构查询服务使用ParamConstant替换ServiceConstant style: 清理无用代码和注释 fix: 修复CompanyCustomerEvaluationFormFileService查询方法 docs: 更新CloudYuVo和CompanyBankAccountVo字段注释
This commit is contained in:
@@ -2,14 +2,13 @@ package com.ecep.contract;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.MyRepository;
|
||||
import com.ecep.contract.model.Voable;
|
||||
import com.ecep.contract.util.SpecificationUtils;
|
||||
@@ -54,8 +53,8 @@ public abstract class EntityService<T extends Voable<VO>, VO, ID> {
|
||||
|
||||
public Page<VO> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<T> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
spec = SpecificationUtils.and(spec, buildParameterSpecification(paramsNode));
|
||||
return findAll(spec, pageable).map(T::toVo);
|
||||
|
||||
@@ -9,13 +9,28 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.ds.contract.tasker.AbstContractRepairTasker;
|
||||
import com.ecep.contract.service.tasker.WebSocketServerTasker;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
|
||||
/**
|
||||
* 用友U8系统-同步全量合同
|
||||
* 通过WebSocket与客户端进行通信,实现合同数据的全量同步
|
||||
*/
|
||||
public class ContractSyncAllTask extends AbstContractRepairTasker {
|
||||
public class ContractSyncAllTask extends AbstContractRepairTasker implements WebSocketServerTasker {
|
||||
private static final Logger logger = LoggerFactory.getLogger(ContractSyncAllTask.class);
|
||||
|
||||
@Override
|
||||
public void init(JsonNode argsNode) {
|
||||
// 初始化任务参数
|
||||
// 在这个方法中可以解析argsNode获取客户端传递的参数
|
||||
updateTitle("初始化合同全量同步任务");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
repair(holder);
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void repair(MessageHolder holder) {
|
||||
@@ -35,7 +50,7 @@ public class ContractSyncAllTask extends AbstContractRepairTasker {
|
||||
try {
|
||||
repairFromCMList(rs, subHolder);
|
||||
} catch (Exception e) {
|
||||
updateMessage(e.getMessage());
|
||||
subHolder.error(e.getMessage());
|
||||
logger.error("data = {}", rs, e);
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Optional;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import com.ecep.contract.util.SpecificationUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -27,7 +28,6 @@ import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.cloud.CloudInfo;
|
||||
import com.ecep.contract.cloud.CloudInfoRepository;
|
||||
import com.ecep.contract.cloud.u8.ctx.AbstractYongYouU8Ctx;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.company.service.CompanyService;
|
||||
import com.ecep.contract.ds.other.model.CloudYu;
|
||||
import com.ecep.contract.ds.company.model.Company;
|
||||
@@ -164,8 +164,8 @@ public class YongYouU8Service
|
||||
@Override
|
||||
public Page<CloudYuVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<CloudYu> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
String searchText = paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText();
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
String searchText = paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText();
|
||||
spec = getSpecification(searchText);
|
||||
}
|
||||
spec = SpecificationUtils.andParam(spec, paramsNode, "company");
|
||||
@@ -263,7 +263,7 @@ public class YongYouU8Service
|
||||
} else {
|
||||
cloudYu.setCompany(null);
|
||||
}
|
||||
cloudYu.setActive(vo.isActive());
|
||||
cloudYu.setVersion(vo.getVersion());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ecep.contract.ds.company.model;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.model.Bank;
|
||||
@@ -9,17 +10,11 @@ import com.ecep.contract.model.Voable;
|
||||
import com.ecep.contract.util.HibernateProxyUtils;
|
||||
import com.ecep.contract.vo.CompanyBankAccountVo;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -56,6 +51,24 @@ public class CompanyBankAccount implements IdentityEntity, BasedEntity, CompanyB
|
||||
@Column(name = "DESCRIPTION")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "CREATED")
|
||||
private LocalDate created;
|
||||
|
||||
/**
|
||||
* 启用
|
||||
*/
|
||||
@Column(name = "ACTIVE")
|
||||
private boolean active = false;
|
||||
|
||||
@Version
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "VERSION", nullable = false)
|
||||
@ToString.Exclude
|
||||
private int version;
|
||||
|
||||
@Override
|
||||
public String toPrettyString() {
|
||||
return account;
|
||||
@@ -85,7 +98,9 @@ public class CompanyBankAccount implements IdentityEntity, BasedEntity, CompanyB
|
||||
vo.setAccount(getAccount());
|
||||
vo.setOpeningBank(getOpeningBank());
|
||||
vo.setDescription(getDescription());
|
||||
vo.setActive(false); // 默认值
|
||||
vo.setCreated(getCreated());
|
||||
vo.setActive(isActive()); // 默认值
|
||||
vo.setVersion(getVersion());
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ecep.contract.ds.company.service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -56,6 +57,7 @@ public class CompanyBankAccountService implements IEntityService<CompanyBankAcco
|
||||
account = new CompanyBankAccount();
|
||||
account.setCompany(company);
|
||||
account.setAccount(bankAccount);
|
||||
account.setCreated(LocalDate.now());
|
||||
holder.info("新增银行账户" + bankAccount);
|
||||
modified = true;
|
||||
}
|
||||
@@ -87,7 +89,7 @@ public class CompanyBankAccountService implements IEntityService<CompanyBankAcco
|
||||
public CompanyBankAccountVo findById(Integer id) {
|
||||
return repository.findById(id).map(CompanyBankAccount::toVo).orElse(null);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public CompanyBankAccount getById(Integer id) {
|
||||
return repository.findById(id).orElse(null);
|
||||
@@ -148,26 +150,27 @@ public class CompanyBankAccountService implements IEntityService<CompanyBankAcco
|
||||
if (vo == null) {
|
||||
throw new ServiceException("CompanyBankAccountVo cannot be null");
|
||||
}
|
||||
|
||||
|
||||
// 基本属性映射
|
||||
model.setAccount(vo.getAccount());
|
||||
model.setOpeningBank(vo.getOpeningBank());
|
||||
model.setDescription(vo.getDescription());
|
||||
|
||||
|
||||
// 处理关联关系 - 公司
|
||||
if (vo.getCompanyId() != null) {
|
||||
model.setCompany(SpringApp.getBean(CompanyService.class).getById(vo.getCompanyId()));
|
||||
} else {
|
||||
model.setCompany(null);
|
||||
}
|
||||
|
||||
|
||||
// 处理关联关系 - 银行
|
||||
if (vo.getBankId() != null) {
|
||||
model.setBank(SpringApp.getBean(BankService.class).getById(vo.getBankId()));
|
||||
} else {
|
||||
model.setBank(null);
|
||||
}
|
||||
|
||||
// 注意:CompanyBankAccount实体类中没有active字段,所以不需要设置
|
||||
|
||||
model.setCreated(vo.getCreated());
|
||||
model.setActive(vo.isActive());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ecep.contract.ds.company.service;
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -21,7 +22,6 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.company.repository.CompanyExtendInfoRepository;
|
||||
import com.ecep.contract.ds.company.model.Company;
|
||||
import com.ecep.contract.ds.company.model.CompanyExtendInfo;
|
||||
@@ -71,8 +71,8 @@ public class CompanyExtendInfoService implements IEntityService<CompanyExtendInf
|
||||
@Override
|
||||
public Page<CompanyExtendInfoVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<CompanyExtendInfo> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
// field
|
||||
spec = SpecificationUtils.andParam(spec, paramsNode, "company");
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.util.function.Consumer;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -33,7 +34,6 @@ import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.CloudServiceConstant;
|
||||
import com.ecep.contract.constant.CompanyConstant;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.company.repository.CompanyFileRepository;
|
||||
import com.ecep.contract.ds.contract.service.ContractService;
|
||||
import com.ecep.contract.ds.company.model.Company;
|
||||
@@ -151,7 +151,6 @@ public class CompanyFileService
|
||||
*
|
||||
* @param company 检查的公司对象
|
||||
* @param verifyDate 检查日期
|
||||
* @param status 状态输出
|
||||
* @see CompanyFile
|
||||
* @see CompanyFileType
|
||||
*/
|
||||
@@ -437,8 +436,8 @@ public class CompanyFileService
|
||||
@Override
|
||||
public Page<CompanyFileVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<CompanyFile> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
spec = SpecificationUtils.and(spec, buildParameterSpecification(paramsNode));
|
||||
return findAll(spec, pageable).map(CompanyFile::toVo);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.ecep.contract.ds.company.service;
|
||||
|
||||
import com.ecep.contract.CompanyFileType;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import com.ecep.contract.service.VoableService;
|
||||
import com.ecep.contract.util.SpecificationUtils;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
@@ -53,8 +53,8 @@ public class CompanyFileTypeService
|
||||
@Override
|
||||
public Page<CompanyFileTypeLocalVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<CompanyFileTypeLocal> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
if (paramsNode.has("type")) {
|
||||
|
||||
@@ -4,8 +4,8 @@ import java.io.File;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.Message;
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -217,8 +217,8 @@ public class CompanyOldNameService implements IEntityService<CompanyOldName>, Qu
|
||||
@Override
|
||||
public Page<CompanyOldNameVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<CompanyOldName> spec = null;
|
||||
if (paramsNode.has("searchText")) {
|
||||
spec = getSpecification(paramsNode.get("searchText").asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
if (paramsNode.has("company")) {
|
||||
JsonNode param = paramsNode.get("company");
|
||||
@@ -235,6 +235,7 @@ public class CompanyOldNameService implements IEntityService<CompanyOldName>, Qu
|
||||
});
|
||||
}
|
||||
}
|
||||
spec = SpecificationUtils.andFieldEqualParam(spec, paramsNode, "name", "ambiguity", "beginDate", "endDate");
|
||||
return findAll(spec, pageable).map(CompanyOldName::toVo);
|
||||
}
|
||||
|
||||
@@ -245,7 +246,7 @@ public class CompanyOldNameService implements IEntityService<CompanyOldName>, Qu
|
||||
companyOldName.setAmbiguity(ambiguity);
|
||||
return companyOldName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateByVo(CompanyOldName model, CompanyOldNameVo vo) {
|
||||
model.setCompanyId(vo.getCompanyId());
|
||||
@@ -255,9 +256,9 @@ public class CompanyOldNameService implements IEntityService<CompanyOldName>, Qu
|
||||
model.setAmbiguity(vo.isAmbiguity());
|
||||
model.setPath(vo.getPath());
|
||||
model.setMemo(vo.getMemo());
|
||||
|
||||
|
||||
if (model.getVersion() != vo.getVersion()) {
|
||||
logger.warn("CompanyOldName version not equal, id: {}, version: {}, vo version: {}",
|
||||
logger.warn("CompanyOldName version not equal, id: {}, version: {}, vo version: {}",
|
||||
model.getId(), model.getVersion(), vo.getVersion());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
@@ -19,7 +20,6 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.ContractFileType;
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.contract.repository.ContractFileTypeLocalRepository;
|
||||
import com.ecep.contract.model.ContractFileTypeLocal;
|
||||
import com.ecep.contract.service.ServiceException;
|
||||
@@ -41,8 +41,8 @@ public class ContractFileTypeService
|
||||
@Override
|
||||
public Page<ContractFileTypeLocalVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<ContractFileTypeLocal> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
if (paramsNode.has("type")) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.ds.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -17,7 +18,6 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.contract.repository.ContractGroupRepository;
|
||||
import com.ecep.contract.model.ContractGroup;
|
||||
import com.ecep.contract.service.VoableService;
|
||||
@@ -57,8 +57,8 @@ public class ContractGroupService implements IEntityService<ContractGroup>, Quer
|
||||
@Override
|
||||
public Page<ContractGroupVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<ContractGroup> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
return findAll(spec, pageable).map(ContractGroup::toVo);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.ds.contract.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import com.ecep.contract.vo.ContractVo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -21,7 +22,6 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.contract.repository.ContractItemRepository;
|
||||
import com.ecep.contract.ds.other.service.EmployeeService;
|
||||
import com.ecep.contract.ds.other.service.InventoryService;
|
||||
@@ -95,8 +95,8 @@ public class ContractItemService implements IEntityService<ContractItem>, QueryS
|
||||
@Override
|
||||
public Page<ContractItemVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<ContractItem> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
// field
|
||||
spec = SpecificationUtils.andParam(spec, paramsNode, "contract", "inventory", "creator", "updater");
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.ecep.contract.ds.customer.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.criteria.Path;
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -19,7 +19,6 @@ import org.springframework.stereotype.Service;
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.customer.repository.CompanyCustomerEvaluationFormFileRepository;
|
||||
import com.ecep.contract.ds.customer.model.CompanyCustomer;
|
||||
import com.ecep.contract.ds.customer.model.CompanyCustomerEvaluationFormFile;
|
||||
@@ -95,8 +94,8 @@ public class CompanyCustomerEvaluationFormFileService
|
||||
@Override
|
||||
public Page<CompanyCustomerEvaluationFormFile> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<CompanyCustomerEvaluationFormFile> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
if (paramsNode.has("customer")) {
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import com.ecep.contract.ds.company.service.HolidayService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -27,8 +28,6 @@ import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.CompanyCustomerConstant;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.company.service.CompanyBasicService;
|
||||
import com.ecep.contract.ds.contract.service.ContractService;
|
||||
import com.ecep.contract.ds.customer.repository.CompanyCustomerEvaluationFormFileRepository;
|
||||
import com.ecep.contract.ds.customer.repository.CompanyCustomerFileRepository;
|
||||
@@ -108,8 +107,8 @@ public class CompanyCustomerFileService
|
||||
@Override
|
||||
public Page<CompanyCustomerFile> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<CompanyCustomerFile> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
// field
|
||||
spec = SpecificationUtils.andParam(spec, paramsNode, "customer");
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ecep.contract.ds.customer.service;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
@@ -17,7 +18,6 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.CustomerFileType;
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.customer.repository.CompanyCustomerFileTypeLocalRepository;
|
||||
import com.ecep.contract.ds.customer.model.CompanyCustomerFileTypeLocal;
|
||||
import com.ecep.contract.service.ServiceException;
|
||||
@@ -49,8 +49,8 @@ public class CompanyCustomerFileTypeService implements IEntityService<CompanyCus
|
||||
@Override
|
||||
public Page<CompanyCustomerFileTypeLocalVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<CompanyCustomerFileTypeLocal> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
if (paramsNode.has("type")) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.ecep.contract.ds.customer.service;
|
||||
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import com.ecep.contract.ds.customer.repository.CustomerCatalogRepository;
|
||||
import com.ecep.contract.model.CustomerCatalog;
|
||||
import com.ecep.contract.service.ServiceException;
|
||||
@@ -114,8 +114,8 @@ public class CustomerCatalogService implements IEntityService<CustomerCatalog>,
|
||||
@Override
|
||||
public Page<CustomerCatalogVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<CustomerCatalog> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
// 字段等值查询
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.ecep.contract.ds.customer.service;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
@@ -19,7 +19,6 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.CustomerFileType;
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.customer.repository.CustomerFileTypeLocalRepository;
|
||||
import com.ecep.contract.model.CustomerFileTypeLocal;
|
||||
import com.ecep.contract.util.SpecificationUtils;
|
||||
@@ -41,8 +40,8 @@ public class CustomerFileTypeService implements IEntityService<CustomerFileTypeL
|
||||
@Override
|
||||
public Page<CustomerFileTypeLocalVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<CustomerFileTypeLocal> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
if (paramsNode.has("type")) {
|
||||
|
||||
@@ -67,6 +67,12 @@ public class CloudYu implements IdentityEntity, Voable<CloudYuVo> {
|
||||
@Column(name = "CLOUD_LATEST")
|
||||
private LocalDateTime cloudLatest;
|
||||
|
||||
/**
|
||||
* 是否激活
|
||||
*/
|
||||
@Column(name = "ACTIVE")
|
||||
private boolean active = false;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@@ -105,7 +111,7 @@ public class CloudYu implements IdentityEntity, Voable<CloudYuVo> {
|
||||
vo.setCustomerUpdateDate(customerUpdateDate);
|
||||
vo.setCloudLatest(cloudLatest);
|
||||
vo.setVersion(version);
|
||||
// active字段默认为false,在CloudYuVo类中已经设置
|
||||
vo.setActive(active);
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.ds.project.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
@@ -15,7 +16,6 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.other.service.EmployeeService;
|
||||
import com.ecep.contract.ds.project.repository.CustomerSatisfactionSurveyRepository;
|
||||
import com.ecep.contract.ds.customer.model.CustomerSatisfactionSurvey;
|
||||
@@ -116,8 +116,8 @@ public class CustomerSatisfactionSurveyService
|
||||
@Override
|
||||
public Page<CustomerSatisfactionSurveyVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<CustomerSatisfactionSurvey> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
if (paramsNode.has("project.customer")) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.ds.project.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
@@ -17,7 +18,6 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.customer.service.CompanyCustomerEvaluationFormFileService;
|
||||
import com.ecep.contract.ds.other.service.EmployeeService;
|
||||
import com.ecep.contract.ds.project.repository.ProjectBidRepository;
|
||||
@@ -60,8 +60,8 @@ public class ProjectBidService implements IEntityService<ProjectBid>, QueryServi
|
||||
@Override
|
||||
public Page<ProjectBidVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<ProjectBid> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
// field
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.ds.project.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
@@ -17,7 +18,6 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.other.service.InventoryService;
|
||||
import com.ecep.contract.ds.project.repository.ProjectCostItemRepository;
|
||||
import com.ecep.contract.ds.project.model.ProjectCost;
|
||||
@@ -59,8 +59,8 @@ public class ProjectCostItemService implements IEntityService<ProjectCostItem>,
|
||||
@Override
|
||||
public Page<ProjectCostItemVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<ProjectCostItem> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
// field
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.ds.project.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import com.ecep.contract.ds.contract.service.ContractService;
|
||||
import com.ecep.contract.ds.other.service.EmployeeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -19,7 +20,6 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.project.repository.ProjectCostRepository;
|
||||
import com.ecep.contract.ds.project.model.Project;
|
||||
import com.ecep.contract.ds.project.model.ProjectCost;
|
||||
@@ -61,8 +61,8 @@ public class ProjectCostService implements IEntityService<ProjectCost>, QuerySer
|
||||
@Override
|
||||
public Page<ProjectCostVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<ProjectCost> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
// field
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ecep.contract.ds.project.service;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
@@ -18,7 +19,6 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.ProjectFileType;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.project.repository.ProjectFileTypeLocalRepository;
|
||||
import com.ecep.contract.model.ProjectFileTypeLocal;
|
||||
import com.ecep.contract.service.ServiceException;
|
||||
@@ -41,8 +41,8 @@ public class ProjectFileTypeService
|
||||
@Override
|
||||
public Page<ProjectFileTypeLocalVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<ProjectFileTypeLocal> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
if (paramsNode.has("type")) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.ecep.contract.ds.project.service;
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import com.ecep.contract.util.SpecificationUtils;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -79,8 +79,8 @@ public class ProjectIndustryService implements IEntityService<ProjectIndustry>,
|
||||
@Override
|
||||
public Page<ProjectIndustryVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<ProjectIndustry> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
// field
|
||||
spec = SpecificationUtils.andFieldEqualParam(spec, paramsNode, "code", "name");
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ecep.contract.ds.project.service;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -18,7 +19,6 @@ import org.springframework.stereotype.Service;
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.customer.service.CompanyCustomerEvaluationFormFileService;
|
||||
import com.ecep.contract.ds.other.service.EmployeeService;
|
||||
import com.ecep.contract.ds.project.repository.ProjectQuotationRepository;
|
||||
@@ -60,8 +60,8 @@ public class ProjectQuotationService implements IEntityService<ProjectQuotation>
|
||||
@Override
|
||||
public Page<ProjectQuotationVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<ProjectQuotation> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
// field
|
||||
spec = SpecificationUtils.andParam(spec, paramsNode, "project", "applicant", "authorizer");
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.ecep.contract.ds.project.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
@@ -16,7 +17,6 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.project.repository.ProjectTypeRepository;
|
||||
import com.ecep.contract.model.ProjectType;
|
||||
import com.ecep.contract.service.VoableService;
|
||||
@@ -78,8 +78,8 @@ public class ProjectTypeService
|
||||
@Override
|
||||
public Page<ProjectTypeVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<ProjectType> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
// field
|
||||
spec = SpecificationUtils.andFieldEqualParam(spec, paramsNode, "name", "code");
|
||||
|
||||
@@ -1,41 +1,64 @@
|
||||
package com.ecep.contract.ds.vendor.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import com.ecep.contract.ds.vendor.repository.VendorApprovedFileRepository;
|
||||
import com.ecep.contract.model.VendorApproved;
|
||||
import com.ecep.contract.model.VendorApprovedFile;
|
||||
import com.ecep.contract.service.ServiceException;
|
||||
import com.ecep.contract.service.VoableService;
|
||||
import com.ecep.contract.util.SpecificationUtils;
|
||||
import com.ecep.contract.vo.VendorApprovedFileVo;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.ds.vendor.repository.VendorApprovedFileRepository;
|
||||
import com.ecep.contract.model.VendorApproved;
|
||||
import com.ecep.contract.model.VendorApprovedFile;
|
||||
import com.ecep.contract.service.ServiceException;
|
||||
import com.ecep.contract.service.VoableService;
|
||||
import com.ecep.contract.vo.VendorApprovedFileVo;
|
||||
import java.util.List;
|
||||
|
||||
@Lazy
|
||||
@Service
|
||||
@CacheConfig(cacheNames = "vendor-approved-file")
|
||||
public class VendorApprovedFileService
|
||||
implements IEntityService<VendorApprovedFile>, VoableService<VendorApprovedFile, VendorApprovedFileVo> {
|
||||
implements IEntityService<VendorApprovedFile>, QueryService<VendorApprovedFileVo>, VoableService<VendorApprovedFile, VendorApprovedFileVo> {
|
||||
@Lazy
|
||||
@Autowired
|
||||
private VendorApprovedFileRepository repository;
|
||||
|
||||
/**
|
||||
* 根据ID查找供应商已批准文件
|
||||
*
|
||||
*
|
||||
* @param id 文件ID
|
||||
* @return 找到的文件实体,如果不存在则返回null
|
||||
*/
|
||||
public VendorApprovedFile findById(Integer id) {
|
||||
return repository.findById(id).orElse(null);
|
||||
@Cacheable(key = "#p0")
|
||||
public VendorApprovedFileVo findById(Integer id) {
|
||||
return repository.findById(id).map(VendorApprovedFile::toVo).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<VendorApprovedFileVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<VendorApprovedFile> spec = null;
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
spec = SpecificationUtils.andParam(spec, paramsNode, "list");
|
||||
return findAll(spec, pageable).map(VendorApprovedFile::toVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long count(JsonNode paramsNode) {
|
||||
return repository.count();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public VendorApprovedFile getById(Integer id) {
|
||||
return repository.findById(id).orElse(null);
|
||||
@@ -44,7 +67,7 @@ public class VendorApprovedFileService
|
||||
/**
|
||||
* 获取供应商已批准文件的查询规格
|
||||
* 根据搜索文本构建文件名和描述的模糊查询条件
|
||||
*
|
||||
*
|
||||
* @param searchText 搜索文本
|
||||
* @return 构建的查询规格
|
||||
*/
|
||||
@@ -59,7 +82,7 @@ public class VendorApprovedFileService
|
||||
|
||||
/**
|
||||
* 根据查询规格和分页参数获取供应商已批准文件列表
|
||||
*
|
||||
*
|
||||
* @param spec 查询规格
|
||||
* @param pageable 分页参数
|
||||
* @return 分页的文件列表
|
||||
@@ -71,7 +94,7 @@ public class VendorApprovedFileService
|
||||
|
||||
/**
|
||||
* 删除供应商已批准文件
|
||||
*
|
||||
*
|
||||
* @param entity 要删除的文件实体
|
||||
*/
|
||||
@Override
|
||||
@@ -81,7 +104,7 @@ public class VendorApprovedFileService
|
||||
|
||||
/**
|
||||
* 保存或更新供应商已批准文件
|
||||
*
|
||||
*
|
||||
* @param entity 要保存的文件实体
|
||||
* @return 保存后的文件实体
|
||||
*/
|
||||
@@ -92,7 +115,7 @@ public class VendorApprovedFileService
|
||||
|
||||
/**
|
||||
* 根据已批准列表和文件名查找特定文件
|
||||
*
|
||||
*
|
||||
* @param approvedList 已批准列表
|
||||
* @param name 文件名
|
||||
* @return 找到的文件实体
|
||||
@@ -103,7 +126,7 @@ public class VendorApprovedFileService
|
||||
|
||||
/**
|
||||
* 获取指定已批准列表下的所有文件
|
||||
*
|
||||
*
|
||||
* @param list 已批准列表实体
|
||||
* @return 该列表下的所有文件列表
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.ecep.contract.ds.vendor.service;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ecep.contract.VendorType;
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -101,10 +103,17 @@ public class VendorApprovedItemService
|
||||
@Override
|
||||
public Page<VendorApprovedItemVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<VendorApprovedItem> spec = null;
|
||||
if (paramsNode.has("searchText")) {
|
||||
spec = getSpecification(paramsNode.get("searchText").asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
// 添加额外的参数过滤
|
||||
if (paramsNode.has("type")) {
|
||||
String typeText = paramsNode.get("type").asText();
|
||||
VendorType type = VendorType.valueOf(typeText);
|
||||
spec = SpecificationUtils.and(spec, (root, query, builder) -> {
|
||||
return builder.equal(root.get("type"), type);
|
||||
});
|
||||
}
|
||||
spec = SpecificationUtils.andParam(spec, paramsNode, "vendor", "list");
|
||||
return findAll(spec, pageable).map(VendorApprovedItem::toVo);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
package com.ecep.contract.ds.vendor.service;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import com.ecep.contract.service.SmbFileService;
|
||||
import com.hierynomus.smbj.common.SmbPath;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -74,8 +79,8 @@ public class VendorApprovedService implements IEntityService<VendorApproved>, Qu
|
||||
@Override
|
||||
public Page<VendorApprovedVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<VendorApproved> spec = null;
|
||||
if (paramsNode.has("searchText")) {
|
||||
spec = getSpecification(paramsNode.get("searchText").asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
// 添加额外的参数过滤
|
||||
spec = SpecificationUtils.andFieldEqualParam(spec, paramsNode, "title");
|
||||
@@ -220,6 +225,24 @@ public class VendorApprovedService implements IEntityService<VendorApproved>, Qu
|
||||
return vendorFile;
|
||||
}
|
||||
|
||||
public boolean existPath(Integer vendorApprovedId) {
|
||||
VendorApproved approved = getById(vendorApprovedId);
|
||||
if (approved == null) {
|
||||
return false;
|
||||
}
|
||||
String path = approved.getPath();
|
||||
if (!StringUtils.hasText(path)) {
|
||||
return false;
|
||||
}
|
||||
SmbFileService smbFileService = SpringApp.getBean(SmbFileService.class);
|
||||
SmbPath smbPath = SmbPath.parse(path);
|
||||
try {
|
||||
return smbFileService.exists(smbPath);
|
||||
} catch (IOException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateByVo(VendorApproved model, VendorApprovedVo vo) {
|
||||
if (model == null) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ecep.contract.ds.vendor.service;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
@@ -14,7 +15,6 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.vendor.repository.VendorClassRepository;
|
||||
import com.ecep.contract.model.VendorCatalog;
|
||||
import com.ecep.contract.service.ServiceException;
|
||||
@@ -39,8 +39,8 @@ public class VendorCatalogService implements IEntityService<VendorCatalog>, Quer
|
||||
@Override
|
||||
public Page<VendorCatalogVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<VendorCatalog> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
// field
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.time.LocalDate;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -82,8 +83,8 @@ public class VendorFileService
|
||||
@Override
|
||||
public Page<VendorFile> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<VendorFile> spec = null;
|
||||
if (paramsNode.has("searchText")) {
|
||||
spec = getSpecification(paramsNode.get("searchText").asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
// 添加额外的参数过滤
|
||||
if (paramsNode.has("type")) {
|
||||
@@ -91,6 +92,7 @@ public class VendorFileService
|
||||
spec = SpecificationUtils.and(spec, (root, query, builder) -> builder.equal(root.get("type"), type));
|
||||
}
|
||||
spec = SpecificationUtils.andFieldEqualParam(spec, paramsNode, "valid");
|
||||
spec = SpecificationUtils.andFieldBetweenParam(spec, paramsNode, "signDate", LocalDate.class);
|
||||
spec = SpecificationUtils.andParam(spec, paramsNode, "vendor");
|
||||
return findAll(spec, pageable);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.ecep.contract.ds.vendor.service;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
@@ -20,7 +20,6 @@ import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.VendorFileType;
|
||||
import com.ecep.contract.VendorType;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.vendor.repository.VendorFileTypeLocalRepository;
|
||||
import com.ecep.contract.model.VendorFileTypeLocal;
|
||||
import com.ecep.contract.service.ServiceException;
|
||||
@@ -45,8 +44,8 @@ public class VendorFileTypeService implements IEntityService<VendorFileTypeLocal
|
||||
@Override
|
||||
public Page<VendorFileTypeLocalVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<VendorFileTypeLocal> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
if (paramsNode.has("type")) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.util.Optional;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import com.ecep.contract.vo.CompanyVo;
|
||||
import com.ecep.contract.vo.VendorCatalogVo;
|
||||
import org.hibernate.Hibernate;
|
||||
@@ -35,7 +36,6 @@ import com.ecep.contract.SpringApp;
|
||||
import com.ecep.contract.VendorFileType;
|
||||
import com.ecep.contract.VendorType;
|
||||
import com.ecep.contract.constant.CompanyVendorConstant;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.company.service.CompanyBasicService;
|
||||
import com.ecep.contract.ds.company.service.CompanyContactService;
|
||||
import com.ecep.contract.ds.other.service.SysConfService;
|
||||
@@ -115,8 +115,8 @@ public class VendorService extends CompanyBasicService
|
||||
@Override
|
||||
public Page<VendorVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<Vendor> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
// 添加额外的参数过滤
|
||||
if (paramsNode.has("type")) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.ecep.contract.ds.vendor.service;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ecep.contract.constant.ParamConstant;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
@@ -18,7 +19,6 @@ import org.springframework.util.StringUtils;
|
||||
import com.ecep.contract.IEntityService;
|
||||
import com.ecep.contract.QueryService;
|
||||
import com.ecep.contract.VendorType;
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
import com.ecep.contract.ds.vendor.repository.VendorTypeLocalRepository;
|
||||
import com.ecep.contract.model.VendorTypeLocal;
|
||||
import com.ecep.contract.service.ServiceException;
|
||||
@@ -39,8 +39,8 @@ public class VendorTypeService implements IEntityService<VendorTypeLocal>, Query
|
||||
@Override
|
||||
public Page<VendorTypeLocalVo> findAll(JsonNode paramsNode, Pageable pageable) {
|
||||
Specification<VendorTypeLocal> spec = null;
|
||||
if (paramsNode.has(ServiceConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ServiceConstant.KEY_SEARCH_TEXT).asText());
|
||||
if (paramsNode.has(ParamConstant.KEY_SEARCH_TEXT)) {
|
||||
spec = getSpecification(paramsNode.get(ParamConstant.KEY_SEARCH_TEXT).asText());
|
||||
}
|
||||
|
||||
if (paramsNode.has("type")) {
|
||||
|
||||
131
server/src/main/java/com/ecep/contract/ds/vendor/task/VendorApprovedListMakePathTask.java
vendored
Normal file
131
server/src/main/java/com/ecep/contract/ds/vendor/task/VendorApprovedListMakePathTask.java
vendored
Normal file
@@ -0,0 +1,131 @@
|
||||
package com.ecep.contract.ds.vendor.task;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ecep.contract.model.VendorApproved;
|
||||
import com.ecep.contract.service.SmbFileService;
|
||||
import com.hierynomus.smbj.common.SmbPath;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.ecep.contract.MessageHolder;
|
||||
import com.ecep.contract.ds.vendor.service.VendorApprovedService;
|
||||
import com.ecep.contract.service.tasker.WebSocketServerTasker;
|
||||
import com.ecep.contract.ui.Tasker;
|
||||
import com.ecep.contract.util.FileUtils;
|
||||
import com.ecep.contract.vo.VendorApprovedVo;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
|
||||
/**
|
||||
* 合格供方名录生成路径任务
|
||||
* 用于为合格供方名录生成文件保存路径
|
||||
*/
|
||||
public class VendorApprovedListMakePathTask extends Tasker<Object> implements WebSocketServerTasker {
|
||||
private final Logger logger = LoggerFactory.getLogger(VendorApprovedListMakePathTask.class);
|
||||
|
||||
private VendorApprovedService vendorApprovedService;
|
||||
private SmbFileService smbFileService;
|
||||
|
||||
private VendorApproved vendorApproved;
|
||||
private int vendorApprovedId;
|
||||
|
||||
protected boolean modified = false;
|
||||
|
||||
@Override
|
||||
public void init(JsonNode argsNode) {
|
||||
vendorApprovedId = argsNode.get(0).asInt();
|
||||
vendorApprovedService = getCachedBean(VendorApprovedService.class);
|
||||
smbFileService = getCachedBean(SmbFileService.class);
|
||||
vendorApproved = vendorApprovedService.getById(vendorApprovedId);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object execute(MessageHolder holder) throws Exception {
|
||||
holder.info("开始为合格供方名录生成文件路径...");
|
||||
updateProgress(0, 100);
|
||||
|
||||
if (vendorApproved == null) {
|
||||
holder.error("找不到ID为 " + vendorApprovedId + " 的合格供方名录");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 检查是否已有路径
|
||||
if (StringUtils.hasText(vendorApproved.getPath())) {
|
||||
SmbPath smbPath = SmbPath.parse(vendorApproved.getPath());
|
||||
if (smbFileService.exists(smbPath)) {
|
||||
holder.info("合格供方名录文件路径已存在: " + vendorApproved.getPath());
|
||||
updateProgress(100, 100);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
updateProgress(30, 100);
|
||||
|
||||
// 生成文件路径
|
||||
String newPath = generateFilePath(vendorApproved);
|
||||
holder.info("新的文件路径: " + newPath);
|
||||
SmbPath smbPath = SmbPath.parse(newPath);
|
||||
boolean folderExists = false;
|
||||
try {
|
||||
folderExists = smbFileService.exists(smbPath);
|
||||
} catch (IOException e) {
|
||||
holder.error("检查文件路径时出错: " + e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
updateProgress(60, 100);
|
||||
if (folderExists) {
|
||||
holder.info("文件路径已存在: " + newPath);
|
||||
String uncPath = smbPath.toUncPath();
|
||||
if (Objects.equals(vendorApproved.getPath(), uncPath)) {
|
||||
holder.debug("文件路径未更新");
|
||||
} else {
|
||||
// 更新数据库记录
|
||||
vendorApproved.setPath(uncPath);
|
||||
vendorApprovedService.save(vendorApproved);
|
||||
holder.info("文件路径已更新");
|
||||
modified = true;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
smbFileService.mkdir(smbPath);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
String uncPath = smbPath.toUncPath();
|
||||
holder.info("已创建文件路径: " + uncPath);
|
||||
// 更新数据库记录
|
||||
vendorApproved.setPath(newPath);
|
||||
vendorApprovedService.save(vendorApproved);
|
||||
modified = true;
|
||||
}
|
||||
|
||||
updateProgress(100, 100);
|
||||
holder.info("合格供方名录文件路径生成完成");
|
||||
updateProperty("modified", modified);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 为合格供方名录生成文件路径
|
||||
*
|
||||
* @param vendorApproved 合格供方名录对象
|
||||
* @return 生成的文件路径
|
||||
*/
|
||||
protected String generateFilePath(VendorApproved vendorApproved) {
|
||||
// 基础路径可以配置或从系统中获取
|
||||
File basePath = vendorApprovedService.getBasePath(); // 这里使用工具类获取基础路径
|
||||
|
||||
String title = vendorApproved.getTitle();
|
||||
String fileName = FileUtils.escapeFileName(title);
|
||||
|
||||
return new File(basePath, fileName).getAbsolutePath();
|
||||
}
|
||||
}
|
||||
@@ -590,14 +590,18 @@ public class SmbFileService implements DisposableBean {
|
||||
public void mkdir(java.io.File path) throws IOException {
|
||||
Objects.requireNonNull(path, "Path cannot be null");
|
||||
var smbPath = SmbPath.parse(path.getAbsolutePath());
|
||||
mkdir(smbPath);
|
||||
}
|
||||
|
||||
executeSmbOperation(smbPath, (share, smbFilePath) -> {
|
||||
if (!share.folderExists(smbFilePath)) {
|
||||
share.mkdir(smbFilePath);
|
||||
log.debug("Created directory: {}", smbFilePath);
|
||||
public void mkdir(SmbPath smbPath) throws IOException {
|
||||
executeSmbOperation(smbPath, (share, path) -> {
|
||||
if (!share.folderExists(path)) {
|
||||
share.mkdir(path);
|
||||
log.debug("Created directory: {}", path);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -113,7 +113,7 @@ public class SpecificationUtils {
|
||||
}
|
||||
|
||||
|
||||
public static <T, Y extends Comparable<? super Y>> Specification<T> andFieldBetweenParam(Specification<T> spec, JsonNode paramsNode, String field, Class<Y> valyeType) {
|
||||
public static <T, Y extends Comparable<? super Y>> Specification<T> andFieldBetweenParam(Specification<T> spec, JsonNode paramsNode, String field, Class<Y> valueType) {
|
||||
if (paramsNode.has(field)) {
|
||||
JsonNode param = paramsNode.get(field);
|
||||
if (param.isObject()) {
|
||||
@@ -121,8 +121,8 @@ public class SpecificationUtils {
|
||||
JsonNode endNode = param.get("end");
|
||||
|
||||
ObjectMapper objectMapper = SpringApp.getBean(ObjectMapper.class);
|
||||
Y begin = objectMapper.convertValue(beginNode, valyeType);
|
||||
Y end = objectMapper.convertValue(endNode, valyeType);
|
||||
Y begin = objectMapper.convertValue(beginNode, valueType);
|
||||
Y end = objectMapper.convertValue(endNode, valueType);
|
||||
|
||||
spec = SpecificationUtils.and(spec, (root, query, builder) -> {
|
||||
return builder.between(root.get(field), begin, end);
|
||||
|
||||
@@ -28,7 +28,9 @@
|
||||
"VendorClassSyncTask": "com.ecep.contract.cloud.u8.VendorClassSyncTask",
|
||||
"ContractKindSyncTask": "com.ecep.contract.cloud.u8.ContractKindSyncTask",
|
||||
"ContractTypeSyncTask": "com.ecep.contract.cloud.u8.ContractTypeSyncTask",
|
||||
"ContractGroupSyncTask": "com.ecep.contract.cloud.u8.ContractGroupSyncTask"
|
||||
"ContractGroupSyncTask": "com.ecep.contract.cloud.u8.ContractGroupSyncTask",
|
||||
"ContractSyncAllTask": "com.ecep.contract.cloud.u8.ContractSyncAllTask",
|
||||
"VendorApprovedListMakePathTask": "com.ecep.contract.ds.vendor.task.VendorApprovedListMakePathTask"
|
||||
},
|
||||
"descriptions": "任务注册信息, 客户端的任务可以通过 WebSocket 调用"
|
||||
}
|
||||
Reference in New Issue
Block a user