Browse Source

后台人员企业审核功能,培训人员列表功能

yanliming 2 years ago
parent
commit
ce2add9cbd

+ 18 - 0
common/src/main/java/com/jpsoft/employment/modules/base/dao/TrainingPersonDAO.java

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

+ 9 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/TrainingInfo.java

@@ -57,6 +57,15 @@ public class TrainingInfo {
 	@ApiModelProperty(value = "状态")
 	private String status;
 
+	@ApiModelProperty(value = "缩略图")
+	private String thumbnailImage;
+
+
+	@ApiModelProperty(value = "结束报名时间")
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@JsonFormat(pattern = "yyyy-MM-dd")
+	private Date endTime;
+
 	@Transient
 	@ApiModelProperty(value = "企业名称")
 	private String enterpriseName;

+ 56 - 0
common/src/main/java/com/jpsoft/employment/modules/base/entity/TrainingPerson.java

@@ -0,0 +1,56 @@
+package com.jpsoft.employment.modules.base.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.text.SimpleDateFormat;
+import java.math.BigDecimal;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.data.annotation.Transient;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+/**
+  描述:base_training_person的实体类
+ */
+@Data
+public class TrainingPerson {
+	private String id;
+	private String personId;
+	private String trainingId;
+	private String createBy;
+
+	@ApiModelProperty(value = "创建时间")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date createTime;
+	private String updateBy;
+
+	@ApiModelProperty(value = "更新时间")
+	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+	private Date updateTime;
+	private Boolean delFlag;
+
+	@Transient
+	@ApiModelProperty(value = "用工人员姓名")
+	private String workPersonName;
+
+	@Transient
+	@ApiModelProperty(value = "联系电话")
+	private String phone;
+
+	@Transient
+	@ApiModelProperty(value = "身份证号")
+	private String idCard;
+
+	@Transient
+	@ApiModelProperty(value = "性别")
+	private String gender;
+
+	@Transient
+	@ApiModelProperty(value = "年龄")
+	private Integer age;
+
+}

+ 17 - 0
common/src/main/java/com/jpsoft/employment/modules/base/service/TrainingPersonService.java

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

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

@@ -0,0 +1,70 @@
+package com.jpsoft.employment.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.employment.modules.base.dao.TrainingPersonDAO;
+import com.jpsoft.employment.modules.base.entity.TrainingPerson;
+import com.jpsoft.employment.modules.base.service.TrainingPersonService;
+import com.github.pagehelper.Page;
+import com.jpsoft.employment.modules.common.dto.Sort;
+import com.github.pagehelper.PageHelper;
+
+@Transactional
+@Component(value="trainingPersonService")
+public class TrainingPersonServiceImpl implements TrainingPersonService {
+	@Resource(name="trainingPersonDAO")
+	private TrainingPersonDAO trainingPersonDAO;
+
+	@Override
+	public TrainingPerson get(String id) {
+		// TODO Auto-generated method stub
+		return trainingPersonDAO.get(id);
+	}
+
+	@Override
+	public int insert(TrainingPerson model) {
+		// TODO Auto-generated method stub
+		//model.setId(UUID.randomUUID().toString());
+		
+		return trainingPersonDAO.insert(model);
+	}
+
+	@Override
+	public int update(TrainingPerson model) {
+		// TODO Auto-generated method stub
+		return trainingPersonDAO.update(model);		
+	}
+
+	@Override
+	public int delete(String id) {
+		// TODO Auto-generated method stub
+		return trainingPersonDAO.delete(id);
+	}
+
+	@Override
+	public boolean exist(String id) {
+		// TODO Auto-generated method stub
+		int count = trainingPersonDAO.exist(id);
+		
+		return count > 0 ? true : false;
+	}
+	
+	@Override
+	public List<TrainingPerson> list() {
+		// TODO Auto-generated method stub
+		return trainingPersonDAO.list();
+	}
+		
+	@Override
+	public Page<TrainingPerson> pageSearch(Map<String, Object> searchParams, int pageNumber, int pageSize,boolean count,List<Sort> sortList) {
+        Page<TrainingPerson> page = PageHelper.startPage(pageNumber,pageSize,count).doSelectPage(()->{
+            trainingPersonDAO.search(searchParams,sortList);
+        });
+        
+        return page;
+	}
+}

+ 9 - 0
common/src/main/resources/mapper/base/PersonInfo.xml

@@ -128,6 +128,15 @@
 			<if test="searchParams.realName != null">
 				and real_name like #{searchParams.realName}
 			</if>
+			<if test="searchParams.phone != null">
+				and phone_ like #{searchParams.phone}
+			</if>
+			<if test="searchParams.idCard != null">
+				and id_card like #{searchParams.idCard}
+			</if>
+			<if test="searchParams.status != null">
+				and status_ = #{searchParams.status}
+			</if>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 	        ${sort.name} ${sort.order}

+ 2 - 2
common/src/main/resources/mapper/base/ShareWorksInfo.xml

@@ -95,8 +95,8 @@
 		]]>
 		<where>
 			del_flag = 0
-			<if test="searchParams.id != null">
-				and ID_ like #{searchParams.id}
+			<if test="searchParams.title != null">
+				and title_ like #{searchParams.title}
 			</if>
 			<if test="searchParams.status != null">
 				and status_ = #{searchParams.status}

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

@@ -16,6 +16,10 @@
 			<result property="delFlag" column="del_flag" />
 			<result property="enterpriseId" column="enterprise_id" />
 			<result property="status" column="status_" />
+			<result property="thumbnailImage" column="thumbnail_image" />
+			<result property="endTime" column="end_time" />
+
+
 			</resultMap>
 	<insert id="insert" parameterType="com.jpsoft.employment.modules.base.entity.TrainingInfo">
 	<!--
@@ -25,7 +29,7 @@
 	-->
 	<![CDATA[
 		insert into base_training_info
-	    (id_,name_,title_,content_,file_,create_by,create_time,update_by,update_time,del_flag,enterprise_id,status_)
+	    (id_,name_,title_,content_,file_,create_by,create_time,update_by,update_time,del_flag,enterprise_id,status_,thumbnail_image,end_time)
 		values
 		(
 #{id,jdbcType=VARCHAR}
@@ -40,6 +44,8 @@
 ,#{delFlag,jdbcType= NUMERIC }
 ,#{enterpriseId,jdbcType=VARCHAR}
 ,#{status,jdbcType=VARCHAR}
+,#{thumbnailImage,jdbcType=VARCHAR}
+,#{endTime,jdbcType= TIMESTAMP }
 		)
 	]]>
 	</insert>
@@ -82,6 +88,12 @@
 			<if test="status!=null">
 				status_=#{status,jdbcType=VARCHAR},
 			</if>
+			<if test="thumbnailImage!=null">
+				thumbnail_image=#{thumbnailImage,jdbcType=VARCHAR},
+			</if>
+			<if test="endTime!=null">
+				end_time=#{endTime,jdbcType= TIMESTAMP },
+			</if>
 		</set>
 	where id_=#{id}
 	</update>

+ 91 - 0
common/src/main/resources/mapper/base/TrainingPerson.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.employment.modules.base.dao.TrainingPersonDAO">
+	<resultMap id="TrainingPersonMap" type="TrainingPerson">
+		<id property="id" column="id_" />
+			<result property="personId" column="person_id" />
+			<result property="trainingId" column="training_id" />
+			<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="TrainingPerson">
+	<!--
+	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+		select sys_guid() from dual
+	</selectKey>
+	-->
+	<![CDATA[
+		insert into base_training_person
+	    (id_,person_id,training_id,create_by,create_time,update_by,update_time,del_flag)
+		values
+		(
+#{id,jdbcType=VARCHAR}
+,#{personId,jdbcType=VARCHAR}
+,#{trainingId,jdbcType=VARCHAR}
+,#{createBy,jdbcType=VARCHAR}
+,#{createTime,jdbcType= TIMESTAMP }
+,#{updateBy,jdbcType=VARCHAR}
+,#{updateTime,jdbcType= TIMESTAMP }
+,#{delFlag,jdbcType= NUMERIC }
+		)
+	]]>
+	</insert>
+	<delete id="delete" parameterType="string">
+		delete from base_training_person where id_=#{id,jdbcType=VARCHAR}
+	</delete>
+	<update id="update" parameterType="TrainingPerson">
+		update base_training_person
+		<set>
+				<if test="personId!=null">
+		person_id=#{personId,jdbcType=VARCHAR},
+		</if>
+				<if test="trainingId!=null">
+		training_id=#{trainingId,jdbcType=VARCHAR},
+		</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="TrainingPersonMap">
+		select 
+id_,person_id,training_id,create_by,create_time,update_by,update_time,del_flag		from base_training_person where id_=#{0}
+	</select>
+	<select id="exist" parameterType="string" resultType="int">
+		select count(*) from base_training_person where id_=#{0}
+	</select>
+	<select id="list" resultMap="TrainingPersonMap">
+		select * from base_training_person
+	</select>
+	<select id="search" parameterType="hashmap" resultMap="TrainingPersonMap">
+		<![CDATA[
+			select * from base_training_person
+		]]>
+		<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>

+ 32 - 0
web/src/main/java/com/jpsoft/employment/modules/base/controller/EnterpriseInfoController.java

@@ -247,4 +247,36 @@ public class EnterpriseInfoController {
 
         return msgResult;
     }
+
+
+    @ApiOperation(value="审核信息")
+    @PostMapping("check/{id}")
+    public MessageResult<EnterpriseInfo> check(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<EnterpriseInfo> msgResult = new MessageResult<>();
+
+        try {
+
+            EnterpriseInfo enterpriseInfo = enterpriseInfoService.get(id);
+            enterpriseInfo.setStatus("1");
+            enterpriseInfo.setUpdateBy(subject);
+            enterpriseInfo.setUpdateTime(new Date());
+
+            int affectCount = enterpriseInfoService.update(enterpriseInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库认证失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
 }

+ 34 - 0
web/src/main/java/com/jpsoft/employment/modules/base/controller/MobileBannerInfoController.java

@@ -224,4 +224,38 @@ public class MobileBannerInfoController {
 
         return msgResult;
     }
+
+
+
+    @ApiOperation(value="审核")
+    @PostMapping("checkBannerInfo")
+    public MessageResult<MobileBannerInfo> checkBannerInfo(@RequestBody MobileBannerInfo mobileBannerInfo,@RequestAttribute String subject){
+        MessageResult<MobileBannerInfo> msgResult = new MessageResult<>();
+
+        try {
+            MobileBannerInfo item = mobileBannerInfoService.get(mobileBannerInfo.getId());
+
+            item.setUpdateTime(new Date());
+            item.setUpdateBy(subject);
+            item.setEnabled(mobileBannerInfo.getEnabled());
+
+            int affectCount = mobileBannerInfoService.update(item);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(item);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库更新失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
 }

+ 46 - 2
web/src/main/java/com/jpsoft/employment/modules/base/controller/PersonInfoController.java

@@ -217,7 +217,7 @@ public class PersonInfoController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String realName,
+            String realName,String phone,String idCard,String status,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             HttpServletRequest request){
@@ -234,7 +234,17 @@ public class PersonInfoController {
         sortList.add(new Sort("create_time","desc"));
 
         if (StringUtils.isNotEmpty(realName)) {
-            searchParams.put("realName","%" + realName + "%");
+            searchParams.put("realName",realName + "%");
+        }
+
+        if (StringUtils.isNotEmpty(phone)) {
+            searchParams.put("phone",phone + "%");
+        }
+        if (StringUtils.isNotEmpty(idCard)) {
+            searchParams.put("idCard",idCard + "%");
+        }
+        if (StringUtils.isNotEmpty(status)) {
+            searchParams.put("status",status);
         }
 
         Page<PersonInfo> page = personInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
@@ -434,4 +444,38 @@ public class PersonInfoController {
 
         return msgResult;
     }
+
+
+
+
+    @ApiOperation(value="审核信息")
+    @PostMapping("check/{id}")
+    public MessageResult<PersonInfo> check(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<PersonInfo> msgResult = new MessageResult<>();
+
+        try {
+
+            PersonInfo personInfo = personInfoService.get(id);
+            personInfo.setStatus("1");
+            personInfo.setUpdateBy(subject);
+            personInfo.setUpdateTime(new Date());
+
+            int affectCount = personInfoService.update(personInfo);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } else {
+                msgResult.setResult(false);
+                msgResult.setMessage("数据库审核失败");
+            }
+        }
+        catch(Exception ex){
+            logger.error(ex.getMessage(),ex);
+
+            msgResult.setResult(false);
+            msgResult.setMessage(ex.getMessage());
+        }
+
+        return msgResult;
+    }
 }

+ 5 - 4
web/src/main/java/com/jpsoft/employment/modules/base/controller/ShareWorksInfoController.java

@@ -53,6 +53,7 @@ public class ShareWorksInfoController {
 			shareWorksInfo.setDelFlag(false);
             shareWorksInfo.setCreateBy(subject);
             shareWorksInfo.setCreateTime(new Date());
+            shareWorksInfo.setStatus("0");
 
             int affectCount = shareWorksInfoService.insert(shareWorksInfo);
 
@@ -200,7 +201,7 @@ public class ShareWorksInfoController {
     @ApiOperation(value="列表")
     @RequestMapping(value = "pageList",method = RequestMethod.POST)
     public MessageResult<Map> pageList(
-            String id,
+            String title,
             @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
             @RequestParam(value="pageSize",defaultValue="20") int pageSize,
             HttpServletRequest request){
@@ -214,10 +215,10 @@ public class ShareWorksInfoController {
         Map<String,Object> searchParams = new HashMap<>();
 
         List<Sort> sortList = new ArrayList<>();
-        sortList.add(new Sort("id_","asc"));
+        sortList.add(new Sort("create_time","desc"));
 
-        if (StringUtils.isNotEmpty(id)) {
-            searchParams.put("id","%" + id + "%");
+        if (StringUtils.isNotEmpty(title)) {
+            searchParams.put("title",title + "%");
         }
 
 

+ 244 - 0
web/src/main/java/com/jpsoft/employment/modules/base/controller/TrainingPersonController.java

@@ -0,0 +1,244 @@
+package com.jpsoft.employment.modules.base.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.employment.modules.base.entity.PersonInfo;
+import com.jpsoft.employment.modules.base.service.PersonInfoService;
+import com.jpsoft.employment.modules.common.dto.MessageResult;
+import com.jpsoft.employment.modules.common.utils.PojoUtils;
+import com.jpsoft.employment.modules.common.dto.Sort;
+import com.jpsoft.employment.modules.base.entity.TrainingPerson;
+import com.jpsoft.employment.modules.base.service.TrainingPersonService;
+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/trainingPerson")
+public class TrainingPersonController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private TrainingPersonService trainingPersonService;
+
+    @Autowired
+    private PersonInfoService personInfoService;
+	
+	
+	@ApiOperation(value="创建空记录")
+    @GetMapping("create")
+    public MessageResult<TrainingPerson> create(){
+        MessageResult<TrainingPerson> msgResult = new MessageResult<>();
+
+        TrainingPerson trainingPerson = new TrainingPerson();
+
+        msgResult.setData(trainingPerson);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<TrainingPerson> add(@RequestBody TrainingPerson trainingPerson,@RequestAttribute String subject){
+        MessageResult<TrainingPerson> msgResult = new MessageResult<>();
+
+        try {
+            trainingPerson.setId(UUID.randomUUID().toString());
+			trainingPerson.setDelFlag(false);
+            trainingPerson.setCreateBy(subject);
+            trainingPerson.setCreateTime(new Date());
+
+            int affectCount = trainingPersonService.insert(trainingPerson);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(trainingPerson);
+            } 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<TrainingPerson> edit(@PathVariable("id") String id){
+        MessageResult<TrainingPerson> msgResult = new MessageResult<>();
+
+        try {
+            TrainingPerson trainingPerson = trainingPersonService.get(id);
+
+            if (trainingPerson != null) {
+                msgResult.setResult(true);
+                msgResult.setData(trainingPerson);
+            } 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<TrainingPerson> update(@RequestBody TrainingPerson trainingPerson,@RequestAttribute String subject){
+        MessageResult<TrainingPerson> msgResult = new MessageResult<>();
+
+        try {
+		    trainingPerson.setUpdateBy(subject);
+            trainingPerson.setUpdateTime(new Date());
+		
+            int affectCount = trainingPersonService.update(trainingPerson);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(trainingPerson);
+            } 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<TrainingPerson> delete(@PathVariable("id") String id,@RequestAttribute String subject){
+        MessageResult<TrainingPerson> msgResult = new MessageResult<>();
+
+        try {
+			
+			TrainingPerson trainingPerson = trainingPersonService.get(id);
+            trainingPerson.setDelFlag(true);
+            trainingPerson.setUpdateBy(subject);
+            trainingPerson.setUpdateTime(new Date());
+			
+			int affectCount = trainingPersonService.update(trainingPerson);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+            } 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) {
+                TrainingPerson trainingPerson = trainingPersonService.get(id);
+                trainingPerson.setDelFlag(true);
+                trainingPerson.setUpdateBy(subject);
+                trainingPerson.setUpdateTime(new Date());
+
+                affectCount += trainingPersonService.update(trainingPerson);
+            }
+
+            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,
+            HttpServletRequest request){
+        String subject = (String)request.getAttribute("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("create_time","desc"));
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id","%" + id + "%");
+        }
+
+
+        Page<TrainingPerson> page = trainingPersonService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+
+        for (TrainingPerson trainingPerson:page) {
+            PersonInfo personInfo = personInfoService.get(trainingPerson.getPersonId());
+            if(personInfo!=null){
+                trainingPerson.setWorkPersonName(personInfo.getRealName());
+                trainingPerson.setPhone(personInfo.getPhone());
+                trainingPerson.setIdCard(personInfo.getIdCard());
+                trainingPerson.setAge(personInfo.getAge());
+                trainingPerson.setGender(personInfo.getGender());
+            }
+        }
+
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}