Browse Source

修改打卡地址,已打卡修改成会重置

anderx 3 years ago
parent
commit
dff37116da

+ 82 - 10
src/main/java/com/goafanti/common/mapper/PublicReleaseDetailsMapper.xml

@@ -8,9 +8,16 @@
     <result column="ufid" jdbcType="VARCHAR" property="ufid" />
     <result column="new_user" jdbcType="INTEGER" property="newUser" />
     <result column="sign_sum" jdbcType="INTEGER" property="signSum" />
+    <result column="longitude" jdbcType="VARCHAR" property="longitude" />
+    <result column="latitude" jdbcType="VARCHAR" property="latitude" />
+    <result column="clock_in" jdbcType="INTEGER" property="clockIn" />
+    <result column="clock_in_time" jdbcType="TIMESTAMP" property="clockInTime" />
+    <result column="photo_url" jdbcType="VARCHAR" property="photoUrl" />
+    <result column="district_name" jdbcType="VARCHAR" property="districtName" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, prid, `uid`, ufid, new_user, sign_sum
+    id, prid, `uid`, ufid, new_user, sign_sum, longitude, latitude, clock_in, clock_in_time,
+    photo_url, district_name
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select
@@ -18,17 +25,19 @@
     from public_release_details
     where id = #{id,jdbcType=INTEGER}
   </select>
-
-    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
     delete from public_release_details
     where id = #{id,jdbcType=INTEGER}
   </delete>
-
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicReleaseDetails" useGeneratedKeys="true">
     insert into public_release_details (prid, `uid`, ufid,
-      new_user, sign_sum)
+      new_user, sign_sum, longitude,
+      latitude, clock_in, clock_in_time,
+      photo_url, district_name)
     values (#{prid,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{ufid,jdbcType=VARCHAR},
-      #{newUser,jdbcType=INTEGER}, #{signSum,jdbcType=INTEGER})
+      #{newUser,jdbcType=INTEGER}, #{signSum,jdbcType=INTEGER}, #{longitude,jdbcType=VARCHAR},
+      #{latitude,jdbcType=VARCHAR}, #{clockIn,jdbcType=INTEGER}, #{clockInTime,jdbcType=TIMESTAMP},
+      #{photoUrl,jdbcType=VARCHAR}, #{districtName,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicReleaseDetails" useGeneratedKeys="true">
     insert into public_release_details
@@ -48,6 +57,24 @@
       <if test="signSum != null">
         sign_sum,
       </if>
+      <if test="longitude != null">
+        longitude,
+      </if>
+      <if test="latitude != null">
+        latitude,
+      </if>
+      <if test="clockIn != null">
+        clock_in,
+      </if>
+      <if test="clockInTime != null">
+        clock_in_time,
+      </if>
+      <if test="photoUrl != null">
+        photo_url,
+      </if>
+      <if test="districtName != null">
+        district_name,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="prid != null">
@@ -65,9 +92,26 @@
       <if test="signSum != null">
         #{signSum,jdbcType=INTEGER},
       </if>
+      <if test="longitude != null">
+        #{longitude,jdbcType=VARCHAR},
+      </if>
+      <if test="latitude != null">
+        #{latitude,jdbcType=VARCHAR},
+      </if>
+      <if test="clockIn != null">
+        #{clockIn,jdbcType=INTEGER},
+      </if>
+      <if test="clockInTime != null">
+        #{clockInTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="photoUrl != null">
+        #{photoUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="districtName != null">
+        #{districtName,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
-
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicReleaseDetails">
     update public_release_details
     <set>
@@ -86,6 +130,24 @@
       <if test="signSum != null">
         sign_sum = #{signSum,jdbcType=INTEGER},
       </if>
+      <if test="longitude != null">
+        longitude = #{longitude,jdbcType=VARCHAR},
+      </if>
+      <if test="latitude != null">
+        latitude = #{latitude,jdbcType=VARCHAR},
+      </if>
+      <if test="clockIn != null">
+        clock_in = #{clockIn,jdbcType=INTEGER},
+      </if>
+      <if test="clockInTime != null">
+        clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="photoUrl != null">
+        photo_url = #{photoUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="districtName != null">
+        district_name = #{districtName,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -95,7 +157,13 @@
       `uid` = #{uid,jdbcType=VARCHAR},
       ufid = #{ufid,jdbcType=VARCHAR},
       new_user = #{newUser,jdbcType=INTEGER},
-      sign_sum = #{signSum,jdbcType=INTEGER}
+      sign_sum = #{signSum,jdbcType=INTEGER},
+      longitude = #{longitude,jdbcType=VARCHAR},
+      latitude = #{latitude,jdbcType=VARCHAR},
+      clock_in = #{clockIn,jdbcType=INTEGER},
+      clock_in_time = #{clockInTime,jdbcType=TIMESTAMP},
+      photo_url = #{photoUrl,jdbcType=VARCHAR},
+      district_name = #{districtName,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -108,11 +176,15 @@
 
   <insert id="insertBatch">
     insert into public_release_details (prid, `uid`, ufid,
-                                        new_user, sign_sum)
+    new_user, sign_sum, longitude,
+    latitude, clock_in, clock_in_time,
+    photo_url, district_name)
     values
     <foreach  collection="list" item="prd"  separator=",">
       (#{prd.prid,jdbcType=INTEGER}, #{prd.uid,jdbcType=VARCHAR}, #{prd.ufid,jdbcType=VARCHAR},
-      #{prd.newUser,jdbcType=INTEGER}, #{prd.signSum,jdbcType=INTEGER})
+      #{prd.newUser,jdbcType=INTEGER}, #{prd.signSum,jdbcType=INTEGER}, #{prd.longitude,jdbcType=VARCHAR},
+      #{prd.latitude,jdbcType=VARCHAR}, #{prd.clockIn,jdbcType=INTEGER}, #{prd.clockInTime,jdbcType=TIMESTAMP},
+      #{prd.photoUrl,jdbcType=VARCHAR}, #{prd.districtName,jdbcType=VARCHAR})
     </foreach>
   </insert>
 

+ 18 - 18
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -8,7 +8,7 @@
     <result column="release_end" jdbcType="TIMESTAMP" property="releaseEnd" />
     <result column="remarks" jdbcType="VARCHAR" property="remarks" />
     <result column="annex_url" jdbcType="VARCHAR" property="annexUrl" />
-    <result column="user_name" jdbcType="VARCHAR" property="userName" />
+    <result column="district_name" jdbcType="VARCHAR" property="districtName" />
     <result column="longitude" jdbcType="VARCHAR" property="longitude" />
     <result column="latitude" jdbcType="VARCHAR" property="latitude" />
     <result column="status" jdbcType="INTEGER" property="status" />
@@ -49,10 +49,10 @@
     <result column="object_type" jdbcType="INTEGER" property="objectType" />
   </resultMap>
   <sql id="Base_Column_List">
-    id, aid, release_start, release_end, remarks, annex_url, user_name, longitude, latitude,
-    `status`, create_time, clock_in, clock_in_time, photo_url, pid, pname, duration,
-    valid_date, main_status, supplement, audit_info, `plan`, expected_effect, next_plan,
-    `type`, order_no, update_time, update_status, assist, assist_aid, assist_aid_name,
+    id, aid, release_start, release_end, remarks, annex_url, district_name, longitude,
+    latitude, `status`, create_time, clock_in, clock_in_time, photo_url, pid, pname,
+    duration, valid_date, main_status, supplement, audit_info, `plan`, expected_effect,
+    next_plan, `type`, order_no, update_time, update_status, assist, assist_aid, assist_aid_name,
     main_id, main_name, clock_in_remarks, reject_name, assistant_aid, assistant_name,
     public_again, audit_time, `uid`, ufid, new_user, sign_sum, user_names, object_type
   </sql>
@@ -68,7 +68,7 @@
   </delete>
   <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
     insert into public_release (aid, release_start, release_end,
-      remarks, annex_url, user_name,
+      remarks, annex_url, district_name,
       longitude, latitude, `status`,
       create_time, clock_in, clock_in_time,
       photo_url, pid, pname,
@@ -83,7 +83,7 @@
       ufid, new_user, sign_sum,
       user_names, object_type)
     values (#{aid,jdbcType=VARCHAR}, #{releaseStart,jdbcType=TIMESTAMP}, #{releaseEnd,jdbcType=TIMESTAMP},
-      #{remarks,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR},
+      #{remarks,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, #{districtName,jdbcType=VARCHAR},
       #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
       #{createTime,jdbcType=TIMESTAMP}, #{clockIn,jdbcType=INTEGER}, #{clockInTime,jdbcType=TIMESTAMP},
       #{photoUrl,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{pname,jdbcType=VARCHAR},
@@ -116,8 +116,8 @@
       <if test="annexUrl != null">
         annex_url,
       </if>
-      <if test="userName != null">
-        user_name,
+      <if test="districtName != null">
+        district_name,
       </if>
       <if test="longitude != null">
         longitude,
@@ -250,8 +250,8 @@
       <if test="annexUrl != null">
         #{annexUrl,jdbcType=VARCHAR},
       </if>
-      <if test="userName != null">
-        #{userName,jdbcType=VARCHAR},
+      <if test="districtName != null">
+        #{districtName,jdbcType=VARCHAR},
       </if>
       <if test="longitude != null">
         #{longitude,jdbcType=VARCHAR},
@@ -387,8 +387,8 @@
       <if test="annexUrl != null">
         annex_url = #{annexUrl,jdbcType=VARCHAR},
       </if>
-      <if test="userName != null">
-        user_name = #{userName,jdbcType=VARCHAR},
+      <if test="districtName != null">
+        district_name = #{districtName,jdbcType=VARCHAR},
       </if>
       <if test="longitude != null">
         longitude = #{longitude,jdbcType=VARCHAR},
@@ -514,7 +514,7 @@
       release_end = #{releaseEnd,jdbcType=TIMESTAMP},
       remarks = #{remarks,jdbcType=VARCHAR},
       annex_url = #{annexUrl,jdbcType=VARCHAR},
-      user_name = #{userName,jdbcType=VARCHAR},
+      district_name = #{districtName,jdbcType=VARCHAR},
       longitude = #{longitude,jdbcType=VARCHAR},
       latitude = #{latitude,jdbcType=VARCHAR},
       `status` = #{status,jdbcType=INTEGER},
@@ -565,7 +565,7 @@
 
 
   <select id="listPublicRelease" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
-    select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,a.aid,
+    select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.district_name districtName,a.aid,
     date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
     a.latitude ,a.longitude ,a.clock_in clockIn,date_format(a.update_time ,'%Y-%m-%d %H:%i:%S') updateTimes,a.update_status updateStatus,
     a.assist,a.assist_aid assistAid,a.assist_aid_name assistAidName,a.type,a.main_name mainName,a.reject_name rejectName,
@@ -700,7 +700,7 @@
   </select>
 
   <select id="selectDtails" resultType="com.goafanti.weChat.bo.OutPublicRelease">
-    select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,a.update_time updateTime,a.user_names userNames,
+    select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.district_name districtName,a.update_time updateTime,a.user_names userNames,
     date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.status,
     a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,a.longitude ,a.aid ,c.superior_id suprId,a.uid,
     a.clock_in clockIn ,a.plan ,a.expected_effect expectedEffect,a.next_plan nextPlan,c.reviewer,a.type,a.order_no orderNo,d.contract_no contractNo,
@@ -762,7 +762,7 @@
   </select>
 
   <select id="listPublicDtails" resultType="com.goafanti.weChat.bo.OutPublicDtails">
-    select a.id ,a.user_name userName,c.name aname,a.duration ,a.status,a.annex_url annexUrl,a.photo_url photoUrl,a.user_names userNames,
+    select a.id ,a.district_name districtName,c.name aname,a.duration ,a.status,a.annex_url annexUrl,a.photo_url photoUrl,a.user_names userNames,
     date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S') clockInTimes,a.clock_in clockIn,a.remarks,a.supplement,a.type,
     date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.audit_info auditInfo,date_format(a.audit_time ,'%Y-%m-%d %H:%i:%S') auditTimes,
     d.name sname, date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,
@@ -864,7 +864,7 @@
     left join department d on c.department_id =d.id left join district_glossory e on d.province =e.id
   </select>
   <select id="publicByOrder" resultType="com.goafanti.weChat.bo.OutPublicRelease">
-    select a.id,a.uid,a.aid,b.nickname ,c.name aname,a.duration ,a.user_name userName,
+    select a.id,a.uid,a.aid,b.nickname ,c.name aname,a.duration ,a.district_name districtName,
            date_format(a.release_start,'%Y-%m-%d %H:%i:%S')releaseStarts,
            date_format(a.release_end ,'%Y-%m-%d %H:%i:%S')releaseEnds,
            date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S')clockInTimes,

+ 5 - 5
src/main/java/com/goafanti/common/model/PublicRelease.java

@@ -38,7 +38,7 @@ public class PublicRelease implements Serializable {
     /**
      * 公出企业地址
      */
-    private String userName;
+    private String districtName;
 
     /**
      * 经度
@@ -280,12 +280,12 @@ public class PublicRelease implements Serializable {
         this.annexUrl = annexUrl;
     }
 
-    public String getUserName() {
-        return userName;
+    public String getDistrictName() {
+        return districtName;
     }
 
-    public void setUserName(String userName) {
-        this.userName = userName;
+    public void setDistrictName(String districtName) {
+        this.districtName = districtName;
     }
 
     public String getLongitude() {

+ 79 - 0
src/main/java/com/goafanti/common/model/PublicReleaseDetails.java

@@ -1,6 +1,7 @@
 package com.goafanti.common.model;
 
 import java.io.Serializable;
+import java.util.Date;
 
 /**
  * public_release_details
@@ -34,6 +35,36 @@ public class PublicReleaseDetails implements Serializable {
      */
     private Integer signSum;
 
+    /**
+     * 经度
+     */
+    private String longitude;
+
+    /**
+     * 纬度
+     */
+    private String latitude;
+
+    /**
+     * 打卡状态 1正常打卡 2异常打卡
+     */
+    private Integer clockIn;
+
+    /**
+     * 打卡时间
+     */
+    private Date clockInTime;
+
+    /**
+     * 照片
+     */
+    private String photoUrl;
+
+    /**
+     * 公出企业地址
+     */
+    private String districtName;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -83,4 +114,52 @@ public class PublicReleaseDetails implements Serializable {
     public void setSignSum(Integer signSum) {
         this.signSum = signSum;
     }
+
+    public String getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(String longitude) {
+        this.longitude = longitude;
+    }
+
+    public String getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(String latitude) {
+        this.latitude = latitude;
+    }
+
+    public Integer getClockIn() {
+        return clockIn;
+    }
+
+    public void setClockIn(Integer clockIn) {
+        this.clockIn = clockIn;
+    }
+
+    public Date getClockInTime() {
+        return clockInTime;
+    }
+
+    public void setClockInTime(Date clockInTime) {
+        this.clockInTime = clockInTime;
+    }
+
+    public String getPhotoUrl() {
+        return photoUrl;
+    }
+
+    public void setPhotoUrl(String photoUrl) {
+        this.photoUrl = photoUrl;
+    }
+
+    public String getDistrictName() {
+        return districtName;
+    }
+
+    public void setDistrictName(String districtName) {
+        this.districtName = districtName;
+    }
 }

+ 2 - 0
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -97,6 +97,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 				prd.setPrid(in.getId());
 				prd.setUid(s);
 				prd.setSignSum(0);
+				prd.setDistrictName(in.getUserName());
+				prd.set
 				prdList.add(prd);
 			}
 			publicReleaseDetailsMapper.insertBatch(prdList);