Commit 1b494f6c authored by 廖旭伟's avatar 廖旭伟

事项列表增加模糊查找,基础事项转换时自动过滤已转换的事项

parent 91bf67ae
......@@ -18,6 +18,7 @@ import com.deepoove.poi.template.MetaTemplate;
import com.deepoove.poi.util.RegexUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.base.system.upload.service.UploadService;
......@@ -66,6 +67,14 @@ public class MatterDatumServiceImpl extends AbstractCRUDServiceImpl<MatterDatumD
@Autowired
private ParamService paramService;
@Override
protected MatterDatumEntity findBefore(MatterDatumEntity params, PageInfo pageInfo, Context context) throws AppException {
if(com.mortals.xhx.common.utils.StringUtils.isNotEmpty(params.getMaterialName())){
params.setMaterialName("%".concat(params.getMaterialName()).concat("%"));
}
return params;
}
@Override
protected void saveBefore(MatterDatumEntity entity, Context context) throws AppException {
//生成样表预览图片
......
package com.mortals.xhx.module.matter.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.key.ParamKey;
import com.mortals.xhx.common.utils.StringUtils;
import com.mortals.xhx.module.sheet.dao.SheetMatterDao;
import com.mortals.xhx.module.sheet.model.SheetMatterEntity;
import org.apache.commons.collections4.CollectionUtils;
......@@ -30,6 +32,14 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
@Autowired
private SheetMatterDao sheetMatterDao;
@Override
protected MatterEntity findBefore(MatterEntity params, PageInfo pageInfo, Context context) throws AppException {
if(StringUtils.isNotEmpty(params.getMatterName())){
params.setMatterName("%".concat(params.getMatterName()).concat("%"));
}
return params;
}
@Override
public void createMatterbBySheetMatter(Long[] sheetMatterIds) {
List<SheetMatterEntity> sheetMatterEntityList = sheetMatterDao.get(sheetMatterIds);
......@@ -37,6 +47,14 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
Date now = new Date();
List<MatterEntity> list = new ArrayList<>();
for(SheetMatterEntity sheetMatterEntity:sheetMatterEntityList){
MatterEntity query = new MatterEntity();
query.setSiteId(sheetMatterEntity.getSiteId());
query.setTid(sheetMatterEntity.getTid());
query.setTcode(sheetMatterEntity.getTcode());
List<MatterEntity> queryList = this.find(query);
if(CollectionUtils.isNotEmpty(queryList)){
continue;
}
MatterEntity matterEntity = new MatterEntity();
matterEntity.setSiteId(sheetMatterEntity.getSiteId());
matterEntity.setTid(sheetMatterEntity.getTid());
......
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.common.code.YesNo;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.IUser;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.key.ParamKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -49,6 +51,13 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
super.init(model, context);
}
@Override
protected int doListAfter(MatterEntity query, Map<String, Object> model, Context context) throws AppException {
int recommendCount = paramService.getParamIntValue(ParamKey.MATTER_RECOMMEND_COUNT);
model.put("recommendCount", recommendCount);
return 1;
}
@RequestMapping(value = {"createMatter"},method = {RequestMethod.POST, RequestMethod.GET})
public String createMatter(Long[] ids) {
Context context = this.getContext();
......
package com.mortals.xhx.module.matter.web;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.key.ParamKey;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -47,6 +49,13 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
super.init(model, context);
}
@Override
protected int doListAfter(MatterDatumEntity query, Map<String, Object> model, Context context) throws AppException {
int recommendCount = paramService.getParamIntValue(ParamKey.MATTER_DATUM_RECOMMEND_COUNT);
model.put("recommendCount", recommendCount);
return 1;
}
@RequestMapping(value = {"recommend"},method = {RequestMethod.POST, RequestMethod.GET})
public String recommend(Long id) {
Context context = this.getContext();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment