提交 0000b912 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 c9ed1f53
...@@ -15,7 +15,7 @@ import com.zrqx.core.vo.member.department.DepartmentMemberVo; ...@@ -15,7 +15,7 @@ import com.zrqx.core.vo.member.department.DepartmentMemberVo;
@FeignClient(value = "fg-member", fallback = MemberClientHystric.class) @FeignClient(value = "fg-member", fallback = MemberClientHystric.class)
public interface MemberClient { public interface MemberClient {
//TODO 远程调用 根据id获取部门名称 //TODO 远程调用 根据id获取部门名称 测试通过后 删除 TODO
@ApiOperation(value=" 根据id获取部门名称") @ApiOperation(value=" 根据id获取部门名称")
@GetMapping(MemberRequestPath.FG + MemberRequestPath.DEPARTMENT + MemberRequestPath.OID) @GetMapping(MemberRequestPath.FG + MemberRequestPath.DEPARTMENT + MemberRequestPath.OID)
public CallBack<DepartmentMemberVo> get(@PathVariable(BaseRequestPath.OBJECTID) Integer oid); public CallBack<DepartmentMemberVo> get(@PathVariable(BaseRequestPath.OBJECTID) Integer oid);
......
...@@ -41,6 +41,7 @@ public class FgBulletinController { ...@@ -41,6 +41,7 @@ public class FgBulletinController {
@ApiOperation("根据栏目名称查询一定数量的列表") @ApiOperation("根据栏目名称查询一定数量的列表")
@GetMapping(SysUserRequestPath.LIST) @GetMapping(SysUserRequestPath.LIST)
public CallBack<List<BulletinContent>> list(QueryBulletinContentForm form){ public CallBack<List<BulletinContent>> list(QueryBulletinContentForm form){
// TODO 列表与 分页列表的排序方式需要统一, 参考 资讯管理
return CallBack.success(fgBulletinService.selectByParam(form)); return CallBack.success(fgBulletinService.selectByParam(form));
} }
...@@ -53,6 +54,7 @@ public class FgBulletinController { ...@@ -53,6 +54,7 @@ public class FgBulletinController {
return CallBack.success(fgBulletinService.page(pageParam,columnName)); return CallBack.success(fgBulletinService.page(pageParam,columnName));
} }
// 修改意见 参考 资讯管理
@ApiOperation("根据id点击标题查详情") @ApiOperation("根据id点击标题查详情")
@GetMapping(SysUserRequestPath.GET_OID) @GetMapping(SysUserRequestPath.GET_OID)
public CallBack<BulletinContent> get(Integer oid){ public CallBack<BulletinContent> get(Integer oid){
......
package com.zrqx.fg.sysuser.controller.dictionary; package com.zrqx.fg.sysuser.controller.dictionary;
import java.util.List;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import java.util.List;
import java.util.function.Consumer;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -17,6 +17,7 @@ import tk.mybatis.mapper.entity.Example.Criteria; ...@@ -17,6 +17,7 @@ import tk.mybatis.mapper.entity.Example.Criteria;
import com.zrqx.core.constant.sysuser.SysUserRequestPath; import com.zrqx.core.constant.sysuser.SysUserRequestPath;
import com.zrqx.core.form.sysuser.fg.dictionary.QueryFgDictionaryForm; import com.zrqx.core.form.sysuser.fg.dictionary.QueryFgDictionaryForm;
import com.zrqx.core.model.sysuser.dictionary.Dictionary; import com.zrqx.core.model.sysuser.dictionary.Dictionary;
import com.zrqx.core.util.datatype.ArrayUtils;
import com.zrqx.core.util.response.CallBack; import com.zrqx.core.util.response.CallBack;
import com.zrqx.fg.sysuser.service.dictionary.DictionaryService; import com.zrqx.fg.sysuser.service.dictionary.DictionaryService;
...@@ -28,9 +29,15 @@ public class FgDictionaryController { ...@@ -28,9 +29,15 @@ public class FgDictionaryController {
@Autowired @Autowired
private DictionaryService dictionaryService; private DictionaryService dictionaryService;
@ApiOperation("版权信息") private String code = "SITE";
@ApiOperation("基础方法")
@GetMapping(SysUserRequestPath.LIST) @GetMapping(SysUserRequestPath.LIST)
public CallBack<List<Dictionary>> list(QueryFgDictionaryForm form){ public CallBack<List<Dictionary>> list(QueryFgDictionaryForm form){
return CallBack.success(this.baseList(form));
}
private List<Dictionary> baseList(QueryFgDictionaryForm form){
Example example = dictionaryService.createExample(); Example example = dictionaryService.createExample();
Criteria params = example.createCriteria(); Criteria params = example.createCriteria();
if (form.getCode() != null) { if (form.getCode() != null) {
...@@ -42,7 +49,63 @@ public class FgDictionaryController { ...@@ -42,7 +49,63 @@ public class FgDictionaryController {
if (form.getEnkey() != null) { if (form.getEnkey() != null) {
params.andEqualTo("enkey", form.getEnkey()); params.andEqualTo("enkey", form.getEnkey());
} }
return CallBack.success(dictionaryService.selectByExample(example)); return dictionaryService.selectByExample(example);
}
/**
* 查询 数据字典, 默认条件为 FgDictionaryController.createSiteForm
* @param con
* @return
* @author lpf
* @date: 2019年4月26日 下午4:16:10
*/
private CallBack<Dictionary> get(Consumer<QueryFgDictionaryForm> con) {
QueryFgDictionaryForm form = this.createSiteForm();
con.accept(form);
List<Dictionary> list = this.baseList(form);
return ArrayUtils.empty(list) ? CallBack.success(): CallBack.success(list.get(0));
} }
/**
* 创建条件表单
* @return
* @author lpf
* @date: 2019年4月26日 下午4:15:16
*/
private QueryFgDictionaryForm createSiteForm(){
QueryFgDictionaryForm form = new QueryFgDictionaryForm();
form.setCode(this.code);
return form;
}
@ApiOperation("底部版权信息")
@GetMapping(SysUserRequestPath.GET + SysUserRequestPath.FOOTER)
public CallBack<Dictionary> getFooter(){
// code: SITE cnkey: 底部版权信息
return this.get(form -> form.setCnkey("底部版权信息"));
}
@ApiOperation("网站logo")
@GetMapping(SysUserRequestPath.GET + SysUserRequestPath.LOGO)
public CallBack<Dictionary> getLoGo(){
// code: SITE cnkey: 网站logo
return this.get(form -> form.setCnkey("网站logo"));
}
@ApiOperation("网站META关键词")
@GetMapping(SysUserRequestPath.GET + SysUserRequestPath.KEYWORD)
public CallBack<Dictionary> getKeyword(){
// code: SITE cnkey: 网站META关键词
return this.get(form -> form.setCnkey("网站META关键词"));
}
@ApiOperation("网站META描述")
@GetMapping(SysUserRequestPath.GET + SysUserRequestPath.DESCRIPTION)
public CallBack<Dictionary> getDescription(){
// code: SITE cnkey: 网站META描述
return this.get(form -> form.setCnkey("网站META描述"));
}
@ApiOperation("网站访问域名")
@GetMapping(SysUserRequestPath.GET + SysUserRequestPath.PATH)
public CallBack<Dictionary> getPath(){
// code: SITE cnkey: 网站访问域名
return this.get(form -> form.setCnkey("网站访问域名"));
}
} }
...@@ -35,4 +35,6 @@ public class FgFriendsLinksController { ...@@ -35,4 +35,6 @@ public class FgFriendsLinksController {
return CallBack.success(list); return CallBack.success(list);
} }
// TODO 根据友情链接id 修改点击量
} }
package com.zrqx.fg.sysuser.controller.news; package com.zrqx.fg.sysuser.controller.news;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import java.util.List; import java.util.List;
...@@ -11,16 +10,13 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -11,16 +10,13 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;
import com.zrqx.core.constant.sysuser.SysUserRequestPath; import com.zrqx.core.constant.sysuser.SysUserRequestPath;
import com.zrqx.core.enums.StatusEnum;
import com.zrqx.core.form.sysuser.fg.news.QueryNewsForm; import com.zrqx.core.form.sysuser.fg.news.QueryNewsForm;
import com.zrqx.core.model.sysuser.news.News; import com.zrqx.core.model.sysuser.news.News;
import com.zrqx.core.util.page.PageInfo; import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam; import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.util.response.CallBack; import com.zrqx.core.util.response.CallBack;
import com.zrqx.fg.sysuser.mapper.news.FgNewsMapper;
import com.zrqx.fg.sysuser.service.news.FgNewsService; import com.zrqx.fg.sysuser.service.news.FgNewsService;
@RestController @RestController
...@@ -40,15 +36,20 @@ public class FgNewsController { ...@@ -40,15 +36,20 @@ public class FgNewsController {
@ApiOperation("分页列表 其他资讯|技工动态|联盟之声|论坛之音") @ApiOperation("分页列表 其他资讯|技工动态|联盟之声|论坛之音")
@GetMapping(SysUserRequestPath.PAGE) @GetMapping(SysUserRequestPath.PAGE)
public CallBack<PageInfo<News>> page(PageParam pageParam,String columnName){ public CallBack<PageInfo<News>> page(PageParam pageParam,String columnName){
// TODO 字符串判断使用 apache lang3 包下 StringUtils.isEmpty 方法
if(pageParam.getOrderBy() == null) { if(pageParam.getOrderBy() == null) {
pageParam.setOrderBy(" sort , updateTime desc "); pageParam.setOrderBy(FgNewsMapper.DEFAULT_ORDERBY);
} }
return CallBack.success(fgNewsService.page(pageParam,columnName)); return CallBack.success(fgNewsService.page(pageParam,columnName));
} }
// TODO 描述错误, 根据咨询id查询
@ApiOperation("根据标题名查详情") @ApiOperation("根据标题名查详情")
// TODO 根据id 获取一个对象, 使用 SysUserRequestPath.OID
@GetMapping(SysUserRequestPath.GET_OID) @GetMapping(SysUserRequestPath.GET_OID)
// TODO 使用OID 的情况下 需要使用 @PathVariable注解
public CallBack<News> get(Integer oid){ public CallBack<News> get(Integer oid){
return CallBack.success(fgNewsService.selectByPrimaryKey(oid)); return CallBack.success(fgNewsService.selectByPrimaryKey(oid));
} }
} }
...@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.zrqx.core.commons.redis.Redis; import com.zrqx.core.commons.redis.FgRedisManage;
import com.zrqx.core.constant.sysuser.SysUserRequestPath; import com.zrqx.core.constant.sysuser.SysUserRequestPath;
import com.zrqx.core.enums.AuditStatusEnum; import com.zrqx.core.enums.AuditStatusEnum;
import com.zrqx.core.form.sysuser.fg.news.QueryNewsFeedBackForm; import com.zrqx.core.form.sysuser.fg.news.QueryNewsFeedBackForm;
...@@ -40,7 +40,7 @@ public class FgfgNewsFeedBackController { ...@@ -40,7 +40,7 @@ public class FgfgNewsFeedBackController {
private FgNewsFeedBackService fgNewsFeedBackService; private FgNewsFeedBackService fgNewsFeedBackService;
@Autowired @Autowired
private Redis fgRedisManageUser; private FgRedisManage fgRedisManage;
@Autowired @Autowired
private MemberClient memberClient; private MemberClient memberClient;
...@@ -67,14 +67,16 @@ public class FgfgNewsFeedBackController { ...@@ -67,14 +67,16 @@ public class FgfgNewsFeedBackController {
entity.setId(form.getNewsId()); entity.setId(form.getNewsId());
entity.setValue(form.getValue()); entity.setValue(form.getValue());
entity.setStatus(AuditStatusEnum.NONE.getCode()); entity.setStatus(AuditStatusEnum.NONE.getCode());
entity.setMemberName(fgRedisManageUser.getMember().getName()); entity.setMemberName(fgRedisManage.getMember().getName());
entity.setMemberPhone(fgRedisManageUser.getMember().getPhone()); entity.setMemberPhone(fgRedisManage.getMember().getPhone());
String id = fgRedisManageUser.getMember().getDepartmentId();
String id = fgRedisManage.getMember().getDepartmentId();
CallBack<DepartmentMemberVo> callBack = memberClient.get(Integer.parseInt(id)); CallBack<DepartmentMemberVo> callBack = memberClient.get(Integer.parseInt(id));
// TODO 空指针, 需要判断响应的值
String memberRealiationName = callBack.getData().getName(); String memberRealiationName = callBack.getData().getName();
entity.setMemberRealiationName(memberRealiationName); entity.setMemberRealiationName(memberRealiationName);
//TODO 部门名称 //TODO 部门名称
entity.setMemberType(fgRedisManageUser.getMember().getType()); entity.setMemberType(fgRedisManage.getMember().getType());
return CallBack.success(fgNewsFeedBackService.insertSelective(entity)); return CallBack.success(fgNewsFeedBackService.insertSelective(entity));
} }
} }
...@@ -23,6 +23,7 @@ public interface FgAdspaceMapper extends BaseMapper<Adspace>{ ...@@ -23,6 +23,7 @@ public interface FgAdspaceMapper extends BaseMapper<Adspace>{
* @author chyj * @author chyj
* @date: 2019年4月16日 下午2:20:44 * @date: 2019年4月16日 下午2:20:44
*/ */
// TODO 有重复的广告位标识 会报错
@Select(" <script> " @Select(" <script> "
+ " SELECT " + " SELECT "
+ " adspaceid AS id,adsignid,signvalue,url,picture,description,sysuserid,sysusername, " + " adspaceid AS id,adsignid,signvalue,url,picture,description,sysuserid,sysusername, "
......
...@@ -8,10 +8,12 @@ import org.apache.ibatis.annotations.Select; ...@@ -8,10 +8,12 @@ import org.apache.ibatis.annotations.Select;
import com.zrqx.core.form.sysuser.fg.news.QueryNewsForm; import com.zrqx.core.form.sysuser.fg.news.QueryNewsForm;
import com.zrqx.core.mapper.BaseMapper; import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.sysuser.news.News; import com.zrqx.core.model.sysuser.news.News;
import com.zrqx.core.util.page.PageInfo;
public interface FgNewsMapper extends BaseMapper<News>{ public interface FgNewsMapper extends BaseMapper<News>{
// 默认排序
String DEFAULT_ORDERBY = " sort , updateTime desc ";
/** /**
* 根据栏目名称查询一定数量列表 * 根据栏目名称查询一定数量列表
* @param form * @param form
...@@ -19,6 +21,7 @@ public interface FgNewsMapper extends BaseMapper<News>{ ...@@ -19,6 +21,7 @@ public interface FgNewsMapper extends BaseMapper<News>{
* @author chyj * @author chyj
* @date: 2019年4月16日 下午4:16:34 * @date: 2019年4月16日 下午4:16:34
*/ */
// TODO 与分页接口不统一
@Select(" <script> " @Select(" <script> "
+ " SELECT a.* FROM sys_news a,sys_bulletin_column b WHERE " + " SELECT a.* FROM sys_news a,sys_bulletin_column b WHERE "
+ " a.id = b.id " + " a.id = b.id "
...@@ -26,7 +29,8 @@ public interface FgNewsMapper extends BaseMapper<News>{ ...@@ -26,7 +29,8 @@ public interface FgNewsMapper extends BaseMapper<News>{
+ " and b.name = #{form.columnName} " + " and b.name = #{form.columnName} "
+ " </if> " + " </if> "
+ " AND STATUS=1 " + " AND STATUS=1 "
+ " ORDER BY sort ASC " + " ORDER BY "
+ DEFAULT_ORDERBY
+ " limit #{form.num} " + " limit #{form.num} "
+ " </script> ") + " </script> ")
List<News> selectByParam(@Param("form")QueryNewsForm form); List<News> selectByParam(@Param("form")QueryNewsForm form);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论