Commit 351b8253 by 吴迪

Merge remote-tracking branch 'origin/master'

parents fc3ba90b 2dc11e06
package io.office.modules.manage.controller; package io.office.modules.manage.controller;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.ProductEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import io.office.modules.sys.controller.AbstractController;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -27,7 +35,7 @@ import io.office.common.utils.R; ...@@ -27,7 +35,7 @@ import io.office.common.utils.R;
*/ */
@RestController @RestController
@RequestMapping("/knowledgeinfo") @RequestMapping("/knowledgeinfo")
public class KnowledgeinfoController { public class KnowledgeinfoController extends AbstractController {
@Autowired @Autowired
private KnowledgeinfoService knowledgeinfoService; private KnowledgeinfoService knowledgeinfoService;
...@@ -36,10 +44,11 @@ public class KnowledgeinfoController { ...@@ -36,10 +44,11 @@ public class KnowledgeinfoController {
*/ */
@RequestMapping("/list") @RequestMapping("/list")
// @RequiresPermissions("manage:knowledgeinfo:list") // @RequiresPermissions("manage:knowledgeinfo:list")
public R list(@RequestParam Map<String, Object> params){ public R list(@RequestBody NewsParams params){
PageUtils page = knowledgeinfoService.queryPage(params); Page<KnowledgeinfoEntity> page = this.knowledgeinfoService.knowledgeinfoList(params,
new Page(params.getPage(), params.getLimit()));
return R.ok().put("page", page); PageUtils pageUtils = new PageUtils(page);
return R.ok().put("page", pageUtils);
} }
...@@ -60,9 +69,10 @@ public class KnowledgeinfoController { ...@@ -60,9 +69,10 @@ public class KnowledgeinfoController {
@RequestMapping("/save") @RequestMapping("/save")
// @RequiresPermissions("manage:knowledgeinfo:save") // @RequiresPermissions("manage:knowledgeinfo:save")
public R save(@RequestBody KnowledgeinfoEntity knowledgeinfo){ public R save(@RequestBody KnowledgeinfoEntity knowledgeinfo){
knowledgeinfo.setInputdate(new Date());
knowledgeinfo.setEditor(getUser().getUsername());
knowledgeinfoService.save(knowledgeinfo); knowledgeinfoService.save(knowledgeinfo);
return R.ok("新增成功!");
return R.ok();
} }
/** /**
...@@ -71,9 +81,9 @@ public class KnowledgeinfoController { ...@@ -71,9 +81,9 @@ public class KnowledgeinfoController {
@RequestMapping("/update") @RequestMapping("/update")
// @RequiresPermissions("manage:knowledgeinfo:update") // @RequiresPermissions("manage:knowledgeinfo:update")
public R update(@RequestBody KnowledgeinfoEntity knowledgeinfo){ public R update(@RequestBody KnowledgeinfoEntity knowledgeinfo){
knowledgeinfo.setEditor(getUser().getUsername());
knowledgeinfoService.updateById(knowledgeinfo); knowledgeinfoService.updateById(knowledgeinfo);
return R.ok("修改成功!");
return R.ok();
} }
/** /**
...@@ -81,10 +91,27 @@ public class KnowledgeinfoController { ...@@ -81,10 +91,27 @@ public class KnowledgeinfoController {
*/ */
@RequestMapping("/delete") @RequestMapping("/delete")
// @RequiresPermissions("manage:knowledgeinfo:delete") // @RequiresPermissions("manage:knowledgeinfo:delete")
public R delete(@RequestBody Integer[] knowledgeinfoids){ public R delete(@RequestBody List<String> knowledgeinfoids){
knowledgeinfoService.removeByIds(Arrays.asList(knowledgeinfoids)); KnowledgeinfoEntity knowledgeinfo = new KnowledgeinfoEntity();
knowledgeinfo.setEditor(getUser().getUsername());
knowledgeinfo.setLevels(0);
QueryWrapper<KnowledgeinfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("knowledgeinfoid",knowledgeinfoids);
knowledgeinfoService.update(knowledgeinfo,queryWrapper);
return R.ok("删除成功!");
}
return R.ok(); /**
* 删除
*/
@RequestMapping("/verify")
// @RequiresPermissions("manage:knowledgeinfo:delete")
public R verify(@RequestBody KnowledgeinfoEntity knowledgeinfo){
knowledgeinfo.setAuditor(getUser().getUsername());
QueryWrapper<KnowledgeinfoEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("knowledgeinfoid",knowledgeinfo.getKnowledgeinfoid());
knowledgeinfoService.update(knowledgeinfo,queryWrapper);
return R.ok("审核成功!");
} }
} }
...@@ -706,6 +706,26 @@ public class NewsController extends AbstractController { ...@@ -706,6 +706,26 @@ public class NewsController extends AbstractController {
return R.ok().put("page", pageUtils); return R.ok().put("page", pageUtils);
} }
/**
*首页党建文化
*/
@RequestMapping("/api/sydjwhTop4")
// @RequiresPermissions("manage:newsmovie:info")
public R sydjwhTop4(){
List<Map<String,Object>> retList = this.newsService.sydjwhTop4();
return R.ok().put("data", retList);
}
/**
*首页党建文化
*/
@RequestMapping("/api/sydjwhTop1")
// @RequiresPermissions("manage:newsmovie:info")
public R sydjwhTop1(){
List<Map<String,Object>> retList = this.newsService.sydjwhTop1();
return R.ok().put("data", retList);
}
......
package io.office.modules.manage.dao; package io.office.modules.manage.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.KnowledgeinfoEntity; import io.office.modules.manage.entity.KnowledgeinfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* ${comments} * ${comments}
...@@ -14,4 +20,5 @@ import org.apache.ibatis.annotations.Mapper; ...@@ -14,4 +20,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface KnowledgeinfoDao extends BaseMapper<KnowledgeinfoEntity> { public interface KnowledgeinfoDao extends BaseMapper<KnowledgeinfoEntity> {
List<KnowledgeinfoEntity> knowledgeinfoList(@Param("newsParams") NewsParams params, Page page);
} }
...@@ -107,4 +107,8 @@ public interface NewsDao extends BaseMapper<NewsEntity> { ...@@ -107,4 +107,8 @@ public interface NewsDao extends BaseMapper<NewsEntity> {
List<Map<String, Object>> columnList(); List<Map<String, Object>> columnList();
List<NewsEntity> selectYylyList(@Param("newsParams") NewsParams newsParams, Page page); List<NewsEntity> selectYylyList(@Param("newsParams") NewsParams newsParams, Page page);
List<Map<String, Object>> sydjwhTop4();
List<Map<String, Object>> sydjwhTop1();
} }
...@@ -49,6 +49,9 @@ public interface TycpdmFirmDao extends BaseMapper<TycpdmFirmEntity> { ...@@ -49,6 +49,9 @@ public interface TycpdmFirmDao extends BaseMapper<TycpdmFirmEntity> {
@Select("select count(1) from tycpdm_firm where firmName=#{firmname} and logout_flag=1") @Select("select count(1) from tycpdm_firm where firmName=#{firmname} and logout_flag=1")
int selectByIdFirmNameSC(@Param("firmname") String firmname); int selectByIdFirmNameSC(@Param("firmname") String firmname);
@Select("select count(1) from tycpdm_firm where certificateCode=#{certificateCode} and logout_flag=1")
int selectByIdCertificateCode(@Param("certificateCode") String certificateCode);
@Select("select count(1) from firm where firm_name=#{firmname} and (logout_flag=2 or logout_flag=0)") @Select("select count(1) from firm where firm_name=#{firmname} and (logout_flag=2 or logout_flag=0)")
int selectByIdFirmNameXTSC(@Param("firmname")String firmname); int selectByIdFirmNameXTSC(@Param("firmname")String firmname);
......
package io.office.modules.manage.entity; package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
...@@ -65,4 +66,14 @@ public class KnowledgeinfoEntity implements Serializable { ...@@ -65,4 +66,14 @@ public class KnowledgeinfoEntity implements Serializable {
*/ */
private String auditor; private String auditor;
@TableField(exist = false)
private String parentCategoryName;
@TableField(exist = false)
private String CategoryName;
@TableField(exist = false)
private String class1id;
@TableField(exist = false)
private String class2id;
} }
...@@ -38,4 +38,9 @@ public class NewsParams extends PageParams { ...@@ -38,4 +38,9 @@ public class NewsParams extends PageParams {
private String firmname; private String firmname;
private String technology; private String technology;
private String service; private String service;
/**一级分类*/
private String parentCategoryId;
/**二级分类*/
private String categoryId;
} }
package io.office.modules.manage.service; package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.KnowledgeinfoEntity; import io.office.modules.manage.entity.KnowledgeinfoEntity;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import java.util.Map; import java.util.Map;
...@@ -16,5 +19,7 @@ import java.util.Map; ...@@ -16,5 +19,7 @@ import java.util.Map;
public interface KnowledgeinfoService extends IService<KnowledgeinfoEntity> { public interface KnowledgeinfoService extends IService<KnowledgeinfoEntity> {
PageUtils queryPage(Map<String, Object> params); PageUtils queryPage(Map<String, Object> params);
Page<KnowledgeinfoEntity> knowledgeinfoList(NewsParams params, Page page);
} }
...@@ -105,5 +105,9 @@ public interface NewsService extends IService<NewsEntity> { ...@@ -105,5 +105,9 @@ public interface NewsService extends IService<NewsEntity> {
List<Map<String, Object>> columnList(); List<Map<String, Object>> columnList();
Page<NewsEntity> selectYylyList(NewsParams newsParams, Page page); Page<NewsEntity> selectYylyList(NewsParams newsParams, Page page);
List<Map<String, Object>> sydjwhTop4();
List<Map<String, Object>> sydjwhTop1();
} }
package io.office.modules.manage.service.impl; package io.office.modules.manage.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.dto.NewsParams;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -16,6 +22,10 @@ import io.office.modules.manage.service.KnowledgeinfoService; ...@@ -16,6 +22,10 @@ import io.office.modules.manage.service.KnowledgeinfoService;
@Service("knowledgeinfoService") @Service("knowledgeinfoService")
public class KnowledgeinfoServiceImpl extends ServiceImpl<KnowledgeinfoDao, KnowledgeinfoEntity> implements KnowledgeinfoService { public class KnowledgeinfoServiceImpl extends ServiceImpl<KnowledgeinfoDao, KnowledgeinfoEntity> implements KnowledgeinfoService {
@Autowired
KnowledgeinfoDao knowledgeinfoDao;
@Override @Override
public PageUtils queryPage(Map<String, Object> params) { public PageUtils queryPage(Map<String, Object> params) {
IPage<KnowledgeinfoEntity> page = this.page( IPage<KnowledgeinfoEntity> page = this.page(
...@@ -26,4 +36,11 @@ public class KnowledgeinfoServiceImpl extends ServiceImpl<KnowledgeinfoDao, Know ...@@ -26,4 +36,11 @@ public class KnowledgeinfoServiceImpl extends ServiceImpl<KnowledgeinfoDao, Know
return new PageUtils(page); return new PageUtils(page);
} }
@Override
public Page<KnowledgeinfoEntity> knowledgeinfoList(NewsParams params, Page page) {
List<KnowledgeinfoEntity> retList = this.knowledgeinfoDao.knowledgeinfoList(params,page);
page.setRecords(retList);
return page;
}
} }
\ No newline at end of file
...@@ -615,5 +615,17 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements ...@@ -615,5 +615,17 @@ public class NewsServiceImpl extends ServiceImpl<NewsDao, NewsEntity> implements
return page; return page;
} }
@Override
public List<Map<String, Object>> sydjwhTop4() {
List<Map<String, Object>> retList = this.newsDao.sydjwhTop4();
return retList;
}
@Override
public List<Map<String, Object>> sydjwhTop1() {
List<Map<String, Object>> retList = this.newsDao.sydjwhTop1();
return retList;
}
} }
\ No newline at end of file
...@@ -319,9 +319,13 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm ...@@ -319,9 +319,13 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
TycpdmFirmChangeEntity tycpdmFirmChangeEntity = new TycpdmFirmChangeEntity(); TycpdmFirmChangeEntity tycpdmFirmChangeEntity = new TycpdmFirmChangeEntity();
Integer status = body.get("status")==null?0:Integer.valueOf(String.valueOf(body.get("status"))); Integer status = body.get("status")==null?0:Integer.valueOf(String.valueOf(body.get("status")));
Object certificateCode = body.get("certificatecode");//填统一社会信用代码 Object certificateCode = body.get("certificatecode");//填统一社会信用代码
if (!AlgorithmUtils.checkUSCC(certificateCode.toString())){ if (!AlgorithmUtils.checkUSCC(certificateCode.toString())){
throw new RRException("统一社会信用代码输入错误"); throw new RRException("统一社会信用代码输入错误");
} }
if(tycpdmFirmDao.selectByIdCertificateCode(String.valueOf(certificateCode))>0){
throw new RRException("统一社会信用代码已存在");
}
//写入死值 //写入死值
body.put("useddesc","企业产品描述信息"); body.put("useddesc","企业产品描述信息");
body.put("wishusednum",100); body.put("wishusednum",100);
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
and a.editor =#{newsParams.editor} and a.editor =#{newsParams.editor}
</if> </if>
<if test="newsParams.type !=null and newsParams.type !=''"> <if test="newsParams.type !=null and newsParams.type !=''">
and b.announcetype =#{newsParams.type} and a.announcetype =#{newsParams.type}
</if> </if>
ORDER BY ORDER BY
a.id DESC a.id DESC
......
...@@ -18,5 +18,42 @@ ...@@ -18,5 +18,42 @@
<result property="auditor" column="auditor"/> <result property="auditor" column="auditor"/>
</resultMap> </resultMap>
<select id="knowledgeinfoList" resultMap="knowledgeinfoMap">
SELECT
c.knowledgeCategoryID class1id,
c.description parentCategoryName,
b.knowledgeCategoryID class2id,
b.description CategoryName,
a.*
FROM
knowledgeInfo a
LEFT JOIN knowledgeCategory b ON a.knowledgeCategoryID = b.knowledgeCategoryID
LEFT JOIN knowledgeCategory c ON b.parentCategoryID = c.knowledgeCategoryID
WHERE 1=1
<choose>
<when test="newsParams.levels !=null">
AND a.levels = #{newsParams.levels}
</when>
<otherwise>
AND a.levels > 0
</otherwise>
</choose>
<if test="newsParams.title !=null and newsParams.title !=''">
and a.title like concat('%',#{newsParams.title},'%')
</if>
<if test="newsParams.status !=null and newsParams.status !=''">
and a.status =#{newsParams.status}
</if>
<if test="newsParams.releaseTimeStart !=null and newsParams.releaseTimeEnd !=null">
and a.inputdate BETWEEN #{newsParams.releaseTimeStart} AND #{newsParams.releaseTimeEnd}
</if>
<if test="newsParams.parentCategoryId !=null and newsParams.parentCategoryId !=''">
and c.knowledgeCategoryID = #{newsParams.parentCategoryId}
</if>
<if test="newsParams.categoryId !=null and newsParams.categoryId !=''">
and b.knowledgeCategoryID = #{newsParams.categoryId}
</if>
ORDER BY
inputdate DESC
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -418,6 +418,8 @@ ...@@ -418,6 +418,8 @@
knowledgeInfo t knowledgeInfo t
LEFT JOIN knowledgeCategory tt ON t.knowledgeCategoryID = tt.knowledgeCategoryID LEFT JOIN knowledgeCategory tt ON t.knowledgeCategoryID = tt.knowledgeCategoryID
where 1=1 where 1=1
and t.status = 1
AND t.levels > 0
<if test="title !=null and title !=''"> <if test="title !=null and title !=''">
and t.Title like concat(concat('%',#{title}),'%') and t.Title like concat(concat('%',#{title}),'%')
</if> </if>
...@@ -425,7 +427,7 @@ ...@@ -425,7 +427,7 @@
<foreach collection="list" index="index" item="item" open="(" separator="," close=")"> <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
order by knowledgeInfoID desc order by t.levels DESC,t.knowledgeInfoid DESC
</select> </select>
<select id="searchKnowledgeInfoList" resultType="java.util.Map"> <select id="searchKnowledgeInfoList" resultType="java.util.Map">
SELECT SELECT
...@@ -463,6 +465,8 @@ order by knowledgeInfoID desc ...@@ -463,6 +465,8 @@ order by knowledgeInfoID desc
knowledgeInfo t knowledgeInfo t
LEFT JOIN knowledgeCategory tt ON t.knowledgeCategoryID = tt.knowledgeCategoryID LEFT JOIN knowledgeCategory tt ON t.knowledgeCategoryID = tt.knowledgeCategoryID
where 1=1 where 1=1
and t.status = 1
AND t.levels > 0
<if test="params.title !=null and params.title !=''"> <if test="params.title !=null and params.title !=''">
and t.Title like concat(concat('%',#{title}),'%') and t.Title like concat(concat('%',#{title}),'%')
</if> </if>
...@@ -470,6 +474,7 @@ order by knowledgeInfoID desc ...@@ -470,6 +474,7 @@ order by knowledgeInfoID desc
<foreach collection="params.list" index="index" item="item" open="(" separator="," close=")"> <foreach collection="params.list" index="index" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
order by t.levels DESC,t.knowledgeInfoid DESC
</select> </select>
<select id="dsxxjyTop8" resultMap="newsMap"> <select id="dsxxjyTop8" resultMap="newsMap">
...@@ -715,4 +720,50 @@ ORDER BY ...@@ -715,4 +720,50 @@ ORDER BY
</if> </if>
order by id desc order by id desc
</select> </select>
<select id="sydjwhTop4" resultType="java.util.Map">
SELECT
TOP 4 a.classid,
a.newsid as id,
a.id AS yid,
a.newslevels,
a. TIME,
b.title,
b.author,
b.updatedate,
b.levels,
b.id
FROM
TopIcNews AS a
LEFT JOIN news AS b ON a.newsid = b.id
WHERE
status = 1
AND a.classid = 428
ORDER BY
levels DESC,
releasedate DESC
</select>
<select id="sydjwhTop1" resultType="java.util.Map">
SELECT
TOP 1 a.classid,
a.newsid as id,
a.id AS yid,
a.newslevels,
a. TIME,
b.title,
b.author,
b.updatedate,
b.levels,
b.id
FROM
TopIcNews AS a
LEFT JOIN news AS b ON a.newsid = b.id
WHERE
status = 1
AND a.classid = 429
ORDER BY
levels DESC,
releasedate DESC
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -45,7 +45,8 @@ ...@@ -45,7 +45,8 @@
showtime, showtime,
auditor, auditor,
status, status,
editor editor,
levels
from news_movie from news_movie
where 1=1 where 1=1
<if test="params.title !=null and params.title !=''"> <if test="params.title !=null and params.title !=''">
...@@ -66,7 +67,7 @@ ...@@ -66,7 +67,7 @@
<if test="params.clanguage !=null and params.clanguage !=''"> <if test="params.clanguage !=null and params.clanguage !=''">
and clanguage =#{params.clanguage} and clanguage =#{params.clanguage}
</if> </if>
<if test="params.levels !=null and params.levels !=''"> <if test="params.levels !=null">
and levels = #{params.levels} and levels = #{params.levels}
</if> </if>
ORDER BY releasedate desc ORDER BY releasedate desc
......
...@@ -58,8 +58,8 @@ ...@@ -58,8 +58,8 @@
and inputDate BETWEEN #{params.inputDateStart} AND #{params.inputDateEnd} and inputDate BETWEEN #{params.inputDateStart} AND #{params.inputDateEnd}
</if> </if>
<choose> <choose>
<when test="params.levels !=null and params.levels !=''"> <when test="params.pictureLevel !=null and params.pictureLevel !=''">
AND PicLevel = #{params.levels} AND PicLevel = #{params.pictureLevel}
</when> </when>
<otherwise> <otherwise>
AND PicLevel = 0 AND PicLevel = 0
......
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