Commit 600c48cf authored by “yiyousong”'s avatar “yiyousong”
parents 97edec66 bdcf1443
...@@ -184,8 +184,8 @@ export default { ...@@ -184,8 +184,8 @@ export default {
data() { data() {
return { return {
searchVal: "", searchVal: "",
siteId: local.getLocal("writeSiteId") siteId: local.getLocal("sampleSiteId")
? local.getLocal("writeSiteId") ? local.getLocal("sampleSiteId")
: "", : "",
tableData: [], tableData: [],
pageSizes: [10, 20, 30, 40, 50, 100, 200], pageSizes: [10, 20, 30, 40, 50, 100, 200],
......
...@@ -71,8 +71,8 @@ export default { ...@@ -71,8 +71,8 @@ export default {
// 获取部门列表 // 获取部门列表
async getdeptList() { async getdeptList() {
let res = await getdeptList({ let res = await getdeptList({
siteId: local.getLocal("writeSiteId") siteId: local.getLocal("sampleSiteId")
? local.getLocal("writeSiteId") ? local.getLocal("sampleSiteId")
: "", : "",
}); });
let { code, data } = res.data; let { code, data } = res.data;
......
...@@ -178,7 +178,7 @@ export default { ...@@ -178,7 +178,7 @@ export default {
// siteName: obj.label, // siteName: obj.label,
// siteid: obj.id, // siteid: obj.id,
// }; // };
local.setLocal("writeSiteId", obj.id); local.setLocal("sampleSiteId", obj.id);
this.show = false; this.show = false;
if (location.href.search(/token/gi) >= 0) { if (location.href.search(/token/gi) >= 0) {
setTimeout(() => { setTimeout(() => {
......
...@@ -296,8 +296,8 @@ export default { ...@@ -296,8 +296,8 @@ export default {
}, },
data() { data() {
return { return {
siteId: local.getLocal("writeSiteId") siteId: local.getLocal("sampleSiteId")
? local.getLocal("writeSiteId") ? local.getLocal("sampleSiteId")
: "", : "",
departmentLeft: "", departmentLeft: "",
departmentRight: "", departmentRight: "",
......
...@@ -41,13 +41,14 @@ ...@@ -41,13 +41,14 @@
<el-form-item label="上传附件" prop="fileUrl"> <el-form-item label="上传附件" prop="fileUrl">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:action="api + 'fm/file/commonupload'" :action="api + 'sampleform/file/commonupload'"
:on-remove="handleRemoveFileUrl" :on-remove="handleRemoveFileUrl"
:limit="1" :limit="1"
:file-list="fileUrlFileList" :file-list="fileUrlFileList"
:on-success="OnsuccessfileUrl" :on-success="OnsuccessfileUrl"
:headers="headers" :headers="headers"
:before-upload="beforeUpload" :before-upload="beforeUpload"
accept="application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
> >
<el-button size="small" type="primary">上传Word文件</el-button> <el-button size="small" type="primary">上传Word文件</el-button>
</el-upload> </el-upload>
...@@ -55,13 +56,14 @@ ...@@ -55,13 +56,14 @@
<el-form-item label="上传模板" prop="templatePath"> <el-form-item label="上传模板" prop="templatePath">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:action="api + 'fm/file/commonupload'" :action="api + 'sampleform/file/commonupload'"
:on-remove="handleRemoveTemplatePath" :on-remove="handleRemoveTemplatePath"
:limit="1" :limit="1"
:file-list="templatePathFileList" :file-list="templatePathFileList"
:on-success="OnsuccesstemplatePath" :on-success="OnsuccesstemplatePath"
:headers="headers" :headers="headers"
:before-upload="beforeUpload" :before-upload="beforeUpload"
accept="application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
> >
<el-button size="small" type="primary">上传Word文件</el-button> <el-button size="small" type="primary">上传Word文件</el-button>
</el-upload> </el-upload>
...@@ -69,13 +71,14 @@ ...@@ -69,13 +71,14 @@
<el-form-item label="上传样表" prop="samplePath"> <el-form-item label="上传样表" prop="samplePath">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
:action="api + 'fm/file/commonupload'" :action="api + 'sampleform/file/commonupload'"
:on-remove="handleRemoveSamplePath" :on-remove="handleRemoveSamplePath"
:limit="1" :limit="1"
:file-list="samplePathFileList" :file-list="samplePathFileList"
:on-success="OnsuccessSamplePath" :on-success="OnsuccessSamplePath"
:headers="headers" :headers="headers"
:before-upload="beforeUpload" :before-upload="beforeUpload"
accept="application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document"
> >
<el-button size="small" type="primary">上传Word文件</el-button> <el-button size="small" type="primary">上传Word文件</el-button>
</el-upload> </el-upload>
......
...@@ -288,8 +288,8 @@ export default { ...@@ -288,8 +288,8 @@ export default {
}, },
data() { data() {
return { return {
siteId: local.getLocal("writeSiteId") siteId: local.getLocal("sampleSiteId")
? local.getLocal("writeSiteId") ? local.getLocal("sampleSiteId")
: "", : "",
departmentLeft: "", departmentLeft: "",
departmentRight: "", departmentRight: "",
...@@ -330,7 +330,7 @@ export default { ...@@ -330,7 +330,7 @@ export default {
size: this.rightSize, size: this.rightSize,
matterName: this.rightSearch, matterName: this.rightSearch,
deptId: this.departmentRight, deptId: this.departmentRight,
siteId: this.siteId, //siteId: this.siteId,
}); });
if (res.data.code === 1) { if (res.data.code === 1) {
let { total, data } = res.data.data; let { total, data } = res.data.data;
...@@ -457,7 +457,7 @@ export default { ...@@ -457,7 +457,7 @@ export default {
}, },
// 右边加入 // 右边加入
async handleJoin(id) { async handleJoin(id) {
let res = await createMatter({ ids: id }); let res = await createMatter({ ids: id,siteId:this.siteId });
let { code, msg } = res.data; let { code, msg } = res.data;
if (code === 1) { if (code === 1) {
this.$message.success(msg); this.$message.success(msg);
......
...@@ -85,8 +85,8 @@ export default { ...@@ -85,8 +85,8 @@ export default {
matterName: "", // 事项简称 matterName: "", // 事项简称
deptId: "", // 部门id deptId: "", // 部门id
matterNo: "", // 事项编号 matterNo: "", // 事项编号
siteId: local.getLocal("writeSiteId") siteId: local.getLocal("sampleSiteId")
? local.getLocal("writeSiteId") ? local.getLocal("sampleSiteId")
: "", : "",
source: 0, source: 0,
deptName: "", deptName: "",
......
...@@ -60,7 +60,7 @@ exec "$JAVACMD" $JAVA_OPTS \ ...@@ -60,7 +60,7 @@ exec "$JAVACMD" $JAVA_OPTS \
-Dapp.port="$PORT" \ -Dapp.port="$PORT" \
-Dbasedir="$BASEDIR" \ -Dbasedir="$BASEDIR" \
-Djava.io.tmpdir=$TEMP_PATH \ -Djava.io.tmpdir=$TEMP_PATH \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=15609 \ -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=15689 \
-jar $MAIN_CLASS \ -jar $MAIN_CLASS \
> /dev/null & > /dev/null &
......
...@@ -333,9 +333,9 @@ public class MatterEntity extends MatterVo { ...@@ -333,9 +333,9 @@ public class MatterEntity extends MatterVo {
this.deptName = ""; this.deptName = "";
this.total = null; this.total = 0;
this.sort = null; this.sort = 0;
this.isRecommend = 0; this.isRecommend = 0;
......
package com.mortals.xhx.module.matter.service; package com.mortals.xhx.module.matter.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.matter.model.MatterEntity; import com.mortals.xhx.module.matter.model.MatterEntity;
/** /**
...@@ -15,7 +17,7 @@ public interface MatterService extends ICRUDService<MatterEntity,Long>{ ...@@ -15,7 +17,7 @@ public interface MatterService extends ICRUDService<MatterEntity,Long>{
* 站点事项转系统事项 * 站点事项转系统事项
* @param sheetMatterIds * @param sheetMatterIds
*/ */
void createMatterbBySheetMatter(Long[] sheetMatterIds); Rest<String> createMatterbBySheetMatter(Long[] sheetMatterIds,Long siteId, Context context);
/** /**
* 推荐or取消推荐 * 推荐or取消推荐
......
package com.mortals.xhx.module.matter.service.impl; package com.mortals.xhx.module.matter.service.impl;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.MatterSourceEnum; import com.mortals.xhx.common.code.MatterSourceEnum;
import com.mortals.xhx.common.key.ParamKey; import com.mortals.xhx.common.key.ParamKey;
import com.mortals.xhx.common.utils.StringUtils; import com.mortals.xhx.common.utils.StringUtils;
import com.mortals.xhx.module.matter.model.MatterDatumEntity; import com.mortals.xhx.module.matter.model.MatterDatumEntity;
import com.mortals.xhx.module.matter.model.MatterQuery;
import com.mortals.xhx.module.matter.service.MatterDatumService; import com.mortals.xhx.module.matter.service.MatterDatumService;
import com.mortals.xhx.module.sheet.dao.SheetMatterDao; import com.mortals.xhx.module.sheet.dao.SheetMatterDao;
import com.mortals.xhx.module.sheet.model.SheetMatterEntity; import com.mortals.xhx.module.sheet.model.SheetMatterEntity;
import com.mortals.xhx.module.sheet.model.SheetMatterQuery;
import com.mortals.xhx.module.sheet.service.SheetMatterService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -17,16 +22,17 @@ import com.mortals.framework.model.Context; ...@@ -17,16 +22,17 @@ import com.mortals.framework.model.Context;
import com.mortals.xhx.module.matter.dao.MatterDao; import com.mortals.xhx.module.matter.dao.MatterDao;
import com.mortals.xhx.module.matter.model.MatterEntity; import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.matter.service.MatterService; import com.mortals.xhx.module.matter.service.MatterService;
import org.springframework.util.ObjectUtils;
import java.util.*; import java.util.*;
/** /**
* MatterService * MatterService
* 事项申请材料 service实现 * 事项申请材料 service实现
* *
* @author zxfei * @author zxfei
* @date 2022-09-27 * @date 2022-09-27
*/ */
@Service("matterService") @Service("matterService")
public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, MatterEntity, Long> implements MatterService { public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, MatterEntity, Long> implements MatterService {
...@@ -34,27 +40,18 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -34,27 +40,18 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired @Autowired
private SheetMatterDao sheetMatterDao; private SheetMatterService sheetMatterService;
@Autowired @Autowired
private MatterDatumService matterDatumService; private MatterDatumService matterDatumService;
@Override @Override
protected MatterEntity findBefore(MatterEntity params, PageInfo pageInfo, Context context) throws AppException { protected MatterEntity findBefore(MatterEntity params, PageInfo pageInfo, Context context) throws AppException {
if(StringUtils.isNotEmpty(params.getMatterName())){ if (StringUtils.isNotEmpty(params.getMatterName())) {
params.setMatterName("%".concat(params.getMatterName()).concat("%")); params.setMatterName("%".concat(params.getMatterName()).concat("%"));
} }
return params; return params;
} }
@Override
protected void saveBefore(MatterEntity entity, Context context) throws AppException {
entity.setTotal(0);
entity.setSort(0);
entity.setIsRecommend(0);
entity.setSource(MatterSourceEnum.MANUAL.getValue());
this.validData(entity, context);
}
@Override @Override
protected void updateBefore(MatterEntity entity, Context context) throws AppException { protected void updateBefore(MatterEntity entity, Context context) throws AppException {
entity.setIsRecommend(null); entity.setIsRecommend(null);
...@@ -63,47 +60,68 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -63,47 +60,68 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
@Override @Override
protected void removeBefore(Long[] ids, Context context) throws AppException { protected void removeBefore(Long[] ids, Context context) throws AppException {
List<MatterEntity> queryList = this.get(ids,context); List<MatterEntity> queryList = this.get(ids, context);
if(CollectionUtils.isNotEmpty(queryList)){ if (CollectionUtils.isNotEmpty(queryList)) {
int recommendCount = paramService.getParamIntValue(ParamKey.MATTER_RECOMMEND_COUNT); int recommendCount = paramService.getParamIntValue(ParamKey.MATTER_RECOMMEND_COUNT);
for(MatterEntity matterEntity:queryList){ for (MatterEntity matterEntity : queryList) {
if(matterEntity.getIsRecommend()==1){ if (matterEntity.getIsRecommend() == 1) {
recommendCount--; recommendCount--;
} }
} }
paramService.setValueByKey(ParamKey.MATTER_RECOMMEND_COUNT,String.valueOf(recommendCount)); paramService.setValueByKey(ParamKey.MATTER_RECOMMEND_COUNT, String.valueOf(recommendCount));
} }
} }
@Override @Override
protected void findAfter(MatterEntity entity, PageInfo pageInfo, Context context, List<MatterEntity> list) throws AppException { protected void findAfter(MatterEntity entity, PageInfo pageInfo, Context context, List<MatterEntity> list) throws AppException {
if(CollectionUtils.isNotEmpty(list)){ if (CollectionUtils.isNotEmpty(list)) {
for(MatterEntity matterEntity:list){ for (MatterEntity matterEntity : list) {
MatterDatumEntity query = new MatterDatumEntity(); MatterDatumEntity query = new MatterDatumEntity();
query.setMatterId(matterEntity.getId()); query.setMatterId(matterEntity.getId());
int datumCount = matterDatumService.count(query,context); int datumCount = matterDatumService.count(query, context);
matterEntity.setDatumCount(datumCount); matterEntity.setDatumCount(datumCount);
} }
} }
} }
@Override @Override
public void createMatterbBySheetMatter(Long[] sheetMatterIds) { public Rest<String> createMatterbBySheetMatter(Long[] sheetMatterIds, Long siteId, Context context) {
List<SheetMatterEntity> sheetMatterEntityList = sheetMatterDao.get(sheetMatterIds); if(ObjectUtils.isEmpty(sheetMatterIds)){
if(CollectionUtils.isNotEmpty(sheetMatterEntityList)){ throw new AppException("事项ids is null");
Date now = new Date(); }
List<MatterEntity> list = new ArrayList<>(); int success = 0;
for(SheetMatterEntity sheetMatterEntity:sheetMatterEntityList){ int fail = 0;
MatterEntity query = new MatterEntity(); List<SheetMatterEntity> sheetMatterEntityList = sheetMatterService.get(sheetMatterIds, context);
query.setSiteId(sheetMatterEntity.getSiteId()); for (SheetMatterEntity sheetMatterEntity : sheetMatterEntityList) {
query.setTid(sheetMatterEntity.getTid()); Boolean bool = updateOrSave(sheetMatterEntity, siteId, context);
query.setTcode(sheetMatterEntity.getTcode()); if (bool) {
List<MatterEntity> queryList = this.find(query); success++;
if(CollectionUtils.isNotEmpty(queryList)){ } else {
continue; fail++;
}
} }
String msg = "当前加入事项已存在!";
if (sheetMatterIds.length == 1) {
if (success > 0) {
msg = "加入事项成功!";
}
} else if (sheetMatterIds.length > 1) {
if (success > 0 && fail == 0) {
msg = String.format("加入事项成功%d条!", success);
} else if (success > 0 && fail > 0) {
msg = String.format("加入事项成功%d条,重复加入事项%d条!", success, fail);
} else if (success == 0 && fail > 0) {
msg = String.format("重复加入事项%d条!", fail);
}
}
return Rest.ok(msg);
}
private Boolean updateOrSave(SheetMatterEntity sheetMatterEntity, Long siteId, Context context) {
MatterEntity siteMatterEntity = this.selectOne(new MatterQuery().siteId(siteId).tid(sheetMatterEntity.getTid()));
if (ObjectUtils.isEmpty(siteMatterEntity)) {
MatterEntity matterEntity = new MatterEntity(); MatterEntity matterEntity = new MatterEntity();
matterEntity.setSiteId(sheetMatterEntity.getSiteId()); matterEntity.setSiteId(siteId);
matterEntity.setTid(sheetMatterEntity.getTid()); matterEntity.setTid(sheetMatterEntity.getTid());
matterEntity.setTcode(sheetMatterEntity.getTcode()); matterEntity.setTcode(sheetMatterEntity.getTcode());
matterEntity.setTname(sheetMatterEntity.getTname()); matterEntity.setTname(sheetMatterEntity.getTname());
...@@ -111,40 +129,36 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -111,40 +129,36 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
matterEntity.setEnglishName(sheetMatterEntity.getEnglishName()); matterEntity.setEnglishName(sheetMatterEntity.getEnglishName());
matterEntity.setMatterNo(sheetMatterEntity.getMatterNo()); matterEntity.setMatterNo(sheetMatterEntity.getMatterNo());
matterEntity.setMatterFullName(sheetMatterEntity.getMatterName()); matterEntity.setMatterFullName(sheetMatterEntity.getMatterName());
matterEntity.setTotal(0);
matterEntity.setSort(0);
matterEntity.setIsRecommend(0);
matterEntity.setSource(MatterSourceEnum.AUTO.getValue()); matterEntity.setSource(MatterSourceEnum.AUTO.getValue());
matterEntity.setCreateUserId(1l); matterEntity.setCreateUserId(this.getContextUserId(context));
matterEntity.setCreateTime(now); matterEntity.setCreateTime(new Date());
list.add(matterEntity); this.save(matterEntity, context);
} return true;
this.dao.insertBatch(list);
} }
return false;
} }
@Override @Override
public void recommend(Long id) { public void recommend(Long id) {
MatterEntity matterEntity = this.dao.get(id); MatterEntity matterEntity = this.dao.get(id);
if(matterEntity==null){ if (matterEntity == null) {
throw new AppException("数据已更改,请重试"); throw new AppException("数据已更改,请重试");
} }
int recommendCount = paramService.getParamIntValue(ParamKey.MATTER_RECOMMEND_COUNT); int recommendCount = paramService.getParamIntValue(ParamKey.MATTER_RECOMMEND_COUNT);
Map<String,Object> data = new HashMap<>(); Map<String, Object> data = new HashMap<>();
Map<String,Object> condition = new HashMap<>(); Map<String, Object> condition = new HashMap<>();
condition.put("id",id); condition.put("id", id);
if(matterEntity.getIsRecommend()==0){ if (matterEntity.getIsRecommend() == 0) {
if(recommendCount>=RECOMMEND_COUNT){ if (recommendCount >= RECOMMEND_COUNT) {
throw new AppException("超过推荐个数"); throw new AppException("超过推荐个数");
} }
recommendCount++; recommendCount++;
data.put("isRecommend",1); data.put("isRecommend", 1);
}else { } else {
recommendCount--; recommendCount--;
data.put("isRecommend",0); data.put("isRecommend", 0);
} }
this.dao.update(data,condition); this.dao.update(data, condition);
paramService.setValueByKey(ParamKey.MATTER_RECOMMEND_COUNT,String.valueOf(recommendCount)); paramService.setValueByKey(ParamKey.MATTER_RECOMMEND_COUNT, String.valueOf(recommendCount));
} }
} }
\ No newline at end of file
package com.mortals.xhx.module.matter.web; package com.mortals.xhx.module.matter.web;
import com.mortals.framework.common.IBaseEnum; import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.Rest;
import com.mortals.framework.common.code.YesNo; import com.mortals.framework.common.code.YesNo;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol; import com.mortals.framework.model.OrderCol;
...@@ -56,7 +57,7 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -56,7 +57,7 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
@Override @Override
protected void doListBefore(MatterEntity query, Map<String, Object> model, Context context) throws AppException { protected void doListBefore(MatterEntity query, Map<String, Object> model, Context context) throws AppException {
List<OrderCol> orderColList = new ArrayList<>(); List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("isRecommend")); orderColList.add(new OrderCol("isRecommend",OrderCol.DESCENDING));
query.setOrderColList(orderColList); query.setOrderColList(orderColList);
super.doListBefore(query, model, context); super.doListBefore(query, model, context);
} }
...@@ -68,18 +69,18 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -68,18 +69,18 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
return super.doListAfter(query, model, context); return super.doListAfter(query, model, context);
} }
@RequestMapping(value = {"createMatter"},method = {RequestMethod.POST, RequestMethod.GET}) @RequestMapping(value = {"createMatter"},method = {RequestMethod.POST, RequestMethod.GET})
public String createMatter(Long[] ids) { public String createMatter(Long[] ids,Long siteId) {
Context context = this.getContext(); // public String createMatter(Long[] ids) {
Map<String, Object> model = new HashMap(); Map<String, Object> model = new HashMap();
int code = 1; int code = 1;
String busiDesc = "站点事项转事项"; String busiDesc = "站点事项转事项";
try { try {
this.service.createMatterbBySheetMatter(ids); Rest<String> rest = this.service.createMatterbBySheetMatter(ids, siteId, getContext());
model.put("message_info", "站点事项转事项成功!"); model.put("message_info", rest.getMsg());
this.recordSysLog(this.request, busiDesc + " 【成功】 [id:" + ids + "]");
this.recordSysLog(this.request, rest.getMsg());
} catch (Exception var7) { } catch (Exception var7) {
code = -1; code = -1;
this.doException(this.request, busiDesc, model, var7); this.doException(this.request, busiDesc, model, var7);
......
package com.mortals.xhx.module.matter.web; package com.mortals.xhx.module.matter.web;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.key.ParamKey; import com.mortals.xhx.common.key.ParamKey;
...@@ -15,12 +16,10 @@ import com.mortals.xhx.module.matter.model.MatterDatumEntity; ...@@ -15,12 +16,10 @@ import com.mortals.xhx.module.matter.model.MatterDatumEntity;
import com.mortals.xhx.module.matter.service.MatterDatumService; import com.mortals.xhx.module.matter.service.MatterDatumService;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*; import static com.mortals.framework.ap.SysConstains.*;
...@@ -49,6 +48,14 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat ...@@ -49,6 +48,14 @@ public class MatterDatumController extends BaseCRUDJsonBodyMappingController<Mat
super.init(model, context); super.init(model, context);
} }
@Override
protected void doListBefore(MatterDatumEntity query, Map<String, Object> model, Context context) throws AppException {
List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("isRecommend",OrderCol.DESCENDING));
query.setOrderColList(orderColList);
super.doListBefore(query, model, context);
}
@Override @Override
protected int doListAfter(MatterDatumEntity query, Map<String, Object> model, Context context) throws AppException { protected int doListAfter(MatterDatumEntity query, Map<String, Object> model, Context context) throws AppException {
int recommendCount = paramService.getParamIntValue(ParamKey.MATTER_DATUM_RECOMMEND_COUNT); int recommendCount = paramService.getParamIntValue(ParamKey.MATTER_DATUM_RECOMMEND_COUNT);
......
...@@ -31,14 +31,12 @@ Content-Type: application/json ...@@ -31,14 +31,12 @@ Content-Type: application/json
{} {}
###短信设置编辑 ###添加
GET {{baseUrl}}/sms/set/edit?id={{SmsSet_id}} GET {{baseUrl}}/matter/createMatter?ids=37,38,39&siteId=1
Authorization: {{authToken}}
Accept: application/json Accept: application/json
###短信设置删除
GET {{baseUrl}}/sms/set/delete?id={{SmsSet_id}}
Accept: application/json
......
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