合并分支 'dev_third_stage' 到 'master'

Dev third stage

查看合并请求 laws-nio/laws-weilai!90
This commit is contained in:
肖文钰
2022-07-15 22:08:07 +08:00
28 changed files with 568 additions and 60 deletions
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jero.modules.document.entity.BussDocumentLibraryEO;
import com.jero.modules.document.entity.OSSFileForDocumentLibrary;
import com.jero.modules.document.vo.QueryConditionVO;
import com.jero.modules.oss.entity.OSSFile;
import org.springframework.web.multipart.MultipartFile;
@@ -220,4 +221,6 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
void isModifyForOcrAndSplit(Map<String, Object> parameter);
String getTitle(String id,String cut);
String sqlJoint(List<QueryConditionVO> queryConditionVOList);
}
@@ -5813,8 +5813,8 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
//高级搜索条件拼接
private String sqlJoint(List<QueryConditionVO> queryConditionVOList){
@Override
public String sqlJoint(List<QueryConditionVO> queryConditionVOList){
StringBuilder sb = new StringBuilder();
if(queryConditionVOList.size() != 0){
int count =0;
@@ -210,4 +210,12 @@ public class LawsTechnologyEvaluationEOController extends JeroController<LawsTec
List<Map<String,Object>> result = this.lawsTechnologyEvaluationEOService.importItemExcel(file,cut,request);
return Result.OK(result);
}
@ApiOperation(value="根据id查询明细数据", notes="根据id查询明细数据")
@PostMapping(value = "/queryPageDummyById")
@ResponseBody
public Result<?> queryPageDummyById(@RequestBody Map<String,Object> parameter) {
List<Map<String, Object>> result = this.lawsTechnologyEvaluationEOService.queryPageDummyById(parameter);
return Result.OK(result);
}
}
@@ -122,6 +122,8 @@ public class LawsTechnologyEvaluationItemResultEO implements Serializable {
@Excel(name = "评估人id", width = 15)
@ApiModelProperty(value = "评估人id")
private java.lang.String evaluatorId;
@TableField(exist = false)
private java.lang.String evaluatorName;
/**流程实例id*/
@Excel(name = "流程实例id", width = 15)
@@ -86,4 +86,6 @@ public interface ILawsTechnologyEvaluationEOService extends IService<LawsTechnol
void exportItemTemplate(String cut, HttpServletResponse response, HttpServletRequest request);
List<Map<String,Object>> importItemExcel(MultipartFile file, String cut, HttpServletRequest request)throws Exception;
List<Map<String, Object>> queryPageDummyById(Map<String, Object> parameter);
}
@@ -209,7 +209,7 @@ public class LawsTechnologyEvaluationComplianceResultEOServiceImpl extends Servi
for (int i = 0; i < exportData.size(); i++){
//使用评估人的名字命名sheet页
HSSFSheet sheet = workbook.createSheet(exportData.get(i).getCreateBy() + " " + sheetName);
HSSFSheet sheet = workbook.createSheet(exportData.get(i).getCreateBy() + " " + sheetName + "" + (i + 1));
CellStyle titleCellStyle = workbook.createCellStyle();
titleCellStyle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
@@ -28,12 +28,9 @@ import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@@ -401,6 +398,73 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
return result;
}
@Override
public List<Map<String, Object>> queryPageDummyById(Map<String, Object> parameter) {
String cut = (String) parameter.get("cut");//中英文切换标识
String id = (String) parameter.get("id");
//文档库字段
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList(ModuleEnum.DOCUMENT_LIBRARY.getValue());
List<String> fileFieldStrList = fieldList.stream()
.filter(e -> FieldTypeEnum.FILE.getValue().equals(e.getFieldShowType())).map(OnlCgformField::getDbFieldName)
.collect(Collectors.toList());
List<Map<String, Object>> result = this.bussDocumentLibraryEOMapper.queryListByIds(id);
//树形数据字典
List<SysCategory> categoryList = this.sysCategoryService.list();
//过滤出树形字段
List<OnlCgformField> treeFieldList = fieldList.stream()
.filter(e -> FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))
.collect(Collectors.toList());
//数据字典
List<SysDictItem> sysDictItems = this.sysDictItemServiceImpl.selectItemsAll();
//下拉选处理数据字典
for (Map record : result) {
Map<String, Object> record1 = (Map) record;
String technology_territory = (String)record1.get("technology_territory");
List<String> connectIdList = new ArrayList<>();
for (Map.Entry<String, Object> entry : record1.entrySet()) {
//下拉选处理数据字典
this.bussDocumentLibraryEOService.dictItem(sysDictItems, entry, cut, fieldList,null);
this.bussDocumentLibraryEOService.treeDictItem(categoryList, entry, treeFieldList, cut,null);
if(fileFieldStrList.contains(entry.getKey())){
if(entry.getValue()!=null){
connectIdList.add(entry.getValue().toString());
}
}
}
record1.put("technology_territory_id",technology_territory);
if(CollectionUtils.isNotEmpty(connectIdList)){
//根据id查询当前文档库数据是否有拆分数据。
QueryWrapper<SarFileSplitInfoEO> splitInfoEOQueryWrapper = new QueryWrapper<>();
splitInfoEOQueryWrapper.lambda().in(SarFileSplitInfoEO::getConnectId,connectIdList);
List<SarFileSplitInfoEO> sarFileSplitInfoList = new ArrayList<>();
List<SarFileSplitInfoEO> sarFileSplitInfoListTemp = sarFileSplitInfoService.list(splitInfoEOQueryWrapper);
if (CollectionUtils.isNotEmpty(sarFileSplitInfoListTemp)){
sarFileSplitInfoListTemp.forEach(splitInfo -> {
//查询出已回传的数据
String flag = ""; // 1 已回传 0未回传。
if(StringUtils.isNotEmpty(splitInfo.getFileId())){
flag = "1";
sarFileSplitInfoList.add(splitInfo);
}else {
flag = "0";
}
splitInfo.setFlag(flag);
});
record1.put("sarFileSplitInfoList",sarFileSplitInfoList);
}
}
}
return result;
}
private String getTreeName(String cut, List<SysCategory> categoryList, List<String> technologyTerritoryList) {
StringBuilder sb = new StringBuilder();
for (String technologyTerritory : technologyTerritoryList) {
@@ -20,7 +20,17 @@ import com.jero.modules.oss.entity.OSSFile;
import com.jero.modules.oss.service.IOSSFileService;
import com.jero.modules.project.enums.OperatorTypeEnum;
import com.jero.modules.project.enums.RequestSourceEnum;
import com.jero.modules.split.dto.FileSpiltValTableExportDto;
import com.jero.modules.split.dto.FileSplitValExportDto;
import com.jero.modules.split.dto.FileSplitValImgExportDto;
import com.jero.modules.split.entity.SarFileSplitItemsValEO;
import com.jero.modules.split.page.SarFileSplitItemsEOPage;
import com.jero.modules.split.page.SarFileSplitItemsValEOPage;
import com.jero.modules.split.service.IFileSplitItemsEOService;
import com.jero.modules.split.service.ISarFileSplitItemsValEOService;
import com.jero.modules.system.entity.SysCategory;
import com.jero.modules.system.entity.SysUser;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.service.impl.SysCategoryServiceImpl;
import com.jero.modules.system.util.PDFUtils;
import org.apache.commons.collections4.CollectionUtils;
@@ -62,6 +72,12 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl
private SysCategoryServiceImpl sysCategoryService;
@Autowired
private IOSSFileService iOSSFileService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private IFileSplitItemsEOService fileSplitItemsEOService;
@Autowired
private ISarFileSplitItemsValEOService sarFileSplitItemsValEOService;
/**
* 保存
@@ -190,6 +206,13 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl
@Override
public void disposeData(List<LawsTechnologyEvaluationItemResultEO> datas, String cut) {
if(CollectionUtils.isNotEmpty(datas)){
List<String> evaluatorIdList = datas.stream().map(LawsTechnologyEvaluationItemResultEO::getEvaluatorId).distinct().collect(Collectors.toList());
List<SysUser> sysUserList = new ArrayList<>();
if(CollectionUtils.isNotEmpty(evaluatorIdList)){
sysUserList = this.sysUserService.querySysUserListByIdList(evaluatorIdList);
}
List<SysCategory> categoryList = sysCategoryService.list();
for (LawsTechnologyEvaluationItemResultEO data : datas) {
String evaluationMethods = data.getEvaluationMethods();
@@ -205,6 +228,19 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl
String accessoryFileName = accessoryFileList.stream().map(OSSFile::getFileName).collect(Collectors.joining(","));
data.setAccessoryFileName(accessoryFileName);
}
if(StringUtils.isNotEmpty(data.getEvaluatorId())){
if(CollectionUtils.isNotEmpty(sysUserList)){
String evaluatorNames = sysUserList.stream().filter(sysUser -> {
boolean flag = false;
if(StringUtils.equals(sysUser.getId(),data.getEvaluatorId())){
flag = true;
}
return flag;
}).map(SysUser::getUsername).collect(Collectors.joining(","));
data.setEvaluatorName(evaluatorNames);
}
}
}
}
}
@@ -252,7 +288,7 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl
//创建表头
String[] titleArr = title.split(",");
for (int i=0; i<=5; i++){
for (int i=0; i<=10; i++){
sheet.setColumnWidth(i,4000);
Cell cell = firstRow.createCell(i);
cell.setCellStyle(titleCellStyle);
@@ -261,12 +297,30 @@ public class LawsTechnologyEvaluationItemResultEOServiceImpl extends ServiceImpl
//设置导出数据
if(CollectionUtils.isNotEmpty(exportData)) {
List<FileSpiltValTableExportDto> allTableList = new ArrayList<>(); // 存储表格数据
List<FileSplitValImgExportDto> allImgList = new ArrayList<>(); // 存储文件数据
SarFileSplitItemsEOPage page = new SarFileSplitItemsEOPage();
for (int dataIndex = 0; dataIndex < exportData.size(); dataIndex++) {
Row dataRow = sheet.createRow(dataIndex + 1);
dataRow.createCell(0).setCellValue(exportData.get(dataIndex).getItemNum());
dataRow.createCell(1).setCellValue(exportData.get(dataIndex).getItemName());
dataRow.createCell(2).setCellValue(exportData.get(dataIndex).getItemContent());
dataRow.createCell(3).setCellValue(exportData.get(dataIndex).getCreateBy());
String itemContent = exportData.get(dataIndex).getItemContent();
if(StringUtils.isNotEmpty(exportData.get(dataIndex).getItemId())){
SarFileSplitItemsValEOPage valEOPage = new SarFileSplitItemsValEOPage();
valEOPage.setItemId(exportData.get(dataIndex).getItemId());
valEOPage.setOrderBy("DISPLAY_SEQ,ID");
List<SarFileSplitItemsValEO> getValList = this.sarFileSplitItemsValEOService.queryByList(valEOPage);
List<FileSplitValExportDto> valContentList = this.fileSplitItemsEOService.combineItemValInfo(getValList,allTableList,allImgList,page); //TODO
if(CollectionUtils.isNotEmpty(valContentList)){
itemContent = valContentList.get(0).getValContent();
}
}
dataRow.createCell(2).setCellValue(itemContent);
dataRow.createCell(3).setCellValue(exportData.get(dataIndex).getEvaluatorName());
dataRow.createCell(4).setCellValue(exportData.get(dataIndex).getEvaluationMethodsName());
dataRow.createCell(5).setCellValue(exportData.get(dataIndex).getTechnicalFileName());
dataRow.createCell(6).setCellValue(exportData.get(dataIndex).getSection());
@@ -0,0 +1,45 @@
package com.jero.modules.project.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.modules.project.service.ILawsComplianceBoardService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@Api(tags="法规符合性看板")
@RestController
@RequestMapping("/project/lawsComplianceBoard")
@Slf4j
public class LawsComplianceBoardController {
@Autowired
private ILawsComplianceBoardService lawsComplianceBoardService;
@AutoLog(value = "项目库-法规符合性看板列表分页查询")
@ApiOperation(value="项目库-法规符合性看板列表分页查询", notes="项目库-法规符合性看板列表分页查询")
@GetMapping(value = "/page")
public JSONObject queryPageList(@RequestParam Map<String,Object> params){
IPage infoPage = this.lawsComplianceBoardService.queryPageList(params);
Result<IPage> ok = Result.OK(infoPage);
JSONObject jsonResult = JSONObject.fromObject(ok);
return jsonResult;
}
@AutoLog(value = "项目库-法规符合性看板-查询符合性结果列表")
@ApiOperation(value="项目库-法规符合性看板-查询符合性结果列表", notes="项目库-法规符合性看板-查询符合性结果列表")
@GetMapping(value = "/queryComplianceResultList")
public Result<?> queryComplianceResultList(@RequestParam Map<String,Object> params){
JSONObject result = this.lawsComplianceBoardService.queryComplianceResultList(params);
return Result.OK(result);
}
}
@@ -0,0 +1,24 @@
package com.jero.modules.project.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface LawsComplianceBoardMapper {
/**
* 查询出 启动过 设计、prehomo、验证符合性、法规技术评估、法规意见收集其中一个流程 的数据
* @param page
* @param params
* @return
*/
IPage queryPageList(IPage page, @Param("params") Map<String, Object> params);
/**
* 项目库-法规符合性看板-查询符合性结果列表
* @param params
* @return
*/
List<Map<String, Object>> queryComplianceResultList(@Param("params") Map<String, Object> params);
}
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jero.modules.project.mapper.LawsComplianceBoardMapper">
<select id="queryPageList" resultType="hashMap">
SELECT
bdl.id as "id",
bdl.serial_number as "serialNumber",
bdl.title as "title",
bdl.technology_territory as "technologyTerritory",
bdl.state as "state",
bdl.create_time as "createTime"
FROM
buss_document_library bdl
LEFT JOIN project_laws_inventory pli ON ( pli.stand_id = bdl.id )
LEFT JOIN project_task_inventory pti ON ( pli.id = pti.project_laws_inventory_id )
WHERE
(
bdl.id IN ( SELECT DISTINCT stand_id FROM laws_opinion_gather)
OR bdl.id IN ( SELECT DISTINCT stand_id FROM laws_technology_evaluation)
or pti.design_p_id IS NOT NULL
OR pti.prehomo_p_id IS NOT NULL
OR pti.verify_p_id IS NOT NULL
)
${params.condition}
GROUP BY bdl.id
order by bdl.create_time desc
</select>
<select id="queryComplianceResultList" resultType="hashMap">
SELECT
pli.stand_id as "standId",
pli.id as "id",
pli.serial_number as "serialNumber",
pli.title as "title",
pli.project_library_id as "projectLibraryId",
pni.project_name as "projectName",
pyni.year_name as "yearName",
pti.design_status as "designStatus",
pti.design_p_id as "designPId",
pti.prehomo_status as "prehomoStatsu",
pti.prehomo_p_id as "prehomoPId",
pti.verify_status as "verifyStatus",
pti.verify_p_id as "verifyPId",
pli.duty_territory as "dutyTerritory"
FROM
project_laws_inventory pli
LEFT JOIN project_task_inventory pti ON ( pli.id = pti.project_laws_inventory_id )
LEFT JOIN project_library_base plb ON ( plb.id = pli.project_library_id )
LEFT JOIN project_name_info pni ON ( pni.id = plb.project_name_id )
LEFT JOIN project_year_name_info pyni ON ( pyni.id = plb.year_name_id )
WHERE
pli.stand_id = #{params.id}
AND( pti.design_p_id IS NOT NULL OR pti.prehomo_p_id IS NOT NULL OR pti.verify_p_id IS NOT NULL )
<if test="params.dutyTerritory != null params.dutyTerritory != '' ">
and pli.duty_territory like CONCAT(CONCAT('%',#{params.dutyTerritory}),'%')
</if>
<if test="params.projectNameId != null params.projectNameId != '' ">
and pni.id like CONCAT(CONCAT('%',#{params.projectNameId}),'%')
</if>
<if test="params.projectName != null params.projectName != '' ">
and pni.project_name like CONCAT(CONCAT('%',#{params.projectName}),'%')
</if>
</select>
</mapper>
@@ -0,0 +1,18 @@
package com.jero.modules.project.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jero.common.api.vo.Result;
import net.sf.json.JSONObject;
import java.util.Map;
public interface ILawsComplianceBoardService {
IPage queryPageList(Map<String, Object> params);
/**
* 项目库-法规符合性看板-查询符合性结果列表
* @param params
* @return
*/
JSONObject queryComplianceResultList(Map<String, Object> params);
}
@@ -0,0 +1,201 @@
package com.jero.modules.project.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jero.modules.document.enums.FieldTypeEnum;
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
import com.jero.modules.document.vo.QueryConditionVO;
import com.jero.modules.lawsOpinionGather.entity.LawsOpinionGatherEO;
import com.jero.modules.lawsOpinionGather.service.ILawsOpinionGatherEOService;
import com.jero.modules.lawsTechnologyEvaluation.entity.LawsTechnologyEvaluationEO;
import com.jero.modules.lawsTechnologyEvaluation.service.ILawsTechnologyEvaluationEOService;
import com.jero.modules.project.mapper.LawsComplianceBoardMapper;
import com.jero.modules.project.service.ILawsComplianceBoardService;
import com.jero.modules.system.util.StringUtils;
import net.sf.json.JSONObject;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
@Service
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
public class LawsComplianceBoardServiceImpl implements ILawsComplianceBoardService {
@Autowired
private LawsComplianceBoardMapper lawsComplianceBoardMapper;
@Autowired
private ILawsOpinionGatherEOService lawsOpinionGatherEOService;
@Autowired
private ILawsTechnologyEvaluationEOService lawsTechnologyEvaluationEOService;
@Autowired
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
@Override
public IPage queryPageList(Map<String, Object> params) {
int pageNo = Integer.parseInt(params.get("pageNo").toString());
int pageSize = Integer.parseInt(params.get("pageSize").toString());
//封装查询条件(包含高级搜索)
String condition = this.getConditionStr(params);
params.put("condition",condition);
IPage page = new Page(pageNo, pageSize);
IPage infoPage = this.lawsComplianceBoardMapper.queryPageList(page, params);
List records = infoPage.getRecords();
this.disposeData(records);
return infoPage;
}
public void disposeData(List datas){
if (CollectionUtils.isNotEmpty(datas)) {
for (Object data : datas) {
Map<String,Object> dataMap = (Map<String, Object>) data;
}
}
}
@Override
public JSONObject queryComplianceResultList(Map<String, Object> params) {
JSONObject result = new JSONObject();
String id = (String) params.get("id");
String cut = (String) params.get("cut");
List<Map<String,Object>> cmplianceResultList = this.lawsComplianceBoardMapper.queryComplianceResultList(params);
result.put("cmplianceResultList",cmplianceResultList);
//查询当前数据是否有法规意见收集流程数据
QueryWrapper<LawsOpinionGatherEO> opinionGatherEOQueryWrapper = new QueryWrapper<>();
opinionGatherEOQueryWrapper.lambda().eq(LawsOpinionGatherEO::getStandId,id);
int opinionGatherCount = this.lawsOpinionGatherEOService.count(opinionGatherEOQueryWrapper);
result.put("opinionGather",opinionGatherCount);
//查询当前数据是否有法规技术评估流程数据
QueryWrapper<LawsTechnologyEvaluationEO> evaluationEOQueryWrapper = new QueryWrapper<>();
evaluationEOQueryWrapper.lambda().eq(LawsTechnologyEvaluationEO::getStandId,id);
int evaluationCount = this.lawsTechnologyEvaluationEOService.count(evaluationEOQueryWrapper);
result.put("technologyEvaluation",evaluationCount);
return result;
}
@NotNull
public String getConditionStr(Map<String, Object> parameter) {
String cut = (String) parameter.get("cut");
String flag = String.valueOf(parameter.get("flag"));
//查询条件
StringBuilder conditionSb = new StringBuilder("");
//过滤查询条件字段类型使用
List<Map<String, Object>> mapList = this.bussDocumentLibraryEOService.queryCondition("1", cut, null);
//查询条件处理
for (Map.Entry<String, Object> entry : parameter.entrySet()) {
String key = entry.getKey();
if (!"pageNo".equals(key) && !"pageSize".equals(key)) {
String value = "";
if(ObjectUtils.isNotEmpty(entry.getValue())){
value = StringUtils.valueOf(entry.getValue());
}
if (StringUtils.isNotBlank(value)) {
for (Map<String, Object> map : mapList) {
String fieldName = (String) map.get("db_field_name");//字段
if (key.equals(fieldName)) {
//字段类型(判断是输入框还是下拉,等等)
String fieldType = (String) map.get("field_show_type");//字段类型
if (FieldTypeEnum.TEXT_STRING.getValue().equals(fieldType) || FieldTypeEnum.TEXT_NUMBER.getValue().equals(fieldType)) {
//输入框 LIKE CONCAT("%", '/%', "%") ESCAPE '/'
if (value.contains("%")) {
value = value.replace("%", "/%");
}
conditionSb.append(" and " + key + " like concat(concat('%','" + value + "'),'%') ESCAPE '/'");
} else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(fieldType)
|| FieldTypeEnum.PULL_MORE.getValue().equals(fieldType)
|| FieldTypeEnum.TREE.getValue().equals(fieldType)) {
StringBuilder valueSb = new StringBuilder();
StringBuilder condition = new StringBuilder();
for (String valueTemp : value.split(",")) {
valueSb.append("'" + valueTemp + "',");
condition.append(" or " + key + " like concat(concat('%','" + valueTemp + "'),'%')");
}
condition.append(")");
String substring = valueSb.substring(0, valueSb.length() - 1);
//下拉单选或下拉多选
conditionSb.append(" and (" + key + " in(" + substring + ")" + condition.toString());
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldType)) {
//日期(区分单日期还时间范围)
if (value.contains(",")) {
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') >= '" + value.split(",")[0] + "'"
+ " and " + "date_format(" + key + ",'%Y-%m-%d') <= '" + value.split(",")[1] + "'");
} else {
conditionSb.append(" and " + "date_format(" + key + ",'%Y-%m-%d') = '" + value + "'");
}
} else if (FieldTypeEnum.PERSON.getValue().equals(fieldType)) {
//输入框 LIKE CONCAT("%", '/%', "%") ESCAPE '/'
if (value.contains("%")) {
value = value.replace("%", "/%");
}
conditionSb.append(" and " + key + " like concat(concat('%','" + value + "'),'%') ESCAPE '/'");
}
}
}
}
}
}
//处理法规预警模块预警时间查询条件 flag = 0(新车实施日期), flag = 1(在产车实施日期)
String warnTime = (String) parameter.get("WarnTime");
if(StringUtils.isNotBlank(warnTime)){
if("0".equals(flag)){
//日期(区分单日期还时间范围)
if (warnTime.contains(",")) {
conditionSb.append(" and " + "date_format(" + "xin1_che1_xing2_shi2_shi1_ri4_qi1" + ",'%Y-%m-%d') >= '" + warnTime.split(",")[0] + "'"
+ " and " + "date_format(" + "xin1_che1_xing2_shi2_shi1_ri4_qi1" + ",'%Y-%m-%d') <= '" + warnTime.split(",")[1] + "'");
} else {
conditionSb.append(" and " + "date_format(" + "xin1_che1_xing2_shi2_shi1_ri4_qi1" + ",'%Y-%m-%d') = '" + warnTime + "'");
}
}else{
//日期(区分单日期还时间范围)
if (warnTime.contains(",")) {
conditionSb.append(" and " + "date_format(" + "implement_time" + ",'%Y-%m-%d') >= '" + warnTime.split(",")[0] + "'"
+ " and " + "date_format(" + "implement_time" + ",'%Y-%m-%d') <= '" + warnTime.split(",")[1] + "'");
} else {
conditionSb.append(" and " + "date_format(" + "implement_time" + ",'%Y-%m-%d') = '" + warnTime + "'");
}
}
}
//高级搜索 queryConditionVOList List<QueryConditionVO>
if(ObjectUtils.isNotEmpty(parameter.get("queryConditionVOList"))){
String queryConditionVOListStr = (String) parameter.get("queryConditionVOList");
List<QueryConditionVO> queryConditionVOList = com.alibaba.fastjson.JSONObject.parseArray(queryConditionVOListStr, QueryConditionVO.class);
if(ObjectUtils.isNotEmpty(queryConditionVOList)){
String queryCondition = this.bussDocumentLibraryEOService.sqlJoint(queryConditionVOList);
if(StringUtils.isNotBlank(queryCondition)){
conditionSb.append(" and " + queryCondition);
}
}
}
//处理列表表头排序
/*if (StringUtils.isNotBlank((String) parameter.get("orderByField"))) {
conditionSb.append(" order by " + (String) parameter.get("orderByField"));
if ("1".equals((String) parameter.get("orderBy"))) {
conditionSb.append(" asc");//正序
} else if ("2".equals((String) parameter.get("orderBy"))) {
conditionSb.append(" desc");//倒序
}
} else {
conditionSb.append(" order by create_time desc");
}*/
String condition = conditionSb.toString();
return condition;
}
}