anderx лет назад: 4
Родитель
Сommit
b6f4ab7957

+ 0 - 2
src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java

@@ -23,8 +23,6 @@ public interface PublicReleaseMapper {
     int updateByPrimaryKey(PublicRelease record);
     int updateByPrimaryKey(PublicRelease record);
 
 
 
 
-    void insertSelectiveGetId(PublicRelease in);
-
     OutPublicRelease selectDtails(@Param("id") Integer id, @Param("ufid")String ufid);
     OutPublicRelease selectDtails(@Param("id") Integer id, @Param("ufid")String ufid);
 
 
     int checkTime(@Param("aid")String aid, @Param("start") Date start, @Param("end")Date end);
     int checkTime(@Param("aid")String aid, @Param("start") Date start, @Param("end")Date end);

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

@@ -31,12 +31,13 @@
     <result column="expected_effect" jdbcType="VARCHAR" property="expectedEffect" />
     <result column="expected_effect" jdbcType="VARCHAR" property="expectedEffect" />
     <result column="next_plan" jdbcType="VARCHAR" property="nextPlan" />
     <result column="next_plan" jdbcType="VARCHAR" property="nextPlan" />
     <result column="type" jdbcType="INTEGER" property="type" />
     <result column="type" jdbcType="INTEGER" property="type" />
+    <result column="order_no" jdbcType="VARCHAR" property="orderNo" />
   </resultMap>
   </resultMap>
   <sql id="Base_Column_List">
   <sql id="Base_Column_List">
     id, `uid`, aid, release_start, release_end, remarks, annex_url, user_name, longitude, 
     id, `uid`, aid, release_start, release_end, remarks, annex_url, user_name, longitude, 
     latitude, `status`, create_time, clock_in, clock_in_time, photo_url, pid, pname, 
     latitude, `status`, create_time, clock_in, clock_in_time, photo_url, pid, pname, 
     ufid, duration, valid_date, new_user, sign_sum, main_status, supplement, audit_info, 
     ufid, duration, valid_date, new_user, sign_sum, main_status, supplement, audit_info, 
-    `plan`, expected_effect, next_plan, `type`
+    `plan`, expected_effect, next_plan, `type`, order_no
   </sql>
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select 
     select 
@@ -58,7 +59,7 @@
       valid_date, new_user, sign_sum, 
       valid_date, new_user, sign_sum, 
       main_status, supplement, audit_info, 
       main_status, supplement, audit_info, 
       `plan`, expected_effect, next_plan, 
       `plan`, expected_effect, next_plan, 
-      `type`)
+      `type`, order_no)
     values (#{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{releaseStart,jdbcType=TIMESTAMP}, 
     values (#{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{releaseStart,jdbcType=TIMESTAMP}, 
       #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, 
       #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, 
       #{userName,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, 
       #{userName,jdbcType=VARCHAR}, #{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, 
@@ -68,7 +69,7 @@
       #{validDate,jdbcType=VARCHAR}, #{newUser,jdbcType=INTEGER}, #{signSum,jdbcType=INTEGER}, 
       #{validDate,jdbcType=VARCHAR}, #{newUser,jdbcType=INTEGER}, #{signSum,jdbcType=INTEGER}, 
       #{mainStatus,jdbcType=INTEGER}, #{supplement,jdbcType=VARCHAR}, #{auditInfo,jdbcType=VARCHAR}, 
       #{mainStatus,jdbcType=INTEGER}, #{supplement,jdbcType=VARCHAR}, #{auditInfo,jdbcType=VARCHAR}, 
       #{plan,jdbcType=VARCHAR}, #{expectedEffect,jdbcType=VARCHAR}, #{nextPlan,jdbcType=VARCHAR}, 
       #{plan,jdbcType=VARCHAR}, #{expectedEffect,jdbcType=VARCHAR}, #{nextPlan,jdbcType=VARCHAR}, 
-      #{type,jdbcType=INTEGER})
+      #{type,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR})
   </insert>
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
     insert into public_release
     insert into public_release
@@ -157,6 +158,9 @@
       <if test="type != null">
       <if test="type != null">
         `type`,
         `type`,
       </if>
       </if>
+      <if test="orderNo != null">
+        order_no,
+      </if>
     </trim>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="uid != null">
       <if test="uid != null">
@@ -243,6 +247,9 @@
       <if test="type != null">
       <if test="type != null">
         #{type,jdbcType=INTEGER},
         #{type,jdbcType=INTEGER},
       </if>
       </if>
+      <if test="orderNo != null">
+        #{orderNo,jdbcType=VARCHAR},
+      </if>
     </trim>
     </trim>
   </insert>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicRelease">
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicRelease">
@@ -332,6 +339,9 @@
       <if test="type != null">
       <if test="type != null">
         `type` = #{type,jdbcType=INTEGER},
         `type` = #{type,jdbcType=INTEGER},
       </if>
       </if>
+      <if test="orderNo != null">
+        order_no = #{orderNo,jdbcType=VARCHAR},
+      </if>
     </set>
     </set>
     where id = #{id,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
   </update>
@@ -364,7 +374,8 @@
       `plan` = #{plan,jdbcType=VARCHAR},
       `plan` = #{plan,jdbcType=VARCHAR},
       expected_effect = #{expectedEffect,jdbcType=VARCHAR},
       expected_effect = #{expectedEffect,jdbcType=VARCHAR},
       next_plan = #{nextPlan,jdbcType=VARCHAR},
       next_plan = #{nextPlan,jdbcType=VARCHAR},
-      `type` = #{type,jdbcType=INTEGER}
+      `type` = #{type,jdbcType=INTEGER},
+      order_no = #{orderNo,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
   </update>
 
 
@@ -374,160 +385,6 @@
     set a.sign_sum =a.sign_sum +1
     set a.sign_sum =a.sign_sum +1
     where a.aid =#{aid} and a.uid =#{uid} and a.main_status =1 and a.create_time =b.create_time
     where a.aid =#{aid} and a.uid =#{uid} and a.main_status =1 and a.create_time =b.create_time
   </update>
   </update>
-  <insert id="insertSelectiveGetId" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
-     insert into public_release
-     <trim prefix="(" suffix=")" suffixOverrides=",">
-       <if test="uid != null">
-         `uid`,
-       </if>
-       <if test="aid != null">
-         aid,
-       </if>
-       <if test="releaseStart != null">
-         release_start,
-       </if>
-       <if test="releaseEnd != null">
-         release_end,
-       </if>
-       <if test="remarks != null">
-         remarks,
-       </if>
-       <if test="annexUrl != null">
-         annex_url,
-       </if>
-       <if test="userName != null">
-         user_name,
-       </if>
-       <if test="longitude != null">
-         longitude,
-       </if>
-       <if test="latitude != null">
-         latitude,
-       </if>
-       <if test="status != null">
-         `status`,
-       </if>
-       <if test="createTime != null">
-         create_time,
-       </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="pid != null">
-         pid,
-       </if>
-       <if test="pname != null">
-         pname,
-       </if>
-       <if test="ufid != null">
-         ufid,
-       </if>
-       <if test="duration != null">
-         duration,
-       </if>
-       <if test="validDate != null">
-         valid_date,
-       </if>
-       <if test="newUser != null">
-         new_user,
-       </if>
-       <if test="signSum != null">
-         sign_sum,
-       </if>
-       <if test="mainStatus != null">
-         main_status,
-       </if>
-       <if test="supplement != null">
-         supplement,
-       </if>
-       <if test="auditInfo != null">
-         audit_info,
-       </if>
-     </trim>
-     <trim prefix="values (" suffix=")" suffixOverrides=",">
-       <if test="uid != null">
-         #{uid,jdbcType=VARCHAR},
-       </if>
-       <if test="aid != null">
-         #{aid,jdbcType=VARCHAR},
-       </if>
-       <if test="releaseStart != null">
-         #{releaseStart,jdbcType=TIMESTAMP},
-       </if>
-       <if test="releaseEnd != null">
-         #{releaseEnd,jdbcType=TIMESTAMP},
-       </if>
-       <if test="remarks != null">
-         #{remarks,jdbcType=VARCHAR},
-       </if>
-       <if test="annexUrl != null">
-         #{annexUrl,jdbcType=VARCHAR},
-       </if>
-       <if test="userName != null">
-         #{userName,jdbcType=VARCHAR},
-       </if>
-       <if test="longitude != null">
-         #{longitude,jdbcType=VARCHAR},
-       </if>
-       <if test="latitude != null">
-         #{latitude,jdbcType=VARCHAR},
-       </if>
-       <if test="status != null">
-         #{status,jdbcType=INTEGER},
-       </if>
-       <if test="createTime != null">
-         #{createTime,jdbcType=TIMESTAMP},
-       </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="pid != null">
-         #{pid,jdbcType=VARCHAR},
-       </if>
-       <if test="pname != null">
-         #{pname,jdbcType=VARCHAR},
-       </if>
-       <if test="ufid != null">
-         #{ufid,jdbcType=VARCHAR},
-       </if>
-       <if test="duration != null">
-         #{duration,jdbcType=DOUBLE},
-       </if>
-       <if test="validDate != null">
-         #{validDate,jdbcType=VARCHAR},
-       </if>
-       <if test="newUser != null">
-         #{newUser,jdbcType=INTEGER},
-       </if>
-       <if test="signSum != null">
-         #{signSum,jdbcType=INTEGER},
-       </if>
-       <if test="mainStatus != null">
-         #{mainStatus,jdbcType=INTEGER},
-       </if>
-       <if test="supplement != null">
-         #{supplement,jdbcType=VARCHAR},
-       </if>
-       <if test="auditInfo != null">
-         #{auditInfo,jdbcType=VARCHAR},
-       </if>
-     </trim>
-    <selectKey keyProperty="id" order="AFTER" resultType="int">
-        SELECT LAST_INSERT_ID()
-    </selectKey>
-  </insert>
 
 
   <select id="listPublicRelease" resultType="com.goafanti.weChat.bo.OutPublicReleaseList">
   <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,
   select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
@@ -604,7 +461,7 @@
     select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
     select  a.id,b.nickname ,c.name  aname,date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,a.user_name userName,
     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,
     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.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.clock_in clockIn ,a.plan ,a.expected_effect expectedEffect,a.next_plan nextPlan,c.reviewer,a.type,a.order_no orderNo
   	from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
   	from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
 	where 1=1
 	where 1=1
 	<if test="id !=null">
 	<if test="id !=null">
@@ -620,7 +477,7 @@
   	select y.aid,y.bh,y.dk,y.wsh,y.tg,y.duration,c.name from(select x.aid ,sum(x.bh)bh,sum(x.wsh)wsh,sum(x.tg)tg,sum(x.dk)dk,sum(x.duration)duration
   	select y.aid,y.bh,y.dk,y.wsh,y.tg,y.duration,c.name from(select x.aid ,sum(x.bh)bh,sum(x.wsh)wsh,sum(x.tg)tg,sum(x.dk)dk,sum(x.duration)duration
 	from (select if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,if(a.clock_in=1,1,0) dk,a.aid
 	from (select if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,if(a.clock_in=1,1,0) dk,a.aid
   	,if(a.status=2,a.duration,0)duration    from  public_release a  left join admin b on a.aid=b.id
   	,if(a.status=2,a.duration,0)duration    from  public_release a  left join admin b on a.aid=b.id
-	where 1=1
+	where a.type=0
 	<if test="aid != null">
 	<if test="aid != null">
 	and a.aid= #{aid}
 	and a.aid= #{aid}
 	</if>
 	</if>
@@ -642,7 +499,7 @@
 
 
   <select id="countPublicStatistics" resultType="java.lang.Integer">
   <select id="countPublicStatistics" resultType="java.lang.Integer">
   	select count(*) from (select aid from public_release a  left join admin b on a.aid=b.id
   	select count(*) from (select aid from public_release a  left join admin b on a.aid=b.id
-	where 1=1
+	where a.type=0
 	<if test="aid != null">
 	<if test="aid != null">
 	and a.aid= #{aid}
 	and a.aid= #{aid}
 	</if>
 	</if>

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

@@ -150,6 +150,11 @@ public class PublicRelease implements Serializable {
      */
      */
     private Integer type;
     private Integer type;
 
 
+    /**
+     * 订单编号
+     */
+    private String orderNo;
+
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
     public Integer getId() {
     public Integer getId() {
@@ -383,4 +388,12 @@ public class PublicRelease implements Serializable {
     public void setType(Integer type) {
     public void setType(Integer type) {
         this.type = type;
         this.type = type;
     }
     }
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
 }
 }

+ 2 - 0
src/main/java/com/goafanti/weChat/bo/InputPublicRelease.java

@@ -17,6 +17,8 @@ public class InputPublicRelease extends PublicRelease {
 	
 	
 	private String reason;
 	private String reason;
 
 
+
+
 	public String getReleaseStarts() {
 	public String getReleaseStarts() {
 		return releaseStarts;
 		return releaseStarts;
 	}
 	}

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

@@ -150,6 +150,13 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			e.printStackTrace();
 			e.printStackTrace();
 			throw new BusinessException("转换异常");
 			throw new BusinessException("转换异常");
 		}
 		}
+		User u=userMapper.selectByPrimaryKey(in.getUid());
+		if (u!=null&&u.getShareType()==2){
+			in.setNewUser(1);
+		}
+		if (u.getAid().equals(TokenManager.getAdminId())){
+			in.setMainStatus(1);
+		}
 		if(in.getStatus()==null||in.getStatus()!=3) {
 		if(in.getStatus()==null||in.getStatus()!=3) {
 			in.setStatus(1);
 			in.setStatus(1);
 		}else {
 		}else {