Explorar el Código

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

anderx hace 6 años
padre
commit
1c08791776
Se han modificado 29 ficheros con 1141 adiciones y 1102 borrados
  1. 1 1
      GeneratorConfig.xml
  2. 0 2
      src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java
  3. 7 5
      src/main/java/com/goafanti/common/bo/EmailBo.java
  4. 19 15
      src/main/java/com/goafanti/common/constant/AFTConstants.java
  5. 2 0
      src/main/java/com/goafanti/common/dao/AdminMapper.java
  6. 56 77
      src/main/java/com/goafanti/common/dao/IdleContractNoMapper.java
  7. 3 1
      src/main/java/com/goafanti/common/dao/TOrderTaskMapper.java
  8. 4 0
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  9. 39 24
      src/main/java/com/goafanti/common/mapper/IdleContractNoMapper.xml
  10. 13 9
      src/main/java/com/goafanti/common/mapper/NewOrderChangeMapper.xml
  11. 27 5
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  12. 11 8
      src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml
  13. 162 197
      src/main/java/com/goafanti/common/model/IdleContractNo.java
  14. 702 683
      src/main/java/com/goafanti/common/model/IdleContractNoExample.java
  15. 2 21
      src/main/java/com/goafanti/common/utils/ExportExcelUtil.java
  16. 4 1
      src/main/java/com/goafanti/common/utils/SendEmailUtil.java
  17. 1 1
      src/main/java/com/goafanti/order/bo/TOrderNewBo.java
  18. 8 0
      src/main/java/com/goafanti/order/bo/TOrderTaskDetailBo.java
  19. 4 7
      src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java
  20. 3 3
      src/main/java/com/goafanti/order/service/OrderNewService.java
  21. 2 2
      src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java
  22. 2 2
      src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java
  23. 3 3
      src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java
  24. 38 26
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  25. 10 3
      src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java
  26. 1 1
      src/main/java/com/goafanti/order/service/impl/OutsourceOrgServiceImpl.java
  27. 14 2
      src/main/java/com/goafanti/permission/service/impl/NewRoleServiceImpl.java
  28. 2 2
      src/main/resources/props/config_local.properties
  29. 1 1
      src/main/resources/props/config_test.properties

+ 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" targetProject="kede-server" type="XMLMAPPER" />
-    <table schema="aft" tableName="new_order_dun"/>
+    <table schema="aft" tableName="idle_contract_no"/>
   </context>
 </generatorConfiguration>

+ 0 - 2
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -36,8 +36,6 @@ import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.BusinessListBo;
-import com.goafanti.customer.bo.LockingReleaseBo;
-import com.goafanti.order.bo.TOrderNewBo;
 
 @Service
 public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements AdminService {

+ 7 - 5
src/main/java/com/goafanti/common/bo/EmailBo.java

@@ -84,8 +84,9 @@ public class EmailBo {
 	 * @return 
 	 */
 	public  EmailBo(String subject, String address, String deptname, String sender,
-			String content , String orderNo,String date ,String dunStatusName,String adminName,String userName,Integer type) {
-		this.subject = subject;
+			String content , String orderNo,String date ,String dunStatusName,String adminName,String userName,Integer type,Integer approval) {
+		if(approval !=null&&approval!=0)this.subject = "[特批]"+subject;
+		else this.subject = subject;
 		this.address = address;
 		this.addressee = "";
 		this.deptname = deptname;
@@ -227,8 +228,9 @@ public class EmailBo {
 	}
 	
 	public String setGeneralFormat() {
+		
 		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" + 
+				"    	<tbody><tr>\r\n" +
 				"		        <td>\r\n" + 
 				"		             <table width=\"800\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" height=\"40\"></table>\r\n" + 
 				"		        </td>\r\n" + 
@@ -248,10 +250,10 @@ public class EmailBo {
 				"        		</td>\r\n" + 
 				"		    </tr>\r\n" + 
 				"		    \r\n" + 
-				"   			<tr>\r\n" + 
+				"   		<tr>\r\n" + 
 				"        		<td>\r\n" + 
 				"		            \r\n" + 
-				"		        <table width=\"800\" border=\"0\" align=\"left\" cellpadding=\"0\" cellspacing=\"0\" style=\" border:1px solid #edecec; border-top:none; padding:0 20px;font-size:14px;color:#333333;\">\r\n" + 
+				"		        	<table width=\"800\" border=\"0\" align=\"left\" cellpadding=\"0\" cellspacing=\"0\" style=\" border:1px solid #edecec; border-top:none; padding:0 20px;font-size:14px;color:#333333;\">\r\n" + 
 				"	               		<tbody><tr>\r\n" + 
 				"              </tr>\r\n" + 
 				"               <tr>\r\n" + 

+ 19 - 15
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -13,27 +13,33 @@ public class AFTConstants {
 
 	public static final String	INITIALPASSWORD						= "123456";				// 初始密码
 
+	/**	超级管理员 */
 	public static final String	SUPERADMIN							= "999999";				// 超级管理员
-
+	/**	特批决策者 */
 	public static final String	APPROVAL_DECISION					= "99999";				// 特批决策者
-	
+	/**	总裁 */
 	public static final String	CED									= "99998";				// 总裁
-
+	/**	集团副总 */
 	public static final String	VICE_CEO							= "99997";				// 集团副总
-
+	/** 技术管理员 */
 	public static final String  TECH_ADMIN                          = "9998";				// 技术管理员
-	
+	/**	技术经理 */
+	public static final String  TECH_MANAGER                        = "998";				// 技术经理
+	/**	技术员 */
+	public static final String  TECH		                        = "98";					// 技术员
+	/**	财务管理员*/
 	public static final String  FINANCE_ADMIN                       = "9997";				// 财务管理员
-	
+	/**	财务经理*/
+	public static final String  FINANCE_MANAGER						= "997";				// 财务经理
+	/**	财务专员*/
+	public static final String  FINANCE								= "97";					// 财务专员
+	/**	营销管理员 */
 	public static final String  SALESMAN_ADMIN                      = "9996";				// 营销管理员
-	
+	/** 营销经理 */
 	public static final String  SALESMAN_MANAGER                    = "996";				// 营销经理
-	
+	/**	营销员 */
 	public static final String  SALESMAN                      		= "96";					// 营销员
-	
-	public static final String  TECH_MANAGER                        = "998";				// 技术管理员
-	
-	public static final String  TECH		                        = "98";				// 技术管理员
+
 
 	public static final String	AREAADMIN							= "";					// 地区管理员
 
@@ -41,9 +47,7 @@ public class AFTConstants {
 
 	public static final String	MANAGERADMIN						= "";					// 客户经理
 	
-	public static final String  FINANCE_MANAGER						= "997";				// 财务经理
-	
-	public static final String  FINANCE								= "97";					// 财务专员
+
 
 
 	public static final String	TECHBROKER							= "";					// 技术经纪人

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

@@ -193,5 +193,7 @@ public interface AdminMapper {
 	List<String> selectBySuperId(String aid);
 
 	Admin selectFinanceAdminByOrderDep(String orderDep);
+
+	String getPermission(String transferId);
 	
 }

+ 56 - 77
src/main/java/com/goafanti/common/dao/IdleContractNoMapper.java

@@ -7,92 +7,71 @@ import org.apache.ibatis.annotations.Param;
 
 public interface IdleContractNoMapper {
     /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table idle_contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    long countByExample(IdleContractNoExample example);
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table idle_contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	long countByExample(IdleContractNoExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table idle_contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    int deleteByExample(IdleContractNoExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table idle_contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	int deleteByExample(IdleContractNoExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table idle_contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    int deleteByPrimaryKey(Integer id);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table idle_contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	int deleteByPrimaryKey(Integer id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table idle_contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    int insert(IdleContractNo record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table idle_contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	int insert(IdleContractNo record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table idle_contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    int insertSelective(IdleContractNo record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table idle_contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	int insertSelective(IdleContractNo record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table idle_contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:16 CST 2019
-     */
-    List<IdleContractNo> selectByExample(IdleContractNoExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table idle_contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	List<IdleContractNo> selectByExample(IdleContractNoExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table idle_contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:16 CST 2019
-     */
-    IdleContractNo selectByPrimaryKey(Integer id);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table idle_contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	IdleContractNo selectByPrimaryKey(Integer id);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table idle_contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:16 CST 2019
-     */
-    int updateByExampleSelective(@Param("record") IdleContractNo record, @Param("example") IdleContractNoExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table idle_contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	int updateByExampleSelective(@Param("record") IdleContractNo record,
+			@Param("example") IdleContractNoExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table idle_contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:16 CST 2019
-     */
-    int updateByExample(@Param("record") IdleContractNo record, @Param("example") IdleContractNoExample example);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table idle_contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	int updateByExample(@Param("record") IdleContractNo record, @Param("example") IdleContractNoExample example);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table idle_contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:16 CST 2019
-     */
-    int updateByPrimaryKeySelective(IdleContractNo record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table idle_contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	int updateByPrimaryKeySelective(IdleContractNo record);
 
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method corresponds to the database table idle_contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:16 CST 2019
-     */
-    int updateByPrimaryKey(IdleContractNo record);
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table idle_contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	int updateByPrimaryKey(IdleContractNo record);
 
-	IdleContractNo selectByAbbreviation(String abbreviation);
+	IdleContractNo selectByAbbreviation(@Param("abbreviation")String abbreviation, @Param("year")Integer year);
 }

+ 3 - 1
src/main/java/com/goafanti/common/dao/TOrderTaskMapper.java

@@ -102,10 +102,12 @@ public interface TOrderTaskMapper {
 	
 	List<TOrderTask> getReceiverByOid(String oid);
 
-	void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId);
+	void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId, @Param("type")Integer type);
 
 	String selectEstimateCost(String orderNo);
 
 	List<String> listNameByDepAndName(@Param("orderNo")String orderNo, @Param("type")Integer type);
 
+	
+
 }

+ 4 - 0
src/main/java/com/goafanti/common/mapper/AdminMapper.xml

@@ -1156,4 +1156,8 @@
  	 select a.finance_id id,b.name from department a left join admin b on a.finance_id=b.id
 	where a.id= #{orderDep}
   </select>
+  <select id="getPermission" resultType="java.lang.String">
+  select c.role_type from admin a left join user_role b on a.id=b.uid left join `role` c on b.rid=c.id
+	where a.id= #{transferId}
+  </select>
 </mapper>

+ 39 - 24
src/main/java/com/goafanti/common/mapper/IdleContractNoMapper.xml

@@ -5,7 +5,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     <id column="id" jdbcType="INTEGER" property="id" />
     <result column="abbreviation" jdbcType="VARCHAR" property="abbreviation" />
@@ -13,12 +13,13 @@
     <result column="contract_no" jdbcType="VARCHAR" property="contractNo" />
     <result column="aid" jdbcType="VARCHAR" property="aid" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="year" jdbcType="INTEGER" property="year" />
   </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 Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -52,7 +53,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -86,15 +87,15 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
-    id, abbreviation, used_order_no, contract_no, aid, create_time
+    id, abbreviation, used_order_no, contract_no, aid, create_time, year
   </sql>
   <select id="selectByExample" parameterType="com.goafanti.common.model.IdleContractNoExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     select
     <if test="distinct">
@@ -113,7 +114,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -124,7 +125,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     delete from idle_contract_no
     where id = #{id,jdbcType=INTEGER}
@@ -133,7 +134,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     delete from idle_contract_no
     <if test="_parameter != null">
@@ -144,20 +145,20 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     insert into idle_contract_no (id, abbreviation, used_order_no, 
-      contract_no, aid, create_time
-      )
+      contract_no, aid, create_time, 
+      year)
     values (#{id,jdbcType=INTEGER}, #{abbreviation,jdbcType=VARCHAR}, #{usedOrderNo,jdbcType=VARCHAR}, 
-      #{contractNo,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
-      )
+      #{contractNo,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{year,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.IdleContractNo">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     insert into idle_contract_no
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -179,6 +180,9 @@
       <if test="createTime != null">
         create_time,
       </if>
+      <if test="year != null">
+        year,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -199,13 +203,16 @@
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="year != null">
+        #{year,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.IdleContractNoExample" resultType="java.lang.Long">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     select count(*) from idle_contract_no
     <if test="_parameter != null">
@@ -216,7 +223,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     update idle_contract_no
     <set>
@@ -238,6 +245,9 @@
       <if test="record.createTime != null">
         create_time = #{record.createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="record.year != null">
+        year = #{record.year,jdbcType=INTEGER},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -247,7 +257,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     update idle_contract_no
     set id = #{record.id,jdbcType=INTEGER},
@@ -255,7 +265,8 @@
       used_order_no = #{record.usedOrderNo,jdbcType=VARCHAR},
       contract_no = #{record.contractNo,jdbcType=VARCHAR},
       aid = #{record.aid,jdbcType=VARCHAR},
-      create_time = #{record.createTime,jdbcType=TIMESTAMP}
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      year = #{record.year,jdbcType=INTEGER}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -264,7 +275,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     update idle_contract_no
     <set>
@@ -283,6 +294,9 @@
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="year != null">
+        year = #{year,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -290,19 +304,20 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Sep 30 16:05:16 CST 2019.
+      This element was generated on Tue Jan 07 16:15:44 CST 2020.
     -->
     update idle_contract_no
     set abbreviation = #{abbreviation,jdbcType=VARCHAR},
       used_order_no = #{usedOrderNo,jdbcType=VARCHAR},
       contract_no = #{contractNo,jdbcType=VARCHAR},
       aid = #{aid,jdbcType=VARCHAR},
-      create_time = #{createTime,jdbcType=TIMESTAMP}
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      year = #{year,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
   <select id="selectByAbbreviation" resultType="com.goafanti.common.model.IdleContractNo">
 	select a.id,a.abbreviation,a.used_order_no usedOrderNo,a.aid,a.create_time createTime,a.contract_no contractNo from idle_contract_no a
-	where abbreviation= #{abbreviation,jdbcType=VARCHAR} 
-	and a.contract_no=(select max(contract_no)from idle_contract_no where abbreviation= #{abbreviation,jdbcType=VARCHAR})
+	where abbreviation= #{abbreviation,jdbcType=VARCHAR}  and `year`= #{year ,jdbcType=INTEGER}
+	and a.contract_no=(select max(contract_no)from idle_contract_no where abbreviation= #{abbreviation,jdbcType=VARCHAR} and `year`= #{year ,jdbcType=INTEGER})
   </select>
 </mapper>

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

@@ -668,8 +668,7 @@ select
   a.process_state processState from new_order_change 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 admin d on b.salesman_id=d.id left join department e on b.order_dep=e.id 
 	<if test="processState==2 or processState==3 "> 
-	left join (select x.order_no,x.aid from (SELECT order_no,task_allocator aid FROM t_order_task where task_allocator is not null
-  UNION SELECT order_no,task_receiver aid FROM t_order_task  where task_receiver is not null)x group by order_no,aid) f on a.order_no=f.order_no
+	left join (select order_no,consultant_id,manager_id from t_order_task group by order_no,consultant_id,manager_id) x on a.order_no=x.order_no
 	</if> 
 	where 1=1
 	<if test="processState==0">
@@ -681,8 +680,11 @@ select
 	 #{deps.id}
   	</foreach>
 	</if>
-	<if test="processState==2 or processState==3 ">
-	and f.aid=#{aid}  and process_state &gt;= 2
+	<if test="processState==2 ">
+	and  x.consultant_id=#{aid}  and process_state &gt;= 2
+	</if>
+	<if test="processState==3 ">
+	and x.manager_id=#{aid}  and process_state &gt;= 3
 	</if>
 	<if test="processState==5">
 	and e.finance_id =#{aid}
@@ -754,9 +756,8 @@ select
   select count(*) from new_order_change 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 admin d on b.salesman_id=d.id left join department e on b.order_dep=e.id
 	<if test="processState==2 or processState==3 "> 
-	left join (select x.order_no,x.aid from (SELECT order_no,task_allocator aid FROM t_order_task where task_allocator is not null
-  UNION SELECT order_no,task_receiver aid FROM t_order_task  where task_receiver is not null)x group by order_no,aid) f on a.order_no=f.order_no
-	</if> 
+	left join t_order_task x on a.order_no=x.order_no
+	</if>
 	where 1=1
 	<if test="processState==0">
 	and b.salesman_id= #{aid}
@@ -767,8 +768,11 @@ select
 	 #{deps.id}
   	</foreach>
 	</if>
-	<if test="processState==2 or processState==3 ">
-	and f.aid=#{aid}
+	<if test="processState==2 ">
+	and  x.consultant_id=#{aid}  and process_state &gt;= 2
+	</if>
+	<if test="processState==3 ">
+	and x.manager_id=#{aid}  and process_state &gt;= 3
 	</if>
 	<if test="processState==5">
 	and e.finance_id =#{aid}

+ 27 - 5
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1210,7 +1210,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	</if>
   	<if test="specially == 4">
   	left join (select * from t_order_task
-where super_id is null )  e on e.order_no=a.order_no
+	where super_id is null )  e on e.order_no=a.order_no
   	left join admin f on e.task_receiver=f.id
   	</if>
   	where a.delete_sign !=1
@@ -1234,8 +1234,18 @@ where super_id is null )  e on e.order_no=a.order_no
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
   	</if>
   	<if test="specially == 3">
-  	and a.approval = 1 and  a.order_status=2 and a.process_status != 99 
+  	 and  a.order_status=2 and a.process_status != 99
+  	 <if test="approval ==0">
+  	and a.approval &gt; 0
   	</if>
+  	<if test="approval ==1">
+  	and a.approval = 1
+  	</if>
+  	<if test="approval ==2">
+  	and a.approval &gt; 1
+  	</if> 
+  	</if>
+  	
   	<if test="specially == 4">
   	and e.main=1
   	and a.process_status in (4,5,6,99)
@@ -1274,7 +1284,10 @@ where super_id is null )  e on e.order_no=a.order_no
   	<if test="starTime !=null and endTime !=null">
   	and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
   	</if>
-  	order by 
+  	order by
+  	<if test="specially == 3">
+  	a.approval,
+  	</if> 
   	<if test="specially == 4">
   	a.process_status,
   	</if>
@@ -1327,10 +1340,19 @@ where super_id is null ) e on e.order_no=a.order_no
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
   	</if>
   	<if test="specially == 3">
-  	and a.approval = 1 and  a.order_status=2 and a.process_status != 99 
+  	 and  a.order_status=2 and a.process_status != 99 
+  	<if test="approval ==0">
+  	and a.approval &gt; 0
+  	</if>
+  	<if test="approval ==1">
+  	and a.approval = 1
+  	</if>
+  	<if test="approval ==2">
+  	and a.approval &gt; 1
+  	</if>
   	</if>
   	<if test="specially == 4">
-  	 and e.main=1
+  	and e.main=1
   	and a.process_status in (4,5,6,99)
   	and a.order_status not in(5,7)
   	</if>

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

@@ -1003,7 +1003,7 @@
   	</if>
   </select>
   <select id="getOrderTaskDetail" resultType="com.goafanti.order.bo.TOrderTaskDetailBo">
- select  
+select  
 	a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,a.task_comment as taskComment,
     a.project_status as projectStatus,a.task_status as taskStatus,e.contacts,a.attachment_url as attachmentUrl,a.outsource_name outsourceName,
 	f.nickname as userName,g.name as salesmanName,date_format(a.task_start_time,'%Y-%m-%d') as startDate,a.retrieve_content as retrieveContent,
@@ -1013,13 +1013,10 @@
 	date_format(a.review_time,'%Y-%m-%d') as reviewDate,date_format(a.publicity_time,'%Y-%m-%d') as publicityDate,a.outsource_price outsourcePrice,
 	date_format(a.licence_time,'%Y-%m-%d') as licenceDate,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
 	e.contacts ,e.contact_mobile as contactMobile ,e.legal_person as legalPerson,e.legal_person_tel as legalPersonTel,
-	a.set_up_amount as setUpAmount,a.arrival_money as arrivalMoney
-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 admin d on a.task_receiver=d.id
-    left join t_order_new e on a.order_no=e.order_no
-    left join department h on e.order_dep=h.id
-    left join user f on e.buyer_id=f.id
+	a.set_up_amount as setUpAmount,a.arrival_money as arrivalMoney,a.task_receiver taskReceiver
+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 admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
+    left join department h on e.order_dep=h.id left join user f on e.buyer_id=f.id
     left join admin g on e.salesman_id=g.id
     where a.id= #{id,jdbcType=VARCHAR}
   </select>
@@ -1187,6 +1184,12 @@ from t_order_task a left join business_project b on a.commodity_id=b.id
   	</select>
   	<update id="updateDimissionTransfer" parameterType="java.lang.String">
     update t_order_task set task_allocator= #{aid,jdbcType=VARCHAR},task_receiver= #{transferId,jdbcType=VARCHAR}
+    <if test="type==0">
+    ,consultant_id=#{transferId,jdbcType=VARCHAR}
+    </if>
+    <if test="type==1">
+    ,manager_id=#{transferId,jdbcType=VARCHAR}
+    </if>
 	where task_receiver=#{aid,jdbcType=VARCHAR}
   </update>
   <select id="selectEstimateCost" resultType="java.lang.String">

+ 162 - 197
src/main/java/com/goafanti/common/model/IdleContractNo.java

@@ -3,201 +3,166 @@ package com.goafanti.common.model;
 import java.util.Date;
 
 public class IdleContractNo {
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column idle_contract_no.id
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    private Integer id;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column idle_contract_no.abbreviation
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    private String abbreviation;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column idle_contract_no.used_order_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    private String usedOrderNo;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column idle_contract_no.contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    private String contractNo;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column idle_contract_no.aid
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    private String aid;
-
-    /**
-     *
-     * This field was generated by MyBatis Generator.
-     * This field corresponds to the database column idle_contract_no.create_time
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    private Date createTime;
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column idle_contract_no.id
-     *
-     * @return the value of idle_contract_no.id
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    public Integer getId() {
-        return id;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column idle_contract_no.id
-     *
-     * @param id the value for idle_contract_no.id
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    public void setId(Integer id) {
-        this.id = id;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column idle_contract_no.abbreviation
-     *
-     * @return the value of idle_contract_no.abbreviation
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    public String getAbbreviation() {
-        return abbreviation;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column idle_contract_no.abbreviation
-     *
-     * @param abbreviation the value for idle_contract_no.abbreviation
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    public void setAbbreviation(String abbreviation) {
-        this.abbreviation = abbreviation;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column idle_contract_no.used_order_no
-     *
-     * @return the value of idle_contract_no.used_order_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    public String getUsedOrderNo() {
-        return usedOrderNo;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column idle_contract_no.used_order_no
-     *
-     * @param usedOrderNo the value for idle_contract_no.used_order_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    public void setUsedOrderNo(String usedOrderNo) {
-        this.usedOrderNo = usedOrderNo;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column idle_contract_no.contract_no
-     *
-     * @return the value of idle_contract_no.contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    public String getContractNo() {
-        return contractNo;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column idle_contract_no.contract_no
-     *
-     * @param contractNo the value for idle_contract_no.contract_no
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    public void setContractNo(String contractNo) {
-        this.contractNo = contractNo;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column idle_contract_no.aid
-     *
-     * @return the value of idle_contract_no.aid
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    public String getAid() {
-        return aid;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column idle_contract_no.aid
-     *
-     * @param aid the value for idle_contract_no.aid
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    public void setAid(String aid) {
-        this.aid = aid;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method returns the value of the database column idle_contract_no.create_time
-     *
-     * @return the value of idle_contract_no.create_time
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    public Date getCreateTime() {
-        return createTime;
-    }
-
-    /**
-     * This method was generated by MyBatis Generator.
-     * This method sets the value of the database column idle_contract_no.create_time
-     *
-     * @param createTime the value for idle_contract_no.create_time
-     *
-     * @mbg.generated Mon Sep 30 16:05:15 CST 2019
-     */
-    public void setCreateTime(Date createTime) {
-        this.createTime = createTime;
-    }
+
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.id
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private Integer id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.abbreviation
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private String abbreviation;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.used_order_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private String usedOrderNo;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private String contractNo;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.aid
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private String aid;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.create_time
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private Date createTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column idle_contract_no.year
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	private Integer year;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column idle_contract_no.id
+	 * @return  the value of idle_contract_no.id
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public Integer getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column idle_contract_no.id
+	 * @param id  the value for idle_contract_no.id
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column idle_contract_no.abbreviation
+	 * @return  the value of idle_contract_no.abbreviation
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public String getAbbreviation() {
+		return abbreviation;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column idle_contract_no.abbreviation
+	 * @param abbreviation  the value for idle_contract_no.abbreviation
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public void setAbbreviation(String abbreviation) {
+		this.abbreviation = abbreviation;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column idle_contract_no.used_order_no
+	 * @return  the value of idle_contract_no.used_order_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public String getUsedOrderNo() {
+		return usedOrderNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column idle_contract_no.used_order_no
+	 * @param usedOrderNo  the value for idle_contract_no.used_order_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public void setUsedOrderNo(String usedOrderNo) {
+		this.usedOrderNo = usedOrderNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column idle_contract_no.contract_no
+	 * @return  the value of idle_contract_no.contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public String getContractNo() {
+		return contractNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column idle_contract_no.contract_no
+	 * @param contractNo  the value for idle_contract_no.contract_no
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public void setContractNo(String contractNo) {
+		this.contractNo = contractNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column idle_contract_no.aid
+	 * @return  the value of idle_contract_no.aid
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public String getAid() {
+		return aid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column idle_contract_no.aid
+	 * @param aid  the value for idle_contract_no.aid
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public void setAid(String aid) {
+		this.aid = aid;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column idle_contract_no.create_time
+	 * @return  the value of idle_contract_no.create_time
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column idle_contract_no.create_time
+	 * @param createTime  the value for idle_contract_no.create_time
+	 * @mbg.generated  Tue Jan 07 16:15:44 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 idle_contract_no.year
+	 * @return  the value of idle_contract_no.year
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public Integer getYear() {
+		return year;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column idle_contract_no.year
+	 * @param year  the value for idle_contract_no.year
+	 * @mbg.generated  Tue Jan 07 16:15:44 CST 2020
+	 */
+	public void setYear(Integer year) {
+		this.year = year;
+	}
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 702 - 683
src/main/java/com/goafanti/common/model/IdleContractNoExample.java


+ 2 - 21
src/main/java/com/goafanti/common/utils/ExportExcelUtil.java

@@ -148,7 +148,6 @@ public class ExportExcelUtil {
 		//map 数据 ,comment表头 (列名称)
  		//1,创建一个workbook,对应的是一个excel文件
 		XSSFWorkbook wb = new XSSFWorkbook();
-		int count = 0;
 		//遍历map
 		for (Map.Entry<String,List<TOrderBillNew>> entry : map.entrySet()) {
 			//2.创建一个sheet
@@ -158,7 +157,6 @@ public class ExportExcelUtil {
 			//4.创建一个cell
 			XSSFCell cell = row.createCell(0);
 			cell.setCellValue(entry.getKey()+" 流水记录");
-			count ++;
 			XSSFCellStyle style1 = setCellStyle1(wb);
 			cell.setCellStyle(style1);
 			//合并列
@@ -251,7 +249,6 @@ public class ExportExcelUtil {
 		//map 数据 ,comment表头 (列名称)
 		//1,创建一个workbook,对应的是一个excel文件
 		XSSFWorkbook wb = new XSSFWorkbook();
-		int count = 0;
 		//遍历map
 		for (Map.Entry<String,List<TOrderBonusBo>> entry : map.entrySet()) {
 			//2.创建一个sheet
@@ -261,7 +258,6 @@ public class ExportExcelUtil {
 			//4.创建一个cell
 			XSSFCell cell = row.createCell(0);
 			cell.setCellValue(entry.getKey()+" 奖金记录");
-			count ++;
 			XSSFCellStyle style1 = setCellStyle1(wb);
 			cell.setCellStyle(style1);
 			//合并列
@@ -440,7 +436,7 @@ public class ExportExcelUtil {
 					case "未收款(万元)": o = ob.getUncollectedAmount().toString(); break;
 					case "订单部门": o =ob.getDepName(); break;
 					case "订单负责人": o =ob.getSalesmanName(); break;
-					case "催收科目": o = getDunSuBubject(ob.getDunSubject()); break;
+//					case "催收科目": o = ob.getDunSubjectToString(); break;
 					case "催款启动日期": o = ob.getStartDate(); break;
 					default: o = ""; break;
 					}
@@ -452,20 +448,7 @@ public class ExportExcelUtil {
 		
 	}
 
-	public static String getDunSuBubject(String dunSubject) {
-		if ("12".equals(dunSubject)) return "订单审核通过";
-		if ("20".equals(dunSubject)) return "项目待提交";
-		if ("21".equals(dunSubject)) return "项目已提交";
-		if ("22".equals(dunSubject)) return "项目评审";
-		if ("23".equals(dunSubject)) return "项目立项";
-		if ("24".equals(dunSubject)) return "项目公示";
-		if ("25".equals(dunSubject)) return "项目抽查";
-		if ("26".equals(dunSubject)) return "项目备案";
-		if ("27".equals(dunSubject)) return "项目下证";
-		if ("28".equals(dunSubject)) return "项目验收";
-		if ("29".equals(dunSubject)) return "项目拨款";
-		return "";
-	}
+	
 
 
 	public static XSSFWorkbook exportTaskHoursListData(List<TOrderTaskListBo> list, String[] comment, String filePath) {
@@ -618,7 +601,6 @@ public class ExportExcelUtil {
 		//map 数据 ,comment表头 (列名称)
 		//1,创建一个workbook,对应的是一个excel文件
 		XSSFWorkbook wb = new XSSFWorkbook();
-		int count = 0;
 		//遍历map
 		for (Map.Entry<String,List<TOrderBonusBo>> entry : map.entrySet()) {
 			//2.创建一个sheet
@@ -628,7 +610,6 @@ public class ExportExcelUtil {
 			//4.创建一个cell
 			XSSFCell cell = row.createCell(0);
 			cell.setCellValue(entry.getKey()+" 奖金记录");
-			count ++;
 			XSSFCellStyle style1 = setCellStyle1(wb);
 			cell.setCellStyle(style1);
 			//合并列

+ 4 - 1
src/main/java/com/goafanti/common/utils/SendEmailUtil.java

@@ -137,11 +137,14 @@ public class SendEmailUtil {
 	
 	public static boolean isEmail(String email){
     	//邮箱正则表达式
-        String pattern = "^[a-zA-Z][\\w\\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\\w\\.-]*[a-zA-Z0-9]\\.[a-zA-Z][a-zA-Z\\.]*[a-zA-Z]$";
+        String pattern = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";
         Pattern p = Pattern.compile(pattern);
         Matcher m = p.matcher(email);
         return m.matches();
     }
 
+	/*public static void main(String[] args) {
+		System.out.println(isEmail("anderx@dingtalk.com"));
+	}*/
 	
 }

+ 1 - 1
src/main/java/com/goafanti/order/bo/TOrderNewBo.java

@@ -48,8 +48,8 @@ public class TOrderNewBo extends TOrderNew{
 	private BigDecimal setUpAmount;
 	
 	public String getDunSubject() {
-		if(dunSubject!=null)return OrderDunSubject.getValueByCode(Integer.valueOf(dunSubject));
 		if(getDunType()!=null&&getProjectType()!=null)return NewOrderDunType.getValueByCode(Integer.valueOf(""+getProjectType()+getDunType()));
+		if(dunSubject!=null)return OrderDunSubject.getValueByCode(Integer.valueOf(dunSubject));
 		return dunSubject;
 	}
 	public Integer getLocationProvince() {

+ 8 - 0
src/main/java/com/goafanti/order/bo/TOrderTaskDetailBo.java

@@ -8,6 +8,7 @@ public class TOrderTaskDetailBo {
 	private String orderNo;
 	private String userName;
 	private String cname;
+	private String taskReceiver;
 	private String receiverName;
 	private Integer projectStatus;
 	private Integer taskStatus;
@@ -313,5 +314,12 @@ public class TOrderTaskDetailBo {
 	public void setRetrieveContent(String retrieveContent) {
 		this.retrieveContent = retrieveContent;
 	}
+	public String getTaskReceiver() {
+		return taskReceiver;
+	}
+	public void setTaskReceiver(String taskReceiver) {
+		this.taskReceiver = taskReceiver;
+	}
+	
 	
 }

+ 4 - 7
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -244,10 +244,10 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	 *distribution	(咨询师管理列表 0 未分配 1部分 2全部
 	 */
 	@RequestMapping(value="/orderNewList", method = RequestMethod.GET)
-	public Result orderNewList(String name,String orderNo,String starTime,String endTime ,Integer specially ,
+	public Result orderNewList(String name,String orderNo,String starTime,String endTime ,Integer specially ,Integer approval,
 			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus,Integer pageNo,Integer pageSize){
 		Result res=new Result();
-		res.data(orderNewService.orderNewList(name, orderNo, starTime, endTime, specially , distribution,depId, contractNo,outsource, liquidationStatus,pageNo, pageSize));
+		res.data(orderNewService.orderNewList(name, orderNo, starTime, endTime, specially ,approval, distribution,depId, contractNo,outsource, liquidationStatus,pageNo, pageSize));
 		return res;
 	}
 	
@@ -486,16 +486,14 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value = "/exportOrderDunData", method = RequestMethod.GET)
 	public Result exportOrderDunData(String name,String orderNo,String starTime,String endTime,Integer specially,String adminName,
-			String depId,Integer newStatus,Integer pageNo,Integer pageSize,HttpServletResponse response) throws IOException{
+			String depId,Integer newStatus,Integer pageNo,Integer pageSize,HttpServletResponse response){
 		 Result res = new Result();
  		try {
  			orderNewService.exportOrderDunData( name, orderNo, starTime, endTime, specially, adminName, depId,newStatus, pageNo, pageSize, response);
 		} catch (Exception e) {
 			res.getError().add(buildError("格式不正确"));
-			e.printStackTrace();
 			return res;
 		}
- 		res.data(1); 
  		return res;
 	}
 	/**
@@ -503,13 +501,12 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	 * @throws IOException 
 	 */
 	@RequestMapping(value = "/exportOrderTaskData", method = RequestMethod.GET)
-	public Result exportOrderTaskData(String orderNo,HttpServletResponse response) throws IOException{
+	public Result exportOrderTaskData(String orderNo,HttpServletResponse response){
 		 Result res = new Result();
  		try {
  			orderNewService.exportOrderTaskData(  orderNo,response);
 		} catch (Exception e) {
 			res.getError().add(buildError("格式不正确"));
-			e.printStackTrace();
 			return res;
 		}
  		return res;

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

@@ -87,7 +87,7 @@ public interface OrderNewService {
 	 * @param pageSize
 	 * @return
 	 */
-	Pagination<TOrderNewBo> orderNewList(String name, String orderNo, String starTime, String endTime,Integer specially ,Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus,Integer pageNo, Integer pageSize);
+	Pagination<TOrderNewBo> orderNewList(String name, String orderNo, String starTime, String endTime,Integer specially ,Integer approval,Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus,Integer pageNo, Integer pageSize);
 	/**
 	 * 订单审核
 	 * @param orderNo
@@ -167,7 +167,7 @@ public interface OrderNewService {
 	boolean checkORderTask(String orderNo);
 	
 	void exportOrderDunData(String name,String orderNo,String starTime,String endTime,Integer specially,String adminName,
-			String depId,Integer newStatus,Integer pageNo,Integer pageSize,HttpServletResponse response) throws IOException ;
+			String depId,Integer newStatus,Integer pageNo,Integer pageSize,HttpServletResponse response) throws  Exception;
 	
 	int updateOrderOver(String orderNo);
 	
@@ -192,7 +192,7 @@ public interface OrderNewService {
 	int updateFinance(String orderNo, String newFinance);
 	List<TOrderLogBo> selectOrderLog(String orderNo);
 
-	void pushGeneralSendNoticeAndEmail(List<String> alist, Integer type,String OrderNo,String adminId);
+	void pushGeneralSendNoticeAndEmail(List<String> alist, Integer type,String OrderNo,String adminId,Integer approval);
 	void exportOrderTaskData(String orderNo, HttpServletResponse response)throws IOException,BusinessException ;
 	
 }

+ 2 - 2
src/main/java/com/goafanti/order/service/impl/FundManagerOrderServiceImpl.java

@@ -214,7 +214,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 			c = backMapper.insertSelective(back);
 			List<String> aids = new ArrayList<>();
 			aids.add(t.getSalesmanId());;
-			orderNewService.pushGeneralSendNoticeAndEmail(aids, NoticeStatus.ORDER_NO.getCode(),t.getOrderNo(), TokenManager.getAdminId());
+			orderNewService.pushGeneralSendNoticeAndEmail(aids, NoticeStatus.ORDER_NO.getCode(),t.getOrderNo(), TokenManager.getAdminId(),t.getApproval());
 		}
 		return c;
 	}
@@ -513,7 +513,7 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 		tl.setProcess(OrderLogProcess.CWPD.getCode());
 		tl.setRemarks(remarks);
 		tOrderLogMapper.insertSelective(tl);
-		orderNewService.pushGeneralSendNoticeAndEmail(aids, NoticeStatus.ORDER_YES.getCode(),t.getOrderNo(), TokenManager.getAdminId());
+		orderNewService.pushGeneralSendNoticeAndEmail(aids, NoticeStatus.ORDER_YES.getCode(),t.getOrderNo(), TokenManager.getAdminId(),new1.getApproval());
 		return tOrderNewMapper.updateByPrimaryKeySelective(t);
 	}
 

+ 2 - 2
src/main/java/com/goafanti/order/service/impl/OrderChangeServiceImpl.java

@@ -331,7 +331,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		
 		}
 		//发送站内信息与邮件
-		orderNewService.pushGeneralSendNoticeAndEmail(alist, type, o.getOrderNo(), TokenManager.getAdminId());
+		orderNewService.pushGeneralSendNoticeAndEmail(alist, type, o.getOrderNo(), TokenManager.getAdminId(),0);
 		
 	}
 	
@@ -476,7 +476,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		TOrderNew o=tOrderNewMapper.selectByPrimaryKey(nb.getOrderNo());
 		alist.add(o.getSalesmanId());
 		newOrderChangeMapper.updateByPrimaryKeySelective(nb);
-		orderNewService.pushGeneralSendNoticeAndEmail(alist,NoticeStatus.ORDER_CHANGE_END.getCode(), o.getOrderNo(), TokenManager.getAdminId());
+		orderNewService.pushGeneralSendNoticeAndEmail(alist,NoticeStatus.ORDER_CHANGE_END.getCode(), o.getOrderNo(), TokenManager.getAdminId(),0);
 		return 1;
 	}
 	@Override

+ 3 - 3
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -83,7 +83,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 				}
 			}
 		}
-		orderNewService.pushGeneralSendNoticeAndEmail(aids, NoticeStatus.ORDER_INVPICE_START.getCode(),o.getOrderNo(), TokenManager.getAdminId());
+		orderNewService.pushGeneralSendNoticeAndEmail(aids, NoticeStatus.ORDER_INVPICE_START.getCode(),o.getOrderNo(), TokenManager.getAdminId(),0);
 	}
 
 	@Override
@@ -168,7 +168,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 			//重新计算开票金额
 			
 		}
-		orderNewService.pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId());
+		orderNewService.pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId(),0);
 		tOrderInvoiceMapper.updateByPrimaryKeySelective(t);
 		if(examine==2)tOrderMidMapper.updateInvoice(t2.getOrderNo());
 		return 1; 
@@ -230,7 +230,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 			}
 		
 		}
-		orderNewService.pushGeneralSendNoticeAndEmail(aids,type,o.getOrderNo(), TokenManager.getAdminId());
+		orderNewService.pushGeneralSendNoticeAndEmail(aids,type,o.getOrderNo(), TokenManager.getAdminId(),0);
 		return tOrderInvoiceMapper.updateByPrimaryKeySelective(t);
 	}
 

+ 38 - 26
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -12,9 +12,9 @@ import java.util.Arrays;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.TimeZone;
 import java.util.UUID;
 
 import javax.mail.MessagingException;
@@ -279,7 +279,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			tl.setOrderNo(t.getOrderNo());
 			tl.setProcess(OrderLogProcess.TJ.getCode());
 			tl.setAid(TokenManager.getAdminId());
-			addOrderLog(tl);
+			addOrderLog(tl,null);
 			System.out.println(""+t2.getContractNo());
 			if (StringUtils.isBlank(t2.getContractNo())) {
 				//没有合同编号则生成
@@ -295,7 +295,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			AdminListBo a = adminMapper.getDeptNameByAid(TokenManager.getAdminId());
 			aids.addAll(adminMapper.listNameByDepAndName(a.getDepartmentId(), "营销管理员"));
 			type=NoticeStatus.ORDER_START.getCode();
-			pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId());
+			pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId(),t.getApproval());
 		}
 		if (t2.getApproval()==ApprovalNewState.BH.getCode()||
 				t2.getOrderStatus()==OrderNewState.QDSHJJ.getCode()||
@@ -353,19 +353,20 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	private void createContractNo(TOrderNew t) {
 		//根据订单部门或许合同编号前缀
 		OrganizationManagement dep=organizationManagementMapper.selectByPrimaryKey(t.getOrderDep());
+		//获取日期年份
+		Calendar c=Calendar.getInstance();
+		int y=c.get(Calendar.YEAR);
 		if (dep==null||StringUtils.isBlank(dep.getAbbreviation())) {
 			throw new BusinessException(new Error( "该部门缩写不存在","该部门缩写不存在"));
 		}
-		IdleContractNo i=idleContractNoMapper.selectByAbbreviation(dep.getAbbreviation());
+		IdleContractNo i=idleContractNoMapper.selectByAbbreviation(dep.getAbbreviation(),y);
 		if (i!=null&&i.getContractNo()!=null) {
 			t.setContractNo(i.getContractNo());
 			idleContractNoMapper.deleteByPrimaryKey(i.getId());
 		}else {
 			//根据前缀查询最大编号
 			String max=organizationManagementMapper.getMaxAbbreviation(dep.getAbbreviation()+"-");
-			//获取日期年份
-			Calendar c=Calendar.getInstance();
-			int y=c.get(Calendar.YEAR);
+			
 			String sno=null;
 			if (StringUtils.isBlank(max)||max.length()<13) {
 				String cn=""+dep.getAbbreviation()+"-"+y+"0001";
@@ -418,8 +419,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	}
 	
 
-	public void addOrderLog(TOrderLog tl) {
+	public void addOrderLog(TOrderLog tl, String reason) {
 		tl.setAid(TokenManager.getAdminId());
+		if(reason!=null)tl.setRemarks(reason);
 		tOrderLogMapper.insertSelective(tl);
 		
 	}
@@ -478,7 +480,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<TOrderNewBo> orderNewList(String name, String orderNo, String starTime, String endTime,Integer specially,
+	public Pagination<TOrderNewBo> orderNewList(String name, String orderNo, String starTime, String endTime,Integer specially,Integer approval,
 			Integer distribution,String depId,String contractNo,Integer outsource,Integer liquidationStatus, Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
@@ -498,6 +500,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (StringUtils.isNotBlank(depId)) params.put("depId", depId);
 		if (StringUtils.isNotBlank(contractNo)) params.put("contractNo", contractNo);
 		if (null!=liquidationStatus) params.put("liquidationStatus", liquidationStatus);
+		if (null==approval)params.put("approval", 0);
+		else 	params.put("approval", approval);
 		if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
 		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
 		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
@@ -532,8 +536,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 					t.setProcessStatus(ProcessStatus.YPWBSH.getCode());
 					tl.setOrderNo(orderNo);
 					tl.setProcess(OrderLogProcess.FQWB.getCode());
-					addOrderLog(tl);
-					
+					addOrderLog(tl,null);
 					
 				}
 			}else {
@@ -546,7 +549,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			tl.setOrderNo(orderNo);
 			tl.setProcess(OrderLogProcess.SH.getCode());
 			//增加日志
-			addOrderLog(tl);
+			addOrderLog(tl,null);
 			//非特批增加催款信息
 			//外包
 			 if(outsource==1) {
@@ -565,14 +568,14 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				addBackOrder(orderNo, reason);
 				tl.setOrderNo(orderNo);
 				tl.setProcess(OrderLogProcess.SH.getCode());
-				addOrderLog(tl);
+				addOrderLog(tl,null);
 			}
 				aids.add(t2.getSalesmanId());
 				type=NoticeStatus.ORDER_NO.getCode();
 		}
 		t.setOrderStatus(orderStatus);
 		tOrderNewMapper.updateByPrimaryKeySelective(t);
-		pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId());
+		pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId(),t2.getApproval());
 		return 1; 
 	}
 
@@ -628,7 +631,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			//发送驳回邮件
 		if(SendEmailUtil.isEmail(b.getEmail())) {
 	    	 EmailBo bo = new EmailBo("催收通知", b.getEmail(), a.getDepartmentName(), a.getName(),
-						"", orderNo,new SimpleDateFormat("yyyy-MM-dd").format(ob.getCreateTime()),dunTypeName,a2.getName(),b.getUserName(),1);
+						"", orderNo,new SimpleDateFormat("yyyy-MM-dd").format(ob.getCreateTime()),dunTypeName,a2.getName(),b.getUserName(),1,0);
 				if(StringUtils.isNotBlank(b.getEmail())) {
 					SendEmailUtil.getInstance().patentSend(bo);
 				}
@@ -733,7 +736,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		TOrderLog tl=new TOrderLog();
 		tl.setOrderNo(t.getOrderNo());
 		tl.setProcess(OrderLogProcess.FQTD.getCode());
-		addOrderLog(tl);
+		addOrderLog(tl,null);
 		return tOrderRefundMapper.insertSelective(t);
 	}
 
@@ -770,8 +773,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			aids.add(t2.getSalesmanId());
 			type=NoticeStatus.ORDER_APPROVA_NO.getCode();
 		}
-		addOrderLog(tl);
-		pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId());
+		addOrderLog(tl,reason);
+		pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId(),t2.getApproval());
 		//新增特批催款信息
 		
 		return tOrderNewMapper.updateByPrimaryKeySelective(t);
@@ -860,6 +863,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			i.setAid(TokenManager.getAdminId());
 			i.setContractNo(contractNo);
 			i.setUsedOrderNo(orderNo);
+			i.setYear(y);
 			//如果找不到订单部门,则取订单编号-前面的缩写
 			if(StringUtils.isNotBlank(orderDep)) {
 				OrganizationManagement o=organizationManagementMapper.selectByPrimaryKey(orderDep);
@@ -931,19 +935,21 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	 */
 	@Override
 	public void exportOrderDunData(String name,String orderNo,String starTime,String endTime,Integer specially,String adminName,
-			String depId,Integer newStatus,Integer pageNo,Integer pageSize,HttpServletResponse response) throws IOException {
+			String depId,Integer newStatus,Integer pageNo,Integer pageSize,HttpServletResponse response) throws Exception  {
 		OutputStream out = response.getOutputStream();
 		try {
 			@SuppressWarnings("unchecked")
-			List<TOrderNewBo> list=(List<TOrderNewBo>) dunOrderNewList( name,  orderNo,  starTime,  endTime,
+			List<outOrderDunListBo> list=(List<outOrderDunListBo>) dunOrderNewList( name,  orderNo,  starTime,  endTime,
 					 specially,  adminName, depId,newStatus, pageNo,  pageSize).getList();
+			
     		String[] comment = {"合同编号","订单编号","客户名称","订单负责人","订单部门","订单状态","签单金额","结算状态","应收款","已收款","未收款","项目状态","催收科目","催款状态","催款启动时间","签单时间"};
     		String fileName ="催款信息记录表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
     		//type 0 变更
     		XSSFWorkbook wb =ExportExcelUtil.exportTemplateInfoS(comment,"催款信息");
     		//根据列表编写文档
     		XSSFSheet sheet =wb.getSheetAt(0);
-    		for (TOrderNewBo ob : list) {
+    		System.out.println(list.get(0).getAccountsReceivable());
+    		for (outOrderDunListBo ob : list) {
     			//新增一行
     			XSSFRow r = sheet.createRow(sheet.getLastRowNum()+1);
     			for (int i = 0; i < comment.length; i++) {
@@ -984,7 +990,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			throw new BusinessException(new Error("表格生成错误。"));
 		}finally {
 			out.flush(); 
-			 out.close(); 
+			out.close(); 
 		}
 		
 	}
@@ -1036,7 +1042,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		addBackOrder(orderNo, reason);
 		List<String> aids = new ArrayList<>();
 		aids.add(t.getSalesmanId());
-		pushGeneralSendNoticeAndEmail(aids, NoticeStatus.ORDER_NO.getCode(),t.getOrderNo(), TokenManager.getAdminId());
+		pushGeneralSendNoticeAndEmail(aids, NoticeStatus.ORDER_NO.getCode(),t.getOrderNo(), TokenManager.getAdminId(),t.getApproval());
 		return tOrderNewMapper.updateByPrimaryKeySelective(t);
 	}
 
@@ -1128,9 +1134,11 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
     @Async
-	public  void pushGeneralSendNoticeAndEmail(List<String> alist, Integer type,String OrderNo,String adminId) {
+	public  void pushGeneralSendNoticeAndEmail(List<String> alist, Integer type,String orderNo,String adminId,Integer approval) {
 		AdminListBo a = adminMapper.getDeptNameByAid(adminId);
-		String str=NoticeStatus.getValueByCode(type)+": 订单编号 -"+OrderNo+", 操作人:"+a.getDepartmentName()+"-"+a.getName()+"。";
+		String approvalType="";
+		if (approval!=ApprovalNewState.FTP.getCode()) approvalType="[特批]";
+		String str=approvalType+NoticeStatus.getValueByCode(type)+": 订单编号 -"+orderNo+", 操作人:"+a.getDepartmentName()+"-"+a.getName()+"。";
 		String adminIds="";
 		List<Notice> nlist=new  ArrayList<>();
 		for (String string : alist) {
@@ -1149,7 +1157,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if(StringUtils.isNotBlank(adminIds)) {
 			adminIds=adminIds.substring(0, adminIds.length()-1);
 			EmailBo bo = new EmailBo(NoticeStatus.getValueByCode(type), adminIds, a.getDepartmentName(), a.getName(), "请登录查看"
-					,null,null,null,null,null,0);
+					,null,null,null,null,null,0,approval);
 				try {
 					//使用专利邮件模板
 					SendEmailUtil.getInstance().patentSend(bo);
@@ -1225,5 +1233,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		
 	}
 
+
+
+
+
 	
 }

+ 10 - 3
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import com.alibaba.druid.sql.ast.statement.SQLIfStatement.Else;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
@@ -138,7 +139,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		tOrderTaskMapper.updateByPrimaryKey(t);
 		List<String> aids = new ArrayList<>();
 		aids.add(taskReceiverId);
-		orderNewService.pushGeneralSendNoticeAndEmail(aids, NoticeStatus.ORDER_TASK_TO.getCode(),t.getOrderNo(), TokenManager.getAdminId());
+		orderNewService.pushGeneralSendNoticeAndEmail(aids, NoticeStatus.ORDER_TASK_TO.getCode(),t.getOrderNo(), TokenManager.getAdminId(),0);
 		updateOrder(t);
 		return 1;
 	}
@@ -208,14 +209,20 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	@Override
 	public TOrderTaskDetailBo orderTaskDetail(String id) {
 		TOrderTaskDetailBo t=tOrderTaskMapper.getOrderTaskDetail(id);
-		if(TokenManager.hasRole(AFTConstants.SALESMAN)) {
+		if (TokenManager.hasRole(AFTConstants.SUPERADMIN)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)
+				||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)||TokenManager.hasRole(AFTConstants.TECH_ADMIN)
+					||TokenManager.getAdminId().equals(t.getTaskReceiver())) {
+			return t;
+		}else {
 			t.setOutsourceName("****");
 			t.setOutsourcePrice("****");
 			t.setDeclareUser("****");
 			t.setDeclarePwd("****");
 			t.setCertificateNumber("****");
+			return t;
 		}
-		return t;
+		
+		
 	}
 
 	@Override

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

@@ -122,7 +122,7 @@ public class OutsourceOrgServiceImpl  extends BaseMybatisDao<TOrderOutsourceMapp
 			type=NoticeStatus.ORDER_OUTSOURCE_NO.getCode();
 		}
 		tOrderNewMapper.updateByPrimaryKeySelective(t);
-		orderNewService.pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId());
+		orderNewService.pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId(),t2.getApproval());
 		return tOrderOutsourceMapper.updateByPrimaryKeySelective(o);
 	}
 	

+ 14 - 2
src/main/java/com/goafanti/permission/service/impl/NewRoleServiceImpl.java

@@ -14,6 +14,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.bo.Error;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.AdminLocationMapper;
+import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.ContractTaskLogMapper;
 import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.PatentNewMapper;
@@ -48,6 +51,8 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 	@Autowired
 	UserMapper				userMapper;
 	@Autowired
+	AdminMapper				adminMapper;
+	@Autowired
 	UserRoleMapper			userRoleMapper;
 	@Autowired
 	RolePermissionMapper	rolePermissionMapper;
@@ -211,8 +216,15 @@ public class NewRoleServiceImpl extends BaseMybatisDao<RoleMapper> implements Ne
 			}
 			if (s==roleResources.XMRW.getCode()) {
 //				contractTaskLogMapper.updateDimissionTransfer(aid,transferId);
-				tOrderTaskMapper.updateDimissionTransfer(aid,transferId);
-				tTaskLogMapper.updateDimissionTransfer(aid,transferId);
+				//获取被转角色判断修改对应任务角色
+				String qx=adminMapper.getPermission(transferId);
+				Integer type=-1;
+				if (qx.equals(AFTConstants.TECH)) type=0;
+				else if(qx.equals(AFTConstants.TECH_MANAGER))type=1;
+				if (type!=-1) {
+					tOrderTaskMapper.updateDimissionTransfer(aid,transferId,type);
+					tTaskLogMapper.updateDimissionTransfer(aid,transferId);
+				}
 			}
 			if (s!=roleResources.QDYW.getCode()) {
 				roleResourcesMapper.updateDimissionTransfer(s,aid,transferId);

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

@@ -60,12 +60,12 @@ template.cacheable=false
 portal.host=//sf.jishutao.com/portal/2.0.6
 avatar.upload.host=//sb.jishutao.com/upload
 #连接开发
-#static.host=//sb.jishutao.com/1.1.28
+#static.host=//sb.jishutao.com/1.1.29
 #avatar.host=//sb.jishutao.com
 
 #连测试
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.1.28
+static.host=//static.jishutao.com/1.1.29
 
 upload.path=F:/data/public/upload
 upload.private.path=F:/data/private/upload

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

@@ -54,7 +54,7 @@ session.validate.timespan=18000000
 app.name=AFT
 template.cacheable=false
 
-static.host=//static.jishutao.com/1.1.28
+static.host=//static.jishutao.com/1.1.29
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload