Explorar o código

小程序、公出模块修改

anderx %!s(int64=4) %!d(string=hai) anos
pai
achega
6971481038

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

@@ -27,11 +27,15 @@
     <result column="main_status" jdbcType="INTEGER" property="mainStatus" />
     <result column="supplement" jdbcType="VARCHAR" property="supplement" />
     <result column="audit_info" jdbcType="VARCHAR" property="auditInfo" />
+    <result column="plan" jdbcType="VARCHAR" property="plan" />
+    <result column="expected_effect" jdbcType="VARCHAR" property="expectedEffect" />
+    <result column="next_plan" jdbcType="VARCHAR" property="nextPlan" />
   </resultMap>
   <sql id="Base_Column_List">
     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, 
-    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
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select 
@@ -51,7 +55,8 @@
       clock_in_time, photo_url, pid, 
       pname, ufid, duration, 
       valid_date, new_user, sign_sum, 
-      main_status, supplement, audit_info
+      main_status, supplement, audit_info, 
+      `plan`, expected_effect, next_plan
       )
     values (#{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{releaseStart,jdbcType=TIMESTAMP}, 
       #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, 
@@ -60,7 +65,8 @@
       #{clockInTime,jdbcType=TIMESTAMP}, #{photoUrl,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, 
       #{pname,jdbcType=VARCHAR}, #{ufid,jdbcType=VARCHAR}, #{duration,jdbcType=DOUBLE}, 
       #{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}
       )
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
@@ -138,6 +144,15 @@
       <if test="auditInfo != null">
         audit_info,
       </if>
+      <if test="plan != null">
+        `plan`,
+      </if>
+      <if test="expectedEffect != null">
+        expected_effect,
+      </if>
+      <if test="nextPlan != null">
+        next_plan,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="uid != null">
@@ -212,6 +227,15 @@
       <if test="auditInfo != null">
         #{auditInfo,jdbcType=VARCHAR},
       </if>
+      <if test="plan != null">
+        #{plan,jdbcType=VARCHAR},
+      </if>
+      <if test="expectedEffect != null">
+        #{expectedEffect,jdbcType=VARCHAR},
+      </if>
+      <if test="nextPlan != null">
+        #{nextPlan,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PublicRelease">
@@ -289,6 +313,15 @@
       <if test="auditInfo != null">
         audit_info = #{auditInfo,jdbcType=VARCHAR},
       </if>
+      <if test="plan != null">
+        `plan` = #{plan,jdbcType=VARCHAR},
+      </if>
+      <if test="expectedEffect != null">
+        expected_effect = #{expectedEffect,jdbcType=VARCHAR},
+      </if>
+      <if test="nextPlan != null">
+        next_plan = #{nextPlan,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -317,7 +350,10 @@
       sign_sum = #{signSum,jdbcType=INTEGER},
       main_status = #{mainStatus,jdbcType=INTEGER},
       supplement = #{supplement,jdbcType=VARCHAR},
-      audit_info = #{auditInfo,jdbcType=VARCHAR}
+      audit_info = #{auditInfo,jdbcType=VARCHAR},
+      `plan` = #{plan,jdbcType=VARCHAR},
+      expected_effect = #{expectedEffect,jdbcType=VARCHAR},
+      next_plan = #{nextPlan,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
 
@@ -487,6 +523,9 @@
   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
   from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
+  <if test="type==2">
+    left join department d on c.department_id =d.id
+  </if>
       where 1=1
 	<if test="type==0">
 	and a.aid= #{aid}
@@ -494,6 +533,9 @@
 	<if test="type==1">
 	and c.reviewer = #{aid}
 	</if>
+    <if test="type==2">
+      and d.manager_id = #{aid}
+    </if>
 	<if test="clockTime !=null">
 	and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
 	</if>
@@ -516,15 +558,20 @@
   </select>
   <select id="countPublicRelease" resultType="java.lang.Integer">
   select  count(*)
-	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
-	<if test="type==0">
-	and a.aid= #{aid}
-	</if>
-	<if test="type==1">
-    and c.reviewer = #{aid}
-	</if>
+	from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
+    <if test="type==2">
+      left join department d on c.department_id =d.id
+    </if>
+    where 1=1
+    <if test="type==0">
+      and a.aid= #{aid}
+    </if>
+    <if test="type==1">
+      and c.reviewer = #{aid}
+    </if>
+    <if test="type==2">
+      and d.manager_id = #{aid}
+    </if>
 	<if test="clockTime !=null">
 	and a.release_start &lt; #{clockTime} and a.release_end &gt; #{clockTime}
 	</if>
@@ -543,10 +590,11 @@
   </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,
+    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,
     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 from public_release a left join `user` b on a.uid =b.id left join admin c on a.aid =c.id
+    a.clock_in clockIn ,a.plan ,a.expected_effect expectedEffect,a.next_plan nextPlan,d.reviewer
+  	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
 	<if test="id !=null">
 	and a.id= #{id}
@@ -603,7 +651,8 @@
     select a.id,b.nickname ,a.user_name userName,c.name aname,a.duration ,a.status,a.annex_url annexUrl,a.photo_url photoUrl,
     date_format(a.clock_in_time ,'%Y-%m-%d %H:%i:%S') clockInTimes,a.clock_in clockIn,a.remarks,a.supplement,
     date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.audit_info auditInfo,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
+    date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds,
+    a.plan ,a.next_plan nextPlan ,a.expected_effect expectedEffect
     from public_release a left join `user` b on a.uid=b.id left join admin c on a.aid =c.id
     left join admin d on b.aid=d.id where 1=1
     <if test="aid != null">

+ 2 - 2
src/main/java/com/goafanti/common/mapper/UserMapperExt.xml

@@ -662,8 +662,8 @@
 	<select id="selectFollowHistoryList" resultType="com.goafanti.customer.bo.FollowListBo">
 		select a.id as followId, a.aid,date_format( a.create_time,'%Y-%m-%d %H:%i:%S') as followTime, a.contact_type as contactType,
 		a.result,a.guidance, b.nickname,b.identify_name as identifyName, c.name as contacts, c.mobile as contactMobile,pr.supplement ,pr.id prid,
-		d.name as adminName,date_format(a.guidance_time,'%Y-%m-%d %H:%i:%S') as guidanceTime,a.guidance_name guidanceName
-
+		d.name as adminName,date_format(a.guidance_time,'%Y-%m-%d %H:%i:%S') as guidanceTime,a.guidance_name guidanceName,
+		pr.plan ,pr.next_plan nextPlan ,pr.expected_effect expectedEffect
 		<if test="businessProjectId != null and businessProjectId != ''"><!--  客户甲项目A所有的跟进记录 -->
 			,e.id as ufbId,e.follow_situation as followSituation,e.customer_status as customerStatus
 		</if>

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

@@ -5,7 +5,7 @@ import java.util.Date;
 
 /**
  * public_release
- * @author
+ * @author 
  */
 public class PublicRelease implements Serializable {
     private Integer id;
@@ -31,7 +31,7 @@ public class PublicRelease implements Serializable {
     private Date releaseEnd;
 
     /**
-     * 备注
+     * 公出目标
      */
     private String remarks;
 
@@ -121,7 +121,7 @@ public class PublicRelease implements Serializable {
     private Integer mainStatus;
 
     /**
-     * 公出补充
+     * 本次总结
      */
     private String supplement;
 
@@ -130,6 +130,21 @@ public class PublicRelease implements Serializable {
      */
     private String auditInfo;
 
+    /**
+     * 公出计划
+     */
+    private String plan;
+
+    /**
+     * 预计效果
+     */
+    private String expectedEffect;
+
+    /**
+     * 下次计划
+     */
+    private String nextPlan;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -308,7 +323,6 @@ public class PublicRelease implements Serializable {
         this.signSum = signSum;
     }
 
-
     public Integer getMainStatus() {
         return mainStatus;
     }
@@ -332,4 +346,28 @@ public class PublicRelease implements Serializable {
     public void setAuditInfo(String auditInfo) {
         this.auditInfo = auditInfo;
     }
+
+    public String getPlan() {
+        return plan;
+    }
+
+    public void setPlan(String plan) {
+        this.plan = plan;
+    }
+
+    public String getExpectedEffect() {
+        return expectedEffect;
+    }
+
+    public void setExpectedEffect(String expectedEffect) {
+        this.expectedEffect = expectedEffect;
+    }
+
+    public String getNextPlan() {
+        return nextPlan;
+    }
+
+    public void setNextPlan(String nextPlan) {
+        this.nextPlan = nextPlan;
+    }
 }

+ 28 - 0
src/main/java/com/goafanti/customer/bo/FollowListBo.java

@@ -51,6 +51,34 @@ public class FollowListBo {
 
 	private String guidanceName;
 
+	private String plan;
+	private String nextPlan;
+	private String expectedEffect;
+
+	public String getPlan() {
+		return plan;
+	}
+
+	public void setPlan(String plan) {
+		this.plan = plan;
+	}
+
+	public String getNextPlan() {
+		return nextPlan;
+	}
+
+	public void setNextPlan(String nextPlan) {
+		this.nextPlan = nextPlan;
+	}
+
+	public String getExpectedEffect() {
+		return expectedEffect;
+	}
+
+	public void setExpectedEffect(String expectedEffect) {
+		this.expectedEffect = expectedEffect;
+	}
+
 	public Integer getPrid() {
 		return prid;
 	}

+ 33 - 3
src/main/java/com/goafanti/weChat/bo/OutPublicDtails.java

@@ -27,15 +27,45 @@ public class OutPublicDtails {
 	private String clockInTimes;
 	@Excel(name = "创建时间" )
 	private String createTimes;
-	@Excel(name = "公出原因" )
+	@Excel(name = "公出目标" )
 	private String remarks;
+	@Excel(name = "公出计划" )
+	private String plan;
+	@Excel(name = "预计效果" )
+	private String expectedEffect;
+	@Excel(name = "本次公出目标总结" )
+	private String supplement;
+	@Excel(name = "下次计划" )
+	private String nextPlan;
 	@Excel(name = "审核信息" )
 	private String auditInfo;
-	@Excel(name = "公出补充" )
-	private String supplement;
 	private String annexUrl;
 	private String photoUrl;
 
+	public String getPlan() {
+		return plan;
+	}
+
+	public void setPlan(String plan) {
+		this.plan = plan;
+	}
+
+	public String getExpectedEffect() {
+		return expectedEffect;
+	}
+
+	public void setExpectedEffect(String expectedEffect) {
+		this.expectedEffect = expectedEffect;
+	}
+
+	public String getNextPlan() {
+		return nextPlan;
+	}
+
+	public void setNextPlan(String nextPlan) {
+		this.nextPlan = nextPlan;
+	}
+
 	public String getSname() {
 		return sname;
 	}

+ 9 - 5
src/main/java/com/goafanti/weChat/bo/OutPublicRelease.java

@@ -7,7 +7,6 @@ public class OutPublicRelease extends PublicRelease {
 	 * 
 	 */
 	private static final long serialVersionUID = 1L;
-	private String nickname;
 	private String aname;
 	private String releaseStarts;
 	private String userName;
@@ -17,12 +16,17 @@ public class OutPublicRelease extends PublicRelease {
 	private String suprId;
 	/** 审核权限*/
 	private Integer permission;
-	public String getNickname() {
-		return nickname;
+
+	private String reviewer;
+
+	public String getReviewer() {
+		return reviewer;
 	}
-	public void setNickname(String nickname) {
-		this.nickname = nickname;
+
+	public void setReviewer(String reviewer) {
+		this.reviewer = reviewer;
 	}
+
 	public String getAname() {
 		return aname;
 	}

+ 10 - 2
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -214,13 +214,21 @@ public class AdminReleaseApiController extends CertifyApiController{
 	 * @return
 	 */
 	@RequestMapping(value = "/addSupplement", method = RequestMethod.POST)
-	public Result addSupplement(Integer id,String supplement){
+	public Result addSupplement(Integer id,String supplement,String nextPlan){
 		Result res =new Result();
 		if (id==null) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"公出编号"));
 			return res;
 		}
-		res.setData(publicReleaseService.addSupplement( id ,supplement));
+		if (supplement==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"本次公出目标总结"));
+			return res;
+		}
+		if (nextPlan==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"下次公出计划"));
+			return res;
+		}
+		res.setData(publicReleaseService.addSupplement( id ,supplement,nextPlan));
 		return res;
 	}
 	

+ 1 - 1
src/main/java/com/goafanti/weChat/service/PublicReleaseService.java

@@ -42,5 +42,5 @@ public interface PublicReleaseService {
 
 	List<OutPublicDtails> publicReleaseListDtailsList(InputPublicDtails in);
 
-    int addSupplement(Integer id,String supplement);
+    int addSupplement(Integer id, String supplement, String nextPlan);
 }

+ 8 - 5
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -90,7 +90,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		if (u.getAid().equals(TokenManager.getAdminId())){
 			in.setMainStatus(1);
 		}
-		publicReleaseMapper.insertSelectiveGetId(in);
+		publicReleaseMapper.insertSelective(in);
 		AdminListBo my = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
 		Admin a=adminMapper.selectByPrimaryKey(my.getReviewer());
 		PublicReleaseLog log=new PublicReleaseLog(in.getId(),TokenManager.getAdminId(),1,"发起外出申请",new Date());
@@ -158,8 +158,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			PublicReleaseLog log=new PublicReleaseLog(in.getId(),TokenManager.getAdminId(),4,in.getReason(),new Date());
 			publicReleaseLogMapper.insertSelective(log);
 		}
-		publicReleaseMapper.updateByPrimaryKeySelective(in);
-		return 1;
+		return publicReleaseMapper.updateByPrimaryKeySelective(in);
 	}
 
 	@SuppressWarnings("unchecked")
@@ -270,7 +269,10 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	public OutPublicRelease dtails(Integer id) {
 		OutPublicRelease out=publicReleaseMapper.selectDtails(id,null);
 		//如果不是本人和审核人员则不返回信息
-		if(out!=null&&!TokenManager.getAdminId().equals( out.getAid())&&!TokenManager.getAdminId().equals(out.getSuprId())) {
+		if(out!=null&&
+				!TokenManager.getAdminId().equals( out.getAid())&&
+				!TokenManager.getAdminId().equals(out.getSuprId())&&
+				!TokenManager.getAdminId().equals(out.getReviewer())) {
 			out=null;
 		}else if(TokenManager.getAdminId().equals(out.getAid())) {
 			out.setPermission(0);
@@ -357,10 +359,11 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	}
 
 	@Override
-	public int addSupplement(Integer id,String supplement) {
+	public int addSupplement(Integer id, String supplement, String nextPlan) {
 		PublicRelease pr=new PublicRelease();
 		pr.setId(id);
 		pr.setSupplement(supplement);
+		pr.setNextPlan(nextPlan);
 		return publicReleaseMapper.updateByPrimaryKeySelective(pr);
 	}