|
@@ -11,6 +11,7 @@ import cn.com.qmth.examcloud.commons.base.exception.StatusException;
|
|
import cn.com.qmth.examcloud.core.print.common.jpa.OrderBuilder;
|
|
import cn.com.qmth.examcloud.core.print.common.jpa.OrderBuilder;
|
|
import cn.com.qmth.examcloud.core.print.common.jpa.SearchBuilder;
|
|
import cn.com.qmth.examcloud.core.print.common.jpa.SearchBuilder;
|
|
import cn.com.qmth.examcloud.core.print.common.jpa.SpecUtils;
|
|
import cn.com.qmth.examcloud.core.print.common.jpa.SpecUtils;
|
|
|
|
+import cn.com.qmth.examcloud.core.print.common.jpa.SqlWrapper;
|
|
import cn.com.qmth.examcloud.core.print.common.utils.Check;
|
|
import cn.com.qmth.examcloud.core.print.common.utils.Check;
|
|
import cn.com.qmth.examcloud.core.print.entity.PrintingProject;
|
|
import cn.com.qmth.examcloud.core.print.entity.PrintingProject;
|
|
import cn.com.qmth.examcloud.core.print.enums.ExamType;
|
|
import cn.com.qmth.examcloud.core.print.enums.ExamType;
|
|
@@ -18,6 +19,7 @@ import cn.com.qmth.examcloud.core.print.repository.PrintingProjectRepository;
|
|
import cn.com.qmth.examcloud.core.print.service.CommonService;
|
|
import cn.com.qmth.examcloud.core.print.service.CommonService;
|
|
import cn.com.qmth.examcloud.core.print.service.PrintingProjectService;
|
|
import cn.com.qmth.examcloud.core.print.service.PrintingProjectService;
|
|
import cn.com.qmth.examcloud.core.print.service.bean.common.ExamInfo;
|
|
import cn.com.qmth.examcloud.core.print.service.bean.common.ExamInfo;
|
|
|
|
+import cn.com.qmth.examcloud.core.print.service.bean.common.OrgInfo;
|
|
import cn.com.qmth.examcloud.core.print.service.bean.printingproject.PrintingProjectConvert;
|
|
import cn.com.qmth.examcloud.core.print.service.bean.printingproject.PrintingProjectConvert;
|
|
import cn.com.qmth.examcloud.core.print.service.bean.printingproject.PrintingProjectInfo;
|
|
import cn.com.qmth.examcloud.core.print.service.bean.printingproject.PrintingProjectInfo;
|
|
import cn.com.qmth.examcloud.core.print.service.bean.printingproject.PrintingProjectQuery;
|
|
import cn.com.qmth.examcloud.core.print.service.bean.printingproject.PrintingProjectQuery;
|
|
@@ -29,6 +31,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
|
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
|
|
|
|
+import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -48,6 +52,8 @@ public class PrintingProjectServiceImpl implements PrintingProjectService {
|
|
private PrintingProjectRepository printingProjectRepository;
|
|
private PrintingProjectRepository printingProjectRepository;
|
|
@Autowired
|
|
@Autowired
|
|
private CommonService commonService;
|
|
private CommonService commonService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private JdbcTemplate jdbcTemplate;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public Page<PrintingProjectInfo> getPrintingProjectList(PrintingProjectQuery query) {
|
|
public Page<PrintingProjectInfo> getPrintingProjectList(PrintingProjectQuery query) {
|
|
@@ -199,4 +205,33 @@ public class PrintingProjectServiceImpl implements PrintingProjectService {
|
|
printingProjectRepository.updateSupplierNameBySupplierId(supplierId, supplierName);
|
|
printingProjectRepository.updateSupplierNameBySupplierId(supplierId, supplierName);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public List<OrgInfo> getOrgList(Long pmId, Long supplierId) {
|
|
|
|
+ SqlWrapper sql = new SqlWrapper()
|
|
|
|
+ .select("org_id,org_name")
|
|
|
|
+ .from("ec_prt_project")
|
|
|
|
+ .where().append("1=1");
|
|
|
|
+ if (pmId != null) {
|
|
|
|
+ sql.and().eq("pm_id", pmId);
|
|
|
|
+ }
|
|
|
|
+ if (supplierId != null) {
|
|
|
|
+ sql.and().eq("supplier_id", supplierId);
|
|
|
|
+ }
|
|
|
|
+ sql.groupBy("org_id");
|
|
|
|
+ return jdbcTemplate.query(sql.build(), new BeanPropertyRowMapper(OrgInfo.class));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<ExamInfo> getExamList(Long orgId) {
|
|
|
|
+ SqlWrapper sql = new SqlWrapper()
|
|
|
|
+ .select("org_id,org_name,exam_id,exam_name")
|
|
|
|
+ .from("ec_prt_project")
|
|
|
|
+ .where().append("1=1");
|
|
|
|
+ if (orgId != null) {
|
|
|
|
+ sql.and().eq("org_id", orgId);
|
|
|
|
+ }
|
|
|
|
+ sql.groupBy("exam_id");
|
|
|
|
+ return jdbcTemplate.query(sql.build(), new BeanPropertyRowMapper(ExamInfo.class));
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|