Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

jz.kai 5 лет назад
Родитель
Сommit
c63a17e8fe

+ 20 - 0
common/src/main/java/com/jpsoft/campus/modules/base/dao/OfferInfoDAO.java

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

+ 90 - 0
common/src/main/java/com/jpsoft/campus/modules/base/entity/OfferInfo.java

@@ -0,0 +1,90 @@
+package com.jpsoft.campus.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_offer_info的实体类
+ */
+@Data
+@ApiModel(value = "base_offer_info的实体类")
+public class OfferInfo {
+	/**
+	 *
+	 */
+        @ApiModelProperty(value = "")
+	private String id;
+	/**
+	 *学生ID
+	 */
+        @ApiModelProperty(value = "学生ID")
+	private String studentId;
+	/**
+	 *申请单ID
+	 */
+        @ApiModelProperty(value = "申请单ID")
+	private String applicationId;
+	/**
+	 *招生类型:(1小学一年级/2小升初
+	 */
+        @ApiModelProperty(value = "招生类型:(1小学一年级/2小升初")
+	private String enrollmentType;
+	/**
+	 *录取学校ID
+	 */
+        @ApiModelProperty(value = "录取学校ID")
+	private String schoolId;
+	/**
+	 *序号
+	 */
+        @ApiModelProperty(value = "序号")
+	private Integer serialNum;
+	/**
+	 *录取编号
+	 */
+        @ApiModelProperty(value = "录取编号")
+	private String code;
+	/**
+	 *报道时间
+	 */
+    	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+	    @ApiModelProperty(value = "报道时间")
+	private Date reportTime;
+	/**
+	 *创建人
+	 */
+        @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 createTime;
+	/**
+	 *更新人
+	 */
+        @ApiModelProperty(value = "更新人")
+	private String updateBy;
+	/**
+	 *更新时间
+	 */
+    	@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 Boolean delFlag;
+}

+ 19 - 0
common/src/main/java/com/jpsoft/campus/modules/base/service/OfferInfoService.java

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

+ 77 - 0
common/src/main/java/com/jpsoft/campus/modules/base/service/impl/OfferInfoServiceImpl.java

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

+ 13 - 0
common/src/main/resources/mapper/base/ApplicationPrimary.xml

@@ -221,11 +221,24 @@
             <if test="searchParams.code != null">
                 and d.code_ like #{searchParams.code}
             </if>
+            <if test="searchParams.startStatus != null">
+                <![CDATA[
+                and a.status_ >= #{searchParams.startStatus}
+                ]]>
+            </if>
+            <if test="searchParams.endStatus != null">
+                <![CDATA[
+                and a.status_ <= #{searchParams.endStatus}
+                ]]>
+            </if>
             <if test="searchParams.orStatus != null">
                 <foreach item="status" collection="searchParams.orStatus" open="and (" separator="or" close=")">
                     a.status_ = #{status}
                 </foreach>
             </if>
+            <if test="searchParams.categoryId != null">
+                and a.category_id = #{searchParams.categoryId}
+            </if>
         </where>
         <foreach item="sort" collection="sortList" open="order by" separator=",">
             ${sort.name} ${sort.order}

+ 1 - 1
common/src/main/resources/mapper/base/NewsInfo.xml

@@ -47,7 +47,7 @@
 ,#{updateTime,jdbcType= TIMESTAMP }
 ,#{delFlag,jdbcType= NUMERIC }
 ,#{subtitle,jdbcType=VARCHAR}
-,#{sortNp,jdbcType= NUMERIC }
+,#{sortNo,jdbcType= NUMERIC }
 		)
 	]]>
 	</insert>

+ 126 - 0
common/src/main/resources/mapper/base/OfferInfo.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.campus.modules.base.dao.OfferInfoDAO">
+	<resultMap id="OfferInfoMap" type="com.jpsoft.campus.modules.base.entity.OfferInfo">
+		<id property="id" column="id_" />
+			<result property="studentId" column="student_id" />
+			<result property="applicationId" column="application_id" />
+			<result property="enrollmentType" column="enrollment_type" />
+			<result property="schoolId" column="school_id" />
+			<result property="serialNum" column="serial_num" />
+			<result property="code" column="code_" />
+			<result property="reportTime" column="report_time" />
+			<result property="createBy" column="create_by" />
+			<result property="createTime" column="create_time" />
+			<result property="updateBy" column="update_by" />
+			<result property="updateTime" column="update_time" />
+			<result property="delFlag" column="del_flag" />
+			</resultMap>
+	<insert id="insert" parameterType="com.jpsoft.campus.modules.base.entity.OfferInfo">
+	<!--
+	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+		select sys_guid() from dual
+	</selectKey>
+	-->
+	<![CDATA[
+		insert into base_offer_info
+	    (id_,student_id,application_id,enrollment_type,school_id,serial_num,code_,report_time,create_by,create_time,update_by,update_time,del_flag)
+		values
+		(
+#{id,jdbcType=VARCHAR}
+,#{studentId,jdbcType=VARCHAR}
+,#{applicationId,jdbcType=VARCHAR}
+,#{enrollmentType,jdbcType=VARCHAR}
+,#{schoolId,jdbcType=VARCHAR}
+,#{serialNum,jdbcType= NUMERIC }
+,#{code,jdbcType=VARCHAR}
+,#{reportTime,jdbcType= TIMESTAMP }
+,#{createBy,jdbcType=VARCHAR}
+,#{createTime,jdbcType= TIMESTAMP }
+,#{updateBy,jdbcType=VARCHAR}
+,#{updateTime,jdbcType= TIMESTAMP }
+,#{delFlag,jdbcType= NUMERIC }
+		)
+	]]>
+	</insert>
+	<delete id="delete" parameterType="string">
+		delete from base_offer_info where id_=#{id,jdbcType=VARCHAR}
+	</delete>
+	<update id="update" parameterType="com.jpsoft.campus.modules.base.entity.OfferInfo">
+		update base_offer_info
+		<set>
+				<if test="studentId!=null">
+		student_id=#{studentId,jdbcType=VARCHAR},
+		</if>
+				<if test="applicationId!=null">
+		application_id=#{applicationId,jdbcType=VARCHAR},
+		</if>
+				<if test="enrollmentType!=null">
+		enrollment_type=#{enrollmentType,jdbcType=VARCHAR},
+		</if>
+				<if test="schoolId!=null">
+		school_id=#{schoolId,jdbcType=VARCHAR},
+		</if>
+				<if test="serialNum!=null">
+		serial_num=#{serialNum,jdbcType= NUMERIC },
+		</if>
+				<if test="code!=null">
+		code_=#{code,jdbcType=VARCHAR},
+		</if>
+				<if test="reportTime!=null">
+		report_time=#{reportTime,jdbcType= TIMESTAMP },
+		</if>
+				<if test="createBy!=null">
+		create_by=#{createBy,jdbcType=VARCHAR},
+		</if>
+				<if test="createTime!=null">
+		create_time=#{createTime,jdbcType= TIMESTAMP },
+		</if>
+				<if test="updateBy!=null">
+		update_by=#{updateBy,jdbcType=VARCHAR},
+		</if>
+				<if test="updateTime!=null">
+		update_time=#{updateTime,jdbcType= TIMESTAMP },
+		</if>
+				<if test="delFlag!=null">
+		del_flag=#{delFlag,jdbcType= NUMERIC },
+		</if>
+		</set>
+	where id_=#{id}
+	</update>
+	<select id="get" parameterType="string" resultMap="OfferInfoMap">
+		select * from base_offer_info where id_=#{0}
+	</select>
+	<select id="exist" parameterType="string" resultType="int">
+		select count(*) from base_offer_info where id_=#{0}
+	</select>
+	<select id="list" resultMap="OfferInfoMap">
+		select * from base_offer_info
+	</select>
+	<select id="search" parameterType="hashmap" resultMap="OfferInfoMap">
+		<![CDATA[
+			select * from base_offer_info
+		]]>
+		<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>
+
+	<select id="findMaxSerialNum" parameterType="string" resultType="int">
+		SELECT
+		IF ( max( serial_num ) IS NULL, 0, max( serial_num ) )
+		FROM
+		base_offer_info
+		WHERE
+		del_flag = 0
+		AND school_id = #{schoolId}
+		AND enrollment_type = #{enrollmentType}
+	</select>
+</mapper>

+ 158 - 2
web/src/main/java/com/jpsoft/campus/modules/base/controller/ApplicationPrimaryController.java

@@ -52,6 +52,8 @@ public class ApplicationPrimaryController {
     private UserService userService;
     @Autowired
     private UserRoleService userRoleService;
+    @Autowired
+    private OfferInfoService offerInfoService;
 
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
@@ -238,6 +240,7 @@ public class ApplicationPrimaryController {
             String status,
             String cardType,
             String schoolId,
+            @RequestParam(value="categoryId",defaultValue="") String categoryId,
             @RequestParam(value="startStatus",defaultValue="") String startStatus,
             @RequestParam(value="endStatus",defaultValue="") String endStatus,
             @RequestParam(value="delFlag",defaultValue="false") Boolean delFlag,
@@ -293,6 +296,10 @@ public class ApplicationPrimaryController {
             searchParams.put("endStatus",endStatus);
         }
 
+        if (StringUtils.isNotEmpty(categoryId)) {
+            searchParams.put("categoryId",categoryId);
+        }
+
         //根据用户和角色查询
         int count1 = userRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
         int count2 = userRoleService.findCountByAIdAndRName(subject,"XFLD");
@@ -433,6 +440,8 @@ public class ApplicationPrimaryController {
             String type,
             String nameOrIdCard,
             String schoolId,
+            @RequestParam(value="startStatus",defaultValue="") String startStatus,
+            @RequestParam(value="endStatus",defaultValue="") String endStatus,
             @RequestParam(value="delFlag",defaultValue="false") Boolean delFlag,
             @RequestAttribute String subject){
         //当前用户ID
@@ -441,13 +450,13 @@ public class ApplicationPrimaryController {
         MessageResult<Map> msgResult = new MessageResult<>();
         Map<String,Object> map = new HashMap<>();
 
-        Integer sum = 0;
         List<Sort> sortList2 = new ArrayList<>();
         sortList2.add(new Sort("parent_id","asc"));
         sortList2.add(new Sort("code_","asc"));
 
         Map<String,Object> searchParams2 = new HashMap<>();
 
+        Integer sum = 0;
         if (!userService.hasRole(subject,"SYSADMIN")) {
             User user = userService.get(subject);
             searchParams2.put("code", "%" + user.getSchoolId() + "%");
@@ -476,6 +485,15 @@ public class ApplicationPrimaryController {
                 searchParams.put("cardType",cardType);
             }
 
+            //开始
+            if (StringUtils.isNotEmpty(startStatus)) {
+                searchParams.put("startStatus",startStatus);
+            }
+            //结束
+            if (StringUtils.isNotEmpty(endStatus)) {
+                searchParams.put("endStatus",endStatus);
+            }
+
             searchParams.put("delFlag",delFlag);
 
             if(StringUtils.isNotEmpty(schoolId)){
@@ -517,6 +535,108 @@ public class ApplicationPrimaryController {
         return msgResult;
     }
 
+    @ApiOperation(value="根据报名类型查询数量")
+    @RequestMapping(value = "categoryCount",method = RequestMethod.POST)
+    public MessageResult<Map> categoryCount(
+            String status,
+            String cardType,
+            String type,
+            String nameOrIdCard,
+            String schoolId,
+            String categoryId,
+            @RequestParam(value="startStatus",defaultValue="") String startStatus,
+            @RequestParam(value="endStatus",defaultValue="") String endStatus,
+            @RequestParam(value="delFlag",defaultValue="false") Boolean delFlag,
+            @RequestAttribute String subject){
+        //当前用户ID
+        System.out.println(subject);
+
+        MessageResult<Map> msgResult = new MessageResult<>();
+        Map<String,Object> map = new HashMap<>();
+
+        List<Sort> sortList2 = new ArrayList<>();
+        sortList2.add(new Sort("parent_id","asc"));
+        sortList2.add(new Sort("code_","asc"));
+
+        Map<String,Object> searchParams2 = new HashMap<>();
+
+        Integer sum = 0;
+        List<DataDictionary> dataDictionaryList = dataDictionaryService.findByCatalogName("C类生证明");
+        for(DataDictionary dataDictionary : dataDictionaryList){
+            Map<String,Object> searchParams = new HashMap<>();
+            categoryId = dataDictionary.getId();
+
+            List<Sort> sortList = new ArrayList<>();
+            sortList.add(new Sort("id_","asc"));
+
+            if (StringUtils.isNotEmpty(type)) {
+                searchParams.put("type",type);
+            }
+            if (StringUtils.isNotEmpty(status)) {
+                searchParams.put("status",status);
+            }
+            if (StringUtils.isNotEmpty(nameOrIdCard)) {
+                searchParams.put("nameOrIdCard","%" + nameOrIdCard + "%");
+            }
+
+            if (StringUtils.isNotEmpty(cardType)) {
+                searchParams.put("cardType",cardType);
+            }
+
+            if (StringUtils.isNotEmpty(categoryId)) {
+                searchParams.put("categoryId",categoryId);
+            }
+
+            //开始
+            if (StringUtils.isNotEmpty(startStatus)) {
+                searchParams.put("startStatus",startStatus);
+            }
+            //结束
+            if (StringUtils.isNotEmpty(endStatus)) {
+                searchParams.put("endStatus",endStatus);
+            }
+
+            searchParams.put("delFlag",delFlag);
+
+            if(StringUtils.isNotEmpty(schoolId)){
+                searchParams.put("code", "%" + schoolId + "%");
+            }else{
+                if (!userService.hasRole(subject,"SYSADMIN")) {
+                    User user = userService.get(subject);
+                    searchParams.put("code", "%" + user.getSchoolId() + "%");
+                }
+            }
+
+
+            //根据用户和角色查询
+            int count1 = userRoleService.findCountByAIdAndRName(subject,"SYSADMIN");
+            int count2 = userRoleService.findCountByAIdAndRName(subject,"XFLD");
+            int count3 = userRoleService.findCountByAIdAndRName(subject,"XFGZRY");
+
+            if(count1 > 0){
+                //管理员查全部
+            }else if(count2 > 0){
+                //领导查全部
+            }else if(count3 > 0){
+                //工作人员只能查网上初审10和现场初审20
+                List statusList = new ArrayList();
+                statusList.add("10");
+                statusList.add("20");
+                searchParams.put("orStatus",statusList);
+            }
+
+            Page<ApplicationPrimaryDTO> page = applicationPrimaryService.pageSearchDTO(searchParams,1,10000,false,sortList);
+            map.put(categoryId,page.size());
+            sum += page.size();
+        }
+        map.put("all",sum);
+
+        msgResult.setResult(true);
+        msgResult.setData(map);
+
+        return msgResult;
+    }
+
     @ApiOperation(value="获取详情")
     @GetMapping("datail/{id}")
     public MessageResult<Map> datail(@PathVariable("id") String id){
@@ -741,7 +861,43 @@ public class ApplicationPrimaryController {
             int affectCount = approvalInfoService.insert(approvalInfo);
 
             if (affectCount > 0) {
-                applicationPrimary.setStatus(String.valueOf(Integer.parseInt(applicationPrimary.getStatus()) + 10));
+
+
+                if("50".equals(applicationPrimary.getStatus())){
+                    //A类B类直接录取
+                    if("A".equals(applicationPrimary.getType()) || "B".equals(applicationPrimary.getType())){
+                        applicationPrimary.setStatus("90");
+
+                        //获取最大编号
+                        int serialNum = offerInfoService.findMaxSerialNum(applicationPrimary.getSchoolId(),"1");
+                        serialNum = serialNum+1;//最大编号加一
+                        Calendar date = Calendar.getInstance();
+                        String year = String.valueOf(date.get(Calendar.YEAR));
+                        SchoolInfo si = schoolInfoService.get(applicationPrimary.getSchoolId());
+                        //开发区+年份+学校编号2位+序号4位
+                        String code = "KFQ" + year + si.getSchoolCode() + String.format("%04d", serialNum);
+                        //保存录取信息表
+                        OfferInfo off = new OfferInfo();
+                        off.setId(UUID.randomUUID().toString());
+
+                        off.setApplicationId(applicationPrimary.getId());
+                        off.setStudentId(applicationPrimary.getStudentId());
+                        off.setEnrollmentType("1");//小学
+                        off.setSchoolId(applicationPrimary.getSchoolId());
+                        off.setSerialNum(serialNum);
+
+                        off.setCode(code);
+                        off.setDelFlag(false);
+                        off.setCreateBy(subject);
+                        off.setCreateTime(new Date());
+                        offerInfoService.insert(off);
+                    }else{
+                        applicationPrimary.setStatus(String.valueOf(Integer.parseInt(applicationPrimary.getStatus()) + 10));
+                    }
+                }else{
+                    applicationPrimary.setStatus(String.valueOf(Integer.parseInt(applicationPrimary.getStatus()) + 10));
+                }
+
                 applicationPrimary.setUpdateBy(subject);
                 applicationPrimary.setUpdateTime(new Date());
                 applicationPrimaryService.update(applicationPrimary);

+ 225 - 0
web/src/main/java/com/jpsoft/campus/modules/base/controller/OfferInfoController.java

@@ -0,0 +1,225 @@
+package com.jpsoft.campus.modules.base.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.campus.modules.base.entity.OfferInfo;
+import com.jpsoft.campus.modules.base.service.OfferInfoService;
+import com.jpsoft.campus.modules.common.dto.MessageResult;
+import com.jpsoft.campus.modules.common.utils.PojoUtils;
+import com.jpsoft.campus.modules.common.dto.Sort;
+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("/offerInfo")
+@Api(description = "offerInfo")
+public class OfferInfoController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private OfferInfoService offerInfoService;
+
+    @ApiOperation(value="创建空记录")
+    @GetMapping("create")
+    public MessageResult<OfferInfo> create(){
+        MessageResult<OfferInfo> msgResult = new MessageResult<>();
+
+        OfferInfo offerInfo = new OfferInfo();
+
+        msgResult.setData(offerInfo);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+    
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<OfferInfo> add(@RequestBody OfferInfo offerInfo,@RequestAttribute String subject){
+        MessageResult<OfferInfo> msgResult = new MessageResult<>();
+
+        try {
+            offerInfo.setId(UUID.randomUUID().toString());
+            offerInfo.setDelFlag(false);
+            offerInfo.setCreateBy(subject);
+            offerInfo.setCreateTime(new Date());
+            
+            int affectCount = offerInfoService.insert(offerInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(offerInfo);
+            } 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<OfferInfo> edit(@PathVariable("id") String id){
+        MessageResult<OfferInfo> msgResult = new MessageResult<>();
+
+        try {
+            OfferInfo offerInfo = offerInfoService.get(id);
+
+            if (offerInfo != null) {
+                msgResult.setResult(true);
+                msgResult.setData(offerInfo);
+            } 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<OfferInfo> update(@RequestBody OfferInfo offerInfo,@RequestAttribute String subject){
+        MessageResult<OfferInfo> msgResult = new MessageResult<>();
+
+        try {
+            offerInfo.setUpdateBy(subject);
+            offerInfo.setUpdateTime(new Date());
+            
+            int affectCount = offerInfoService.update(offerInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(offerInfo);
+            } 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 {
+            OfferInfo offerInfo = offerInfoService.get(id);
+            offerInfo.setDelFlag(true);
+            offerInfo.setUpdateBy(subject);
+            offerInfo.setUpdateTime(new Date());
+
+            int affectCount = offerInfoService.update(offerInfo);
+
+            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) {
+                OfferInfo offerInfo = offerInfoService.get(id);
+                offerInfo.setDelFlag(true);
+                offerInfo.setUpdateBy(subject);
+                offerInfo.setUpdateTime(new Date());
+
+                affectCount += offerInfoService.update(offerInfo);
+            }
+
+            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<OfferInfo> page = offerInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}