jz.kai 2 lat temu
rodzic
commit
7fed9ce1cc

+ 18 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/dao/OfficeAttachmentDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.excellent.modules.base.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.base.entity.OfficeAttachment;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface OfficeAttachmentDAO {
+	int insert(OfficeAttachment entity);
+	int update(OfficeAttachment entity);
+	int exist(String id);
+	OfficeAttachment get(String id);
+	int delete(String id);
+	List<OfficeAttachment> list();
+	List<OfficeAttachment> search(Map<String,Object> searchParams,List<Sort> sortList);
+}

+ 18 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/dao/OfficeOpinionDAO.java

@@ -0,0 +1,18 @@
+package com.jpsoft.excellent.modules.base.dao;
+
+import java.util.List;
+import org.springframework.stereotype.Repository;
+import com.jpsoft.excellent.modules.base.entity.OfficeOpinion;
+import java.util.Map;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+@Repository
+public interface OfficeOpinionDAO {
+	int insert(OfficeOpinion entity);
+	int update(OfficeOpinion entity);
+	int exist(String id);
+	OfficeOpinion get(String id);
+	int delete(String id);
+	List<OfficeOpinion> list();
+	List<OfficeOpinion> search(Map<String,Object> searchParams,List<Sort> sortList);
+}

+ 37 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/entity/OfficeAttachment.java

@@ -0,0 +1,37 @@
+package com.jpsoft.excellent.modules.base.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+  描述:base_office_attachment的实体类
+ */
+@Data
+@ApiModel(value = "base_office_attachment的实体类")
+public class OfficeAttachment {
+        @ApiModelProperty(value = "编号")
+    private String id;
+        @ApiModelProperty(value = "评议信息编号")
+    private String officeOpinionId;
+        @ApiModelProperty(value = "附件类型")
+    private String attachmentType;
+        @ApiModelProperty(value = "附件标题")
+    private String attachmentTitle;
+        @ApiModelProperty(value = "附件路径")
+    private String attachmentUrl;
+        @ApiModelProperty(value = "序号")
+    private Integer sortNo;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+        @ApiModelProperty(value = "创建人")
+    private String createBy;
+}

+ 53 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/entity/OfficeOpinion.java

@@ -0,0 +1,53 @@
+package com.jpsoft.excellent.modules.base.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+/**
+  描述:base_office_opinion的实体类
+ */
+@Data
+@ApiModel(value = "base_office_opinion的实体类")
+public class OfficeOpinion {
+        @ApiModelProperty(value = "编号")
+    private String id;
+        @ApiModelProperty(value = "联系人")
+    private String connect;
+        @ApiModelProperty(value = "联系电话")
+    private String connectPhone;
+        @ApiModelProperty(value = "机关编号")
+    private String officeId;
+        @ApiModelProperty(value = "是否满意")
+    private Boolean isSatisfied;
+        @ApiModelProperty(value = "内容")
+    private String content;
+        @ApiModelProperty(value = "附件")
+    private String appendix;
+        @ApiModelProperty(value = "处理进度")
+    private Boolean opinionStatus;
+        @ApiModelProperty(value = "确认状态")
+    private Boolean confirmStatus;
+        @ApiModelProperty(value = "处理情况")
+    private String contentAttachment;
+        @ApiModelProperty(value = "是否删除")
+    private Boolean delFlag;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+        @ApiModelProperty(value = "创建人")
+    private String createBy;
+        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "更新时间")
+    private Date updateTime;
+        @ApiModelProperty(value = "更新人")
+    private String updateBy;
+}

+ 17 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/OfficeAttachmentService.java

@@ -0,0 +1,17 @@
+package com.jpsoft.excellent.modules.base.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.base.entity.OfficeAttachment;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface OfficeAttachmentService {
+	OfficeAttachment get(String id);
+	boolean exist(String id);
+	int insert(OfficeAttachment model);
+	int update(OfficeAttachment model);
+	int delete(String id);
+	List<OfficeAttachment> list();
+	Page<OfficeAttachment> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+}

+ 17 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/OfficeOpinionService.java

@@ -0,0 +1,17 @@
+package com.jpsoft.excellent.modules.base.service;
+
+import java.util.List;
+import java.util.Map;
+import com.jpsoft.excellent.modules.base.entity.OfficeOpinion;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+
+public interface OfficeOpinionService {
+	OfficeOpinion get(String id);
+	boolean exist(String id);
+	int insert(OfficeOpinion model);
+	int update(OfficeOpinion model);
+	int delete(String id);
+	List<OfficeOpinion> list();
+	Page<OfficeOpinion> pageSearch(Map<String, Object> searchParams,int pageNum,int pageSize,boolean count,List<Sort> sortList);
+}

+ 70 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/OfficeAttachmentServiceImpl.java

@@ -0,0 +1,70 @@
+package com.jpsoft.excellent.modules.base.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.base.dao.OfficeAttachmentDAO;
+import com.jpsoft.excellent.modules.base.entity.OfficeAttachment;
+import com.jpsoft.excellent.modules.base.service.OfficeAttachmentService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="officeAttachmentService")
+public class OfficeAttachmentServiceImpl implements OfficeAttachmentService {
+	@Resource(name="officeAttachmentDAO")
+	private OfficeAttachmentDAO officeAttachmentDAO;
+
+	@Override
+	public OfficeAttachment get(String id) {
+		// TODO Auto-generated method stub
+		return officeAttachmentDAO.get(id);
+	}
+
+	@Override
+	public int insert(OfficeAttachment model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return officeAttachmentDAO.insert(model);
+	}
+
+	@Override
+	public int update(OfficeAttachment model) {
+		// TODO Auto-generated method stub
+		return officeAttachmentDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return officeAttachmentDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = officeAttachmentDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<OfficeAttachment> list() {
+		// TODO Auto-generated method stub
+		return officeAttachmentDAO.list();
+	}
+		
+	@Override
+	public Page<OfficeAttachment> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<OfficeAttachment> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            officeAttachmentDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 70 - 0
common/src/main/java/com/jpsoft/excellent/modules/base/service/impl/OfficeOpinionServiceImpl.java

@@ -0,0 +1,70 @@
+package com.jpsoft.excellent.modules.base.service.impl;
+
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import javax.annotation.Resource;
+import org.springframework.stereotype.Component;
+import org.springframework.transaction.annotation.Transactional;
+import com.jpsoft.excellent.modules.base.dao.OfficeOpinionDAO;
+import com.jpsoft.excellent.modules.base.entity.OfficeOpinion;
+import com.jpsoft.excellent.modules.base.service.OfficeOpinionService;
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="officeOpinionService")
+public class OfficeOpinionServiceImpl implements OfficeOpinionService {
+	@Resource(name="officeOpinionDAO")
+	private OfficeOpinionDAO officeOpinionDAO;
+
+	@Override
+	public OfficeOpinion get(String id) {
+		// TODO Auto-generated method stub
+		return officeOpinionDAO.get(id);
+	}
+
+	@Override
+	public int insert(OfficeOpinion model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return officeOpinionDAO.insert(model);
+	}
+
+	@Override
+	public int update(OfficeOpinion model) {
+		// TODO Auto-generated method stub
+		return officeOpinionDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return officeOpinionDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = officeOpinionDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<OfficeOpinion> list() {
+		// TODO Auto-generated method stub
+		return officeOpinionDAO.list();
+	}
+		
+	@Override
+	public Page<OfficeOpinion> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<OfficeOpinion> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            officeOpinionDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 91 - 0
common/src/main/resources/mapper/base/OfficeAttachment.xml

@@ -0,0 +1,91 @@
+<?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">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.excellent.modules.base.dao.OfficeAttachmentDAO">
+	<resultMap id="OfficeAttachmentMap" type="com.jpsoft.excellent.modules.base.entity.OfficeAttachment">
+		<id property="id" column="id_" />
+			<result property="officeOpinionId" column="office_opinion_id" />
+			<result property="attachmentType" column="attachment_type" />
+			<result property="attachmentTitle" column="attachment_title" />
+			<result property="attachmentUrl" column="attachment_url" />
+			<result property="sortNo" column="sort_no" />
+			<result property="createTime" column="create_time" />
+			<result property="createBy" column="create_by" />
+			</resultMap>
+	<insert id="insert" parameterType="com.jpsoft.excellent.modules.base.entity.OfficeAttachment">
+	<!--
+	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+		select sys_guid() from dual
+	</selectKey>
+	-->
+	<![CDATA[
+		insert into base_office_attachment
+	    (id_,office_opinion_id,attachment_type,attachment_title,attachment_url,sort_no,create_time,create_by)
+		values
+		(
+#{id,jdbcType=VARCHAR}
+,#{officeOpinionId,jdbcType=VARCHAR}
+,#{attachmentType,jdbcType=VARCHAR}
+,#{attachmentTitle,jdbcType=VARCHAR}
+,#{attachmentUrl,jdbcType=VARCHAR}
+,#{sortNo,jdbcType= NUMERIC }
+,#{createTime,jdbcType= TIMESTAMP }
+,#{createBy,jdbcType=VARCHAR}
+		)
+	]]>
+	</insert>
+	<delete id="delete" parameterType="string">
+		delete from base_office_attachment where id_=#{id,jdbcType=VARCHAR}
+	</delete>
+	<update id="update" parameterType="com.jpsoft.excellent.modules.base.entity.OfficeAttachment">
+		update base_office_attachment
+		<set>
+				<if test="officeOpinionId!=null">
+		office_opinion_id=#{officeOpinionId,jdbcType=VARCHAR},
+		</if>
+				<if test="attachmentType!=null">
+		attachment_type=#{attachmentType,jdbcType=VARCHAR},
+		</if>
+				<if test="attachmentTitle!=null">
+		attachment_title=#{attachmentTitle,jdbcType=VARCHAR},
+		</if>
+				<if test="attachmentUrl!=null">
+		attachment_url=#{attachmentUrl,jdbcType=VARCHAR},
+		</if>
+				<if test="sortNo!=null">
+		sort_no=#{sortNo,jdbcType= NUMERIC },
+		</if>
+				<if test="createTime!=null">
+		create_time=#{createTime,jdbcType= TIMESTAMP },
+		</if>
+				<if test="createBy!=null">
+		create_by=#{createBy,jdbcType=VARCHAR},
+		</if>
+		</set>
+	where id_=#{id}
+	</update>
+	<select id="get" parameterType="string" resultMap="OfficeAttachmentMap">
+		select 
+id_,office_opinion_id,attachment_type,attachment_title,attachment_url,sort_no,create_time,create_by		from base_office_attachment where id_=#{0}
+	</select>
+	<select id="exist" parameterType="string" resultType="int">
+		select count(*) from base_office_attachment where id_=#{0}
+	</select>
+	<select id="list" resultMap="OfficeAttachmentMap">
+		select * from base_office_attachment
+	</select>
+	<select id="search" parameterType="hashmap" resultMap="OfficeAttachmentMap">
+		<![CDATA[
+			select * from base_office_attachment
+		]]>
+		<where>
+			<if test="searchParams.id != null">
+				and ID_ like #{searchParams.id}
+			</if>
+		</where>
+		<foreach item="sort" collection="sortList"  open="order by" separator=",">
+	        ${sort.name} ${sort.order}
+	 	</foreach>
+	</select>
+</mapper>

+ 126 - 0
common/src/main/resources/mapper/base/OfficeOpinion.xml

@@ -0,0 +1,126 @@
+<?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">
+<!-- namespace必须指向DAO接口 -->
+<mapper namespace="com.jpsoft.excellent.modules.base.dao.OfficeOpinionDAO">
+	<resultMap id="OfficeOpinionMap" type="com.jpsoft.excellent.modules.base.entity.OfficeOpinion">
+		<id property="id" column="id_" />
+			<result property="connect" column="connect_" />
+			<result property="connectPhone" column="connect_phone" />
+			<result property="officeId" column="office_id" />
+			<result property="isSatisfied" column="is_satisfied" />
+			<result property="content" column="content_" />
+			<result property="appendix" column="appendix_" />
+			<result property="opinionStatus" column="opinion_status" />
+			<result property="confirmStatus" column="confirm_status" />
+			<result property="contentAttachment" column="content_attachment" />
+			<result property="delFlag" column="del_flag" />
+			<result property="createTime" column="create_time" />
+			<result property="createBy" column="create_by" />
+			<result property="updateTime" column="update_time" />
+			<result property="updateBy" column="update_by" />
+			</resultMap>
+	<insert id="insert" parameterType="com.jpsoft.excellent.modules.base.entity.OfficeOpinion">
+	<!--
+	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+		select sys_guid() from dual
+	</selectKey>
+	-->
+	<![CDATA[
+		insert into base_office_opinion
+	    (id_,connect_,connect_phone,office_id,is_satisfied,content_,appendix_,opinion_status,confirm_status,content_attachment,del_flag,create_time,create_by,update_time,update_by)
+		values
+		(
+#{id,jdbcType=VARCHAR}
+,#{connect,jdbcType=VARCHAR}
+,#{connectPhone,jdbcType=VARCHAR}
+,#{officeId,jdbcType=VARCHAR}
+,#{isSatisfied,jdbcType= NUMERIC }
+,#{content,jdbcType=VARCHAR}
+,#{appendix,jdbcType=VARCHAR}
+,#{opinionStatus,jdbcType= NUMERIC }
+,#{confirmStatus,jdbcType= NUMERIC }
+,#{contentAttachment,jdbcType=VARCHAR}
+,#{delFlag,jdbcType= NUMERIC }
+,#{createTime,jdbcType= TIMESTAMP }
+,#{createBy,jdbcType=VARCHAR}
+,#{updateTime,jdbcType= TIMESTAMP }
+,#{updateBy,jdbcType=VARCHAR}
+		)
+	]]>
+	</insert>
+	<delete id="delete" parameterType="string">
+		delete from base_office_opinion where id_=#{id,jdbcType=VARCHAR}
+	</delete>
+	<update id="update" parameterType="com.jpsoft.excellent.modules.base.entity.OfficeOpinion">
+		update base_office_opinion
+		<set>
+				<if test="connect!=null">
+		connect_=#{connect,jdbcType=VARCHAR},
+		</if>
+				<if test="connectPhone!=null">
+		connect_phone=#{connectPhone,jdbcType=VARCHAR},
+		</if>
+				<if test="officeId!=null">
+		office_id=#{officeId,jdbcType=VARCHAR},
+		</if>
+				<if test="isSatisfied!=null">
+		is_satisfied=#{isSatisfied,jdbcType= NUMERIC },
+		</if>
+				<if test="content!=null">
+		content_=#{content,jdbcType=VARCHAR},
+		</if>
+				<if test="appendix!=null">
+		appendix_=#{appendix,jdbcType=VARCHAR},
+		</if>
+				<if test="opinionStatus!=null">
+		opinion_status=#{opinionStatus,jdbcType= NUMERIC },
+		</if>
+				<if test="confirmStatus!=null">
+		confirm_status=#{confirmStatus,jdbcType= NUMERIC },
+		</if>
+				<if test="contentAttachment!=null">
+		content_attachment=#{contentAttachment,jdbcType=VARCHAR},
+		</if>
+				<if test="delFlag!=null">
+		del_flag=#{delFlag,jdbcType= NUMERIC },
+		</if>
+				<if test="createTime!=null">
+		create_time=#{createTime,jdbcType= TIMESTAMP },
+		</if>
+				<if test="createBy!=null">
+		create_by=#{createBy,jdbcType=VARCHAR},
+		</if>
+				<if test="updateTime!=null">
+		update_time=#{updateTime,jdbcType= TIMESTAMP },
+		</if>
+				<if test="updateBy!=null">
+		update_by=#{updateBy,jdbcType=VARCHAR},
+		</if>
+		</set>
+	where id_=#{id}
+	</update>
+	<select id="get" parameterType="string" resultMap="OfficeOpinionMap">
+		select 
+id_,connect_,connect_phone,office_id,is_satisfied,content_,appendix_,opinion_status,confirm_status,content_attachment,del_flag,create_time,create_by,update_time,update_by		from base_office_opinion where id_=#{0}
+	</select>
+	<select id="exist" parameterType="string" resultType="int">
+		select count(*) from base_office_opinion where id_=#{0}
+	</select>
+	<select id="list" resultMap="OfficeOpinionMap">
+		select * from base_office_opinion
+	</select>
+	<select id="search" parameterType="hashmap" resultMap="OfficeOpinionMap">
+		<![CDATA[
+			select * from base_office_opinion
+		]]>
+		<where>
+			<if test="searchParams.id != null">
+				and ID_ like #{searchParams.id}
+			</if>
+		</where>
+		<foreach item="sort" collection="sortList"  open="order by" separator=",">
+	        ${sort.name} ${sort.order}
+	 	</foreach>
+	</select>
+</mapper>

+ 1 - 0
common/src/main/resources/mapper/sys/User.xml

@@ -107,6 +107,7 @@
         <![CDATA[
 			select a.* from sys_user a
 			where a.del_flag = 0
+			and a.id_ <> '72dc480e-6816-4be3-918d-da2436f39627'
 		]]>
         <if test="searchParams.userName != null">
             and a.user_name like #{searchParams.userName}

+ 225 - 0
web/src/main/java/com/jpsoft/excellent/modules/base/controller/OfficeOpinionController.java

@@ -0,0 +1,225 @@
+package com.jpsoft.excellent.modules.base.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.excellent.modules.common.utils.PojoUtils;
+import com.jpsoft.excellent.modules.common.dto.Sort;
+import com.jpsoft.excellent.modules.common.dto.MessageResult;
+import com.jpsoft.excellent.modules.base.entity.OfficeOpinion;
+import com.jpsoft.excellent.modules.base.service.OfficeOpinionService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+@RestController
+@RequestMapping("/base/officeOpinion")
+@Api(description = "officeOpinion")
+public class OfficeOpinionController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private OfficeOpinionService officeOpinionService;
+
+    @ApiOperation(value="创建空记录")
+    @GetMapping("create")
+    public MessageResult<OfficeOpinion> create(){
+        MessageResult<OfficeOpinion> msgResult = new MessageResult<>();
+
+        OfficeOpinion officeOpinion = new OfficeOpinion();
+
+        msgResult.setData(officeOpinion);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+    
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<OfficeOpinion> add(@RequestBody OfficeOpinion officeOpinion,@RequestAttribute String subject){
+        MessageResult<OfficeOpinion> msgResult = new MessageResult<>();
+
+        try {
+            officeOpinion.setId(UUID.randomUUID().toString());
+            officeOpinion.setDelFlag(false);
+            officeOpinion.setCreateBy(subject);
+            officeOpinion.setCreateTime(new Date());
+            
+            int affectCount = officeOpinionService.insert(officeOpinion);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(officeOpinion);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库添加失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="获取信息")
+    @GetMapping("edit/{id}")
+    public MessageResult<OfficeOpinion> edit(@PathVariable("id") String id){
+        MessageResult<OfficeOpinion> msgResult = new MessageResult<>();
+
+        try {
+            OfficeOpinion officeOpinion = officeOpinionService.get(id);
+
+            if (officeOpinion != null) {
+                msgResult.setResult(true);
+                msgResult.setData(officeOpinion);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库不存在该记录!");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="更新用户")
+    @PostMapping("update")
+    public MessageResult<OfficeOpinion> update(@RequestBody OfficeOpinion officeOpinion,@RequestAttribute String subject){
+        MessageResult<OfficeOpinion> msgResult = new MessageResult<>();
+
+        try {
+            officeOpinion.setUpdateBy(subject);
+            officeOpinion.setUpdateTime(new Date());
+            
+            int affectCount = officeOpinionService.update(officeOpinion);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(officeOpinion);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+	@ApiOperation(value="删除")
+    @PostMapping("delete/{id}")
+    public MessageResult<Integer> delete(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            OfficeOpinion officeOpinion = officeOpinionService.get(id);
+            officeOpinion.setDelFlag(true);
+            officeOpinion.setUpdateBy(subject);
+            officeOpinion.setUpdateTime(new Date());
+
+            int affectCount = officeOpinionService.update(officeOpinion);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+
+    @ApiOperation(value="批量删除")
+    @PostMapping("batchDelete")
+    public MessageResult<Integer> batchDelete(@RequestBody List<String> idList,@RequestAttribute String subject){
+        MessageResult<Integer> msgResult = new MessageResult<>();
+
+        try {
+            int affectCount = 0;
+
+            for (String id : idList) {
+                OfficeOpinion officeOpinion = officeOpinionService.get(id);
+                officeOpinion.setDelFlag(true);
+                officeOpinion.setUpdateBy(subject);
+                officeOpinion.setUpdateTime(new Date());
+
+                affectCount += officeOpinionService.update(officeOpinion);
+            }
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(affectCount);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("删除失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String id,
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="20") int pageSize,
+            @RequestAttribute String subject){
+
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("id_","asc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id","%" + id + "%");
+        }
+
+        Page<OfficeOpinion> page = officeOpinionService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 5 - 5
web/src/main/resources/application-dev.yml

@@ -5,12 +5,12 @@ server:
 
 spring:
   datasource:
-    url: jdbc:log4jdbc:mysql://39.104.144.104:3308/double_excellent?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
-    username: root
-    password: jpsoft8121234
-#    url: jdbc:log4jdbc:mysql://192.168.33.20:3306/double_excellent?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+#    url: jdbc:log4jdbc:mysql://39.104.144.104:3308/double_excellent?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
 #    username: root
-#    password: jpsoft2016
+#    password: jpsoft8121234
+    url: jdbc:log4jdbc:mysql://192.168.33.20:3306/double_excellent?autoReconnect=true&characterEncoding=utf8&serverTimezone=GMT%2B8
+    username: root
+    password: jpsoft2016
   devtools:
     add-properties: false
     restart: