Forráskód Böngészése

sz 申请补卡管理

xiao547607 5 éve
szülő
commit
e877509ebd

+ 19 - 0
common/src/main/java/com/jpsoft/smart/modules/business/dao/FillAttendanceDAO.java

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

+ 19 - 0
common/src/main/java/com/jpsoft/smart/modules/business/dao/FillAttendanceFilesDAO.java

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

+ 106 - 0
common/src/main/java/com/jpsoft/smart/modules/business/entity/FillAttendance.java

@@ -0,0 +1,106 @@
+package com.jpsoft.smart.modules.business.entity;
+
+import java.util.Date;
+
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiModel;
+
+/**
+  描述:business_fill_attendance的实体类
+ */
+@Data
+@ApiModel(value = "business_fill_attendance的实体类")
+public class FillAttendance {
+	/**
+	 * 编号
+	 */
+	@ApiModelProperty(value = "编号")
+	private String id;
+	/**
+	 *申请人ID
+	 */
+	@ApiModelProperty(value = "申请人ID")
+	private Long personId;
+	/**
+	 *申请人姓名
+	 */
+	@ApiModelProperty(value = "申请人姓名")
+	private String personName;
+	/**
+	 *申请人ID
+	 */
+	@ApiModelProperty(value = "编号")
+	private String companyName;
+	/**
+	 *申请类型:外勤打卡、补卡
+	 */
+	@ApiModelProperty(value = "申请类型:外勤打卡、补卡")
+	private String type;
+	/**
+	 *申请类型翻译
+	 */
+	@ApiModelProperty(value = "申请类型翻译")
+	private String typeN;
+	/**
+	 *补卡日
+	 */
+	@ApiModelProperty(value = "补卡日")
+	private String fillDay;
+	/**
+	 *补卡时间
+	 */
+	@ApiModelProperty(value = "补卡时间")
+	private String fillAttendanceTime;
+	/**
+	 *内容
+	 */
+	@ApiModelProperty(value = "内容")
+	private String content;
+	/**
+	 *审核人ID
+	 */
+	@ApiModelProperty(value = "审核人ID")
+	private Long approvalPersonId;
+	/**
+	 *审核人姓名
+	 */
+	@ApiModelProperty(value = "审核人姓名")
+	private String approvalPersonName;
+	/**
+	 *状态
+	 */
+	@ApiModelProperty(value = "状态")
+	private String status;
+	/**
+	 *创建人
+	 */
+	@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;
+}

+ 150 - 0
common/src/main/java/com/jpsoft/smart/modules/business/entity/FillAttendanceFiles.java

@@ -0,0 +1,150 @@
+package com.jpsoft.smart.modules.business.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;
+
+/**
+  描述:business_fill_attendance_files的实体类
+ */
+@ApiModel(value = "business_fill_attendance_files的实体类")
+public class FillAttendanceFiles {
+	private String id;
+	private String fillAttendanceId;
+	private String fileName;
+	private String fileUrl;
+	private String createBy;
+	private Date createTime;
+	private String updateBy;
+	private Date updateTime;
+	private Boolean delFlag;
+
+		/**
+	 *获取主键
+	 */
+	public String getId(){
+		return id;
+	}
+	
+	/**
+	 *设置主键
+	 */
+	public void setId(String id){
+		this.id = id;
+	}
+		/**
+	 *获取补卡ID
+	 */
+	public String getFillAttendanceId(){
+		return fillAttendanceId;
+	}
+	
+	/**
+	 *设置补卡ID
+	 */
+	public void setFillAttendanceId(String fillAttendanceId){
+		this.fillAttendanceId = fillAttendanceId;
+	}
+		/**
+	 *获取
+	 */
+	public String getFileName(){
+		return fileName;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setFileName(String fileName){
+		this.fileName = fileName;
+	}
+		/**
+	 *获取
+	 */
+	public String getFileUrl(){
+		return fileUrl;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setFileUrl(String fileUrl){
+		this.fileUrl = fileUrl;
+	}
+		/**
+	 *获取
+	 */
+	public String getCreateBy(){
+		return createBy;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setCreateBy(String createBy){
+		this.createBy = createBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+    @ApiModelProperty(value = "")
+		/**
+	 *获取
+	 */
+	public Date getCreateTime(){
+		return createTime;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setCreateTime(Date createTime){
+		this.createTime = createTime;
+	}
+		/**
+	 *获取
+	 */
+	public String getUpdateBy(){
+		return updateBy;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setUpdateBy(String updateBy){
+		this.updateBy = updateBy;
+	}
+		@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
+	@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone ="GMT+8")
+    @ApiModelProperty(value = "")
+		/**
+	 *获取
+	 */
+	public Date getUpdateTime(){
+		return updateTime;
+	}
+	
+	/**
+	 *设置
+	 */
+	public void setUpdateTime(Date updateTime){
+		this.updateTime = updateTime;
+	}
+		/**
+	 *获取是否删除
+	 */
+	public Boolean getDelFlag(){
+		return delFlag;
+	}
+	
+	/**
+	 *设置是否删除
+	 */
+	public void setDelFlag(Boolean delFlag){
+		this.delFlag = delFlag;
+	}
+}

+ 17 - 0
common/src/main/java/com/jpsoft/smart/modules/business/service/FillAttendanceFilesService.java

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

+ 17 - 0
common/src/main/java/com/jpsoft/smart/modules/business/service/FillAttendanceService.java

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

+ 71 - 0
common/src/main/java/com/jpsoft/smart/modules/business/service/impl/FillAttendanceFilesServiceImpl.java

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

+ 71 - 0
common/src/main/java/com/jpsoft/smart/modules/business/service/impl/FillAttendanceServiceImpl.java

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

+ 138 - 0
common/src/main/resources/mapper/business/FillAttendance.xml

@@ -0,0 +1,138 @@
+<?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.smart.modules.business.dao.FillAttendanceDAO">
+	<resultMap id="FillAttendanceMap" type="com.jpsoft.smart.modules.business.entity.FillAttendance">
+		<id property="id" column="id_" />
+			<result property="personId" column="person_id" />
+			<result property="personName" column="person_name" />
+			<result property="companyName" column="company_name" />
+			<result property="type" column="type_" />
+			<result property="fillDay" column="fill_day" />
+			<result property="fillAttendanceTime" column="fill_attendance_time" />
+			<result property="content" column="content_" />
+			<result property="approvalPersonId" column="approval_person_id" />
+			<result property="approvalPersonName" column="approval_person_name" />
+			<result property="status" column="status_" />
+			<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.smart.modules.business.entity.FillAttendance">
+	<!--
+	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+		select sys_guid() from dual
+	</selectKey>
+	-->
+	<![CDATA[
+		insert into business_fill_attendance
+	    (id_,person_id,type_,fill_day,fill_attendance_time,content_,approval_person_id,status_,create_by,create_time,update_by,update_time,del_flag)
+		values
+		(
+#{id,jdbcType=VARCHAR}
+,#{personId,jdbcType= NUMERIC }
+,#{type,jdbcType=VARCHAR}
+,#{fillDay,jdbcType=VARCHAR}
+,#{fillAttendanceTime,jdbcType=VARCHAR}
+,#{content,jdbcType=VARCHAR}
+,#{approvalPersonId,jdbcType= NUMERIC }
+,#{status,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 business_fill_attendance where id_=#{id,jdbcType=VARCHAR}
+	</delete>
+	<update id="update" parameterType="com.jpsoft.smart.modules.business.entity.FillAttendance">
+		update business_fill_attendance
+		<set>
+				<if test="personId!=null">
+		person_id=#{personId,jdbcType= NUMERIC },
+		</if>
+				<if test="type!=null">
+		type_=#{type,jdbcType=VARCHAR},
+		</if>
+				<if test="fillDay!=null">
+		fill_day=#{fillDay,jdbcType=VARCHAR},
+		</if>
+				<if test="fillAttendanceTime!=null">
+		fill_attendance_time=#{fillAttendanceTime,jdbcType=VARCHAR},
+		</if>
+				<if test="content!=null">
+		content_=#{content,jdbcType=VARCHAR},
+		</if>
+				<if test="approvalPersonId!=null">
+		approval_person_id=#{approvalPersonId,jdbcType= NUMERIC },
+		</if>
+				<if test="status!=null">
+		status_=#{status,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="FillAttendanceMap">
+		select * from business_fill_attendance where id_=#{0} and del_flag = 0
+	</select>
+	<select id="exist" parameterType="string" resultType="int">
+		select count(*) from business_fill_attendance where id_=#{0} and del_flag = 0
+	</select>
+	<select id="list" resultMap="FillAttendanceMap">
+		select * from business_fill_attendance and del_flag = 0
+	</select>
+	<select id="search" parameterType="hashmap" resultMap="FillAttendanceMap">
+		<![CDATA[
+			select a.*,
+			b.name_ as person_name,
+			c.name_ as approval_person_name,
+			d.name_ as company_name
+			 from business_fill_attendance a
+			left join base_person_info b on a.person_id = b.id_
+			left join base_person_info c on a.approval_person_id = c.id_
+			left join base_company_info d on b.company_id = d.id_
+		]]>
+		<where>
+			a.del_flag = 0
+			and b.del_flag = 0
+			and c.del_flag = 0
+			and d.del_flag = 0
+			<if test="searchParams.id != null">
+				and a.ID_ like #{searchParams.id}
+			</if>
+			<if test="searchParams.personName != null">
+				and b.name_ like #{searchParams.personName}
+			</if>
+			<if test="searchParams.type != null">
+				and a.type_ = #{searchParams.type}
+			</if>
+			<if test="searchParams.status != null">
+				and a.status_ like #{searchParams.status}
+			</if>
+		</where>
+		<foreach item="sort" collection="sortList"  open="order by" separator=",">
+			a.${sort.name} ${sort.order}
+	 	</foreach>
+	</select>
+</mapper>

+ 99 - 0
common/src/main/resources/mapper/business/FillAttendanceFiles.xml

@@ -0,0 +1,99 @@
+<?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.smart.modules.business.dao.FillAttendanceFilesDAO">
+	<resultMap id="FillAttendanceFilesMap" type="com.jpsoft.smart.modules.business.entity.FillAttendanceFiles">
+		<id property="id" column="id_" />
+			<result property="fillAttendanceId" column="fill_attendance_id" />
+			<result property="fileName" column="file_name" />
+			<result property="fileUrl" column="file_url" />
+			<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.smart.modules.business.entity.FillAttendanceFiles">
+	<!--
+	<selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
+		select sys_guid() from dual
+	</selectKey>
+	-->
+	<![CDATA[
+		insert into business_fill_attendance_files
+	    (id_,fill_attendance_id,file_name,file_url,create_by,create_time,update_by,update_time,del_flag)
+		values
+		(
+#{id,jdbcType=VARCHAR}
+,#{fillAttendanceId,jdbcType=VARCHAR}
+,#{fileName,jdbcType=VARCHAR}
+,#{fileUrl,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 business_fill_attendance_files where id_=#{id,jdbcType=VARCHAR}
+	</delete>
+	<update id="update" parameterType="com.jpsoft.smart.modules.business.entity.FillAttendanceFiles">
+		update business_fill_attendance_files
+		<set>
+				<if test="fillAttendanceId!=null">
+		fill_attendance_id=#{fillAttendanceId,jdbcType=VARCHAR},
+		</if>
+				<if test="fileName!=null">
+		file_name=#{fileName,jdbcType=VARCHAR},
+		</if>
+				<if test="fileUrl!=null">
+		file_url=#{fileUrl,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="FillAttendanceFilesMap">
+		select  *	from business_fill_attendance_files where id_=#{0} and del_flag = 0
+	</select>
+	<select id="exist" parameterType="string" resultType="int">
+		select count(*) from business_fill_attendance_files where id_=#{0} and del_flag = 0
+	</select>
+	<select id="list" resultMap="FillAttendanceFilesMap">
+		select * from business_fill_attendance_files where del_flag = 0
+	</select>
+	<select id="search" parameterType="hashmap" resultMap="FillAttendanceFilesMap">
+		<![CDATA[
+			select * from business_fill_attendance_files
+		]]>
+		<where>
+			del_flag = 0
+			<if test="searchParams.id != null">
+				and ID_ like #{searchParams.id}
+			</if>
+			<if test="searchParams.fillAttendanceId != null">
+				and fill_attendance_id = #{searchParams.fillAttendanceId}
+			</if>
+		</where>
+		<foreach item="sort" collection="sortList"  open="order by" separator=",">
+	        ${sort.name} ${sort.order}
+	 	</foreach>
+	</select>
+</mapper>

+ 297 - 0
web/src/main/java/com/jpsoft/smart/modules/business/controller/FillAttendanceController.java

@@ -0,0 +1,297 @@
+package com.jpsoft.smart.modules.business.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.smart.modules.base.entity.CompanyInfo;
+import com.jpsoft.smart.modules.base.service.CompanyInfoService;
+import com.jpsoft.smart.modules.business.entity.FillAttendance;
+import com.jpsoft.smart.modules.business.service.FillAttendanceService;
+import com.jpsoft.smart.modules.common.dto.MessageResult;
+import com.jpsoft.smart.modules.common.dto.Sort;
+import com.jpsoft.smart.modules.common.utils.PojoUtils;
+import com.jpsoft.smart.modules.sys.entity.User;
+import com.jpsoft.smart.modules.sys.service.DataDictionaryService;
+import com.jpsoft.smart.modules.sys.service.UserService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+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("/business/fillAttendance")
+@Api(description = "fillAttendance")
+public class FillAttendanceController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private FillAttendanceService fillAttendanceService;
+
+    @Autowired
+    private UserService userService;
+
+    @Autowired
+    private CompanyInfoService companyInfoService;
+
+    @Autowired
+    private DataDictionaryService dataDictionaryService;
+
+    @ApiOperation(value="创建空记录")
+    @GetMapping("create")
+    public MessageResult<FillAttendance> create(){
+        MessageResult<FillAttendance> msgResult = new MessageResult<>();
+
+        FillAttendance fillAttendance = new FillAttendance();
+
+        msgResult.setData(fillAttendance);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+    
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<FillAttendance> add(@RequestBody FillAttendance fillAttendance,@RequestAttribute String subject){
+        MessageResult<FillAttendance> msgResult = new MessageResult<>();
+
+        try {
+            fillAttendance.setId(UUID.randomUUID().toString());
+            fillAttendance.setDelFlag(false);
+            fillAttendance.setCreateBy(subject);
+            fillAttendance.setCreateTime(new Date());
+            
+            int affectCount = fillAttendanceService.insert(fillAttendance);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(fillAttendance);
+            } 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<FillAttendance> edit(@PathVariable("id") String id){
+        MessageResult<FillAttendance> msgResult = new MessageResult<>();
+
+        try {
+            FillAttendance fillAttendance = fillAttendanceService.get(id);
+
+            if (fillAttendance != null) {
+                msgResult.setResult(true);
+                msgResult.setData(fillAttendance);
+            } 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<FillAttendance> update(@RequestBody FillAttendance fillAttendance,@RequestAttribute String subject){
+        MessageResult<FillAttendance> msgResult = new MessageResult<>();
+
+        try {
+            fillAttendance.setUpdateBy(subject);
+            fillAttendance.setUpdateTime(new Date());
+            
+            int affectCount = fillAttendanceService.update(fillAttendance);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(fillAttendance);
+            } 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 {
+            FillAttendance fillAttendance = fillAttendanceService.get(id);
+            fillAttendance.setDelFlag(true);
+            fillAttendance.setUpdateBy(subject);
+            fillAttendance.setUpdateTime(new Date());
+
+            int affectCount = fillAttendanceService.update(fillAttendance);
+
+            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) {
+                FillAttendance fillAttendance = fillAttendanceService.get(id);
+                fillAttendance.setDelFlag(true);
+                fillAttendance.setUpdateBy(subject);
+                fillAttendance.setUpdateTime(new Date());
+
+                affectCount += fillAttendanceService.update(fillAttendance);
+            }
+
+            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="列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "personName", value = "申请人姓名", required = false, paramType = "form", dataType = "String"),
+            @ApiImplicitParam(name = "type", value = "类型", required = false, paramType = "form", dataType = "String"),
+            @ApiImplicitParam(name = "status", value = "状态", required = false, paramType = "form", dataType = "String"),
+            @ApiImplicitParam(name = "parentId",value = "上级企业ID", required = false, paramType = "form",dataType = "String"),
+            @ApiImplicitParam(name = "subordinate",value = "是否查询下级单位", required = false, paramType = "form",dataType = "String"),
+    })
+    @RequestMapping(value = "pageList",method = RequestMethod.POST)
+    public MessageResult<Map> pageList(
+            String id,
+            @RequestParam(value="personName",defaultValue="") String personName,
+            @RequestParam(value="type",defaultValue="") String type,
+            @RequestParam(value="status",defaultValue="") String status,
+            @RequestParam(value="parentId",defaultValue="")  String parentId,
+            @RequestParam(value="subordinate",defaultValue="false")  Boolean subordinate,
+            @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"));
+
+        //为公司管理员
+        boolean is_admin = userService.hasRole(subject,"ADMIN");
+        if(is_admin){
+            User user = userService.get(subject);
+            String companyId = user.getCompanyId();
+            searchParams.put("bindCompanyId", companyId);
+        }
+
+        if (StringUtils.isNotEmpty(id)) {
+            searchParams.put("id","%" + id + "%");
+        }
+
+        if (StringUtils.isNotEmpty(personName)) {
+            searchParams.put("personName","%" + personName + "%");
+        }
+
+        if (StringUtils.isNotEmpty(type)) {
+            searchParams.put("type",type);
+        }
+
+        if (StringUtils.isNotEmpty(status)) {
+            searchParams.put("status","%" + status + "%");
+        }
+
+        if(StringUtils.isNotEmpty(parentId)){
+            CompanyInfo parentCompanyInfo = companyInfoService.get(parentId);
+
+            String parentCode = parentCompanyInfo.getCode();
+
+            if (StringUtils.isEmpty(parentCode)){
+                if (!userService.hasRole(subject,"SYSADMIN")) {
+                    searchParams.put("companyCode", parentCode + "%");
+                }
+            }
+            else{
+                if(subordinate){
+                    searchParams.put("companyCode", parentCode + "%");
+                }
+                else {
+                    searchParams.put("companyCode", parentCode);
+                }
+            }
+        }
+
+        Page<FillAttendance> page = fillAttendanceService.pageSearch(searchParams,pageIndex,pageSize,sortList);
+        for(FillAttendance fillAttendance : page.getResult()){
+            String typeN = dataDictionaryService.findNameByCatalogNameAndValue("补卡类型",fillAttendance.getType());
+            fillAttendance.setTypeN(typeN);
+        }
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}

+ 253 - 0
web/src/main/java/com/jpsoft/smart/modules/business/controller/FillAttendanceFilesController.java

@@ -0,0 +1,253 @@
+package com.jpsoft.smart.modules.business.controller;
+
+import com.github.pagehelper.Page;
+import com.jpsoft.smart.modules.business.entity.FillAttendanceFiles;
+import com.jpsoft.smart.modules.business.service.FillAttendanceFilesService;
+import com.jpsoft.smart.modules.common.dto.MessageResult;
+import com.jpsoft.smart.modules.common.utils.PojoUtils;
+import com.jpsoft.smart.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("/business/fillAttendanceFiles")
+@Api(description = "fillAttendanceFiles")
+public class FillAttendanceFilesController {
+    private Logger logger = LoggerFactory.getLogger(getClass());
+
+    @Autowired
+    private FillAttendanceFilesService fillAttendanceFilesService;
+
+    @ApiOperation(value="创建空记录")
+    @GetMapping("create")
+    public MessageResult<FillAttendanceFiles> create(){
+        MessageResult<FillAttendanceFiles> msgResult = new MessageResult<>();
+
+        FillAttendanceFiles fillAttendanceFiles = new FillAttendanceFiles();
+
+        msgResult.setData(fillAttendanceFiles);
+        msgResult.setResult(true);
+
+        return msgResult;
+    }
+    
+    @ApiOperation(value="添加信息")
+    @PostMapping("add")
+    public MessageResult<FillAttendanceFiles> add(@RequestBody FillAttendanceFiles fillAttendanceFiles,@RequestAttribute String subject){
+        MessageResult<FillAttendanceFiles> msgResult = new MessageResult<>();
+
+        try {
+            fillAttendanceFiles.setId(UUID.randomUUID().toString());
+            fillAttendanceFiles.setDelFlag(false);
+            fillAttendanceFiles.setCreateBy(subject);
+            fillAttendanceFiles.setCreateTime(new Date());
+            
+            int affectCount = fillAttendanceFilesService.insert(fillAttendanceFiles);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(fillAttendanceFiles);
+            } 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<FillAttendanceFiles> edit(@PathVariable("id") String id){
+        MessageResult<FillAttendanceFiles> msgResult = new MessageResult<>();
+
+        try {
+            FillAttendanceFiles fillAttendanceFiles = fillAttendanceFilesService.get(id);
+
+            if (fillAttendanceFiles != null) {
+                msgResult.setResult(true);
+                msgResult.setData(fillAttendanceFiles);
+            } 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<FillAttendanceFiles> update(@RequestBody FillAttendanceFiles fillAttendanceFiles,@RequestAttribute String subject){
+        MessageResult<FillAttendanceFiles> msgResult = new MessageResult<>();
+
+        try {
+            fillAttendanceFiles.setUpdateBy(subject);
+            fillAttendanceFiles.setUpdateTime(new Date());
+            
+            int affectCount = fillAttendanceFilesService.update(fillAttendanceFiles);
+
+            if (affectCount > 0) {
+                msgResult.setResult(true);
+                msgResult.setData(fillAttendanceFiles);
+            } 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 {
+            FillAttendanceFiles fillAttendanceFiles = fillAttendanceFilesService.get(id);
+            fillAttendanceFiles.setDelFlag(true);
+            fillAttendanceFiles.setUpdateBy(subject);
+            fillAttendanceFiles.setUpdateTime(new Date());
+
+            int affectCount = fillAttendanceFilesService.update(fillAttendanceFiles);
+
+            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) {
+                FillAttendanceFiles fillAttendanceFiles = fillAttendanceFilesService.get(id);
+                fillAttendanceFiles.setDelFlag(true);
+                fillAttendanceFiles.setUpdateBy(subject);
+                fillAttendanceFiles.setUpdateTime(new Date());
+
+                affectCount += fillAttendanceFilesService.update(fillAttendanceFiles);
+            }
+
+            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<FillAttendanceFiles> page = fillAttendanceFilesService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+
+    @ApiOperation(value="列表")
+    @RequestMapping(value = "list",method = RequestMethod.POST)
+    public MessageResult<Map> list(
+            String fillAttendanceId,
+            @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(fillAttendanceId)) {
+            searchParams.put("fillAttendanceId",fillAttendanceId);
+        }
+
+        Page<FillAttendanceFiles> page = fillAttendanceFilesService.pageSearch(searchParams,0,9999,false,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
+}