ソースを参照

Merge branch 'test' of jishutao/kede-server into prod

anderx 4 年 前
コミット
607c948907
共有20 個のファイルを変更した258 個の追加119 個の削除を含む
  1. 6 2
      src/main/java/com/goafanti/admin/service/impl/NoticeServiceImpl.java
  2. 8 8
      src/main/java/com/goafanti/common/mapper/NewOrderChangeMapper.xml
  3. 3 3
      src/main/java/com/goafanti/common/mapper/PatentNewMapper.xml
  4. 9 3
      src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml
  5. 79 68
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  6. 8 2
      src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml
  7. 13 0
      src/main/java/com/goafanti/common/model/TOrderNew.java
  8. 21 18
      src/main/java/com/goafanti/common/task/PatentTask.java
  9. 3 2
      src/main/java/com/goafanti/common/utils/AsyncUtils.java
  10. 24 5
      src/main/java/com/goafanti/order/bo/OutArrearsDunListBo.java
  11. 10 0
      src/main/java/com/goafanti/order/bo/inuptTaskListBo.java
  12. 10 0
      src/main/java/com/goafanti/order/bo/outOrderDunListBo.java
  13. 1 0
      src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java
  14. 1 1
      src/main/java/com/goafanti/patent/service/PatentNewService.java
  15. 37 5
      src/main/java/com/goafanti/patent/service/impl/PatentNewServiceImpl.java
  16. 12 0
      src/main/java/com/goafanti/weChat/bo/InputPublicDtails.java
  17. 10 0
      src/main/java/com/goafanti/weChat/bo/OutPublicDtails.java
  18. 1 0
      src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java
  19. 1 1
      src/main/resources/props/config_local.properties
  20. 1 1
      src/main/resources/props/config_test.properties

+ 6 - 2
src/main/java/com/goafanti/admin/service/impl/NoticeServiceImpl.java

@@ -5,6 +5,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import com.goafanti.common.utils.AsyncUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -20,6 +21,9 @@ import com.goafanti.core.shiro.token.TokenManager;
 public class NoticeServiceImpl extends BaseMybatisDao<NoticeMapper> implements NoticeService {
 	@Autowired
 	private NoticeMapper noticeMapper;
+	@Autowired
+	private AsyncUtils asyncUtils;
+
 
 	@Override
 	public List<Map<String, Object>> updateListUnreadNoticeByAid() {
@@ -58,7 +62,7 @@ public class NoticeServiceImpl extends BaseMybatisDao<NoticeMapper> implements N
 				// 添加已读
 				dl.add(n.getId());
 			}
-			noticeMapper.batchUpdateUnreaded(dl);
+			asyncUtils.batchUpdateUnreaded(dl);
 		}
 		return list;
 	}
@@ -87,7 +91,7 @@ public class NoticeServiceImpl extends BaseMybatisDao<NoticeMapper> implements N
 				// 添加已读
 				dl.add(n.getId());
 			}
-			noticeMapper.batchUpdateUnreaded(dl);
+			asyncUtils.batchUpdateUnreaded(dl);
 		}
 		return nl;
 	}

+ 8 - 8
src/main/java/com/goafanti/common/mapper/NewOrderChangeMapper.xml

@@ -537,10 +537,10 @@ select
 	 and (a.process_state in(5,9)  and a.status !=4)
 	</if>
 	<if test="complete ==1 and processState == 7">
-	 and (a.process_state = 7  and  a.status != 4 and a.status !=2)
+	 and (a.process_state = 7  and  a.status =1)
 	</if>
 	<if test="complete ==1 and processState == 8">
-	 and a.process_state = #{processState}  and a.status != 4 and a.status !=2
+	 and (a.process_state = #{processState}  a.status =1)
 	</if>
 	<if test="complete ==2 and processState != 5 and processState != 7 and processState != 8">
 	 and a.process_state &gt; #{processState}
@@ -649,12 +649,12 @@ select
 	<if test="complete ==1 and processState == 5">
 	 and (a.process_state in(5,9)  and a.status !=4)
 	</if>
-	<if test="complete ==1 and processState == 7">
-	 and (a.process_state = 7  and  a.status != 4 and a.status !=2)
-	</if>
-	<if test="complete ==1 and processState == 8">
-	 and a.process_state = #{processState}  and a.status != 4 and a.status !=2
-	</if>
+    <if test="complete ==1 and processState == 7">
+      and (a.process_state = 7  and  a.status =1)
+    </if>
+    <if test="complete ==1 and processState == 8">
+      and (a.process_state = #{processState}  a.status =1)
+    </if>
 	<if test="complete ==2 and processState != 5 and processState != 7 and processState != 8">
 	 and a.process_state &gt; #{processState}
 	</if>

+ 3 - 3
src/main/java/com/goafanti/common/mapper/PatentNewMapper.xml

@@ -555,10 +555,10 @@
 
 	<select id="AllselectStartPatentNew" resultType="com.goafanti.patent.bo.PatentNewBo">
 		select
-		a.id,a.patent_no patentNo,a.name ,a.aid ,a.email ,a.end_date endDate,a.status
-		,c.buyer_name userName,a.salesman_remind salesmanRemind
+			a.id,a.patent_no patentNo,a.name ,a.aid ,a.email ,a.end_date endDate,a.status
+			 ,c.buyer_name userName,a.salesman_remind salesmanRemind
 		from patent_new 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
+			 t_order_mid c on b.order_no=c.order_no where a.status &lt; 6
 	</select>
 	<select id="AllselectEndPatentNew" resultMap="BaseResultMap">
 		select

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

@@ -478,7 +478,7 @@
   	select y.aid,y.bh,y.dk,y.wsh,y.tg,y.duration,c.name from(select x.aid ,sum(x.bh)bh,sum(x.wsh)wsh,sum(x.tg)tg,sum(x.dk)dk,sum(x.duration)duration
 	from (select if(a.status=0,1,0)bh ,if(a.status=1,1,0)wsh,if(a.status=2,1,0)tg,if(a.clock_in=1,1,0) dk,a.aid
   	,if(a.status=2,a.duration,0)duration    from  public_release a  left join admin b on a.aid=b.id
-	where a.type=0
+	where 1=1
 	<if test="aid != null">
 	and a.aid= #{aid}
 	</if>
@@ -500,7 +500,7 @@
 
   <select id="countPublicStatistics" resultType="java.lang.Integer">
   	select count(*) from (select aid from public_release a  left join admin b on a.aid=b.id
-	where a.type=0
+	where 1=1
 	<if test="aid != null">
 	and a.aid= #{aid}
 	</if>
@@ -518,12 +518,15 @@
 
   <select id="listPublicDtails" resultType="com.goafanti.weChat.bo.OutPublicDtails">
     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.clock_in_time ,'%Y-%m-%d %H:%i:%S') clockInTimes,a.clock_in clockIn,a.remarks,a.supplement,a.type,
     date_format(a.create_time ,'%Y-%m-%d %H:%i:%S') createTimes,a.audit_info auditInfo,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,
     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="publicType != null">
+      and a.type= #{publicType}
+    </if>
     <if test="aid != null">
       and a.aid= #{aid}
     </if>
@@ -562,6 +565,9 @@
 	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="publicType != null">
+      and a.type= #{publicType}
+    </if>
     <if test="aid != null">
       and a.aid= #{aid}
     </if>

+ 79 - 68
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -2,11 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.goafanti.common.dao.TOrderNewMapper">
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrderNew">
-    <!--
-      WARNING - @mbg.generated
-      This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Fri May 15 10:33:54 CST 2020.
-    -->
     <id column="order_no" jdbcType="VARCHAR" property="orderNo" />
     <result column="order_type" jdbcType="INTEGER" property="orderType" />
     <result column="creater" jdbcType="VARCHAR" property="creater" />
@@ -48,19 +43,19 @@
     <result column="back_status" jdbcType="INTEGER" property="backStatus" />
     <result column="agreement_url" jdbcType="VARCHAR" property="agreementUrl" />
     <result column="new_user" jdbcType="INTEGER" property="newUser" />
+    <result column="service_content" jdbcType="VARCHAR" property="serviceContent" />
   </resultMap>
   <sql id="Base_Column_List">
     order_no, order_type, creater, create_time, update_time, buyer_id, first_amount, 
     total_amount, settlement_amount, refund_amount, order_status, liquidation_status, 
     process_status, project_status, approval, order_remarks, delete_sign, salesman_id, 
-    finance_id, technician_id, sign_time, settlement_time, contract_no, contract_type,
-    contacts, contact_mobile, legal_person, legal_person_tel, proof_count, proof_aid,
-    proof_time, proof_status, order_dep, outsource, additional_order, primary_order,
-    old_salesman_id, back_status
+    finance_id, technician_id, sign_time, settlement_time, contract_picture_url, contract_no, 
+    contract_type, contacts, contact_mobile, legal_person, legal_person_tel, proof_count, 
+    proof_aid, proof_time, proof_status, order_dep, outsource, additional_order, primary_order, 
+    old_salesman_id, back_status, agreement_url, new_user, service_content
   </sql>
-
   <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
-    select
+    select 
     <include refid="Base_Column_List" />
     from t_order_new
     where order_no = #{orderNo,jdbcType=VARCHAR}
@@ -69,37 +64,39 @@
     delete from t_order_new
     where order_no = #{orderNo,jdbcType=VARCHAR}
   </delete>
-  <insert id="insert" keyColumn="order_no" keyProperty="orderNo" parameterType="com.goafanti.common.model.TOrderNew" useGeneratedKeys="true">
-    insert into t_order_new (order_type, creater, create_time,
-      update_time, buyer_id, first_amount,
-      total_amount, settlement_amount, refund_amount,
-      order_status, liquidation_status, process_status,
-      project_status, approval, order_remarks,
-      delete_sign, salesman_id, finance_id,
-      technician_id, sign_time, settlement_time,
-      contract_picture_url, contract_no, contract_type,
-      contacts, contact_mobile, legal_person, 
-      legal_person_tel, proof_count, proof_aid, 
-      proof_time, proof_status, order_dep, 
-      outsource, additional_order, primary_order, 
-      old_salesman_id, back_status, contract_picture_url,
-      agreement_url)
-    values (#{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR},
-      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR},
-      #{firstAmount,jdbcType=DECIMAL}, #{totalAmount,jdbcType=DECIMAL}, #{settlementAmount,jdbcType=DECIMAL},
-      #{refundAmount,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER},
-      #{processStatus,jdbcType=INTEGER}, #{projectStatus,jdbcType=INTEGER}, #{approval,jdbcType=INTEGER},
-      #{orderRemarks,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}, #{salesmanId,jdbcType=VARCHAR},
-      #{financeId,jdbcType=VARCHAR}, #{technicianId,jdbcType=VARCHAR}, #{signTime,jdbcType=DATE},
-      #{settlementTime,jdbcType=DATE}, #{contractNo,jdbcType=VARCHAR}, #{contractType,jdbcType=VARCHAR},
-      #{contacts,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{legalPerson,jdbcType=VARCHAR}, 
-      #{legalPersonTel,jdbcType=VARCHAR}, #{proofCount,jdbcType=FLOAT}, #{proofAid,jdbcType=VARCHAR},
-      #{proofTime,jdbcType=TIMESTAMP}, #{proofStatus,jdbcType=INTEGER}, #{orderDep,jdbcType=VARCHAR}, 
-      #{outsource,jdbcType=INTEGER}, #{additionalOrder,jdbcType=VARCHAR}, #{primaryOrder,jdbcType=VARCHAR}, 
-      #{oldSalesmanId,jdbcType=VARCHAR}, #{backStatus,jdbcType=INTEGER}, #{agreementUrl,jdbcType=VARCHAR},
-      #{newUser,jdbcType=INTEGER})
+  <insert id="insert" parameterType="com.goafanti.common.model.TOrderNew">
+    insert into t_order_new (order_no, order_type, creater, 
+      create_time, update_time, buyer_id, 
+      first_amount, total_amount, settlement_amount, 
+      refund_amount, order_status, liquidation_status, 
+      process_status, project_status, approval, 
+      order_remarks, delete_sign, salesman_id, 
+      finance_id, technician_id, sign_time, 
+      settlement_time, contract_picture_url, contract_no, 
+      contract_type, contacts, contact_mobile, 
+      legal_person, legal_person_tel, proof_count, 
+      proof_aid, proof_time, proof_status, 
+      order_dep, outsource, additional_order, 
+      primary_order, old_salesman_id, back_status, 
+      agreement_url, new_user, service_content
+      )
+    values (#{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR}, 
+      #{firstAmount,jdbcType=DECIMAL}, #{totalAmount,jdbcType=DECIMAL}, #{settlementAmount,jdbcType=DECIMAL}, 
+      #{refundAmount,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER}, 
+      #{processStatus,jdbcType=INTEGER}, #{projectStatus,jdbcType=INTEGER}, #{approval,jdbcType=INTEGER}, 
+      #{orderRemarks,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}, #{salesmanId,jdbcType=VARCHAR}, 
+      #{financeId,jdbcType=VARCHAR}, #{technicianId,jdbcType=VARCHAR}, #{signTime,jdbcType=DATE}, 
+      #{settlementTime,jdbcType=DATE}, #{contractPictureUrl,jdbcType=VARCHAR}, #{contractNo,jdbcType=VARCHAR}, 
+      #{contractType,jdbcType=VARCHAR}, #{contacts,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, 
+      #{legalPerson,jdbcType=VARCHAR}, #{legalPersonTel,jdbcType=VARCHAR}, #{proofCount,jdbcType=FLOAT}, 
+      #{proofAid,jdbcType=VARCHAR}, #{proofTime,jdbcType=TIMESTAMP}, #{proofStatus,jdbcType=INTEGER}, 
+      #{orderDep,jdbcType=VARCHAR}, #{outsource,jdbcType=INTEGER}, #{additionalOrder,jdbcType=VARCHAR}, 
+      #{primaryOrder,jdbcType=VARCHAR}, #{oldSalesmanId,jdbcType=VARCHAR}, #{backStatus,jdbcType=INTEGER}, 
+      #{agreementUrl,jdbcType=VARCHAR}, #{newUser,jdbcType=INTEGER}, #{serviceContent,jdbcType=VARCHAR}
+      )
   </insert>
-  <insert id="insertSelective" keyColumn="order_no" keyProperty="orderNo" parameterType="com.goafanti.common.model.TOrderNew" useGeneratedKeys="true">
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderNew">
     insert into t_order_new
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="orderNo != null">
@@ -225,6 +222,9 @@
       <if test="newUser != null">
         new_user,
       </if>
+      <if test="serviceContent != null">
+        service_content,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="orderNo != null">
@@ -350,6 +350,9 @@
       <if test="newUser != null">
         #{newUser,jdbcType=INTEGER},
       </if>
+      <if test="serviceContent != null">
+        #{serviceContent,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderNew">
@@ -475,6 +478,9 @@
       <if test="newUser != null">
         new_user = #{newUser,jdbcType=INTEGER},
       </if>
+      <if test="serviceContent != null">
+        service_content = #{serviceContent,jdbcType=VARCHAR},
+      </if>
     </set>
     where order_no = #{orderNo,jdbcType=VARCHAR}
   </update>
@@ -519,7 +525,8 @@
       old_salesman_id = #{oldSalesmanId,jdbcType=VARCHAR},
       back_status = #{backStatus,jdbcType=INTEGER},
       agreement_url = #{agreementUrl,jdbcType=VARCHAR},
-      new_user = #{newUser,jdbcType=INTEGER}
+      new_user = #{newUser,jdbcType=INTEGER},
+      service_content = #{serviceContent,jdbcType=VARCHAR}
     where order_no = #{orderNo,jdbcType=VARCHAR}
   </update>
 
@@ -530,17 +537,17 @@
   	,liquidation_status,o.finance_id as financeId,contract_no as contractNo,d.name as departmentName,e.name as outsourceName
   	from t_order_new o left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
   	left join department d on o.order_dep=d.id left join (select order_no,max(name)as name from outsource_organization group by order_no) e
-  	 on o.order_no=e.order_no  left join t_order_outsource f on f.order_no=o.order_no where delete_sign != 1 
-  	and approval in (0,2) 
+  	 on o.order_no=e.order_no  left join t_order_outsource f on f.order_no=o.order_no where delete_sign != 1
+  	and approval in (0,2)
   	<if test="o.outsource != null">
   	and o.outsource=#{o.outsource,jdbcType=INTEGER}
   	</if>
   	<if test="o.outsource == 1">
   	and f.refund_status=1
   	</if>
-  	
+
   	<if test="o.processStatus == 2">
-  	and process_status = 2 
+  	and process_status = 2
   	</if>
   	<if test="o.processStatus == 3">
   	and process_status &gt;= 2 and process_status &lt; 7
@@ -557,7 +564,7 @@
   	<if test="o.contractNo != null and o.contractNo != &quot;&quot;">
   	and o.contract_no like CONCAT('%',#{o.contractNo,jdbcType=VARCHAR},'%')
   	</if>
-  	
+
   	<if test="o.buyerName != null and o.buyerName != &quot;&quot;">
   	<bind name="n" value="'%' + o.buyerName + '%'" />
   	and u.nickname  like #{n,jdbcType=VARCHAR}
@@ -574,7 +581,7 @@
   </select>
   <select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
   select count(*) from t_order_new o left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
-  	left join t_order_outsource f on f.order_no=o.order_no where delete_sign != 1  and approval in (0,2) 
+  	left join t_order_outsource f on f.order_no=o.order_no where delete_sign != 1  and approval in (0,2)
 	<if test="o.outsource != null">
   	and o.outsource=#{o.outsource,jdbcType=INTEGER}
   	</if>
@@ -582,7 +589,7 @@
   	and f.refund_status=1
   	</if>
   	<if test="o.processStatus == 2">
-  	and process_status = 2 
+  	and process_status = 2
   	</if>
   	<if test="o.processStatus == 3">
   	and process_status &gt; 2 and process_status &lt; 7
@@ -611,7 +618,7 @@
   </select>
   <!-- 查看某订单状态是否符合要求 -->
   <select id="getCountByIdAndStatus" parameterType="com.goafanti.common.model.TOrderNew" resultType="java.lang.Integer">
-  		select count(*) from t_order_new 
+  		select count(*) from t_order_new
   		where order_no = #{orderNo,jdbcType=VARCHAR}
   	  <if test="orderType != null">
        and order_type = #{orderType,jdbcType=INTEGER}
@@ -635,7 +642,7 @@
        and order_status = #{orderStatus,jdbcType=INTEGER}
       </if>
       <if test="liquidationStatus == 1">
-       and liquidation_status between 1 and 2 
+       and liquidation_status between 1 and 2
       </if>
       <if test="processStatus != null">
        and process_status = #{processStatus,jdbcType=INTEGER}
@@ -683,14 +690,15 @@
   <!-- 财务专员查看需要待收款的数据 -->
   <select id="financeList" parameterType="Map" resultType="com.goafanti.order.bo.OrderListBo">
  select o.order_no as orderNo, o.sign_time as signTime, u.nickname as buyerName, o.order_status as orderStatus,a.finance_name financeName,
-	a.cost_amount costAmount,a.payment_amount paymentAmount,o.process_status as processStatus, o.settlement_amount as actuallyTotalAmount, 
+	a.cost_amount costAmount,a.payment_amount paymentAmount,o.process_status as processStatus, o.settlement_amount as actuallyTotalAmount,
 	o.contract_no as contractNo, o.approval, o.back_status backStatus,a.salesman_name as sellerName, o.salesman_id as sellerId,
 	o.buyer_id as buyerId, o.liquidation_status as liquidationStatus ,too.amount outsourceAmount, o.first_amount as signFirstPayment,
 	o.total_amount as signTotalAmount, date_format(o.create_time, '%Y-%m-%d %H:%i:%s') as createTime, too.company_name as outsourceName,
 	0 as companyId, d.name as departmentName, a.final_receivables finalReceivables ,a.invoice_amount invoiceAmount ,
 	date_format(a.`final_Receivables_time`, '%Y-%m-%d %H:%i:%s')finalReceivablesTime,a.order_receivables orderReceivables,a.order_arrears orderArrears
-	from t_order_new o left join department d on o.order_dep = d.id left join `user` u on o.buyer_id = u.id left join t_order_mid a on o.order_no=a.order_no 
-	left join (select * from  t_order_outsource where type=0) too on o.order_no=too.order_no where delete_sign != 1 and approval !=3 and outsource=   #{o.outsource,jdbcType=INTEGER}	
+	from t_order_new o left join department d on o.order_dep = d.id left join `user` u on o.buyer_id = u.id left join t_order_mid a on o.order_no=a.order_no
+	left join (select * from  t_order_outsource where type=0) too on o.order_no=too.order_no where delete_sign in(0,2) and approval in(0,1,2)
+    and outsource=   #{o.outsource,jdbcType=INTEGER}
   	 	<if test="o.processStatus == 3">
 	  	and o.process_status = #{o.processStatus,jdbcType=INTEGER}
 	  	</if>
@@ -701,7 +709,7 @@
 	  	and o.back_status = 3
 	  	</if>
 	  	<if test="fids != null and fids.size() &gt; 0">
-	  	and d.finance_id in 
+	  	and d.finance_id in
 	   <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
        		#{item}
      	</foreach>
@@ -756,9 +764,9 @@
 		</if>
   </select>
   <select id="financeCount" parameterType="Map" resultType="java.lang.Integer">
- select count(*) from t_order_new o left join `user` u on o.buyer_id = u.id  
+ select count(*) from t_order_new o left join `user` u on o.buyer_id = u.id
 left join department d on o.order_dep = d.id   left join t_order_mid a on o.order_no=a.order_no
- where delete_sign != 1 and approval !=3 and outsource=  #{o.outsource,jdbcType=INTEGER}
+ where delete_sign in(0,2) and approval in(0,1,2) and outsource=  #{o.outsource,jdbcType=INTEGER}
   	 	<if test="o.processStatus == 3">
 	  	and o.process_status = #{o.processStatus,jdbcType=INTEGER}
 	  	</if>
@@ -769,7 +777,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
 	  	and o.back_status = 3
 	  	</if>
 	  	<if test="fids != null and fids.size() &gt; 0">
-	  	and d.finance_id in 
+	  	and d.finance_id in
 	   <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
        		#{item}
      	</foreach>
@@ -1100,7 +1108,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
 	from t_order_dun a
 	</if>
 	<if test="newStatus == 1 ">
-	a.project_type projectType,a.status dunStatus, a.dun_type dunType,a.appropriation_ratio appropriationRatio,
+	a.project_type projectType,a.status dunStatus, a.dun_type dunType,a.appropriation_ratio appropriationRatio,e.commodity_name commodityName,
 	e.set_up_amount setUpAmount,date_format(a.customize_time,'%Y-%m-%d') customizeTimes, a.customize_name customizeName
 	from new_order_dun a left join t_order_task e on a.tid=e.id
 	</if>
@@ -1199,7 +1207,8 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     c.contact_mobile as salesmanMobile,d.contact_mobile as financeMobile,b.username as userName ,b.nickname as nickname ,e.back_status as backStatus,f.name as initiateName,
     e.reason,date_format(e.create_time,'%Y-%m-%d') as backDate,a.buyer_id as uid,a.order_dep as orderDep, g.location_province as locationProvince,
     g.location_city as locationCity,g.location_area locationArea,g.postal_address postalAddress,outsource,a.primary_order primaryOrder,a.agreement_url agreementUrl,
-    h.name NowFinance,h.contact_mobile NowFinanceMobile,a.additional_order additionalOrder,i.name as oldSalesmanName, i.contact_mobile oldSalesmanMobile
+    h.name NowFinance,h.contact_mobile NowFinanceMobile,a.additional_order additionalOrder,i.name as oldSalesmanName, i.contact_mobile oldSalesmanMobile,
+    a.service_content serviceContent
     from t_order_new a left join `user` b on a.buyer_id=b.id left join admin i on a.old_salesman_id=i.id
     left join admin c on a.salesman_id=c.id left join department dep on a.order_dep=dep.id
     left join admin d on a.finance_id=d.id left join admin h on dep.finance_id=h.id
@@ -1388,14 +1397,16 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   </update>
 
   <select id="selectArrearsDunListByPage" resultType="com.goafanti.order.bo.OutArrearsDunListBo">
-select a.id, b.contract_no contractNo,a.order_no as orderNo,c.nickname as userName,tm.salesman_name as salesmanName,
-   	b.project_status projectStatus, b.total_amount as totalAmount,b.liquidation_status as liquidationStatus,a.`type`,
-   	b.settlement_amount as settlementAmount, a.order_receivables orderReceivables,a.order_arrears as orderArrears,
-   	b.order_status as orderStatus, date_format(a.start_time, '%Y-%m-%d %H:%i:%s') as startDate,dep.name as depName,
-   	date_format(b.sign_time,'%Y-%m-%d') as signDate,a.dun_status dunStatus  from t_arrears_dun a
-   	left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id
-	left join t_order_mid tm on b.order_no=tm.order_no left join department dep on b.order_dep=dep.id
-	where  b.delete_sign != 1 and dun_status in (1,2,3)
+    select a.id, b.contract_no contractNo,a.order_no as orderNo,c.nickname as userName,tm.salesman_name as salesmanName,
+    b.project_status projectStatus, b.total_amount as totalAmount,b.liquidation_status as liquidationStatus,a.`type`,
+    b.settlement_amount as settlementAmount, a.order_receivables orderReceivables,a.order_arrears as orderArrears,
+    b.order_status as orderStatus, date_format(a.start_time, '%Y-%m-%d %H:%i:%s') as startDate,dep.name as depName,
+    date_format(b.sign_time,'%Y-%m-%d') as signDate,a.dun_status dunStatus,x.commodity_name commodityName
+    from t_arrears_dun a
+    left join (select order_no ,commodity_name from t_order_task where main =1)x on a.order_no =x.order_no
+    left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id
+    left join t_order_mid tm on b.order_no=tm.order_no left join department dep on b.order_dep=dep.id
+    where  b.delete_sign != 1 and dun_status in (1,2,3)
 	<if test="shiroType == 1 and fid !=null">
   	 and tm.finance_id= #{fid,jdbcType=VARCHAR}
   	</if>

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

@@ -1175,6 +1175,9 @@
     <if test="approval ==2">
       and e.approval &gt; 1
     </if>
+    <if test="cid != null">
+      and c.id = #{cid}
+    </if>
     <if test="outsourceStatus !=null">
       and l.refund_status = #{outsourceStatus,jdbcType=INTEGER}
     </if>
@@ -1212,8 +1215,8 @@
   </select>
 
   <select id="selectOrderTaskListCount" resultType="java.lang.Integer">
-    select  count(*) from t_order_task a  left join t_order_new e on a.order_no=e.order_no
-    left join user f on e.buyer_id=f.id left join admin g on e.salesman_id=g.id
+    select  count(*) from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
+        left join t_order_new e on a.order_no=e.order_no left join user f on e.buyer_id=f.id left join admin g on e.salesman_id=g.id
     left join department h on g.department_id=h.id where e.delete_sign in (0,2,3)  and e.order_status in (2,4)
     and a.outsource= #{outsource,jdbcType=INTEGER}
     <if test="role == 0 ">
@@ -1243,6 +1246,9 @@
     <if test="approval ==2">
       and e.approval &gt; 1
     </if>
+    <if test="cid != null">
+      and c.id = #{cid}
+    </if>
     <if test="outsourceStatus !=null">
       and l.refund_status = #{outsourceStatus,jdbcType=INTEGER}
     </if>

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

@@ -214,6 +214,11 @@ public class TOrderNew implements Serializable {
      */
     private Integer newUser;
 
+    /**
+     * 服务内容
+     */
+    private String serviceContent;
+
     private static final long serialVersionUID = 1L;
 
     public String getOrderNo() {
@@ -543,4 +548,12 @@ public class TOrderNew implements Serializable {
     public void setNewUser(Integer newUser) {
         this.newUser = newUser;
     }
+
+    public String getServiceContent() {
+        return serviceContent;
+    }
+
+    public void setServiceContent(String serviceContent) {
+        this.serviceContent = serviceContent;
+    }
 }

+ 21 - 18
src/main/java/com/goafanti/common/task/PatentTask.java

@@ -83,7 +83,6 @@ public class PatentTask {
 				Integer status=0;
 				// 计算相差日期
 				int count = patentNewService.countDays(p.getEndDate());
-				
 				boolean flag=false;
 				if (count > 60 && count <= 90&&p.getStatus()!=1) {
 					flag=true;
@@ -105,8 +104,27 @@ public class PatentTask {
 					flag=true;
 					status = 5;
 					s5.add(p.getId().toString());
-				}else if(count<0&&p.getSalesmanRemind()==1) {
+				}else if(count<0) {
 					s6.add(p.getId().toString());
+					if (p.getSalesmanRemind()==0){
+						Notice n = new Notice();
+						n.setId(UUID.randomUUID().toString());
+						n.setCreateTime(date);
+						n.setReaded(0);// 未读
+						n.setNoticeType(NoticeStatus.TASK_PATENT_ERROR.getCode());
+						PatentNewLog pl = new PatentNewLog();
+						StringBuffer str =new StringBuffer();
+						str.append("专利编号[").append(p.getPatentNo()).append("],名称[").append(p.getName()).append("],email[")
+								.append(p.getEmail().trim()).append("]").append("已超过结束时间,但未做提醒,请悉知!!!");
+						pl.setContent(str.toString());
+						pl.setCreateTime(new Date());
+						pl.setPid(p.getId());
+						logList.add(pl);
+						n.setAid(p.getAid());
+						n.setNoticeType(NoticeStatus.TASK_PATENT_REMIND.getCode());
+						n.setContent(str.toString());
+						nlist.add(n);
+					}
 				}
 				if (flag) {
 					Notice n = new Notice();
@@ -161,7 +179,7 @@ public class PatentTask {
 			updatePatentNew(s3,3);
 			updatePatentNew(s4,4);
 			updatePatentNew(s5,5);
-			pushPatentNewStatus(s6);
+			patentNewService.pushResetPatentNew(s6);
 			
 		} catch (Exception e) {
 			LoggerUtils.debug(getClass(), "=====================专利提醒失败======================");
@@ -175,20 +193,6 @@ public class PatentTask {
 	}
 
 
-	private void pushPatentNewStatus(List<String> s6) throws InterruptedException {
-		List<PatentNewLog> logs = new ArrayList<>();
-		for (String string : s6) {
-			PatentNewLog log=new PatentNewLog();
-			log.setContent("超过时间重置状态并计算下一年");
-			log.setCreateTime(new Date());
-			log.setPid(Integer.valueOf(string));
-			logs.add(log);
-		}
-		pushPatentLog(logs);
-		patentNewService.pushResetPatentNew(s6);
-	}
-
-
 
 
 	private void pushNotice(List<Notice> nlist) throws InterruptedException {
@@ -224,7 +228,6 @@ public class PatentTask {
 
 	/**
 	 * 修改专利状态
-	 * @param s1
 	 * @param status
 	 * @throws InterruptedException 
 	 */

+ 3 - 2
src/main/java/com/goafanti/common/utils/AsyncUtils.java

@@ -72,6 +72,7 @@ public class AsyncUtils {
 	}
 
 
-	
-
+    public void batchUpdateUnreaded(List<String> dl) {
+		noticeMapper.batchUpdateUnreaded(dl);
+    }
 }

+ 24 - 5
src/main/java/com/goafanti/order/bo/OutArrearsDunListBo.java

@@ -7,7 +7,7 @@ import com.goafanti.order.enums.NewProjectStatus;
 
 
 public class OutArrearsDunListBo {
-	private String id;
+	private Integer id;
 	@Excel(name = "合同编号")
 	private String contractNo;
 	@Excel(name = "订单编号")
@@ -21,6 +21,8 @@ public class OutArrearsDunListBo {
 	@Excel(name = "订单状态",readConverterExp = "0=待签单,1=签单待审,2=签单审核通过,3=签单审核拒绝,4=已结项,5=已驳回,6=退单中,7=已退单")
    	private Integer orderStatus;
 	private Integer projectStatus;
+	@Excel(name = "项目名称")
+	private String commodityName;
 	@Excel(name = "项目状态")
 	private String projectStatusName;
 	@Excel(name = "签单金额(万元)")
@@ -41,12 +43,29 @@ public class OutArrearsDunListBo {
 	private String startDate;
 	@Excel(name = "下单时间")
 	private String signDate;
-	
-   	
-	public String getId() {
+	@Excel(name = "法务时间")
+	private String legalTimes;
+
+	public String getCommodityName() {
+		return commodityName;
+	}
+
+	public void setCommodityName(String commodityName) {
+		this.commodityName = commodityName;
+	}
+
+	public String getLegalTimes() {
+		return legalTimes;
+	}
+
+	public void setLegalTimes(String legalTimes) {
+		this.legalTimes = legalTimes;
+	}
+
+	public Integer getId() {
 		return id;
 	}
-	public void setId(String id) {
+	public void setId(Integer id) {
 		this.id = id;
 	}
 	public String getContractNo() {

+ 10 - 0
src/main/java/com/goafanti/order/bo/inuptTaskListBo.java

@@ -15,8 +15,18 @@ public class inuptTaskListBo {
 	private Integer outsourceStatus;
 	private String startTime;
 	private String endTime;
+	private String cid;
 	private Integer pageNo;
 	private Integer pageSize;
+
+	public String getCid() {
+		return cid;
+	}
+
+	public void setCid(String cid) {
+		this.cid = cid;
+	}
+
 	public String getName() {
 		return name;
 	}

+ 10 - 0
src/main/java/com/goafanti/order/bo/outOrderDunListBo.java

@@ -11,6 +11,7 @@ public class outOrderDunListBo {
 	private String orderNo;
 	private String userName;
 	private String salesmanName;
+	private String commodityName;
 	private Integer projectStatus;
 	private BigDecimal totalAmount;
 	private Integer liquidationStatus;
@@ -41,6 +42,15 @@ public class outOrderDunListBo {
 		if(getDunType()!=null&&getDunType()==0&&getProjectType()!=null)return NewOrderDunType.getValueByCode(Integer.valueOf(""+getProjectType()+getDunType()))+getCustomizeName();
 		return dunSubject;
 	}
+
+	public String getCommodityName() {
+		return commodityName;
+	}
+
+	public void setCommodityName(String commodityName) {
+		this.commodityName = commodityName;
+	}
+
 	public void setId(String id) {
 		this.id = id;
 	}

+ 1 - 0
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -301,6 +301,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		if (StringUtils.isNotBlank(ib.getEndTime())) params.put("endTime", ib.getEndTime());
 		if (null != ib.getTaskStatus()) params.put("taskStatus", ib.getTaskStatus());
 		if (ib.getOutsourceStatus() !=null) params.put("outsourceStatus", ib.getOutsourceStatus());
+		if (ib.getCid() !=null) params.put("cid", ib.getCid());
 		List<String> fids=new ArrayList<>();
 		if (TokenManager.hasRole(AFTConstants.FINANCE_ADMIN) ||TokenManager.hasRole(AFTConstants.SUPERADMIN)||
 				TokenManager.hasRole(AFTConstants.CED)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)||

+ 1 - 1
src/main/java/com/goafanti/patent/service/PatentNewService.java

@@ -43,7 +43,7 @@ public interface PatentNewService {
 
 	void updateBatchStatusByid(List<String> l2, Integer status);
 
-	void pushResetPatentNew(List<String> list);
+	void pushResetPatentNew(List<String> list) throws InterruptedException;
 
 	boolean checkTid(Integer tid);
 

+ 37 - 5
src/main/java/com/goafanti/patent/service/impl/PatentNewServiceImpl.java

@@ -12,6 +12,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
+import com.mysql.jdbc.log.Log;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.Row;
@@ -73,7 +74,10 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 	@Autowired
 	private AdminMapper	adminMapper;
 	
-	private List<PatentYearPayment> patentYear=new ArrayList<PatentYearPayment>(); 
+	private List<PatentYearPayment> patentYear=new ArrayList<PatentYearPayment>();
+
+
+
 
 	@Value(value = "${upload.path}")
 	private String uploadPath=null;
@@ -659,11 +663,13 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 	 * 超过时间重置到第二年
 	 */
 	@Override
-	public void pushResetPatentNew(List<String> list) {
+	public void pushResetPatentNew(List<String> list) throws InterruptedException {
+		List<PatentNewLog> logs = new ArrayList<>();
 		for (String ids : list) {
 			PatentNew pn=patentNewMapper.selectByPrimaryKey(Integer.valueOf(ids));
 			int year=pn.getYears()+1;
 			PatentPaymentDetails ppd=patentPaymentDetailsMapper.selectByPidAndYear(pn.getId(),year);
+			//未找到下一年则计算看是否存在
 			if (ppd==null) {
 				sumYears(pn);
 				ppd=patentPaymentDetailsMapper.selectByPidAndYear(pn.getId(),year);
@@ -672,11 +678,37 @@ public class PatentNewServiceImpl  extends BaseMybatisDao<PatentNewMapper> imple
 			n.setId(pn.getId());
 			n.setStatus(0);
 			n.setSalesmanRemind(0);
-			n.setYears(ppd.getYears());
-			n.setEndDate(ppd.getEndDate());
-			n.setPatentAmount(sumAmout(pn.getType(),pn.getTid(),pn.getYears()));
+			//还是未找到,判断为不存在一下年,判断提醒已完成
+			if(ppd==null){
+				n.setStatus(6);
+			}else{
+				n.setYears(ppd.getYears());
+				n.setEndDate(ppd.getEndDate());
+				n.setPatentAmount(sumAmout(pn.getType(),pn.getTid(),pn.getYears()));
+				PatentNewLog log=new PatentNewLog();
+				log.setContent("超过时间重置状态并计算下一年");
+				log.setCreateTime(new Date());
+				log.setPid(Integer.valueOf(ids));
+				logs.add(log);
+			}
 			patentNewMapper.updateByPrimaryKeySelective(n);
 		}
+		pushPatentLog(logs);
+	}
+
+	private void pushPatentLog(List<PatentNewLog> logList) throws InterruptedException {
+		if (!logList.isEmpty()) {
+			List<PatentNewLog> logList2 = new ArrayList<>();
+			for (int i = 0; i < logList.size(); i++) {
+				logList2.add(logList.get(i));
+				if (50 == logList2.size() || i == logList.size() - 1) {
+					if (logList2.size() > 0) insertLogBatch(logList2);
+					Thread.sleep(2000);
+					logList2.clear();
+				}
+			}
+
+		}
 	}
 
 	@Override

+ 12 - 0
src/main/java/com/goafanti/weChat/bo/InputPublicDtails.java

@@ -14,9 +14,21 @@ public class InputPublicDtails {
 	private Integer type;
 	private String sid;
 	private String depId;
+	/**
+	 * 0业务/行政 1技术
+	 */
+	private Integer publicType;
 	private Integer pageSize;
 	private Integer pageNo;
 
+	public Integer getPublicType() {
+		return publicType;
+	}
+
+	public void setPublicType(Integer publicType) {
+		this.publicType = publicType;
+	}
+
 	public String getSid() {
 		return sid;
 	}

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

@@ -27,6 +27,8 @@ public class OutPublicDtails {
 	private String clockInTimes;
 	@Excel(name = "创建时间" )
 	private String createTimes;
+	@Excel(name = "公出类型",readConverterExp = "0=业务/行政,1=技术")
+	private Integer type;
 	@Excel(name = "公出目标" )
 	private String remarks;
 	@Excel(name = "公出计划" )
@@ -42,6 +44,14 @@ public class OutPublicDtails {
 	private String annexUrl;
 	private String photoUrl;
 
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
 	public String getPlan() {
 		return plan;
 	}

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

@@ -351,6 +351,7 @@ 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(in.getPublicType()!=null)map.put("publicType",in.getPublicType());
 		if(TokenManager.hasRole(AFTConstants.SUPERADMIN)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)
 				||TokenManager.hasRole(AFTConstants.CED_ASSISTANT)){
 			in.setType(2);}

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -50,7 +50,7 @@ avatar.upload.host=//sb.jishutao.com/upload
 #avatar.host=//172.16.0.253
 
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.2.02
+static.host=//static.jishutao.com/1.2.04
 
 wx.appId=wxff2f5720ed7d7f63
 wx.appSecret=081744369d42405be58fe37f892631f7

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -43,7 +43,7 @@ user_remind_days=15
 #提前提醒天数
 user_channel_days=90
 
-static.host=//static.jishutao.com/1.2.02
+static.host=//static.jishutao.com/1.2.04
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload