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

+ 4 - 2
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -42,9 +42,11 @@ public class AFTConstants {
 	/**	营销员 */
 	public static final String  SALESMAN                      		= "96";					
 	/**	外包审核员 */
-	public static final String  OUTSOURCE_AUDITOR                   = "9991";				
+	public static final String  OUTSOURCE_AUDITOR                   = "9991";
 	/** 专利管理员 */
-	public static final String  PATENT_AUDITOR 	                  	= "9992";				
+	public static final String  PATENT_AUDITOR 	                  	= "9992";
+	/** 公司管理 */
+	public static final String  COMPANY_MANAGER 	                = "9993";
 	/** 渠道专员 */
 	public static final String  CHANNEL                      		= "80";		
 	/** 渠道总监 */

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

@@ -24,14 +24,14 @@
     <result column="valid_date" jdbcType="VARCHAR" property="validDate" />
     <result column="new_user" jdbcType="INTEGER" property="newUser" />
     <result column="sign_sum" jdbcType="INTEGER" property="signSum" />
-    <result column="main_status" jdbcType="INTEGER" property="mainStatus" />
+    <result column="mian_status" jdbcType="INTEGER" property="mianStatus" />
     <result column="supplement" jdbcType="VARCHAR" property="supplement" />
     <result column="audit_info" jdbcType="VARCHAR" property="auditInfo" />
   </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, mian_status, supplement, audit_info
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select 
@@ -51,7 +51,7 @@
       clock_in_time, photo_url, pid, 
       pname, ufid, duration, 
       valid_date, new_user, sign_sum, 
-      main_status, supplement, audit_info
+      mian_status, supplement, audit_info
       )
     values (#{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{releaseStart,jdbcType=TIMESTAMP}, 
       #{releaseEnd,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{annexUrl,jdbcType=VARCHAR}, 
@@ -60,7 +60,7 @@
       #{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}
+      #{mianStatus,jdbcType=INTEGER}, #{supplement,jdbcType=VARCHAR}, #{auditInfo,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.PublicRelease" useGeneratedKeys="true">
@@ -129,8 +129,8 @@
       <if test="signSum != null">
         sign_sum,
       </if>
-      <if test="mainStatus != null">
-        main_status,
+      <if test="mianStatus != null">
+        mian_status,
       </if>
       <if test="supplement != null">
         supplement,
@@ -203,8 +203,8 @@
       <if test="signSum != null">
         #{signSum,jdbcType=INTEGER},
       </if>
-      <if test="mainStatus != null">
-        #{mainStatus,jdbcType=INTEGER},
+      <if test="mianStatus != null">
+        #{mianStatus,jdbcType=INTEGER},
       </if>
       <if test="supplement != null">
         #{supplement,jdbcType=VARCHAR},
@@ -280,8 +280,8 @@
       <if test="signSum != null">
         sign_sum = #{signSum,jdbcType=INTEGER},
       </if>
-      <if test="mainStatus != null">
-        main_status = #{mainStatus,jdbcType=INTEGER},
+      <if test="mianStatus != null">
+        mian_status = #{mianStatus,jdbcType=INTEGER},
       </if>
       <if test="supplement != null">
         supplement = #{supplement,jdbcType=VARCHAR},
@@ -315,7 +315,7 @@
       valid_date = #{validDate,jdbcType=VARCHAR},
       new_user = #{newUser,jdbcType=INTEGER},
       sign_sum = #{signSum,jdbcType=INTEGER},
-      main_status = #{mainStatus,jdbcType=INTEGER},
+      mian_status = #{mianStatus,jdbcType=INTEGER},
       supplement = #{supplement,jdbcType=VARCHAR},
       audit_info = #{auditInfo,jdbcType=VARCHAR}
     where id = #{id,jdbcType=INTEGER}
@@ -387,8 +387,8 @@
        <if test="signSum != null">
          sign_sum,
        </if>
-       <if test="mainStatus != null">
-         main_status,
+       <if test="mianStatus != null">
+         mian_status,
        </if>
        <if test="supplement != null">
          supplement,
@@ -461,8 +461,8 @@
        <if test="signSum != null">
          #{signSum,jdbcType=INTEGER},
        </if>
-       <if test="mainStatus != null">
-         #{mainStatus,jdbcType=INTEGER},
+       <if test="mianStatus != null">
+         #{mianStatus,jdbcType=INTEGER},
        </if>
        <if test="supplement != null">
          #{supplement,jdbcType=VARCHAR},
@@ -594,15 +594,21 @@ a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,
   </select>
 
   <select id="listPublicDtails" resultType="com.goafanti.weChat.bo.OutPublicDtails">
-	select 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,
-		date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,
-	date_format(a.release_start,'%Y-%m-%d %H:%i:%S') releaseStarts,date_format(a.release_end ,'%Y-%m-%d %H:%i:%S') releaseEnds
-	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="aid != null">
+    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
+    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">
 	and a.aid= #{aid}
 	</if>
+    <if test="type==1 and deps !=null">
+       and d.department_id in
+      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
+        #{deps.id}
+      </foreach>
+    </if>
 	<if test="uid != null">
 	and a.uid = #{uid}
 	</if>
@@ -623,10 +629,17 @@ a.annex_url annexUrl ,a.remarks,a.duration ,a.valid_date validDate ,a.latitude ,
   <select id="countPublicDtails" 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
+    left join admin d on b.aid=d.id
 	where 1=1
 	<if test="aid != null">
 	and a.aid= #{aid}
 	</if>
+    <if test="type==1 and deps !=null">
+      and d.department_id in
+      <foreach close=")" collection="deps" item="deps" open="(" separator=",">
+        #{deps.id}
+      </foreach>
+    </if>
 	<if test="uid != null">
 	and a.uid = #{uid}
 	</if>

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

@@ -661,15 +661,14 @@
 
 	<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,
+		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
+
 		<if test="businessProjectId != null and businessProjectId != ''"><!--  客户甲项目A所有的跟进记录 -->
 			,e.id as ufbId,e.follow_situation as followSituation,e.customer_status as customerStatus
 		</if>
-		from user_follow a
-		left join user b on a.uid = b.id
-		left join organization_contact_book c on a.ocb_id = c.id
-		left join admin d on a.aid = d.id
+		from user_follow a left join user b on a.uid = b.id left join organization_contact_book c on a.ocb_id = c.id
+		left join admin d on a.aid = d.id left join public_release pr on a.id =pr.ufid
 		<if test="businessProjectId != null and businessProjectId != ''"><!--  客户甲项目A所有的跟进记录 -->
 			inner join user_follow_business e on a.id = e.follow_id
 		</if>

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

@@ -118,7 +118,7 @@ public class PublicRelease implements Serializable {
     /**
      * 0辅助根据 1主要跟进
      */
-    private Integer mainStatus;
+    private Integer mianStatus;
 
     /**
      * 公出补充
@@ -308,12 +308,12 @@ public class PublicRelease implements Serializable {
         this.signSum = signSum;
     }
 
-    public Integer getMainStatus() {
-        return mainStatus;
+    public Integer getMianStatus() {
+        return mianStatus;
     }
 
-    public void setMainStatus(Integer mainStatus) {
-        this.mainStatus = mainStatus;
+    public void setMianStatus(Integer mianStatus) {
+        this.mianStatus = mianStatus;
     }
 
     public String getSupplement() {

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

@@ -45,8 +45,28 @@ public class FollowListBo {
 	/** 指导时间 **/
 	private String guidanceTime;
 
+	private Integer prid;
+
+	private String supplement;
+
 	private String guidanceName;
 
+	public Integer getPrid() {
+		return prid;
+	}
+
+	public void setPrid(Integer prid) {
+		this.prid = prid;
+	}
+
+	public String getSupplement() {
+		return supplement;
+	}
+
+	public void setSupplement(String supplement) {
+		this.supplement = supplement;
+	}
+
 	public String getGuidanceName() {
 		return guidanceName;
 	}

+ 13 - 3
src/main/java/com/goafanti/weChat/bo/InputPublicDtails.java

@@ -8,11 +8,21 @@ public class InputPublicDtails {
 	private String uid;
 	private Integer status;
 	private Integer clockIn;
+	/**
+	 * type 0个人 1部门 2全部
+	 */
+	private Integer type;
 	private Integer pageSize;
 	private Integer pageNo;
-	
-	
-	
+
+
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
 
 	public String getAid() {
 		return aid;

+ 20 - 0
src/main/java/com/goafanti/weChat/bo/OutPublicDtails.java

@@ -9,6 +9,8 @@ public class OutPublicDtails {
 	private String nickname;
 	@Excel(name = "公出地点")
 	private String userName;
+	@Excel(name = "跟单人")
+	private String sname;
 	@Excel(name = "公出申请人")
 	private String aname;
 	@Excel(name = "公出时长")
@@ -29,9 +31,27 @@ public class OutPublicDtails {
 	private String remarks;
 	@Excel(name = "审核信息" )
 	private String auditInfo;
+	@Excel(name = "公出补充" )
+	private String supplement;
 	private String annexUrl;
 	private String photoUrl;
 
+	public String getSname() {
+		return sname;
+	}
+
+	public void setSname(String sname) {
+		this.sname = sname;
+	}
+
+	public String getSupplement() {
+		return supplement;
+	}
+
+	public void setSupplement(String supplement) {
+		this.supplement = supplement;
+	}
+
 	public Integer getId() {
 		return id;
 	}

+ 15 - 0
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -203,6 +203,21 @@ public class AdminReleaseApiController extends CertifyApiController{
 		res.setData(handleFile(res, "/publicRelease/", false, req, "publicRelease"));
 		return res;
 	}
+
+	/**
+	 * 搜索
+	 * @return
+	 */
+	@RequestMapping(value = "/addSupplement", method = RequestMethod.POST)
+	public Result addSupplement(Integer id,String supplement){
+		Result res =new Result();
+		if (id==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"公出编号"));
+			return res;
+		}
+		res.setData(publicReleaseService.addSupplement( id ,supplement));
+		return res;
+	}
 	
 	
 	

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

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

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

@@ -8,6 +8,7 @@ import java.util.Map;
 import java.util.UUID;
 
 
+import com.goafanti.order.service.OrderService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.socket.TextMessage;
@@ -60,6 +61,8 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 	@Autowired
 	private CustomerService customerService;
 	@Autowired
+	private OrderService orderService;
+	@Autowired
 	private WeChatUtils weChatUtils;
 	@Autowired
 	private AdminMapper adminMapper;
@@ -330,6 +333,16 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		if(in.getUid()!=null)map.put("uid", in.getUid());
 		if(in.getStatus()!=null)map.put("status", in.getStatus());
 		if(in.getClockIn()!=null)map.put("clockIn", in.getClockIn());
+		if(TokenManager.hasRole(AFTConstants.SUPERADMIN)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)){in.setType(2);}
+		else if(TokenManager.hasRole(AFTConstants.COMPANY_MANAGER)){
+			in.setType(1);
+			map.put("deps", orderService.selectMyDeps());
+		} else{
+			in.setType(0);
+			if (in.getAid()==null)map.put("aid",TokenManager.getAdminId());
+		}
+		map.put("type",in.getType());
+
 		return (Pagination<OutPublicDtails>) findPage("listPublicDtails", "countPublicDtails", map, in.getPageNo(), in.getPageSize());
 	}
 	
@@ -345,11 +358,13 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		return (List<OutPublicDtails>) findList("listPublicDtails", map, in.getPageNo(), 99999);
 	}
 
-
-
-
-
-
+	@Override
+	public int addSupplement(Integer id,String supplement) {
+		PublicRelease pr=new PublicRelease();
+		pr.setId(id);
+		pr.setSupplement(supplement);
+		return publicReleaseMapper.updateByPrimaryKeySelective(pr);
+	}
 
 
 	@Override