Bladeren bron

付款催款开发

Signed-off-by: anderx <312518615@qq.com>
anderx 5 jaren geleden
bovenliggende
commit
aac8fe67b0

+ 1 - 1
GeneratorConfig.xml

@@ -9,6 +9,6 @@
     <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="kede-server" />
     <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="kede-server" />
     <javaClientGenerator  targetPackage="com.goafanti.common.dao"  type="XMLMAPPER" targetProject="kede-server"  />
-    <table schema="aft" tableName="outsource_log"/>
+    <table schema="aft" tableName="payment_node"/>
   </context>
 </generatorConfiguration>

+ 60 - 53
src/main/java/com/goafanti/common/bo/EmailBo.java

@@ -92,57 +92,16 @@ public class EmailBo {
 		this.deptname = deptname;
 		this.sender = sender;
 		if(type==0)this.content = setGeneralFormat();
-		if(type==1)this.content=setDunFormat( addressee, sender, deptname,orderNo, date , dunStatusName,adminName,userName);
+		if(type==1)this.content=setDunFormat( addressee, sender, deptname,orderNo, date , dunStatusName,adminName,userName,0);
+		if(type==2)this.content=setDunFormat( addressee, sender, deptname,orderNo, date , dunStatusName,adminName,userName,1);
 	}
 
-
-
-	public String getSubject() {
-		return subject;
-	}
-
-	public void setSubject(String subject) {
-		this.subject = subject;
-	}
-
-	public String getAddress() {
-		return address;
-	}
-	public void setAddress(String address) {
-		this.address = address;
-	}
-	public String getAddressee() {
-		return addressee;
-	}
-	public void setAddressee(String addressee) {
-		this.addressee = addressee;
-	}
-	public String getDeptname() {
-		return deptname;
-	}
-	public void setDeptname(String deptname) {
-		this.deptname = deptname;
-	}
-	public String getSender() {
-		return sender;
-	}
-	public void setSender(String sender) {
-		this.sender = sender;
-	}
-	public String getContent() {
-		return content;
-	}
-	public void setContent(String content) {
-		this.content = content;
-	}
-	
-	public String format(String name){
-        return "<div>亲爱的" + name + ", 您收到一条由[" + this.deptname +"] 的 [" + this.sender + "] 发起的 [" + this.subject + "] 通知:</div>"
-        		+ "<div>" + this.content + "</div>"
-        		+ "<div>" + this.end + "</div>";
-    }
 	public String setDunFormat(String addressee,String sender,String deptname,String orderNo,String date ,String dunStatusName,String adminName,
-			String userName) {
+			String userName,int i) {
+		String str1 = "",str2= "",str3= "";
+		if (i==0) str1="催收时间";str2="催收科目";str3="催收状态";
+		if (i==1) str1="付款时间";str2="付款科目";str3="催收状态";
+		
 		String str="<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#ffffff\" style=\"font-family:'Microsoft YaHei';\">\r\n" + 
 				"    		<tbody><tr>\r\n" + 
 				"		        <td>\r\n" + 
@@ -156,7 +115,7 @@ public class EmailBo {
 				"            		<table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#1C5299\" height=\"48\" style=\"font-family:'Microsoft YaHei';\">\r\n" + 
 				"              			<tbody><tr>\r\n" + 
 				"                			<td height=\"48\" border=\"0\" align=\"center\" valign=\"middle\" style=\"padding-left:20px; color: white; font-size: 20px;\">\r\n" + 
-				"                				催收通知\r\n" + 
+				"                				"+subject+"\r\n" + 
 				"        					</td>\r\n" + 
 				"              			</tr>\r\n" + 
 				"		            </tbody></table>\r\n" + 
@@ -176,7 +135,7 @@ public class EmailBo {
 				"              </tr>\r\n" + 
 				"                      <tr>\r\n" + 
 				"                <td width=\"40\" height=\"32\" border=\"0\" align=\"left\" valign=\"middle\" style=\" width:40px; text-align:left;vertical-align:middle; line-height:32px; float:left;\">&nbsp;</td>\r\n" + 
-				"                <td width=\"720\" height=\"32\" border=\"0\" align=\"left\" style=\" width:720px; text-align:left;vertical-align:middle;line-height:32px;\"><span style=\"font-weight: 900\">您收到一条由["+deptname+"] 的 ["+sender+"] 发起的 [催收通知] !</span></td>\r\n" + 
+				"                <td width=\"720\" height=\"32\" border=\"0\" align=\"left\" style=\" width:720px; text-align:left;vertical-align:middle;line-height:32px;\"><span style=\"font-weight: 900\">您收到一条由["+deptname+"] 的 ["+sender+"] 发起的 ["+subject+"] !</span></td>\r\n" + 
 				"              </tr>\r\n" + 
 				"              <tr>\r\n" + 
 				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px; font-size: 12px;\"><span style=\"color: red;\">如已缴费,请您忽略此短信!</span></td>\r\n" + 
@@ -192,13 +151,13 @@ public class EmailBo {
 				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">订单编号:"+orderNo+"</td>\r\n" + 
 				"              </tr>\r\n" + 
 				"               <tr>\r\n" + 
-				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">催收时间:"+date+"</td>\r\n" + 
+				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">"+str1+":"+date+"</td>\r\n" + 
 				"              </tr>\r\n" + 
 				"               <tr>\r\n" + 
-				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">催收科目:"+dunStatusName+"</td>\r\n" + 
+				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">"+str2+":"+dunStatusName+"</td>\r\n" + 
 				"              </tr>\r\n" + 
 				"               <tr>\r\n" + 
-				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">催收情况:已启动</td>\r\n" + 
+				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">"+str3+":已启动</td>\r\n" + 
 				"              </tr>\r\n" + 
 				"               <tr>\r\n" + 
 				"                <td width=\"720\" height=\"24\" colspan=\"2\" style=\"padding-left:40px;\">&nbsp;</td>\r\n" + 
@@ -287,6 +246,54 @@ public class EmailBo {
 				"  </table>";
 		return str;
 	}
+
+	
+
+	public String getSubject() {
+		return subject;
+	}
+
+	public void setSubject(String subject) {
+		this.subject = subject;
+	}
+
+	public String getAddress() {
+		return address;
+	}
+	public void setAddress(String address) {
+		this.address = address;
+	}
+	public String getAddressee() {
+		return addressee;
+	}
+	public void setAddressee(String addressee) {
+		this.addressee = addressee;
+	}
+	public String getDeptname() {
+		return deptname;
+	}
+	public void setDeptname(String deptname) {
+		this.deptname = deptname;
+	}
+	public String getSender() {
+		return sender;
+	}
+	public void setSender(String sender) {
+		this.sender = sender;
+	}
+	public String getContent() {
+		return content;
+	}
+	public void setContent(String content) {
+		this.content = content;
+	}
+	
+	public String format(String name){
+        return "<div>亲爱的" + name + ", 您收到一条由[" + this.deptname +"] 的 [" + this.sender + "] 发起的 [" + this.subject + "] 通知:</div>"
+        		+ "<div>" + this.content + "</div>"
+        		+ "<div>" + this.end + "</div>";
+    }
+	
 	
 	
 	

+ 41 - 0
src/main/java/com/goafanti/common/bo/paymentNodeEmailBo.java

@@ -0,0 +1,41 @@
+package com.goafanti.common.bo;
+
+public class paymentNodeEmailBo {
+	//营销员名称、邮箱、订单编号、客户名称
+	private String salesmanId;
+	private String salesmanName;
+	private String email;
+	private String orderNo;
+	private String userName;
+	public String getSalesmanId() {
+		return salesmanId;
+	}
+	public void setSalesmanId(String salesmanId) {
+		this.salesmanId = salesmanId;
+	}
+	public String getSalesmanName() {
+		return salesmanName;
+	}
+	public void setSalesmanName(String salesmanName) {
+		this.salesmanName = salesmanName;
+	}
+	public String getEmail() {
+		return email;
+	}
+	public void setEmail(String email) {
+		this.email = email;
+	}
+	public String getOrderNo() {
+		return orderNo;
+	}
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+	public String getUserName() {
+		return userName;
+	}
+	public void setUserName(String userName) {
+		this.userName = userName;
+	}
+	
+}

+ 17 - 12
src/main/java/com/goafanti/common/dao/PaymentNodeMapper.java

@@ -1,5 +1,6 @@
 package com.goafanti.common.dao;
 
+import com.goafanti.common.bo.paymentNodeEmailBo;
 import com.goafanti.common.model.PaymentNode;
 import com.goafanti.common.model.PaymentNodeExample;
 import com.goafanti.organization.bo.OutPaymentNode;
@@ -10,69 +11,73 @@ import org.apache.ibatis.annotations.Param;
 public interface PaymentNodeMapper {
     /**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	long countByExample(PaymentNodeExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	int deleteByExample(PaymentNodeExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	int deleteByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	int insert(PaymentNode record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	int insertSelective(PaymentNode record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	List<PaymentNode> selectByExample(PaymentNodeExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	PaymentNode selectByPrimaryKey(Integer id);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	int updateByExampleSelective(@Param("record") PaymentNode record, @Param("example") PaymentNodeExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	int updateByExample(@Param("record") PaymentNode record, @Param("example") PaymentNodeExample example);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	int updateByPrimaryKeySelective(PaymentNode record);
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	int updateByPrimaryKey(PaymentNode record);
 
-	List<OutPaymentNode> selectByTid(Integer tid);
+	List<OutPaymentNode> selectByTid(@Param("tid")Integer tid,@Param("status")Integer status);
+
+	List<OutPaymentNode> selectByStatus(Integer status);
+
+	paymentNodeEmailBo selectBytidGetEmail(Integer tid);
 }

+ 1 - 0
src/main/java/com/goafanti/common/enums/NoticeStatus.java

@@ -49,6 +49,7 @@ public enum NoticeStatus {
 	ORDER_ARREARS_DUN(40,"欠款催款信息"),
 	TASK_PATENT_ERROR(41,"专利提醒失败"),
 	TASK_PATENT_REMIND(42,"专利缴费提醒"),
+	PAYMENT_DUN(43,"付款节点提醒"),
 	OTHER(0, "其他");
 
 	private NoticeStatus(Integer code, String desc) {

+ 83 - 21
src/main/java/com/goafanti/common/mapper/PaymentNodeMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="tid" jdbcType="INTEGER" property="tid" />
@@ -19,12 +19,15 @@
     <result column="party_amount" jdbcType="DECIMAL" property="partyAmount" />
     <result column="party_time" jdbcType="TIMESTAMP" property="partyTime" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="dun_status" jdbcType="INTEGER" property="dunStatus" />
+    <result column="effective_count" jdbcType="INTEGER" property="effectiveCount" />
+    <result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -58,7 +61,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -92,16 +95,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     id, tid, cid, company_name, project_type, dun_type, unit_price, quantity, total_amount, 
-    party_amount, party_time, create_time
+    party_amount, party_time, create_time, dun_status, effective_count, start_time
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.PaymentNodeExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     select
     <if test="distinct">
@@ -120,7 +123,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -131,7 +134,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     delete from payment_node
     where id = #{id,jdbcType=INTEGER}
@@ -140,7 +143,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     delete from payment_node
     <if test="_parameter != null">
@@ -151,24 +154,26 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     insert into payment_node (id, tid, cid, 
       company_name, project_type, dun_type, 
       unit_price, quantity, total_amount, 
-      party_amount, party_time, create_time
+      party_amount, party_time, create_time, 
+      dun_status, effective_count, start_time
       )
     values (#{id,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{cid,jdbcType=INTEGER}, 
       #{companyName,jdbcType=VARCHAR}, #{projectType,jdbcType=INTEGER}, #{dunType,jdbcType=INTEGER}, 
       #{unitPrice,jdbcType=DECIMAL}, #{quantity,jdbcType=INTEGER}, #{totalAmount,jdbcType=DECIMAL}, 
-      #{partyAmount,jdbcType=DECIMAL}, #{partyTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}
+      #{partyAmount,jdbcType=DECIMAL}, #{partyTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{dunStatus,jdbcType=INTEGER}, #{effectiveCount,jdbcType=INTEGER}, #{startTime,jdbcType=TIMESTAMP}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.PaymentNode">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     insert into payment_node
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -208,6 +213,15 @@
       <if test="createTime != null">
         create_time,
       </if>
+      <if test="dunStatus != null">
+        dun_status,
+      </if>
+      <if test="effectiveCount != null">
+        effective_count,
+      </if>
+      <if test="startTime != null">
+        start_time,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -246,13 +260,22 @@
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="dunStatus != null">
+        #{dunStatus,jdbcType=INTEGER},
+      </if>
+      <if test="effectiveCount != null">
+        #{effectiveCount,jdbcType=INTEGER},
+      </if>
+      <if test="startTime != null">
+        #{startTime,jdbcType=TIMESTAMP},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.PaymentNodeExample" resultType="java.lang.Long">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     select count(*) from payment_node
     <if test="_parameter != null">
@@ -263,7 +286,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     update payment_node
     <set>
@@ -303,6 +326,15 @@
       <if test="record.createTime != null">
         create_time = #{record.createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="record.dunStatus != null">
+        dun_status = #{record.dunStatus,jdbcType=INTEGER},
+      </if>
+      <if test="record.effectiveCount != null">
+        effective_count = #{record.effectiveCount,jdbcType=INTEGER},
+      </if>
+      <if test="record.startTime != null">
+        start_time = #{record.startTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -312,7 +344,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     update payment_node
     set id = #{record.id,jdbcType=INTEGER},
@@ -326,7 +358,10 @@
       total_amount = #{record.totalAmount,jdbcType=DECIMAL},
       party_amount = #{record.partyAmount,jdbcType=DECIMAL},
       party_time = #{record.partyTime,jdbcType=TIMESTAMP},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP}
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      dun_status = #{record.dunStatus,jdbcType=INTEGER},
+      effective_count = #{record.effectiveCount,jdbcType=INTEGER},
+      start_time = #{record.startTime,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -335,7 +370,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     update payment_node
     <set>
@@ -372,6 +407,15 @@
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="dunStatus != null">
+        dun_status = #{dunStatus,jdbcType=INTEGER},
+      </if>
+      <if test="effectiveCount != null">
+        effective_count = #{effectiveCount,jdbcType=INTEGER},
+      </if>
+      <if test="startTime != null">
+        start_time = #{startTime,jdbcType=TIMESTAMP},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -379,7 +423,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri Jun 12 13:55:18 CST 2020.
+      This element was generated on Mon Jun 15 11:31:47 CST 2020.
     -->
     update payment_node
     set tid = #{tid,jdbcType=INTEGER},
@@ -392,13 +436,31 @@
       total_amount = #{totalAmount,jdbcType=DECIMAL},
       party_amount = #{partyAmount,jdbcType=DECIMAL},
       party_time = #{partyTime,jdbcType=TIMESTAMP},
-      create_time = #{createTime,jdbcType=TIMESTAMP}
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      dun_status = #{dunStatus,jdbcType=INTEGER},
+      effective_count = #{effectiveCount,jdbcType=INTEGER},
+      start_time = #{startTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=INTEGER}
   </update>
   
   <select id="selectByTid" resultType="com.goafanti.organization.bo.OutPaymentNode">
-  select id,tid,cid,company_name companyName,unit_price unitPrice,quantity,total_amount totalAmount,
+  select id,tid,cid,company_name companyName,unit_price unitPrice,quantity,total_amount totalAmount,create_time createTime,
    party_amount partyAmount, date_format(party_time,'%Y-%m-%d')partyTimes,project_type projectType,dun_type dunType
    from payment_node where tid= #{tid}
+   <if test="status !=null">
+   and dun_status = #{status}
+   </if>
+  </select>
+  <select id="selectByStatus" resultType="com.goafanti.organization.bo.OutPaymentNode">
+  select id,tid,cid,company_name companyName,unit_price unitPrice,quantity,total_amount totalAmount,
+   party_amount partyAmount, date_format(party_time,'%Y-%m-%d')partyTimes,project_type projectType,dun_type dunType
+   from payment_node where dun_status = #{status}
+  </select>
+  
+  <select id="selectBytidGetEmail" resultType="com.goafanti.common.bo.paymentNodeEmailBo">
+  select a.tid,b.order_no orderNo,c.salesman_id salesmanId,c.salesman_name salesmanName,c.buyer_name userName,d.email from payment_node a 
+left join t_order_task b on a.tid=b.id
+left join t_order_mid c on b.order_no=c.order_no left join admin d on  c.salesman_id=d.id
+where a.tid= #{tid}
   </select>
 </mapper>

+ 105 - 36
src/main/java/com/goafanti/common/model/PaymentNode.java

@@ -7,69 +7,84 @@ public class PaymentNode {
 
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.id
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	private Integer id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.tid
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	private Integer tid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.cid
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	private Integer cid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.company_name
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	private String companyName;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.project_type
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	private Integer projectType;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.dun_type
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	private Integer dunType;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.unit_price
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	private BigDecimal unitPrice;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.quantity
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	private Integer quantity;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.total_amount
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	private BigDecimal totalAmount;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.party_amount
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	private BigDecimal partyAmount;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.party_time
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	private Date partyTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.create_time
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	private Date createTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.dun_status
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
+	 */
+	private Integer dunStatus;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.effective_count
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
+	 */
+	private Integer effectiveCount;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column payment_node.start_time
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
+	 */
+	private Date startTime;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.id
 	 * @return  the value of payment_node.id
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public Integer getId() {
 		return id;
@@ -78,7 +93,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.id
 	 * @param id  the value for payment_node.id
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setId(Integer id) {
 		this.id = id;
@@ -87,7 +102,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.tid
 	 * @return  the value of payment_node.tid
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public Integer getTid() {
 		return tid;
@@ -96,7 +111,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.tid
 	 * @param tid  the value for payment_node.tid
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setTid(Integer tid) {
 		this.tid = tid;
@@ -105,7 +120,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.cid
 	 * @return  the value of payment_node.cid
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public Integer getCid() {
 		return cid;
@@ -114,7 +129,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.cid
 	 * @param cid  the value for payment_node.cid
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setCid(Integer cid) {
 		this.cid = cid;
@@ -123,7 +138,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.company_name
 	 * @return  the value of payment_node.company_name
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public String getCompanyName() {
 		return companyName;
@@ -132,7 +147,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.company_name
 	 * @param companyName  the value for payment_node.company_name
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setCompanyName(String companyName) {
 		this.companyName = companyName;
@@ -141,7 +156,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.project_type
 	 * @return  the value of payment_node.project_type
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public Integer getProjectType() {
 		return projectType;
@@ -150,7 +165,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.project_type
 	 * @param projectType  the value for payment_node.project_type
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setProjectType(Integer projectType) {
 		this.projectType = projectType;
@@ -159,7 +174,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.dun_type
 	 * @return  the value of payment_node.dun_type
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public Integer getDunType() {
 		return dunType;
@@ -168,7 +183,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.dun_type
 	 * @param dunType  the value for payment_node.dun_type
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setDunType(Integer dunType) {
 		this.dunType = dunType;
@@ -177,7 +192,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.unit_price
 	 * @return  the value of payment_node.unit_price
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public BigDecimal getUnitPrice() {
 		return unitPrice;
@@ -186,7 +201,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.unit_price
 	 * @param unitPrice  the value for payment_node.unit_price
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setUnitPrice(BigDecimal unitPrice) {
 		this.unitPrice = unitPrice;
@@ -195,7 +210,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.quantity
 	 * @return  the value of payment_node.quantity
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public Integer getQuantity() {
 		return quantity;
@@ -204,7 +219,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.quantity
 	 * @param quantity  the value for payment_node.quantity
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setQuantity(Integer quantity) {
 		this.quantity = quantity;
@@ -213,7 +228,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.total_amount
 	 * @return  the value of payment_node.total_amount
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public BigDecimal getTotalAmount() {
 		return totalAmount;
@@ -222,7 +237,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.total_amount
 	 * @param totalAmount  the value for payment_node.total_amount
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setTotalAmount(BigDecimal totalAmount) {
 		this.totalAmount = totalAmount;
@@ -231,7 +246,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.party_amount
 	 * @return  the value of payment_node.party_amount
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public BigDecimal getPartyAmount() {
 		return partyAmount;
@@ -240,7 +255,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.party_amount
 	 * @param partyAmount  the value for payment_node.party_amount
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setPartyAmount(BigDecimal partyAmount) {
 		this.partyAmount = partyAmount;
@@ -249,7 +264,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.party_time
 	 * @return  the value of payment_node.party_time
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public Date getPartyTime() {
 		return partyTime;
@@ -258,7 +273,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.party_time
 	 * @param partyTime  the value for payment_node.party_time
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setPartyTime(Date partyTime) {
 		this.partyTime = partyTime;
@@ -267,7 +282,7 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.create_time
 	 * @return  the value of payment_node.create_time
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public Date getCreateTime() {
 		return createTime;
@@ -276,9 +291,63 @@ public class PaymentNode {
 	/**
 	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.create_time
 	 * @param createTime  the value for payment_node.create_time
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
 	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.dun_status
+	 * @return  the value of payment_node.dun_status
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
+	 */
+	public Integer getDunStatus() {
+		return dunStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.dun_status
+	 * @param dunStatus  the value for payment_node.dun_status
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
+	 */
+	public void setDunStatus(Integer dunStatus) {
+		this.dunStatus = dunStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.effective_count
+	 * @return  the value of payment_node.effective_count
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
+	 */
+	public Integer getEffectiveCount() {
+		return effectiveCount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.effective_count
+	 * @param effectiveCount  the value for payment_node.effective_count
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
+	 */
+	public void setEffectiveCount(Integer effectiveCount) {
+		this.effectiveCount = effectiveCount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column payment_node.start_time
+	 * @return  the value of payment_node.start_time
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
+	 */
+	public Date getStartTime() {
+		return startTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column payment_node.start_time
+	 * @param startTime  the value for payment_node.start_time
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
+	 */
+	public void setStartTime(Date startTime) {
+		this.startTime = startTime;
+	}
 }

+ 196 - 16
src/main/java/com/goafanti/common/model/PaymentNodeExample.java

@@ -8,23 +8,23 @@ import java.util.List;
 public class PaymentNodeExample {
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	protected String orderByClause;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	protected boolean distinct;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	protected List<Criteria> oredCriteria;
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public PaymentNodeExample() {
 		oredCriteria = new ArrayList<Criteria>();
@@ -32,7 +32,7 @@ public class PaymentNodeExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setOrderByClause(String orderByClause) {
 		this.orderByClause = orderByClause;
@@ -40,7 +40,7 @@ public class PaymentNodeExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public String getOrderByClause() {
 		return orderByClause;
@@ -48,7 +48,7 @@ public class PaymentNodeExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void setDistinct(boolean distinct) {
 		this.distinct = distinct;
@@ -56,7 +56,7 @@ public class PaymentNodeExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public boolean isDistinct() {
 		return distinct;
@@ -64,7 +64,7 @@ public class PaymentNodeExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public List<Criteria> getOredCriteria() {
 		return oredCriteria;
@@ -72,7 +72,7 @@ public class PaymentNodeExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void or(Criteria criteria) {
 		oredCriteria.add(criteria);
@@ -80,7 +80,7 @@ public class PaymentNodeExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public Criteria or() {
 		Criteria criteria = createCriteriaInternal();
@@ -90,7 +90,7 @@ public class PaymentNodeExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public Criteria createCriteria() {
 		Criteria criteria = createCriteriaInternal();
@@ -102,7 +102,7 @@ public class PaymentNodeExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	protected Criteria createCriteriaInternal() {
 		Criteria criteria = new Criteria();
@@ -111,7 +111,7 @@ public class PaymentNodeExample {
 
 	/**
 	 * This method was generated by MyBatis Generator. This method corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public void clear() {
 		oredCriteria.clear();
@@ -121,7 +121,7 @@ public class PaymentNodeExample {
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	protected abstract static class GeneratedCriteria {
 		protected List<Criterion> criteria;
@@ -893,11 +893,191 @@ public class PaymentNodeExample {
 			addCriterion("create_time not between", value1, value2, "createTime");
 			return (Criteria) this;
 		}
+
+		public Criteria andDunStatusIsNull() {
+			addCriterion("dun_status is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andDunStatusIsNotNull() {
+			addCriterion("dun_status is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andDunStatusEqualTo(Integer value) {
+			addCriterion("dun_status =", value, "dunStatus");
+			return (Criteria) this;
+		}
+
+		public Criteria andDunStatusNotEqualTo(Integer value) {
+			addCriterion("dun_status <>", value, "dunStatus");
+			return (Criteria) this;
+		}
+
+		public Criteria andDunStatusGreaterThan(Integer value) {
+			addCriterion("dun_status >", value, "dunStatus");
+			return (Criteria) this;
+		}
+
+		public Criteria andDunStatusGreaterThanOrEqualTo(Integer value) {
+			addCriterion("dun_status >=", value, "dunStatus");
+			return (Criteria) this;
+		}
+
+		public Criteria andDunStatusLessThan(Integer value) {
+			addCriterion("dun_status <", value, "dunStatus");
+			return (Criteria) this;
+		}
+
+		public Criteria andDunStatusLessThanOrEqualTo(Integer value) {
+			addCriterion("dun_status <=", value, "dunStatus");
+			return (Criteria) this;
+		}
+
+		public Criteria andDunStatusIn(List<Integer> values) {
+			addCriterion("dun_status in", values, "dunStatus");
+			return (Criteria) this;
+		}
+
+		public Criteria andDunStatusNotIn(List<Integer> values) {
+			addCriterion("dun_status not in", values, "dunStatus");
+			return (Criteria) this;
+		}
+
+		public Criteria andDunStatusBetween(Integer value1, Integer value2) {
+			addCriterion("dun_status between", value1, value2, "dunStatus");
+			return (Criteria) this;
+		}
+
+		public Criteria andDunStatusNotBetween(Integer value1, Integer value2) {
+			addCriterion("dun_status not between", value1, value2, "dunStatus");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveCountIsNull() {
+			addCriterion("effective_count is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveCountIsNotNull() {
+			addCriterion("effective_count is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveCountEqualTo(Integer value) {
+			addCriterion("effective_count =", value, "effectiveCount");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveCountNotEqualTo(Integer value) {
+			addCriterion("effective_count <>", value, "effectiveCount");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveCountGreaterThan(Integer value) {
+			addCriterion("effective_count >", value, "effectiveCount");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveCountGreaterThanOrEqualTo(Integer value) {
+			addCriterion("effective_count >=", value, "effectiveCount");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveCountLessThan(Integer value) {
+			addCriterion("effective_count <", value, "effectiveCount");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveCountLessThanOrEqualTo(Integer value) {
+			addCriterion("effective_count <=", value, "effectiveCount");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveCountIn(List<Integer> values) {
+			addCriterion("effective_count in", values, "effectiveCount");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveCountNotIn(List<Integer> values) {
+			addCriterion("effective_count not in", values, "effectiveCount");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveCountBetween(Integer value1, Integer value2) {
+			addCriterion("effective_count between", value1, value2, "effectiveCount");
+			return (Criteria) this;
+		}
+
+		public Criteria andEffectiveCountNotBetween(Integer value1, Integer value2) {
+			addCriterion("effective_count not between", value1, value2, "effectiveCount");
+			return (Criteria) this;
+		}
+
+		public Criteria andStartTimeIsNull() {
+			addCriterion("start_time is null");
+			return (Criteria) this;
+		}
+
+		public Criteria andStartTimeIsNotNull() {
+			addCriterion("start_time is not null");
+			return (Criteria) this;
+		}
+
+		public Criteria andStartTimeEqualTo(Date value) {
+			addCriterion("start_time =", value, "startTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andStartTimeNotEqualTo(Date value) {
+			addCriterion("start_time <>", value, "startTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andStartTimeGreaterThan(Date value) {
+			addCriterion("start_time >", value, "startTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andStartTimeGreaterThanOrEqualTo(Date value) {
+			addCriterion("start_time >=", value, "startTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andStartTimeLessThan(Date value) {
+			addCriterion("start_time <", value, "startTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andStartTimeLessThanOrEqualTo(Date value) {
+			addCriterion("start_time <=", value, "startTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andStartTimeIn(List<Date> values) {
+			addCriterion("start_time in", values, "startTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andStartTimeNotIn(List<Date> values) {
+			addCriterion("start_time not in", values, "startTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andStartTimeBetween(Date value1, Date value2) {
+			addCriterion("start_time between", value1, value2, "startTime");
+			return (Criteria) this;
+		}
+
+		public Criteria andStartTimeNotBetween(Date value1, Date value2) {
+			addCriterion("start_time not between", value1, value2, "startTime");
+			return (Criteria) this;
+		}
 	}
 
 	/**
 	 * This class was generated by MyBatis Generator. This class corresponds to the database table payment_node
-	 * @mbg.generated  Fri Jun 12 13:55:18 CST 2020
+	 * @mbg.generated  Mon Jun 15 11:31:47 CST 2020
 	 */
 	public static class Criterion {
 		private String condition;

+ 68 - 33
src/main/java/com/goafanti/common/task/OrderDunTask.java

@@ -23,34 +23,34 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.ResponseBody;
 
-import com.goafanti.admin.bo.AdminListBo;
 import com.goafanti.common.bo.EmailBo;
+import com.goafanti.common.bo.paymentNodeEmailBo;
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.NoticeMapper;
-import com.goafanti.common.dao.OutsourceLogMapper;
 import com.goafanti.common.dao.PaymentNodeMapper;
 import com.goafanti.common.dao.TArrearsDunMapper;
 import com.goafanti.common.dao.TOrderMidMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.model.Notice;
+import com.goafanti.common.model.PaymentNode;
 import com.goafanti.common.model.TArrearsDun;
 import com.goafanti.common.model.TOrderDun;
 import com.goafanti.common.model.TOrderMid;
 import com.goafanti.common.model.TOrderNew;
-import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.SendEmailUtil;
-import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.InputNewOrderDunBo;
 import com.goafanti.order.bo.OrderDunTaskBo;
 import com.goafanti.order.bo.OutNewOrderDunBo;
 import com.goafanti.order.bo.TOrderNewBo;
+import com.goafanti.order.enums.NewOrderDunType;
 import com.goafanti.order.enums.OrderDunProjectType;
-import com.goafanti.order.enums.OrderDunSubject;
 import com.goafanti.order.service.NewOrderDunService;
 import com.goafanti.order.service.OrderNewService;
+import com.goafanti.order.service.OrderProjectService;
+import com.goafanti.order.service.impl.OrderProjectServiceImpl;
+import com.goafanti.organization.bo.OutPaymentNode;
 
 @Component
 @Controller
@@ -69,16 +69,18 @@ public class OrderDunTask {
 	private NoticeMapper	noticeMapper;
 	@Autowired
 	private PaymentNodeMapper	paymentNodeMapper;
+	@Autowired
+	private OrderProjectService	orderProjectService;
 	Logger							logger	= LoggerFactory.getLogger(OrderDunTask.class);
 	
 	
 	
 	/**
-	 * 每天凌晨3点轮询处理需要新催款的信息
+	 * 每天凌晨2点轮询处理需要新催款的信息
 	 */
 	@RequestMapping(value = "/open/updateNewOrderDun", method = RequestMethod.GET)
 	@ResponseBody
-	@Scheduled(cron = "0 0 3  * * ?")
+	@Scheduled(cron = "0 0 2  * * ?")
 	@Transactional(rollbackFor=Exception.class)
 	public void updateNewOrderDun(){
   		try {
@@ -88,6 +90,7 @@ public class OrderDunTask {
   		Calendar calendar=Calendar.getInstance();   
   		calendar.setTime(new Date()); 
   		Calendar calendar2=Calendar.getInstance();   
+  		
   		for (OutNewOrderDunBo o : list) {
   			calendar2.setTime(o.getCreateTime());
   			if (o!=null&&o.getApproval()!=null&&o.getApproval()!=0&&o.getDunType()==1&&o.getWaitDay()!=null) {
@@ -106,7 +109,7 @@ public class OrderDunTask {
   				}
   			}
   			if(o.getProjectType()==OrderDunProjectType.CS.getCode()&&o.getDunType()==2) {
-  				//获取年
+  			//获取年
   				int year = calendar2.get(Calendar.YEAR);  
   		        //获取月份,0表示1月份
   		        int month = calendar2.get(Calendar.MONTH) + 1;
@@ -129,8 +132,42 @@ public class OrderDunTask {
 				
 			}
 		}
-  		LoggerUtils.debug(logger, "======================新催款任务轮询结束===================");
-//  		paymentNodeMapper.selectByStatus(0);
+  		LoggerUtils.debug(logger, "======================催款任务结束,付款催款开始===================");
+  		List<OutPaymentNode> list2=paymentNodeMapper.selectByStatus(0);
+  		for (OutPaymentNode pn : list2) {
+  			calendar2.setTime(pn.getCreateTime());
+  			if(pn.getProjectType()==OrderDunProjectType.HY.getCode()&&pn.getDunType()==2) {
+  				calendar2.add(Calendar.DATE, pn.getEffectiveCount()*180);
+  				CalendarTimeCleared(calendar2);
+  				if (calendar.getTimeInMillis() > calendar2.getTimeInMillis()) {//当前时间大于计算后时间则触发
+  					updatePaymentNode(pn);
+  	  	  			Thread.sleep(2000);
+  				}
+  			}
+  			if(pn.getProjectType()==OrderDunProjectType.CS.getCode()&&pn.getDunType()==2) {
+  				//	获取年
+  				int year = calendar2.get(Calendar.YEAR);  
+  		        //获取月份,0表示1月份
+  		        int month = calendar2.get(Calendar.MONTH) + 1;
+  		        if(month<10)year=year+1;
+  		        if(month>9)year=year+2;
+  		        calendar2.set(year, 5, 1);
+  		        CalendarTimeCleared(calendar2);
+  				if (calendar.getTimeInMillis() > calendar2.getTimeInMillis()) {//当前时间大于计算后时间则触发
+  					updatePaymentNode(pn);
+  	  	  			Thread.sleep(2000);
+  				}
+  			}
+  	  		if (pn.getDunType()==0) {
+  	  		calendar2.setTime(pn.getPartyTime());
+  	  		CalendarTimeCleared(calendar);
+  	  			if (calendar.equals(calendar2)) {
+  	  				updatePaymentNode(pn);
+	  	  			Thread.sleep(2000);
+				}
+				
+			}
+		}
   		} catch (Exception e) {
   			EmailBo emailBo = new EmailBo( "催款处理失败",  AFTConstants.ADMIN_EMAIL,  "超管", "平台",  "系统", "催款处理失败");
 			try {
@@ -142,10 +179,25 @@ public class OrderDunTask {
 			LoggerUtils.error(getClass(), "新催款的信息处理失败", e);
 			LoggerUtils.error(getClass(), "=============================================");
 		}
+  	
+  		//处理旧催款
+  		updateorderDun();
   		
   	}
 	
 	
+	private void updatePaymentNode(OutPaymentNode pn) {
+		PaymentNode p=new PaymentNode();
+		p.setId(pn.getId());
+		p.setDunStatus(1);
+		p.setStartTime(new Date());
+		paymentNodeMapper.updateByPrimaryKeySelective(p);
+		orderProjectService.addNoticAndEmail(pn,NoticeStatus.PAYMENT_DUN.getCode());
+	}
+	
+	
+
+
 	private void CalendarTimeCleared(Calendar calendar) {
 		calendar.set(Calendar.HOUR_OF_DAY, 0);
 	    calendar.set(Calendar.MINUTE, 0);
@@ -241,7 +293,7 @@ public class OrderDunTask {
 			
 			}
 		} catch (Exception e) {
-			LoggerUtils.error(getClass(), "===========================欠款催款失败==========================", e);
+			LoggerUtils.error(getClass(), "===========================欠款催款失败==========================", e);
 		}
 	}
 	
@@ -256,33 +308,17 @@ public class OrderDunTask {
 			n.setContent(str);
 			n.setReaded(0);//未读
 			noticeMapper.insertSelective(n);
-	/*		LoggerUtils.debug(logger, "======================邮件信息发送===================");
-			String content = "<div>客户名称: "+ b.getUserName() +"</div><div>订单编号: " + orderNo + "</div>";
-			String tite="催收通知";
-					content +="<div>催收时间: " +  new Date() +
-							"</div><div>催收科目:  欠款催收" +
-							"</div><div>催收情况:  已启动" +"</div>";
-				//发送驳回邮件
-				EmailBo bo = new EmailBo(tite, b.getEmail(), "平台超管中心", "管理员", content,orderNo,
-						DateUtils.formatDate(td.getStartTime(), AFTConstants.YYYYMMDDHHMMSS),"欠款催收",b.getSalesmanName(),b.getUserName(), 1,null);
-				if(StringUtils.isNotBlank(b.getEmail())) {
-					SendEmailUtil.getInstance().patentSend(bo);
-				}
-				LoggerUtils.debug(logger, "=========================================发送邮件成功");*/
-		
 	}
 
 
 	/**
-	 * 每天凌晨2点轮询处理需要催款的信息
+	*
 	*
 	*/
-//	@RequestMapping(value = "/open/updateOrderDun", method = RequestMethod.GET)
-	@Scheduled(cron = "0 0 2  * * ?") 
-  	@Transactional(rollbackFor=Exception.class)
+	@RequestMapping(value = "/open/updateOrderDun", method = RequestMethod.GET)
 	public void updateorderDun(){
   		try {
-  			LoggerUtils.debug(logger, "======================催款任务轮询启动===================");
+  			LoggerUtils.debug(logger, "======================旧催款任务轮询启动===================");
   		List<OrderDunTaskBo> list=orderNewService.selectAllOrderDun();
   		for (OrderDunTaskBo t : list) {
 			if (t.getDunSubject()/10==1) {//1则为订单催款信息否则为项目催款信息
@@ -297,10 +333,9 @@ public class OrderDunTask {
 				}
 			}
 		}
-  		LoggerUtils.debug(logger, "======================催款任务轮询结束===================");
   		} catch (Exception e) {
   			LoggerUtils.error(getClass(), "=============================================");
-			LoggerUtils.error(getClass(), "催款的信息处理失败", e);
+			LoggerUtils.error(getClass(), "催款的信息处理失败", e);
 			LoggerUtils.error(getClass(), "=============================================");
 		}
   		

+ 3 - 0
src/main/java/com/goafanti/order/service/OrderProjectService.java

@@ -13,6 +13,7 @@ import com.goafanti.order.bo.TOrderTaskListBo;
 import com.goafanti.order.bo.TaskLogBo;
 import com.goafanti.order.bo.TaskProgressBo;
 import com.goafanti.order.bo.inuptTaskHoursListBo;
+import com.goafanti.organization.bo.OutPaymentNode;
 
 public interface OrderProjectService {
 
@@ -52,4 +53,6 @@ public interface OrderProjectService {
 	int pushSplitProject(Integer tid, String splitList);
 
 	List<TOrderTaskListBo> splitProjectList(Integer tid);
+
+	void addNoticAndEmail(OutPaymentNode pn, Integer code);
 }

+ 24 - 0
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -16,6 +16,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
+import javax.annotation.Resource;
 import javax.mail.MessagingException;
 import javax.servlet.http.HttpServletResponse;
 import org.apache.commons.lang3.StringUtils;
@@ -44,6 +45,7 @@ import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.OrganizationManagementMapper;
 import com.goafanti.common.dao.OutsourceLogMapper;
+import com.goafanti.common.dao.PaymentNodeMapper;
 import com.goafanti.common.dao.TArrearsDunMapper;
 import com.goafanti.common.dao.TDunLogMapper;
 import com.goafanti.common.dao.TOrderBackMapper;
@@ -67,6 +69,7 @@ import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.OrganizationManagement;
 import com.goafanti.common.model.OutsourceLog;
+import com.goafanti.common.model.PaymentNode;
 import com.goafanti.common.model.TArrearsDun;
 import com.goafanti.common.model.TDunLog;
 import com.goafanti.common.model.TOrderBack;
@@ -113,6 +116,8 @@ import com.goafanti.order.enums.refundState;
 import com.goafanti.order.service.OrderNewService;
 import com.goafanti.order.service.OrderService;
 import com.goafanti.organization.bo.OrganizationListOut;
+import com.goafanti.organization.bo.OutPaymentNode;
+import com.goafanti.order.service.OrderProjectService;
 
 @Service
 @EnableAsync
@@ -161,6 +166,10 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	private UserMapper	userMapper;
 	@Autowired
 	private OutsourceLogMapper	outsourceLogMapper;
+	@Autowired
+	private PaymentNodeMapper	paymentNodeMapper;
+	@Autowired
+	private OrderProjectService	orderProjectService;
 	@Value(value = "${mobileRemindCodeTemplate}")
 	private String					mobileRemindCodeTemplate	= null;
 	@Value(value = "${upload.path}")
@@ -1287,6 +1296,21 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			outsourceLogMapper.insertSelective(ol);
 			pushGeneralSendNoticeAndEmail(aids, NoticeStatus.PROJECT_OUTSOURCE_START.getCode(),o.getOrderNo(), TokenManager.getAdminId(),t2.getApproval());
 		}
+		List<OutPaymentNode> list=paymentNodeMapper.selectByStatus(0);
+		for (OutPaymentNode outPaymentNode : list) {
+			if (outPaymentNode.getDunType()==1) {
+				PaymentNode pn=new PaymentNode();
+				pn.setId(outPaymentNode.getId());
+				pn.setDunStatus(1);
+				paymentNodeMapper.updateByPrimaryKey(pn);
+				orderProjectService.addNoticAndEmail(outPaymentNode, NoticeStatus.PAYMENT_DUN.getCode());
+				try {
+					Thread.sleep(2000);
+				} catch (InterruptedException e) {
+					e.printStackTrace();
+				}
+			}
+		}
 		if (o.getId()!=null) {
 			tOrderOutsourceMapper.updateByPrimaryKeySelective(o);
 		}else {

+ 94 - 5
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -2,6 +2,7 @@ package com.goafanti.order.service.impl;
 
 import java.io.IOException;
 import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -12,6 +13,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
+import javax.mail.MessagingException;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
@@ -19,19 +21,25 @@ import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.apache.poi.xssf.usermodel.XSSFRow;
 import org.apache.poi.xssf.usermodel.XSSFSheet;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import com.goafanti.common.bo.EmailBo;
 import com.goafanti.common.bo.Error;
+import com.goafanti.common.bo.paymentNodeEmailBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.BusinessProjectMapper;
 import com.goafanti.common.dao.NewOrderDunMapper;
+import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
+import com.goafanti.common.dao.PaymentNodeMapper;
 import com.goafanti.common.dao.TArrearsDunMapper;
 import com.goafanti.common.dao.TOrderBonusMapper;
 import com.goafanti.common.dao.TOrderLogMapper;
@@ -48,6 +56,7 @@ import com.goafanti.common.enums.OrderLogProcess;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.BusinessProject;
+import com.goafanti.common.model.Notice;
 import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.OrganizationIdentity;
 import com.goafanti.common.model.TArrearsDun;
@@ -61,8 +70,11 @@ import com.goafanti.common.model.TTaskLog;
 import com.goafanti.common.model.TaskHoursCount;
 import com.goafanti.common.model.TaskLog;
 import com.goafanti.common.model.TaskProgress;
+import com.goafanti.common.task.OrderDunTask;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.ExportExcelUtil;
+import com.goafanti.common.utils.LoggerUtils;
+import com.goafanti.common.utils.SendEmailUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -74,12 +86,14 @@ import com.goafanti.order.bo.TaskLogBo;
 import com.goafanti.order.bo.TaskProgressBo;
 import com.goafanti.order.bo.inuptTaskHoursListBo;
 import com.goafanti.order.enums.BonusSubject;
+import com.goafanti.order.enums.NewOrderDunType;
 import com.goafanti.order.enums.OrderDunProjectType;
 import com.goafanti.order.enums.OrderProjectStatus;
 import com.goafanti.order.enums.ProcessStatus;
 import com.goafanti.order.enums.ProjectNewStage;
 import com.goafanti.order.service.OrderNewService;
 import com.goafanti.order.service.OrderProjectService;
+import com.goafanti.organization.bo.OutPaymentNode;
 import com.goafanti.techproject.enums.TaskState;
 @Service
 public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> implements OrderProjectService {
@@ -117,9 +131,14 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	private TOrderMidMapper	tOrderMidMapper;
 	@Autowired
 	private TArrearsDunMapper	tArrearsDunMapper;
+	@Autowired
+	private PaymentNodeMapper	paymentNodeMapper;
+	@Autowired
+	private NoticeMapper	noticeMapper;
 	@Value(value = "${upload.path}")
 	private String 					uploadPath 			= null;
 	
+	Logger							logger	= LoggerFactory.getLogger(OrderProjectServiceImpl.class);
 	
 	@Override
 	public int updateProjectDistribution(Integer taskId, String taskReceiverId,Integer specially,String remarks) {
@@ -361,7 +380,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		}
 		//项目触发发催款
 		if (task2.getSplitStatus()==0) {
-			pushOrderDun(t,task2);
+			pushOrderDunAndPaymentNode(t,task2);
 		}else if (task2.getSplitStatus()==2){
 			//查出父项目
 			List<TOrderTaskListBo> list=tOrderTaskMapper.splitProjectList(task2.getSplitSuper());
@@ -380,7 +399,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			t2.setOrderNo(t.getOrderNo());
 			t2.setId(task2.getSplitSuper().toString());
 			t2.setProjectStatus(task3.getProjectStatus());
-			pushOrderDun(t2,task3);
+			pushOrderDunAndPaymentNode(t2,task3);
 		}
 		
 		if (task2.getSuperId()!=null) {//是否有父项目
@@ -396,7 +415,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		return 1;
 	}
 
-	private void pushOrderDun(TOrderTaskDetailBo t,TOrderTask task2) {
+	private void pushOrderDunAndPaymentNode(TOrderTaskDetailBo t,TOrderTask task2) {
 		List<OutNewOrderDunBo> list=newOrderDunMapper.selectByTid(t.getId());
 		for (OutNewOrderDunBo ob : list) {
 			if (ob!=null) {
@@ -458,9 +477,79 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 				}
 			}
 		}
-		
-		
+		List<OutPaymentNode> list2=paymentNodeMapper.selectByTid(Integer.parseInt(t.getId()),0);
+		for (OutPaymentNode op : list2) {
+			if (op!=null) {
+				boolean flag=false;
+				if((op.getProjectType()==OrderDunProjectType.CGZH.getCode()&&op.getDunType()==2&&//成果转化 验收
+						t.getProjectStatus()==OrderProjectStatus.XMYS.getCode()))flag=true;
+				if((op.getProjectType()==OrderDunProjectType.COMMON.getCode()&&op.getDunType()==2&&//通用 公示
+						t.getProjectStatus()==OrderProjectStatus.XMGS.getCode()))flag=true;
+				if((op.getProjectType()==OrderDunProjectType.COMMON.getCode()&&op.getDunType()==3&&//通用 下证
+						t.getProjectStatus()==OrderProjectStatus.XMXZ.getCode()))flag=true;
+				if((op.getProjectType()==OrderDunProjectType.KJXM.getCode()&&op.getDunType()==2&&//科技项目 立项或者公示
+						(t.getProjectStatus()==OrderProjectStatus.XMLX.getCode()||(t.getProjectStatus()==OrderProjectStatus.XMGS.getCode()))))flag=true;
+				if((op.getProjectType()==OrderDunProjectType.KJXM.getCode()&&op.getDunType()==3&&//科技项目 拨款
+						t.getProjectStatus()==OrderProjectStatus.XMBK.getCode()))flag=true;
+				if((op.getProjectType()==OrderDunProjectType.KJJR.getCode()&&op.getDunType()==2&&//科技金融 拨款
+						t.getProjectStatus()==OrderProjectStatus.XMBK.getCode()))flag=true;
+				if((op.getProjectType()==OrderDunProjectType.RJKF.getCode()&&op.getDunType()==2&&//软件开发 立项
+						t.getProjectStatus()==OrderProjectStatus.XMLX.getCode()))flag=true;
+				if((op.getProjectType()==OrderDunProjectType.RJKF.getCode()&&op.getDunType()==3&&//软件开发 验收
+						t.getProjectStatus()==OrderProjectStatus.XMYS.getCode()))flag=true;
+				if(op.getProjectType()==OrderDunProjectType.ZSCQ.getCode()){//知识产权 公示 专利受理、转让(项目已提交),软著下证
+					if(op.getDunType()==3&&t.getProjectStatus()==OrderProjectStatus.XMXZ.getCode()) {
+						flag=true;
+					}else if (op.getDunType()==2) {
+						BusinessProject bp=businessProjectMapper.selectByPrimaryKey(task2.getCommodityId());
+						if (bp.getType()==0&&t.getProjectStatus()==OrderProjectStatus.XMGS.getCode()) {
+							flag=true;
+						}
+						if (bp.getType()==1&&t.getProjectStatus()==OrderProjectStatus.XMYTJ.getCode()) {
+							flag=true;
+						}
+						if (bp.getType()==2&&t.getProjectStatus()==OrderProjectStatus.XMXZ.getCode()) {
+							flag=true;
+						}
+						
+					}
+				} 
+					if(flag)addNoticAndEmail( op,NoticeStatus.PAYMENT_DUN.getCode());
+			}
+		}
+	}
+	
+	
+	public void addNoticAndEmail(OutPaymentNode pn,Integer type) {
+		paymentNodeEmailBo pnb=paymentNodeMapper.selectBytidGetEmail(pn.getTid());
+		String str=NoticeStatus.getValueByCode(type)+": 订单编号 -"+pnb.getOrderNo()+", 操作人:平台超管中心-管理员。";
+		Notice n =new Notice();
+		n.setId(UUID.randomUUID().toString());
+		n.setAid(pnb.getSalesmanId());
+		n.setNoticeType(type);
+		n.setContent(str);
+		n.setReaded(0);//未读
+		noticeMapper.insertSelective(n);
+		pn.setDunStatus(1);
+		paymentNodeMapper.updateByPrimaryKeySelective(pn);
+		//营销员名称、邮箱、订单编号、客户名称
+		String dunTypeName=NewOrderDunType.getValueByCode(Integer.valueOf(""+pn.getProjectType()+pn.getDunType()));
+			//发送驳回邮件
+		if(SendEmailUtil.isEmail(pnb.getEmail())) {
+	    	 EmailBo bo = new EmailBo("付款通知", pnb.getEmail(), "平台超管中心", "管理员",
+						"", pnb.getOrderNo(),pn.getPartyTimes(),
+						dunTypeName,pnb.getSalesmanName(),pnb.getUserName(),2,0);
+				if(StringUtils.isNotBlank(pnb.getEmail())) {
+					try {
+						SendEmailUtil.getInstance().patentSend(bo);
+					} catch (UnsupportedEncodingException | MessagingException e) {
+						LoggerUtils.debug(logger, "=========================================发送邮件异常"); 
+						e.printStackTrace();
+					}
+				}
+	     }
 	}
+	
 	private void checkSettlementAward(TOrderNew tn,TOrderTask task) {
 		if(task.getTaskStatus()==TaskState.COMPLETE.getCode()&&tn.getTotalAmount().compareTo(tn.getSettlementAmount())==0) {
 			List<TOrderTask> l = tOrderTaskMapper.getReceiverByOid(tn.getOrderNo());

+ 23 - 0
src/main/java/com/goafanti/organization/controller/ThirdPartyCompanyApiController.java

@@ -50,6 +50,17 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 		return res;
 	}
 	
+	@RequestMapping(value = "/deleteCompany" , method = RequestMethod.POST)
+	public Result deleteCompany(Integer id) {
+		Result res =new Result();
+		if (null==id) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"编号","编号"));
+			return res;
+		}
+		res.data(thirdPartyCompanyService.deleteCompany(id));
+		return res;
+	}
+	
 	@RequestMapping(value = "/selectCompany" , method = RequestMethod.GET)
 	public Result selectCompany(Integer tid) {
 		Result res =new Result();
@@ -84,6 +95,18 @@ public class ThirdPartyCompanyApiController extends BaseApiController{
 		return res;
 	}
 	
+
+	@RequestMapping(value = "/deletePaymentNode" , method = RequestMethod.POST)
+	public Result deletePaymentNode(Integer id) {
+		Result res =new Result();
+		if (null==id) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"编号","编号"));
+			return res;
+		}
+		res.data(thirdPartyCompanyService.deletePaymentNode(id));
+		return res;
+	}
+	
 	@RequestMapping(value = "/updatePaymentNode" , method = RequestMethod.POST)
 	public Result updatePaymentNode(InputPaymentNode p) {
 		Result res =new Result();

+ 4 - 0
src/main/java/com/goafanti/organization/service/ThirdPartyCompanyService.java

@@ -25,4 +25,8 @@ public interface ThirdPartyCompanyService {
 
 	List<OutPaymentNode> selectPaymentNode(Integer tid);
 
+	int deleteCompany(Integer id);
+
+	int deletePaymentNode(Integer id);
+
 }

+ 13 - 1
src/main/java/com/goafanti/organization/service/impl/ThirdPartyCompanyServiceImpl.java

@@ -94,7 +94,19 @@ public class ThirdPartyCompanyServiceImpl extends  BaseMybatisDao<ThirdPartyComp
 
 	@Override
 	public List<OutPaymentNode> selectPaymentNode(Integer tid) {
-		return paymentNodeMapper.selectByTid(tid);
+		return paymentNodeMapper.selectByTid(tid,null);
+	}
+
+
+	@Override
+	public int deleteCompany(Integer id) {
+		return companyLibraryMapper.deleteByPrimaryKey(id);
+	}
+
+
+	@Override
+	public int deletePaymentNode(Integer id) {
+		return paymentNodeMapper.deleteByPrimaryKey(id);
 	}